Question about openGL( change screens- wait )
Hello, i am a bit new to openGL.I wanted to ask how i do this: draw a polygon, rotate it for 5 seconds, clear the screen and then draw another polygon.Of course drawing and rotating is the easy part but timing and clearing the screen is the part that i don''t know...May anyone can help?
Hell World Game/3d EngineFind it at http://www.angelfire.com/on3/ironhell3index/HellWorld.html
this is pretty simple. Im assuming youre using windows for this. in your drawing routine have a static DWORD called something... lets call it change. Start it off as GetTickCount() + 5000, or whatever number of seconds you want in milliseconds. Then each frame check to see if GetTickCount() is greater than change, if it is do something... pseudocode will explain better:
function DrawScene()
static int scene = 0
static DWORD change = GetTickCount() + 5000
if(change < GetTickCount()) then
change += 5000
scene++
endif
switch(scene)
case 0:
draw something
case 1:
something else
....
end DrawScene()
hope that helps... i suck at explaining things
Edited by - alargeduck on December 20, 2001 6:31:56 PM
function DrawScene()
static int scene = 0
static DWORD change = GetTickCount() + 5000
if(change < GetTickCount()) then
change += 5000
scene++
endif
switch(scene)
case 0:
draw something
case 1:
something else
....
end DrawScene()
hope that helps... i suck at explaining things
Edited by - alargeduck on December 20, 2001 6:31:56 PM
ok thanks a lot..i have to try this to work...is there another way, or this is the only one?
Hell World Game/3d EngineFind it at http://www.angelfire.com/on3/ironhell3index/HellWorld.html
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement