PDA

View Full Version : my OpenGL window remains busy and white... why ?



Alexouin
11-25-2000, 11:23 AM
I've got a problem with the GLUT tutorial... It seems like my OpenGL window is 'stuck'... I mean, when the cursor is over it, it has the shape like when it is busy, and the window hardly refreshes itself, and whenever it does, it is all white... I can't do anything (close, resize, move etc), and i need a while(!kbhit()); to prevent it from quitting...

Any help would be appreciate.

source code (vc++6, win98)
--------------------------
#include <gl/glut.h>
#include<gl/gl.h>
#include <conio.h>

void renderScene(void) {
glClear(GL_COLOR_BUFFER_BIT);
glBegin(GL_TRIANGLES);
glVertex3f(-0.5,-0.5,0.0);
glVertex3f(0.5,0.0,0.0);
glVertex3f(0.0,0.5,0.0);
glEnd();
glFlush();
}

void main(int argc, char **argv) {
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_DEPTH | GLUT_SINGLE | GLUT_RGBA);
glutInitWindowPosition(100,100);
glutInitWindowSize(320,100);
try {
glutCreateWindow("3D Tech- GLUT Tutorial");
glutDisplayFunc(renderScene);
glutMainLoop();
}
catch (...) {};
while (!kbhit()) ;
exit(0);
}

Alexouin
11-25-2000, 04:21 PM
Me again... Well, does that source works on your computer at least ? .. It is supposed to draw a triangle..

TIA http://www.opengl.org/discussion_boards/ubb/smile.gif

ipo
11-26-2000, 08:52 AM
Where's your window resize function? You'll need it to choose a projection and setup a viewport.

Also glutMainLoop() never returns so you'll need to set up a keyboard handler where you can determine when to quit. For this use glutKeyboardFunc() and check for a key (e.g. say ESC) that calls exit();

Alexouin
11-26-2000, 11:33 AM
Originally posted by ipo:
Where's your window resize function? You'll need it to choose a projection and setup a viewport.


Ok I try to add a resize function...


[B]
Also glutMainLoop() never returns so you'll need to set up a keyboard handler where you can determine when to quit.

Yes, but my glutMainLoop does return !... The display function is just called once... Maybe I should try to install better drivers.

... Additionnaly, when I download examples, they compile ok, but there's a message box reading "A .DLL file, .DLL, wasn't found" at run time... And so it can't be launched... What DLL files could I need except from GLUT32.DLL, GLU32.DLL and OPENGL32.DLL which are all located in my windows\system\ ??

Thanks...

Alexouin
11-26-2000, 04:27 PM
Me again...

I changed my libs for OpenGL and GLUT, and now it works...

Sorry for the inconvenient http://www.opengl.org/discussion_boards/ubb/smile.gif