Skip to main content
GameDev.net gamedev.net
🔒 Locked

Rendering Scenes Frame by Frame

Started by FrancoisSoft Jan 25, 2003 at 6:11 PM 4 replies 150+ views
Original Post
FrancoisSoft
FrancoisSoft
Ok, I have a very important question. This has been stuck in my mind of quite a long time - ever since I got in the buisness of developing games. In the past few games I wrote I implemented all the game and blitting code within a timer so that this code would execute at a certain interval. This is how I created the frames for my game. Is this the best approach to implementing frames or should I use the WM_PAINT event to render my frames? And what would be the benefit of using the WM_PAINT event if it can be used?
FrancoisSoft
FrancoisSoft
quote:
Original post by Anonymous Poster
My guess is in about a week you will come up with ''the ultimate paint event''.


YOU SMART ASS... I KNOW WHO YOU ARE!!!
RomSteady
RomSteady
I''m assuming that you are using GDI.

Ideally, you would have your game movement code frame rate independant, and have your painting code in a seperate routine.

I''d ignore WM_PAINT, and just paint as soon as you are done with your processing for that frame, unless you are trying to run over Terminal Services, in which case, I''d simply paint the frame differences in your WM_PAINT event.

RomSteady - Test Locally, Test Globally, Test Early, Test Often
Michael Russell / QA Manager, Ritual EntertainmentI used to play SimCity on a 1:1 scale.
niyaw
niyaw
quote:
Original post by FrancoisSoft
Is this the best approach to implementing frames or should I use the WM_PAINT event to render my frames?


why don't you try both and see which one works out better?

[edited by - niyaw on January 26, 2003 1:09:52 AM]
quasar3d
quasar3d
Don''t use wm_timer or wm_paint


MSG msg;
while(1)
{
if(PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
{
if(msg.message == WM_QUIT)
{
Release()
}
TranslateMessage(&msg);
DispatchMessage(&msg);
}
else
{
Render()
}
}


My Site

Topic Locked

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

Sign in to reply to this topic.