Since there are many official (and unofficial) desktop OpenGL implementations, which do actual 3D games use? GLUT? FreeGLUT? Mesa3D?
Which performs the best?
Posted 27 January 2013 - 09:57 AM
Since there are many official (and unofficial) desktop OpenGL implementations, which do actual 3D games use? GLUT? FreeGLUT? Mesa3D?
Which performs the best?
"The only thing stopping you from what you want in the future is what you want right now." - Zig Ziglar
Posted 27 January 2013 - 10:12 AM
Neither GLUT nor FreeGLUT are OpenGL implementations. They are windowing layers for OpenGL. Mesa3D is a software implementation that provides limited possibilities for hardware acceleration.
If you're on Windows, there's pretty much only one sensible option; you use the default implementation that the operating system provides. The benefit with using that implementation is that each hardware manufacturer provides their own hardware driver for it. Just link the standard opengl32.lib that ships with your compiler to use it.
Posted 27 January 2013 - 01:38 PM
Edited by Karsten_, 27 January 2013 - 01:49 PM.
http://www.mutiny3d.org - Open-source pluginless Unity Re-implementation.
Posted 27 January 2013 - 04:06 PM
Note that opengl32.lib only supports up to opengl 1.1. If you want to use any newer functionality, you need to get that functionality from the graphics card drivers. Your best option is to use a library like glew(http://glew.sourceforge.net/) to load that functionality for you.
Posted 27 January 2013 - 04:25 PM
Edited by L. Spiro, 27 January 2013 - 06:48 PM.
Posted 27 January 2013 - 06:02 PM
As far as I know it is like this:
In *nix world you get: Mesa (up to 3.1 spec), proprietary GPU driver's implementation (up to 4.3 for nVidia, 4.2 for AMD) and OSS driver's implementation (i have no idea, enough to play Quake3 based games).
In Windows you get: Microsoft implementation (1.1 spec) and GPU driver's implementation (up to 4.3 for nVidia, 4.2 for AMD).
In OSX you get: Apple's implementation (up to 3.2 for everyone).
EDIT: Corrected Mesa's and Apple's spec implementations.
Edited by TheChubu, 27 January 2013 - 07:36 PM.
My journal: Making a Terrain Generator
Posted 27 January 2013 - 06:29 PM
OS X 10.8 (Mountain Lion) supports OpenGL 3.2 core with some OpenGL 3.3 features as extensions.In OSX you get: Apple's implementation (up to 3.1 for everyone).
Posted 27 January 2013 - 07:02 PM
Just to clarify to MrJoshL, we don't really "choose" what implementation to use (unless we want to force software rendering and we explicitly do so)
If we want hardware acceleration (aka get access to GPU), we'll just load the OpenGL implementation that is installed in the system (for NVIDIA cards, it's NVIDIA's, for ATI cards, it's ATI's). Since they're implementations, they implement everything they're supposed to, otherwise we would get a crash or a "cannot load routine from library" error and exit.
In Windows, the OGL system is called OpenGL "ICD" (Installable Client Driver). When the driver (ati, nvidia, intel, sis, s3, powervr, 3dfx, etc) didn't provide an OpenGL implementation, the application will be routed to a software implementation developed by Microsoft which is very outdated (supports 1.1 spec) so if you're using something higher, your application it will just fail to load (it's as if DirectX wouldn't be installed for Direct3D games)
When the driver did provide the implementation, the ICD will route to the driver's DLL.
In Linux, something very similar happens. Most distros ship the Mesa software implementation (which is usually very up to date), and if you install proprietary drivers, the installation messes with distro's folders & symbolic links to use the driver's OGL implementation instead of Mesa's.
Every now and then the installer (either driver's or distro's package manager) may mess the installation and try to mix Mesa dlls with driver's and X11 will crash when launching a GL application (been there....... multiple times). The situation has improved a lot though, in the last couple of years.
In Mac, I have no idea how it works, but afaik Apple controls the implementation being shipped.
You can of course ship your game with Mesa DLLs (since it's the only implementation I'm aware of that could be licensed for that) and always use Mesa's implementation, but almost nobody would like to do that.
GLUT & FreeGLUT are layers that simplify the creation of a GL context, and may deal with all this trouble (i.e. not having the right ICD installed, not having required GL version, loading extensions, etc) because this is all messing with DLL & function loading that has nothing to do with rendering triangles to the screen.
Edit: We just want to load the installed implementation and start rendering with hardware acceleration.
Edited by Matias Goldberg, 27 January 2013 - 07:06 PM.
Posted 27 January 2013 - 07:24 PM
For the OPs benefit - GLUT, GLFW, etc are nothing more than helper libraries. Their job is to deal with the painful (and non-cross-platform) task of creating a window, initializing a GL context, getting function pointers, etc. This next bit is important. Aside from that, they really have nothing much to do with GL itself; they just wrap the native API calls that would otherwise be used to get things up and running.
One major reason why they exist is for e.g. tutorials, sample code, and the like. The native API code to do all this stuff can be huge, and when you're making a tutorial you really don't want the tutorial-specific code to be swamped by all of this extra stuff. You want to focus on the lines of code that are relevant to the tutorial.
They can also serve another purpose in terms of providing a (at least) reasonably cross-platform way of getting a GL context up. Some even provide other services (input, sound, etc) which may range in implementation from simplistic to comprehensive, but for the purposes of OpenGL itself, once that context is up, they step back and everything is just native GL code from there.
If you want to see how a real-life commercial game handles window and GL context creation, you could do a lot worse than look at the source code for one.
It appears that the gentleman thought C++ was extremely difficult and he was overjoyed that the machine was absorbing it; he understood that good C++ is difficult but the best C++ is well-nigh unintelligible.
Posted 27 January 2013 - 07:43 PM
In Mac, I have no idea how it works, but afaik Apple controls the implementation being shipped.
I've read Apple provides some lower level API that driver developers code for. So Apple gets a hold of everything down to which gl calls can be made and then gives control to the driver implementation. That's all I know though...
My journal: Making a Terrain Generator
Posted 27 January 2013 - 09:58 PM
This is a year-old article explaining what is still mostly the current situation with Mac OS X.
http://renderingpipeline.com/2012/04/sad-state-of-opengl-on-macos-x/
L. Spiro
Posted 30 January 2013 - 08:14 AM
Sorry for being ambiguous, but what I meant by an "actual" OpenGL graphics application is something that utilizes the 3D capabilities of OpenGL, and isn't just drawing quads to the screen.Define what an “actual” 3D game is?
So if I had a list of all the things I need, and only the things I need, would this be correct:
1. opengl32.lib OR opengl32.a
2. gl.h
3. glew
4. glext
5. glu
6. wglext
"The only thing stopping you from what you want in the future is what you want right now." - Zig Ziglar
Posted 30 January 2013 - 08:42 AM
Edited by Brother Bob, 30 January 2013 - 08:50 AM.