Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

milo

Let me reveal to you that I don't know Windows

This topic is 6912 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Was just working on my flipCode contest entry (entry, that is, if I get it done in time) and noticed something that I don''t understand. First, a small bit of background on what I''m doing. I handle the WM_SIZE message by posting a WM_PAINT message. The WM_PAINT message is handled by calling BeginPaint(), then RenderFrame(), then EndPaint(). RenderFrame() is also called within the infinite loop comprimising the message loop in WinMain(). Thusly, it is called over and over. Now here''s what I don''t understand. I get a window filled with black if I comment out the WM_SIZE case. I did this in preparation for this program running full screen(i.e. why have WM_SIZE if resize isn''t possible). I''m currently running it windowed. If I uncomment the WM_SIZE case I get the image I expect. Checking with the debugger, WM_SIZE is only processed one time (unless I resize the window obviously). The image is dynamic and does change with input so I don''t have a static window after 1 frame being drawn. This is true even if I do start the program in full screen mode. What gives? Why can I call RenderFrame() over and over and see nothing, but a single WM_SIZE, leading to a single WM_PAINT, means I see my image? My best guess at this point is that BeginPaint() does something necessary, but I don''t know and that makes me grumpy. Go ahead. Make me feel stupid. Punk. Mike Roberts aka milo mlbobs@telocity.com

Share this post


Link to post
Share on other sites
Advertisement
Like I''ll believe you unless you tell me why.

Mike Roberts
aka milo
mlbobs@telocity.com

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
BeginPaint fills PAINTSTRUCT structure with paint information like the clipping area where update the client area. This update region is set by invoking the InvalidateRect() function or by the system when you modify the client area (creating, scrolling, sizing, moving ...).
By posting a WM_PAINT message directly, paint informations are not defined or inconsistent, I suppose ....

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!