• Advertisement

Archived

This topic is now archived and is closed to further replies.

Problem lesson 1 openGL

This topic is 6221 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
Advertisement
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

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
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

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

  • Advertisement