main loop, process manager and user interface

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • main loop, process manager and user interface

      hello,
      i am reading the book, and the global vision of game coding that it give is really cool !
      i tried a lot to make games and i had a problem about
      scripting the game and this is the first book that give me the answer !
      so that was for the introduction.
      now i have a question, that when you use process managers where do you put the user input module to link it withs process ?

      sorry of ma bad english ! (cause i am french)
    • RE: main loop, process manager and user interface

      Mon français est vraiment terrible. J'utiliserai l'anglais!

      Under Win32 -

      The main message loop - look for GetMessage(...) TranslateMessage(...) calls to find it - will pull Win32 messages out of the queue and send them to your application's message handler. This means that the main UI code runs outside of the CProcess heirarchy. This is actually not a bad way to do it - although you might be able to make a CProcess class that handles the Win32 main loop calls - but watch out for the exit conditions, they could be tricky to clean up.


      Under non-Win32 (purely polled architectures)

      You could make a CProcess for polling your hardware, and queue up translated messages to send into the same code you'd write under Win32. If your hardware must be polled in real time - you'll either need to rearchitect the CProcess system to enable real time processes (grownups only, this is tough) or you'll have to handle it some other way.
      Mr.Mike
      Author, Programmer, Brewer, Patriot
    • RE: main loop, process manager and user interface

      Or maybe, "you'll have fun playing it?"

      English is kind of funny that way...
      Mr.Mike
      Author, Programmer, Brewer, Patriot