How do you guys seperate your windows handling stuff from the actual program code? A lot of tutorials have the game intro before the windows message loop, the game loop inside the windows message lopp, and the game exit after the message loop.
I feel this design is rather constricting and doesn't work very well for games. I tried creating my own thread called "gameEntryPoint" before the start of the windows message loop and creating my window and doing my openGL code in there, but that didn't work very well. The window creates and the opengl code runs, but the window itself is frozen and I can't move it or anything (there's an hourglass when I move the mouse over the window).
I know there's thirdparty libs out you that do this sort of thing (for example, Allegro), so it must be possible somehow. But.. how do you do it?
I feel this design is rather constricting and doesn't work very well for games. I tried creating my own thread called "gameEntryPoint" before the start of the windows message loop and creating my window and doing my openGL code in there, but that didn't work very well. The window creates and the opengl code runs, but the window itself is frozen and I can't move it or anything (there's an hourglass when I move the mouse over the window).
I know there's thirdparty libs out you that do this sort of thing (for example, Allegro), so it must be possible somehow. But.. how do you do it?