pouët.net

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 :)
added on the 2004-05-02 17:05:51 by Tomza Tomza
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();
}
}
added on the 2004-05-02 17:20:30 by kusma kusma
hum well...
I am coding a little game, so i dont use the time...
but thanks :)

anything else?
added on the 2004-05-02 17:25:57 by Tomza Tomza
google

"finite state machines"

have a good read, you'll need this stuff for games anyway ;)
added on the 2004-05-02 17:33:50 by kb_ kb_
coding a game without time ? how rare ...
i'm coding a seawar and i don't use time...
added on the 2004-05-02 17:47:19 by Tomza Tomza
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;
}
added on the 2004-05-02 17:52:21 by psenough psenough
thanks ps for your help.

thanks others too :)
added on the 2004-05-02 18:29:29 by Tomza Tomza
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); ?...
added on the 2004-05-02 18:55:08 by apricot apricot
Easy: glut is portable, winapi is not.
Still, use SDL or something instead. Glut is kinda dead these days.
added on the 2004-05-02 20:37:59 by 216 216
yep.. forgot.. right, 216..
added on the 2004-05-02 23:21:48 by apricot apricot
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.
added on the 2004-05-03 00:19:12 by superplek superplek
plek: well, it's sometimes neat to get parts of the abstractionlayer for free.
added on the 2004-05-03 00:29:13 by kusma kusma
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.
added on the 2004-05-03 00:55:17 by 216 216

login