Skip to main content
gamedev.net
🔒 Locked

Help! why initialization failed?

Started by getitforfun 3 replies 450+ views
Original Post
getitforfun
getitforfun
Hi, I downloaded the lesson 9 code in VC++, compiled and ran it. After I chose full screen mode, black screen, and return to my original desktop. The popped up error is : initialization error! Would you please tell me why this error happened, and how to fix it? Thank you
cANaBiTz
cANaBiTz
the resolution you set up could possibly be not supported in fullscreen mode. did you set up an usual resolution ( f.e. 800x600, if your choice was 666x555 i think this wont work in fullscreen )
braway
braway
hmm, i would guess that he couldnt find the texture...

check the CreateGLWindow function...

this part:

  
if (!InitGL()) // Initialize Our Newly Created GL Window

{
KillGLWindow(); // Reset The Display

MessageBox(NULL,"Initialization failed.","ERROR",MB_OK|MB_ICONEXCLAMATION);
return FALSE; // Return FALSE

}


i''ve checked the code and that is the only error msg with init in it

so, you have 2 choices:
a) put the texture into the debug/release folder
b) project->settings->Settings for all Configurations->Link->Output Filename: Lesson9.exe



braway
cANaBiTz
cANaBiTz
ah jop braway is right. i missunderstood. thought you would first run it in windowed mode and then when you try to switch to fullscreen with f1 the error occurs. 99.99% that your texture is missing(or wrong folder). if you are using vc++ you have to do the following:

if you compile the code itself and run it while beeing in vc++ the texture has to be in the folder where all your sources are in. but if you switch to the directory called retail or debug and than run the binary, you first have to copy / move the texture to the path where this binary is located in. simple and logical because the path in the binary is related to the current directory (so you could even change it in the source and create an extra directory for your textures -> you dont have this problem ).
getitforfun
getitforfun
Thank you. I also guessed that there was a problem in loading texture, then I set a breakpoint in LoadTextures(). What''s weird was that although warning "no matching symbolic information found", when I f5 to continue, the full screen and desired result came out.

I also can use debug mode to run other codes that can''t run use *.exe.

The directory of texture is currectly specified in source code. And I tried Bradway''s two choices. They didn''t help.

Thank you

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.