need help on glut
category: general [glöplog]
hi!
I have problems in glut.
i want to make follow some scenes.
how can i do that?
for example:
-intro
-scene1
-scene2
-outro
thanks for your help :)
I have problems in glut.
i want to make follow some scenes.
how can i do that?
for example:
-intro
-scene1
-scene2
-outro
thanks for your help :)
void draw() {
float time = get_time();
if (time < intro_endtime) {
draw_intro();
} else if (time<scene1_endtime) {
draw_scene1();
} else if (time<scene2_endtime) {
draw_scene2();
} else {
draw_outro();
}
}
float time = get_time();
if (time < intro_endtime) {
draw_intro();
} else if (time<scene1_endtime) {
draw_scene1();
} else if (time<scene2_endtime) {
draw_scene2();
} else {
draw_outro();
}
}
hum well...
I am coding a little game, so i dont use the time...
but thanks :)
anything else?
I am coding a little game, so i dont use the time...
but thanks :)
anything else?
google
"finite state machines"
have a good read, you'll need this stuff for games anyway ;)
"finite state machines"
have a good read, you'll need this stuff for games anyway ;)
coding a game without time ? how rare ...
i'm coding a seawar and i don't use time...
int state=0;
switch (state)
{
case 0:
do_intro;
if (done_doing_intro) state++;
break;
case 1:
do_scene1;
if (done_doing_scene1) state++;
break;
default:
do_fuckings_to_kewlers_scene;
break;
}
switch (state)
{
case 0:
do_intro;
if (done_doing_intro) state++;
break;
case 1:
do_scene1;
if (done_doing_scene1) state++;
break;
default:
do_fuckings_to_kewlers_scene;
break;
}
thanks ps for your help.
thanks others too :)
thanks others too :)
if you want to do animation, you will have to have a timer function somewhere ;)
who needs glut anyway ?
what a pleasure to call glutSwapBufers() ( or how is it called ) if it just gets window DC ( which you can store not to spend time getting it again every frame ) and calls SwapBuffers(hDC); ?...
what a pleasure to call glutSwapBufers() ( or how is it called ) if it just gets window DC ( which you can store not to spend time getting it again every frame ) and calls SwapBuffers(hDC); ?...
Easy: glut is portable, winapi is not.
Still, use SDL or something instead. Glut is kinda dead these days.
Still, use SDL or something instead. Glut is kinda dead these days.
yep.. forgot.. right, 216..
Quote:
Easy: glut is portable, winapi is not.
If you portability lies on such levels you're a total dork anyway :)
So what's the point of that argument.
plek: well, it's sometimes neat to get parts of the abstractionlayer for free.
Sigh..
There's no way you can make your demo work on several different systems without either a) coding platform dependent stuff yourself b) letting someone else do it.
Coding an abstraction layer or few in between doesn't make this fact disappear.
There's no way you can make your demo work on several different systems without either a) coding platform dependent stuff yourself b) letting someone else do it.
Coding an abstraction layer or few in between doesn't make this fact disappear.