Archived

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

Jacek

problem with 'initialization failed'

Recommended Posts

I cannot run some Nehe''s applications. In some cases I received ERROR ''initialization failed'' after message: Would You Like to Run in Fullscreen mode YES/NO. I have Win 2000, Visual C++. What to do? May be someone will help me?

Share this post


Link to post
Share on other sites
Debug the application and find the point where InitGL (or whatever) returns error.



PM


Times change...


Excuse my poor english!

Share this post


Link to post
Share on other sites

-----------------------------------------------------------------
int WINAPI WinMain(.....) .....

......

if (MessageBox(NULL,"Would You Like To Run In Fullscreen Mode?", "Start FullScreen?",MB_YESNO|MB_ICONQUESTION)==IDNO)
{
fullscreen=FALSE;
}
// Create Our OpenGL Window
-----------------------------------------------------------------
APPLICATION RETURNS ERROR IN THIS PLACE:
-----------------------------------------------------------------
if (!CreateGLWindow("Lionel Brits & NeHe''s 3D World Tutorial",640,480,16,fullscreen))
{
return 0; // Quit If Window Was Not Created
}
while(!done)
............
-----------------------------------------------------------------

Share this post


Link to post
Share on other sites
There''s lots of places CreateGLWindow can fail. Start the app from the debugger, choose to run it in windowed mode so it doesn''t overlap with your debugger, and set a breakpoint at the top of CreateGLWindow and step through it, and identify the line in that function that fails.

Share this post


Link to post
Share on other sites
It is in:
----------------------------------------------------------------
BOOL CreateGLWindow(char* title, int width, int height, int bits, bool fullscreenflag)
........

in:

if (!InitGL()) {
KillGLWindow(); MessageBox(NULL,"Initialization Failed.","ERROR",MB_OK|MB_ICONEXCLAMATION);
return FALSE;
}
return TRUE;

where in int InitGL(GLvoid) the (!LoadGLTextures()) returns 0

after that there is message "Initialization Failed."

Share this post


Link to post
Share on other sites
''lo,

if not, you should put the texture in a subdirectory "Data" in the directory where your .exe is.

./lessonXX.exe
./data/texture.bmp

scuse my english too.

Share this post


Link to post
Share on other sites
It seems your LoadGLTextures function returns FALSE. So check the path of the texture(s) and check the LoadGLTextures function. The error also could be that u have only the exe (or the program) and you doesnt have the textures.





PM


Times change...


Excuse my poor english!

Share this post


Link to post
Share on other sites
Yes, application works! Problem is solved. J made additional subdirectory.
Thanks To All Those Who tried to help me.



[edited by - Jacek on May 30, 2003 4:14:13 AM]

Share this post


Link to post
Share on other sites