I'm searching for the best Game layout using windows. Currently I haven't found a layout that enables me to do everything I need(Rendering different things and handling different stuff at different times) while maintaing the windows message procedure. I need to be able to handle and receive messages constantly, so I can't have any real while loops inside of the windows main while loop, or it crashes.
I was thinking of having a switch statement inside of the main while loop with variables that handle different parts of my games.(Opening Menu, Level rendering, Credit Rendering etc..). If anyone could please post their thoughts on the best way to handle windows messages while still having ability to change what's rendered and the variables present constantly.
You'd need to use windows api, or some windowing framework. If You're using OpenGL they have GLFW, GLUT, and you can set callback functions - for what to do when the loop is idle(animatinon would go there), when you press a key or move the mouse- before you initialize the framework's main loop, which uses these callbacks to handle the window.