What is the difference? (OpenGL)

Whether you're a newbie or an experienced programmer, any questions, help, or just talk of any language will be welcomed here.

Moderator: Coders of Rage

Post Reply
AronE.
Chaos Rift Newbie
Chaos Rift Newbie
Posts: 31
Joined: Mon Sep 14, 2015 8:04 am

What is the difference? (OpenGL)

Post by AronE. »

Glbinding
GLee
GLEW
GLUT
GLFW
GL3W
GLSL
etc.

So many GL's.... How are they different from each other? Which are the most used ones and why? I tried researching it myself but got nowhere with finding an answer.
lelandbdean
Chaos Rift Newbie
Chaos Rift Newbie
Posts: 18
Joined: Thu Mar 28, 2013 10:37 pm
Favorite Gaming Platforms: PC, Gameboy, PSP, SNES, NES
Programming Language of Choice: C/++ usually

Re: What is the difference? (OpenGL)

Post by lelandbdean »

Generally, if you're on desktop you probably already have an OpenGL C library (and headers) installed on your system.
You can use OpenGL already, if that's the case. (Tutorials will show you how to link it, etc).

If you're stuck I would recommend checking out this thread: /viewtopic.php?f=6&t=4547
and go to the OpenGL section. I recommend the NeHe tutorials.

GLSL (GL Shader Language) Part of OpenGL. OpenGL shaders are written in this and compiled into shader programs by OpenGL. With modern OpenGL you'll care about this sooner rather than later. With older OpenGL versions, you can get away with not learning this immediately if you're not doing anything too fancy.

As for all these other libs: I haven't used some of them, and finding someone who has used every OpenGL-related lib there is might be difficult.
Don't be paralyzed by worry that you aren't picking the objective best library out of a zillion--just dig into something and see how it goes.
Also, RTFM when possible (it'll save you a lot of grief in the long run).

GLbinding: a generated, cross-platform C++ binding for OpenGL which is solely based on the new xml-based OpenGL API specification.
GLee: (GL Easy Extension) is a free cross-platform extension loading library for OpenGL. Claims 400 extensions (dear God why)
GLEW: (GL Extension Wrangler) a cross-platform open-source C/C++ extension loading library. (Standard-ish)
GL3W: (Name is pun of GLEW, I assume) focuses on the core profile of OpenGL 3 and 4. It only loads the core entrypoints for these OpenGL versions. Doesn't load extensions.
GLUT: (GL Utility Toolkit) a somewhat high-level wrapper for parts of OpenGL. Helps you get shit off the ground faster and learn OpenGL
GLFW: (GL ???) a high level OpenGL wrapper, seemingly. Also has input handling built in. Don't know how it compares to SDL.

You can make an OpenGL-rendered program without using any of the libraries above, but it will be more involved (and you'll learn more).

Sources: Prior experience/ Google
if I fucked up any of those Twitter-tier descriptions call me out
User avatar
dandymcgee
ES Beta Backer
ES Beta Backer
Posts: 4709
Joined: Tue Apr 29, 2008 3:24 pm
Current Project: https://github.com/dbechrd/RicoTech
Favorite Gaming Platforms: NES, Sega Genesis, PS2, PC
Programming Language of Choice: C
Location: San Francisco
Contact:

Re: What is the difference? (OpenGL)

Post by dandymcgee »

lelandbdean wrote: GL3W: (Name is pun of GLEW, I assume) focuses on the core profile of OpenGL 3 and 4. It only loads the core entrypoints for these OpenGL versions. Doesn't load extensions.
Personally, I use GL3W for this very reason. The fact that it only loads core profile and excludes all of the deprecated functions makes it easy for me to avoid accidentally using fixed-pipeline stuff. I found it very difficult to find a reliable reference that marks everything as core or not, so I'd prefer to just not hook the stuff I don't need. That said, there are are some downsides, and this won't work if you *need* "old" OpenGL for some reason (e.g. target hardware doesn't support modern OGL). They are all slight variations of the same idea, which is that you need to query and hook into all of the OpenGL methods so that you can call them. You can do this yourself with a million dllimport calls and a ton of OS-specific, version-specific logic.
Falco Girgis wrote:It is imperative that I can broadcast my narcissistic commit strings to the Twitter! Tweet Tweet, bitches! :twisted:
Post Reply