Advertisement

problem with 'initialization failed'

Started by May 29, 2003 04:51 AM
6 comments, last by Jacek 21 years, 9 months ago
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?
Debug the application and find the point where InitGL (or whatever) returns error.



PM


Times change...


Excuse my poor english!
PM Times change... Excuse my poor english!
Advertisement

-----------------------------------------------------------------
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)
............
-----------------------------------------------------------------
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.
Brianmiserere nostri Domine miserere nostri
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."
''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.
Advertisement
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!
PM Times change... Excuse my poor english!
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]

This topic is closed to new replies.

Advertisement