5
\$\begingroup\$

What is the main implementation of OpenGL?

I see GLUT everywhere, but I want to use whatever is closest to an official implementation, or what ever I will have the most control over.

I might not be asking this right since it's contributed to by different parties. Which is why I have been looking at DirectX, but I see more people using OpenGl so I'd like to use that instead.

\$\endgroup\$
1
  • \$\begingroup\$ OpenGL is an API, not an implementation. The better question might be "for platform XYZ how much of the OpenGL API is implemented in drivers and what common helper libraries are available?" \$\endgroup\$ Commented Jun 9, 2017 at 18:36

1 Answer 1

8
\$\begingroup\$

The "main implementation" of OpenGL is whatever your OS or graphics card vendor provides. For Windows display adapter drivers it's generally OpenGL 3.3 (or at least that's what I got when I updated my driver today). For Mac, it's OpenGL 2.1, or 3.2 if you're on Lion. For iOS it's OpenGL ES 2.0. For Android, it's mostly OpenGL ES 2.0.

GLUT is not an OpenGL implementation. It exists alongside OpenGL and acts as a cross-platform windowing library. It's also kind of old. Freeglut is a little more up to date, but it seems as though people are recommending GLFW as a more modern and featureful alternative. For Mac, I'd recommend installing GLFW via Homebrew, MacPorts, or Fink. Or if you'd rather just go with GLUT, version 3.7 is included on Mac. You just need to include it via #include<GLUT/glut.h> instead of #include <GL/glut.h> since Apple bundles GLUT and OpenGL as frameworks. You can also create windows and OpenGL contexts with SDL and SFML.

If you're running on Mac, freeglut only works under X11. I don't think it's worth trying to get freeglut working with it. I just spent the last couple of days trying to get Nicol Bolas' tutorials to run on Mac, but by the time I was done #ifdef'ing things out, I realized that the shader code is all different versions as well, and I'm not yet ready to understand how to translate that between older and newer versions. Maybe it'll work on Lion if you fiddle enough with it, but I can't back that up.

There's also the "Unofficial OpenGL SDK" which is a bunch of helper libraries (including freeglut, glfw and some asset loaders [note: the version of GLFW bundled with this doesn't cleanly compile on Mac out of the box]). Everything but freeglut and GLFW compile fine on Mac with some header tweaks. To install GLFW on Mac, just use Homebrew.

If you're on Windows, the unofficial OpenGL SDK is actually pretty nice. I'd recommend it. I'm currently working through the aforementioned tutorials with it. I have yet to try OpenGL out on a Linux distribution.

\$\endgroup\$
4
  • 1
    \$\begingroup\$ Everything is so confusing when there is no single vendor, I'm using windows, so I think I'll just use that unofficial SDk. As long as I'm learning it, I don't think it matters too much. Thank you very much =) Good luck on getting your projects working! \$\endgroup\$ Commented Feb 26, 2012 at 0:06
  • \$\begingroup\$ "note: the version of GLFW bundled with this doesn't cleanly compile on Mac out of the box" I'd be surprised if anything in the SDK compiled cleanly on Mac. It's not that I don't want it to work. I just don't have access to the OS. And nobody who does has offered to help. \$\endgroup\$ Commented Feb 26, 2012 at 2:45
  • \$\begingroup\$ @NicolBolas I'd be interested in helping out. It wouldn't be able to guarantee time put toward it until May (I'm in my last semester in school), but I just got glfw and the first few of its examples working great with some quick edits to glfw.lua \$\endgroup\$ Commented Feb 26, 2012 at 12:47
  • 1
    \$\begingroup\$ @bearcdp: Patches are welcome. The Bitbucket repo is over here, or you can use SourceForge to drop off a patch. \$\endgroup\$ Commented Feb 26, 2012 at 15:13

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.