Skip to main content
gamedev.net
🔒 Locked

message generation

Started by aaron_ds 1 reply 350+ views
Original Post
aaron_ds
aaron_ds
I've been working on an OpenGL based GUI. I know there are probably already made libraries, but this is a learning expirence. I decided to seperate the processing routines from the drawing routines so that a list of current windows could be encapsulated in a window manager of sorts. I modeled most of the api off of win32. It could be better, but I havn't had any linux/apple/other gui programming expirence. Anyways, I have a messagebased system running with messages being generated here and there and being picked up buy individual tasks. When I started the WINDOW manager, it hit me. In windows, what generates the WM_PAINT message? I wrap the mouse and keyboard into classes which generate specalized input messages which i cam process. Would the monitor be the peice of hardware that I wrap? would it be the videocard? Anyways, if anyone knows what generates WM_PAINT, I'd like to hear from you. Thanks in advance. :)
ApochPiQ
ApochPiQ
WM_PAINT can come from a lot of places; this page has some useful information about that.

Basically, WM_PAINT is sent when the window needs to be redrawn. You only need to redraw if something has changed, or another window has been moved away from your window and revealed something that wasn't visible before. (There are other cases but those are the major ones.) Your internal "paint" messages should be generated by the window manager itself, when it detects that a window needs to be refreshed. A window should also be able to manually refresh itself when it knows that it needs to (for example, when you type text into a box) and you don't need to notify the window manager itself.
aaron_ds
aaron_ds
Thanks, already checked MSDN but it was vague on where exactly it origninated from. "the system" ;) Anyways, you're right, the screen doesnt need to be redrawn constantly. I had it in my mind that i would be redrawing many times a second. I'm still stuck in game design mode. Thanks for clearing that up. Cheers!

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.