I'm looking to get into 3d with OpenGL, using SDL to help with other stuff.

I found plenty of good tutorials (lazyfoo is a big one), but "Learning Modern 3d Graphics Programming" uses a newer version of openGL that I'm not able to run!

I opened up OpenGL extensions viewer, and I can only run OpenGL 2.0, whereas most tutorials are in higher versions.

I ask this because I've heard that just about everything in 2.* got depreciated in the newer versions, so I'm worried that my code might not work.

I'm looking at a few other tutorials, but I'm so used to SDL that those just confuse me...

So should I bother trying to do graphics programming now, or should I just wait until I can upgrade my computer?

  • \$\begingroup\$ have you tried updating your drivers? check if your card supports OpenGL 3.x, it should if it was manufactured in the last like 4 years or something, even if it wasn't, there's a chance that new drives will let you use opengl 3.x even if it's not fully supported by the hardware \$\endgroup\$
    – dreta
    Commented Jun 19, 2012 at 18:47
  • \$\begingroup\$ Integrateed Intel from a while ago, new drivers had no effect on it, I can only get 2.0, the book I mentioned couldn't even run the tutorials because I couldn't support the latest version. \$\endgroup\$ Commented Jun 19, 2012 at 19:09
  • \$\begingroup\$ Indeed, Intel's drivers are notoriously bad in terms of GL support, both in terms of supported features as well as in terms of bugginess and performance. The need to support the large number of Intel users is alone a strong reason to use D3D for PC-only games, and to at least consider a dual-stack graphics for multi-platform games. \$\endgroup\$ Commented Jun 19, 2012 at 20:35
  • \$\begingroup\$ Also, most of GL 3+ is the exact same as GL 2. Many of the things that have been added are already available on GL 2 hardware via extensions, and the things that have been removed are largely the older GL 1.x functionality. Building an app that can take advantage of GL 3+ features while being compatible with GL 2.0 is quite possible, and some games do exactly that. \$\endgroup\$ Commented Jun 19, 2012 at 20:37

2 Answers 2


Modern drivers / video cards are able to choose OpenGl implementations. Whether it's only using features described in these versions or setting it. So you should be fine going for 2.0 since majority of video cards support this version.


When you create an OpenGL window, you choose the context you want. Here's a possible way to do that on Windows (when creating a Win32 window):

HGLRC tempcontext = wglCreateContext(hDC);
wglMakeCurrent(hDC, tempcontext);

GLenum status = glewInit();
if (status != GLEW_OK)
    char error[256];
    sprintf(error, "%s", glewGetErrorString(status));
    MessageBoxA(NULL, error, "GLEW error", MB_OK | MB_ICONEXCLAMATION);
    return GL_FALSE;

int supported = wglewIsSupported("WGL_ARB_create_context");
if (supported == 1)
    LOG_INFORMATION("Creating OpenGL 3.1 context.");

    int attribs[] =

    hRC = wglCreateContextAttribsARB(hDC, 0, attribs); CGLE();
    wglMakeCurrent(NULL, NULL);
    wglMakeCurrent(hDC, hRC);
    LOG_INFORMATION("Creating OpenGL 2.1 context.");

    hRC = tempcontext;
  • \$\begingroup\$ That's one way to do it, but I'm using SDL, and the WinAPI really makes my head hurt, but thanks for the answer! \$\endgroup\$ Commented Jun 19, 2012 at 18:32
  • \$\begingroup\$ It's bad, but not as bad as you think. ;) Here's a simple Win32 window I copy-paste all the time: pastebin.com/7BAAeter \$\endgroup\$
    – knight666
    Commented Jun 19, 2012 at 18:35
  • \$\begingroup\$ SDL 1.3 should support GL 3 Core contexts, iirc. Of course only in the cases where your OS/hardware/driver supports it. \$\endgroup\$ Commented Jun 19, 2012 at 20:36

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .