PDA

View Full Version : Can't create Rendering Context under win2k



yakuza
04-18-2001, 04:48 PM
Hey,

I'm working through NeHe's tutorials, and have progressed through lesson6. The problem I'm having is that I'm unable to run my executables under win2k. I always get the Rendering Context error. I'm also unable to run the demo's that NeHe includes with his source.

All the exe's work fine when I boot into win98se. I'm pretty sure it's a driver problem, but I thought you guys might have an idea of how I could get this to work. It's a real pain to code in 2k, then boot into 98 to view my little programs, not to mention time consuming!

I'm running an ATI Radeon64DDR VIVO on an athlon 900 with 512 megs RAM. It's weird, 'cause other OpenGL games, and demo's from scene.org usually work ok for me under win2k, even though they run a lot slower than 98.

I should mention that I've tried the "recommended" drivers from ATI, as well as the latest beta drivers.

Thanks for your time.
yakuza

Korval
04-18-2001, 05:06 PM
Could you post the segment of code that gets a rendering context for us?

yakuza
04-18-2001, 05:10 PM
Sure thing, here's the code, it's straight from NeHe's tutorials...

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
}

Warrior
04-18-2001, 06:24 PM
hmmm, there has to be something wrong with your win2k setup. try reinstalling the latest drivers for your card. in my experience through practice and reading OpenGL is ALLOT faster on win2k than 98SE. i am running win2k and all of NeHe's lessons and demos run great, with no modifications to the NeHe base code.
my best guess is that there is something specific to the nehe code that the radeon implementation of opengl doesnt like.

when you execute your program are you seeing the MessageBox() error from the code above? if you arent you should check the return values on the other functions to see which one is giving you problems.

hope this helps
- Dave

[This message has been edited by Warrior (edited 04-18-2001).]

Korval
04-18-2001, 07:05 PM
OK, when I said, "Could you post the segment of code that gets a rendering context for us?", I meant everything leading up to that, such as selecting the pixel format, and so on.

yakuza
04-19-2001, 06:56 AM
I think you're right, warrior. I'm seeing the messagebox pop up just fine. Incidentally, my little demo works just fine on my NT box at work with a Matrox vid card, so I'm now certain that it's ATI's implementation of OpenGL. I'll just have to keep trying diff. drivers until I find one that works, I guess.

Korval, thanks for your offers to help. I don't think it's NeHe's code, though, however if you'd like to see the entire code, I think it would probably be more convenient for both of us if you were to check out Nehe's code directly, instead of me posting a large chunk of difficult-to-read code here. His code is here: http://nehe.gamedev.net/tutorials/lesson01.asp