Tutorial 6
hello i am an 11 year old kid and am learning OpenGL off of nehe poductions website. i am having a little trouble with tutorial 6 and above. it will start but then i will click on windowed mode and it will say initialization failed. if i click yes to go to fullscreen it says Can''t create a rendering context. Did anyone else have this problem? if so please tell me how they fixed it.
thanks
Quantum kid
quantum kidthe guy who invented the wheel, he was an idiot.the guy who invented the other three, now he was a genious.
Post some system specs. Like operating system, cpu, video card, and version of video card drivers.
-Mike
-Mike
The 6th tutorial deals with texture doesn''t it ? I think the program just cannot find the texture file. Make sure you''re in the right directory.
quote:
The 6th tutorial deals with texture doesn''t it ? I think the program just cannot find the texture file. Make sure you''re in the right directory.
Uh huh. Nehe''s code shut downs the program at the initilization if it can''t find a texture.
...
if(!LoadGLTextures())
{
return FALSE;
}
...
_______________________________________Pixelante Game Studios - Fowl Language
I have two questions :
1. Do the previous tutorials work fine ?
2. What video card is installed on your computer ?
1. Do the previous tutorials work fine ?
2. What video card is installed on your computer ?
first of all all of the tutorials up to 6 work. i dont know which kind of video card i have. i have it stored in this directory:
C:/(my name)/programmingdirectx/game/NeHe.bmp
i cant tell you my name but just trust me when i say that in the code it matches.
C:/(my name)/programmingdirectx/game/NeHe.bmp
i cant tell you my name but just trust me when i say that in the code it matches.
quantum kidthe guy who invented the wheel, he was an idiot.the guy who invented the other three, now he was a genious.
P.S i found a typo
in the code where it says:
if (!(hRC=wglCreateContext(hDC))) // Are We Able To Get A Rendering Context?
{
KillGLWindow(); // Reset The Display
MessageBox(NULL,"Can''t Create A GL Rendering Context.","ERROR",MB_OK|MB_ICONEXCLAMATION);
return FALSE; // Return FALSE
}
look very closely!
i changed it to:
if (!(hRC==wglCreateContext(hDC))) // Are We Able To Get A Rendering Context?
{
KillGLWindow(); // Reset The Display
MessageBox(NULL,"Can''t Create A GL Rendering Context.","ERROR",MB_OK|MB_ICONEXCLAMATION);
return FALSE; // Return FALSE
}
see the difference
in the code where it says:
if (!(hRC=wglCreateContext(hDC))) // Are We Able To Get A Rendering Context?
{
KillGLWindow(); // Reset The Display
MessageBox(NULL,"Can''t Create A GL Rendering Context.","ERROR",MB_OK|MB_ICONEXCLAMATION);
return FALSE; // Return FALSE
}
look very closely!
i changed it to:
if (!(hRC==wglCreateContext(hDC))) // Are We Able To Get A Rendering Context?
{
KillGLWindow(); // Reset The Display
MessageBox(NULL,"Can''t Create A GL Rendering Context.","ERROR",MB_OK|MB_ICONEXCLAMATION);
return FALSE; // Return FALSE
}
see the difference
quantum kidthe guy who invented the wheel, he was an idiot.the guy who invented the other three, now he was a genious.
sorry, what you did there was wrong :
if (!(hRC=wglCreateContext(hDC))) // Are We Able To Get A Rendering Context?
is the right way for it to be, as whats it is in fact doing is, calling wglCreadContext() and assigning the hRC varible to returned value AND THEN checking that returned value for being false (NOTing it make false become true thus the code below runs).
Youre ''fix'' will have in fact buggered it up, as hRC isnt getting a value assigned to it.
if (!(hRC=wglCreateContext(hDC))) // Are We Able To Get A Rendering Context?
is the right way for it to be, as whats it is in fact doing is, calling wglCreadContext() and assigning the hRC varible to returned value AND THEN checking that returned value for being false (NOTing it make false become true thus the code below runs).
Youre ''fix'' will have in fact buggered it up, as hRC isnt getting a value assigned to it.
First off, change the section of code I had in there to simply:
LoadGLTextures();
That way if it doesn''t find a texture any polygon using it will just show up white (or whatever colour you''re currently using), easier to find what''s going wrong that way.
(or set it to bring up a message box, crashing the system is not a bright idea IMO)
Second, "C:/(my name)/programmingdirectx/game/NeHe.bmp".
You''re just putting game/NeHe.bmp, right? (and doesn''t NeHe direct all bitmaps into a "Data" folder? Did you change it?)
Third, if(!(hRC=wglCreateContext(hDC))) is right.
It''s like putting:
hRC=wglCreateContext(hDC);
if(!hRC)
{
...
}
Easy mistake to make, it should probably help with the "Can''t create a rendering context" errors.
Lastly, I don''t believe it would matter what video card you''re using (don''t hold me to that though), since mine is some total crap (doesn''t accellerate OGL, slow as hell) and normal texturing works fine. (just not multi-texturing)
LoadGLTextures();
That way if it doesn''t find a texture any polygon using it will just show up white (or whatever colour you''re currently using), easier to find what''s going wrong that way.
(or set it to bring up a message box, crashing the system is not a bright idea IMO)
Second, "C:/(my name)/programmingdirectx/game/NeHe.bmp".
You''re just putting game/NeHe.bmp, right? (and doesn''t NeHe direct all bitmaps into a "Data" folder? Did you change it?)
Third, if(!(hRC=wglCreateContext(hDC))) is right.
It''s like putting:
hRC=wglCreateContext(hDC);
if(!hRC)
{
...
}
Easy mistake to make, it should probably help with the "Can''t create a rendering context" errors.
Lastly, I don''t believe it would matter what video card you''re using (don''t hold me to that though), since mine is some total crap (doesn''t accellerate OGL, slow as hell) and normal texturing works fine. (just not multi-texturing)
_______________________________________Pixelante Game Studios - Fowl Language
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement