Using OpenGl and windows to create a little fog example in my compiler but im running into issues with opening a raw file to create terrain. heres the potion of code that corresponds to my problem:
how i caught the error in WINMAIN
1 2 3 4 5 6 7 8
//g_glRender is a dynamically allocated variable to my CGfxOpenGL class
//call to my openGl class to initialize needed data, returns true/false upon finishing
if(!g_glRender->Init())
{
std::cout << "Init()"; //console reading out this error
delete g_glRender;
return 0;
}
I would rather recommend to change the working directory when running your program from the IDE (instead of hard-coding the path in code). In Visual Studio you can find it under Project Properties -> Debugging -> Working Directory.
I highly recommend using GetModuleFileName() and PathRemoveFileSpec() to get .EXE file directory, no matter what current directory is and without need to hardcode the path.