Problem lesson 1 openGL
I have a problem executing lesson 1 from Nehe''s site. When i download the exe file from his site all works fine, but when i rewrite lesson 1 in Visual C++ 6.0 i can''t run the exe file it creates. I then get a initalisation error. Does somebody knows why this is. I did link gl.h etc.
Thanx in advance
can you write the actual error you get? That would help troubleshooting it.
~~~
Cheers!
Brett Porter
PortaLib3D : A portable 3D game/demo libary for OpenGL
~~~
Cheers!
Brett Porter
PortaLib3D : A portable 3D game/demo libary for OpenGL
~~~Cheers!Brett PorterPortaLib3D : A portable 3D game/demo libary for OpenGLCommunity Service Announcement: Read How to ask questions the smart way before posting!
First i compile and build the file. When i then execute the file in Visual C++ everything works fine. But when i execute the file in the debug or release map i get a messagebox with the text: initalisation failed!
Edited by - Pillejunior on February 13, 2001 5:41:53 AM
Edited by - Pillejunior on February 13, 2001 5:41:53 AM
February 13, 2001 04:53 AM
that means something went wrong here:
int InitGL(GLvoid) // All Setup for OpenGL goes here
{
glShadeModel(GL_SMOOTH) // Enables Smooth Shading
glClearColor(0.0f, 0.0f, 0.0f, 0.0f); // Black Background
glClearDepth(1.0f); // Depth Buffer Setup
glEnable(GL_DEPTH_TEST); // Enables Depth Testing
glDepthFunc(GL_LEQUAL); // The type of Depth Test to do
glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST); // Enables nicest Perspective Correction
return TRUE; // Initalization went OK
}
check your code again
Baraclese
int InitGL(GLvoid) // All Setup for OpenGL goes here
{
glShadeModel(GL_SMOOTH) // Enables Smooth Shading
glClearColor(0.0f, 0.0f, 0.0f, 0.0f); // Black Background
glClearDepth(1.0f); // Depth Buffer Setup
glEnable(GL_DEPTH_TEST); // Enables Depth Testing
glDepthFunc(GL_LEQUAL); // The type of Depth Test to do
glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST); // Enables nicest Perspective Correction
return TRUE; // Initalization went OK
}
check your code again
Baraclese
My code is exactly the same as yours except that i have the line
glClearColor(0.0f, 0.0f, 0.0f, 0.5f); instead of 0.0f at the end. Could that be the problem?
glClearColor(0.0f, 0.0f, 0.0f, 0.5f); instead of 0.0f at the end. Could that be the problem?
The only idea I have is that if your code is the same as NeHe''s in the InitGL() function then check the line where you call it. It goes something like:
if (!InitiGL()) {
MessageBox();
return FALSE;
}
Make sure the ! operand is there. If it''s not then you are doing the message box and ending the program even if InitGL was successfull.
if (!InitiGL()) {
MessageBox();
return FALSE;
}
Make sure the ! operand is there. If it''s not then you are doing the message box and ending the program even if InitGL was successfull.
L.I.G. == Life Is Good
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement