PDA

View Full Version : I need some help !



realcaptain
10-23-2003, 06:27 AM
My os is Win2k professional with the latest
service packs!And Visual Studio as the compiler.

I wrote a programme with GLUT like this:

/////////////////////////////////////

#include<GL\glut.h>


void display()
{
}

int main(int argc, char **argv)
{
glutInit(&argc,argv);

glutInitDisplayMode(GLUT_SINGLE|GLUT_RGBA);

glutInitWindowSize( 400,600);

glutCreateWindow(argv[0]);

glutDisplayFunc(display);

glutMainLoop();

return 0;
}
//////////////////////////////////////

It was successfully compiled,no errors,no
warnings! But when runing the exe programme,
I found it was not responding.
I found some information in Debug Mode like
this:
///////////////////////////////////////////
Loaded 'D:\WINNT\system32\ntdll.dll', no matching symbolic information found.
Loaded 'D:\WINNT\system32\glut32.dll', no matching symbolic information found.
Loaded 'D:\WINNT\system32\OPENGL32.DLL', no matching symbolic information found.
Loaded 'D:\WINNT\system32\msvcrt.dll', no matching symbolic information found.
Loaded 'D:\WINNT\system32\KERNEL32.DLL', no matching symbolic information found.
Loaded 'D:\WINNT\system32\ADVAPI32.DLL', no matching symbolic information found.
Loaded 'D:\WINNT\system32\rpcrt4.dll', no matching symbolic information found.
Loaded 'D:\WINNT\system32\GDI32.DLL', no matching symbolic information found.
Loaded 'D:\WINNT\system32\USER32.DLL', no matching symbolic information found.
Loaded 'D:\WINNT\system32\glu32.dll', no matching symbolic information found.
Loaded 'D:\WINNT\system32\ddraw.dll', no matching symbolic information found.
Loaded 'D:\WINNT\system32\dciman32.dll', no matching symbolic information found.
Loaded 'D:\WINNT\system32\winmm.dll', no matching symbolic information found.
Loaded 'D:\WINNT\system32\imm32.dll', no matching symbolic information found.
Loaded 'D:\WINNT\system32\lpk.dll', no matching symbolic information found.
Loaded 'D:\WINNT\system32\usp10.dll', no matching symbolic information found.
Loaded 'D:\WINNT\system32\nvdesk32.dll', no matching symbolic information found.
Loaded 'D:\WINNT\system32\mmdrv.dll', no matching symbolic information found.
Loaded 'D:\WINNT\system32\MSCTF.DLL', no matching symbolic information found.
Loaded 'D:\WINNT\system32\nvoglnt.dll', no matching symbolic information found.
Loaded 'D:\WINNT\system32\mcd32.dll', no matching symbolic information found.
Loaded 'D:\WINNT\system32\version.dll', no matching symbolic information found.
Loaded 'D:\WINNT\system32\lz32.dll', no matching symbolic information found.
Loaded 'D:\WINNT\MUI\fallback\0804\msctf.dll.mui', no matching symbolic information found.
Loaded 'D:\WINNT\system32\OLEAUT32.DLL', no matching symbolic information found.
Loaded 'D:\WINNT\system32\OLE32.DLL', no matching symbolic information found.
The thread 0x508 has exited with code 0 (0x0).
The program 'D:\Documents and Settings\chenhang\My Documents\work\Debug\new.exe' has exited with code 0 (0x0).
////////////////////////////////////////////

I don't know why,I was just following the book!
Help!

10-23-2003, 07:05 AM
You've registered the display callback but have you actually implemented it? Something like



void display()
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glLoadIdentity();

glRectf(-0.5, -0.5, 0.5, 0.5);

glFlush();
}

See if this draws a rectangle in your window. Also later you could change GL_SINGLE to GL_DOUBLE and instead of glFlush(); use glutSwapBuffers(); (it includes glFlush() http://www.opengl.org/discussion_boards/ubb/wink.gif

realcaptain
10-23-2003, 07:41 AM
Thank you very much!

After I inserted glutSwapBuffers() before glFlush(), it worked!

Thank you again!