Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


#ActualDeafTV

Posted 03 March 2013 - 12:04 PM

I would have the start function initialize the library and an end function to close the library. I would also have a separate function for your main loop to call Update, Draw, etc.

 

I would also have the bool quit as a member variable to allow for more "dynamic" changing.  In my current project, the core class, GameEngine, is set up as a singleton with the bool quit as a static.  Then my main function calls are called in main within my main loop.

 

Just some design ideas as you progress further.  Cleverly placed print statements also help in debugging something like this wink.png

 

Edit: Forgot to mention that your init(), update(), and draw() functions only return 0 and not 1 which is what your if tests for.


#1DeafTV

Posted 03 March 2013 - 11:58 AM

I would have the start function initialize the library and an end function to close the library. I would also have a separate function for your main loop to call Update, Draw, etc.

 

I would also have the bool quit as a member variable to allow for more "dynamic" changing.  In my current project, the core class, GameEngine, is set up as a singleton with the bool quit as a static.  Then my main function calls are called in main within my main loop.

 

Just some design ideas as you progress further.  Cleverly placed print statements also help in debugging something like this wink.png


PARTNERS