Skip to main content
gamedev.net
🔒 Locked

MainLoop??

Started by Ivanch0 Dec 18, 2004 at 3:15 PM 2 replies 550+ views
Original Post
Ivanch0
Ivanch0
Hi to all im a beginner opengl and c++ programmer and i has been follow a lot of tutorials and books about games programming...I need make a 3d game for my highschool and i has thinked to do it using objects (Camera,Model,light...etc) all works good but my problem start when i want change this objects after the opengl window mainloop start, cause after call loop only returns to main program when this windows is closed...and i dont wanna make the changes inside this loop.Any idea or tutorial where i can found my answer? may be another thread? Thnks a lot.
C-Junkie
C-Junkie
Quote:
Original post by Ivanch0
i dont wanna make the changes inside this loop.
I think you have to make changes inside this loop, if I understand you correctly.
Ivanch0
Ivanch0
First to all thnks for read my post and sorry about my poor english...
I try to explain better my problem...
I have made a camera object with a metod ("Camera->Start();") when i create the object I reset the position and colors, later i can do Camara->Color(R,G,B,A); to change the Color parameter and like this all the parameters...But this only work when i change the parameters before i call Camera->Start(); later of this call i cant change nothing cause the program its inside loop main.
Cam->BackColor(0.0,0.0,100.0);
Cam->Translate(0,0,-100);
Cam->Start();
Cam->Translate(100,0,-100);//THIS ONLY WORK WHEN I CLOSE THE OPENGL WINDOW :'(
Thnks again!!
Solias
Solias
I'm not sure I followed that. It sounds like Camera::Start() loops until the app is done? If so, clearly any changes you want to make while the app is running will need to be called from inside the loop. Try posting the code for the main loop, that might clear things up a bit.

If this is a windows sdk style message loop you may want to look into using PeekMessage() instead of GetMessage() to poll for windows messages without blocking.

Topic Locked

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

Sign in to reply to this topic.