i'm doing something like that to create a 3d rendered animation (using C++):
Code:
#include <freeglut.h>
using namespace std;
void StartingScene();
void RefreshScene();
void MyInit();
void MyDelete();
int main(int argc, char* argv[])
{
glutInit(&argc,argv);
glutInitDisplayMode(GLUT_SINGLE|GLUT_RGB);
glutInitWindowPosition( 30,30 );
glutInitWindowSize( 640,480 );
glutCreateWindow("Game 1");
glutDisplayFunc(StartingScene);
glutIdleFunc ( RefreshScene);
MyInit();
glutMainLoop();
MyDelete();
return 0;
}
void StartingScene()
{
//starting scene
}
void RefreshScene()
{
//refreshing image code
}
void MyInit()
{
//initialitation of certain classes and variables
}
void MyDelete()
{
glutIdleFunc (0);
//deallocation of dynamics allocations
}
but what's happening is that the "scene" is redrawed only if the system calls a "redraw" (so the Scene go on only if i resize the window or if i move that on the screen).
(The computing of time for some strange reason is done. So if i move the window after 3 sec. i will see my scene but 3 sec later).
Someone knows a tutorial explaining such func or explain it to me? thanks.
my StartingScene includes the same code of the RefreshScene.
So RefreshScene draws the same points, but in different coords. (also do the changing of coords and drawing at the same time)