Hello,
I am trying to use a OpenGL functionality greater than 2.1, specifically 3.1 and higher. I am not using the GLEW utility functions, but instead have created and mapped myself. This is on a windows 7 platform.
What I do in my code is first determine what is the maximum version supported by the graphics are (4.6 on my test system). Then if the major is greater than two, I use wglCreateContextAttribsARB and if it is 2 or less I use the traditional wglCreateContext. So, what I have been trying to do is start with 3.1 so that I can continue to use the traditional glBegin/glEnd with glVertex3f and such to get basic rendering without a shader.
The issue I am having is that nothing will work between glBegin/glEnd. I know that I got a valid rendering context from wglCreateContextAttribsARB because I am able to set the glClearColor and actually clear the screen to that color with a glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
For the attribs list for wglCreateContxtAttribsARB, I profile the following:
int TOpenGlRenderContext::FAttribList[] = {WGL_CONTEXT_MAJOR_VERSION_ARB, 3,
WGL_CONTEXT_MINOR_VERSION_ARB, 1,
0,0, //No layers
0,0, //No flags
WGL_CONTEXT_PROFILE_MASK_ARB, WGL_CONTEXT_CORE_PROFILE_BIT_ARB};
Now, I have tried several flavors of the ARB, but none of them allow me to see anything rendered between glBegin/glEnd.
Am I missing something here?
If I create using the traditional wglCreateContext(hDC), then everthing is displayed between glBegin/glEnd as expected.
Thanks,
James
– UPDATE –
I am now able to render up to 3.1. However, after 3.1, nothing is rendered and only the glClear color is rendered. Is there additional parameters in the ARB that must be set in order to get glBegin(GL_TRIANGLES) … glVertex3f(…) … glEnd() to work with OpenGL 3.2 and higher with the use of a shader program? FYI, I have not attempted doing shaders yet as I am still learning what is needed to keep some of my legacy code.