Archived

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

Brobanx

Win32 Experts: Would this work well?

Recommended Posts

For my game I''m writing (It''s a simple, but fast-paced puzzle game, must run on all Win95 or higher systems) I''m debating the way in which I should be updating the screen. Since I need a message loop to handle all the windows messages anyway, the thought came across me: Why not use and send my own messages to my WinProc as well, to update the screen? (By using the user-defined WM_APP messages to tell me when (and where) I need to draw something. Considering these will most likely be sent about 30 times per second (on each screen update), is it a good idea to be (ab)using the windows message pump like this?

Share this post


Link to post
Share on other sites
quote:
Original post by Machaira
No.


I agree. Really, really bad idea.

Use double buffering, and PeekMessage. If there''s no message, render the frame. Else process the message.

Share this post


Link to post
Share on other sites
The way you describe would work, however, if you know before hand, where and when you want to render a frame, why not just call your screen update function there instead of sending a message to the window procedure?

Freeware development:
http://www.ruinedsoft.com/

Share this post


Link to post
Share on other sites