Tuesday, May 31, 2011

Passing input events

Today I finished up the basic windowing code.  The window procedure is contained in a window manager, which also handles registering the class and creating the window.

I also did some research into the definition of RAII to try and work out what I should be calling a particular technique I have been using.  I'm still not entirely sure if the technique I am using is valid RAII, but I did find a rather good explanation of what RAII is.  You can find the article over at The RAII Programming Idiom.

I am currently working out how I am going to pass user input events to the game state.  I think I might revisit the idea of a "systems layer", since I could easily give the input gathering systems a pointer to the current game state pointer.  Without using a systems layer, I would need to pass the pointer to the initialization state, which feels a bit awkward.  I am planning on using a pointer to a pointer because the game state could change, thus changing the pointer.

No comments:

Post a Comment