21did21
6th July 2011, 01:21
Hello all,
I have a problem with the display in OpenGL. Currently I have a program that plot little by little some things in an openGL window.
=> i want to update screen each time that i go in the method "plotGL" but i don't know how i can do that :confused:
=> I noticed that openGL screen is updated if I increase the size of the openGL window but this update of the display is not automatically :p
So, How can I update my screen each time that i go in the paintGL function?
thank you in advance for your help
ps: I tried repaint () and updateGL () but it does not work then call these methods paintGL, it makes me so all block
this is my code:
void myGLWidget::paintGL()
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glClearColor(1.0f,1.0f,1.0f,1.0f);
glMatrixMode( GL_MODELVIEW );
glLoadIdentity( );
gluLookAt( 1.2, 1.7, 1.0, 0, 0, 0, 0, 0, 1);
glBegin(GL_LINES);
//plot
glEnd();
// updateSCREEN();
}
i have tried to decomment the line "updateSCREEN();" and put this method
void myGLWidget::updateSCREEN()
{
updateGL();
//repaint(); //i have tried this too
}
but it don't works, it creates a general blocage of alls my windows :mad:
Can you help me please? thanks a lot :rolleyes:
I have a problem with the display in OpenGL. Currently I have a program that plot little by little some things in an openGL window.
=> i want to update screen each time that i go in the method "plotGL" but i don't know how i can do that :confused:
=> I noticed that openGL screen is updated if I increase the size of the openGL window but this update of the display is not automatically :p
So, How can I update my screen each time that i go in the paintGL function?
thank you in advance for your help
ps: I tried repaint () and updateGL () but it does not work then call these methods paintGL, it makes me so all block
this is my code:
void myGLWidget::paintGL()
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glClearColor(1.0f,1.0f,1.0f,1.0f);
glMatrixMode( GL_MODELVIEW );
glLoadIdentity( );
gluLookAt( 1.2, 1.7, 1.0, 0, 0, 0, 0, 0, 1);
glBegin(GL_LINES);
//plot
glEnd();
// updateSCREEN();
}
i have tried to decomment the line "updateSCREEN();" and put this method
void myGLWidget::updateSCREEN()
{
updateGL();
//repaint(); //i have tried this too
}
but it don't works, it creates a general blocage of alls my windows :mad:
Can you help me please? thanks a lot :rolleyes: