Having worked with monobehaviour and processing before, is it possible to create the same paradigm both frameworks use which basically is writing all code in two main functions, start/setup and update/draw. To further elaborate, much like working in unity when creating a new script the user is presented with two functions a start and an update. The first function always gets called on the first frame while the latter gets called every frame there is no main function present only these two. I'd like to imitate that same structure on to c++.

  • 1
    \$\begingroup\$ This looks like a straightforward application of virtual functions. Have you encountered any specific problem in implementing this paradigm this way? \$\endgroup\$ – DMGregory Feb 17 at 22:16
  • \$\begingroup\$ I'm aware it'll be the utilization of virtual functions, however I'm looking to completely hide the main function and not give it use for the user much like the frameworks I mentioned above. \$\endgroup\$ – Fudge Racoon Feb 17 at 23:25
  • \$\begingroup\$ Can you edit your question to describe in more detail what you mean by "hide the main function"? \$\endgroup\$ – DMGregory Feb 17 at 23:27
  • \$\begingroup\$ Sure I'll edit it \$\endgroup\$ – Fudge Racoon Feb 18 at 0:01
  • \$\begingroup\$ So you want to create some kind of blackbox engine based on an entity-component architecture, and allow the users to write two entry points into each of your components? Why? \$\endgroup\$ – Vaillancourt Feb 18 at 0:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.