Advertisement

Despite 12 posts I STILL need help with GL Rendering Contexts

Started by September 07, 2002 11:29 AM
11 comments, last by Ilthigore 22 years, 3 months ago
I've just started the OpenGL tutorials on Nehe.gamedev.net and I have trouble starting the programs in fullscreen as I get the error: "Cannot Create GL Rendring Context." I looked in the code and it was not particularly helpful as I do not yet understand these concepts of OpenGL (the only other API I've got any experience in is Win32 and that isn't very detailed experience). I was wondering if any of you guys could tell me. In the meantime I'll have a look through the tutorials and headers and see what I can find. EDIT: Sorry if you found my signiture annoying, I've changed it now to something slightly more normal. [edited by - ilthigore on September 8, 2002 3:42:18 AM] [edited by - ilthigore on September 12, 2002 3:15:46 PM]
>>>>>>>>>>>>>>>>>Ilthigore<<<<<<<<<<<<<<<<<
Do you test the return codes for each function you call? If not, do so.

Then you will be able to find out which part fails. After that, you can investigate why it fails. I think it's required that you know what each function you call does. If not, get reading the MSDN pages for each.

By the way, I think you might get more help if your topic name and signature weren't so incredibly annoying.

Helpful links:
How To Ask Questions The Smart Way | Google can help with your question | Search MSDN for help with standard C or Windows functions


[edited by - siaspete on September 7, 2002 12:38:44 PM]
Advertisement
That''s the problem, the function that creates the rendering context has failed and I''m using the EXACT code from NeHe''s first tutorial for VC++. What can I do to prevent the function from failing?

>>>>>>>>>>>>>>>>>
Ilthigore
<<<<<<<<<<<<<<<<<
>>>>>>>>>>>>>>>>>Ilthigore<<<<<<<<<<<<<<<<<
Post some code.
I don't have a signature
So are you sure wglCreateContext fails? What pixel format do you ask for?

Helpful links:
How To Ask Questions The Smart Way | Google can help with your question | Search MSDN for help with standard C or Windows functions
The code that doesn't work is the exact same code I got STRAIGHT off nehe.gamedev.net. Click here to download it. This should hold the answers to ALL of your questions. I am sure it fails, as I check it with:

      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}    


>>>>>>>>>>>>>>>>>
Ilthigore
<<<<<<<<<<<<<<<<<


[edited by - ilthigore on September 8, 2002 6:39:48 AM]

[edited by - ilthigore on September 8, 2002 8:15:43 AM]
>>>>>>>>>>>>>>>>>Ilthigore<<<<<<<<<<<<<<<<<
Advertisement
Sure that''s what fails, but that''s not what causes it to fail.

Helpful links:
How To Ask Questions The Smart Way | Google can help with your question | Search MSDN for help with standard C or Windows functions
Sorry, bad presentation. What I meant is that, due to putting in the code shown, I could tell that the function had failed. I checked the function''s return value and it returned FALSE/NULL/0.
Sorry about that but the edit should now make it more clear.

>>>>>>>>>>>>>>>>>
Ilthigore
<<<<<<<<<<<<<<<<<
>>>>>>>>>>>>>>>>>Ilthigore<<<<<<<<<<<<<<<<<
No.

Functions called before that set the hDC pixel format. If OpenGL cannot live with the pixel format you will not be able to create the rendering context.

Helpful links:
How To Ask Questions The Smart Way | Google can help with your question | Search MSDN for help with standard C or Windows functions
Post more code. In fact post the whole thing. I know it''s STRAIGHT from the Nehe tutorials, but I and several hundred other people did them. That code is bug free. It must be something from your end. You need to post more code
I don't have a signature

This topic is closed to new replies.

Advertisement