PDA

View Full Version : I cant open graphic windows in vc++6



shay ophir
03-30-2004, 12:11 PM
thank you in advance,
I downloaded all the download dll,lib and h files
and I have no compiler errors

but when I use the function "glutCreateWindow"
or "auxInitWindow"
the program exit with code 1
I don't know where is the problem.
here is the code:

int main(int argc, char** argv)

{

glutInit(&argc,argv);

glutInitDisplayMode(GLUT_RGB | GLUT_DEPTH);

glutInitWindowSize(500,500);

glutInitWindowPosition(0,0);

glutCreateWindow("Simple");

return 0;

/* ... */

}

and here is what I get

First-chance exception in firstp.exe (NTDLL.DLL): 0xC0000005: Access Violation.
The thread 0xC30 has exited with code 1 (0x1).
The program 'D:\A_PROTEIN\TEMP\firstp\Debug\firstp.exe' has exited with code 1 (0x1).

Andrew Davey
03-30-2004, 12:32 PM
the only thing i can see you are missing is a glutloop. Here is what i have, and this will create a window for you, assuming you are importing the right stuff:



int main ( int argc, char** argv )
{

glutInit ( &argc, argv );

glutInitDisplayMode ( GLUT_RGB | GLUT_DEPTH );
glutInitWindowPosition(100,200);

//this sets the size for the window
glutInitWindowSize ( 800, 700 );

//create the window with a title
glutCreateWindow ("This is a window title");

init();

//this is the method that will have all the draw stuff.
glutDisplayFunc (display);
glutIdleFunc (display);


glutMainLoop ();
return 0;

}//main(int,int) You might need a display function, not sure though, but this should work, as i am working with VC++ 6

Andrew Davey
03-30-2004, 12:33 PM
lso these are the libraries that i am calling:


#include <GL/glut.h>
#include <stdio.h>
#include <stdlib.h>

nexusone
03-30-2004, 03:10 PM
Need to see all of the code that you are using?
Not enought to tell what is causing the error.

shay ophir
03-30-2004, 08:33 PM
thanks,but this promlem occur in all the example code that I downloaded and it's run O.K in other computers so I don't know where is the problem in my computer.

nexusone
03-31-2004, 04:30 AM
Try updating the openGL video drivers for your video card.


Originally posted by shay ophir:
thanks,but this promlem occur in all the example code that I downloaded and it's run O.K in other computers so I don't know where is the problem in my computer.

shay ophir
03-31-2004, 04:41 AM
thanks,
but how can I do this?

shay ophir
03-31-2004, 02:57 PM
it's O.K. I found the driver and it's work correctly.