windowproc vs. peekmessage
Thanks in advance for any response
I am having difficulties understanding why it is necessary for me to use peekmessage() to read into the windows message queue when we are forced to register a windows message handling function in the WNDCLASSEX structure. isn't this registered function called by windows to handle all the messages in the queue? thats what i gathered while splunking through msdn.
My difficulty in grasping its use comes from the apparent need to call peekmessage() then, if necessary, call dispatchmessage() which then runs the wndproc function, which then may in fact run defwndproc(). it just seems a bit of a nasty potential chain of events and a waste of resources (imho) which could all be done by one function - which in turn would not have to be registered with the WNDCLASSEX struct.
Im working on a small opengl app. using nehe's tuts and msdn. novice c++ programmer who chose to just dive in so bear with me if the question is a bit...as the gamers say...n00bish.