Question

I'm confused. I've been trying to start out with OpenGL, and I haven't had any success at all.

details: I seem to have been trying to use Mesa 3D which isn't even strictly an official OpenGL implementation anyway. Does Mesa 3D even use the gpu? and I have version 4.0 (which is like an OpenGL version 1.3 implementation). I don't know how to get another implementation library; I don't even know what others there are. (Mesa 3D was provided with my dev-cpp compiler)

In fact, I don't really fully understand what OpenGL is.

Also, I cannot get freeglut or glut or glu to work. They're calling non-existing functions like gluOrtho and gluPerspective. Is this due to using Mesa 3D? Is there any way I could get these entire libraries to actually work?

Was it helpful?

Solution

In fact, I don't really fully understand what OpenGL is.

OpenGL in and itself is just a specification of an API: A set of functions you can call and special values and tokens and what the effects of each call are. Implementations then follow this specification to provide a working OpenGL.

OpenGL is rasterizing drawing API, optimized for the drawing of primitives in 3D space. I.e. you supply a stream of 3D coordinates and a drawing mode, i.e. draw points, lines or triangles, and OpenGL will then transform the 3D data into the 2D screen space and draw flat primitives on a canvas. Later versions of OpenGL are no longer strictly 3D to 2D, but require so called shaders, which are small programs that describe the transformation of arbitrary dimensional geometry into 2D screen space.

Additional functionality is the sampling and interpolation of image data (texturing) as an additional data source when drawing.


details: I seem to have been trying to use Mesa 3D which isn't even strictly an official OpenGL implementation anyway.

Why? If you're on Windows, then you should use the OpenGL implementation provided by the GPU driver, not some random library (though Mesa3D is not entirely random).

OpenGL is not actually some library you install, it's a set of functions provided by the GPU driver. For cases where the GPU drivers don't provide OpenGL you can use a software rasterizer implementation.

Does Mesa 3D even use the gpu?

Depends. On Windows Mesa3D is a software rasterizer only. However for X.org (Linux, FreeBSD, etc.) Mesa3D is the open source OpenGL frontend to the GPU drivers, so you get GPU acceleration through mesa there, if X.org is configured to use a driver that Mesa3D can use.

I don't know how to get another implementation library; I don't even know what others there are. (Mesa 3D was provided with my dev-cpp compiler)

Usually you get your OpenGL as part of the GPU drivers. On Linux when installing open source GPU drivers this automatically installs Mesa3D. But there are also closed source drivers and those use a entirely different codebase.

This is really important: You do not need a specialized OpenGL library to do OpenGL development.

Usually your compiler ships with a "opengl32.lib" (if on Windows – on other platforms you just tell the linker to link against the system OpenGL). However this is just sort of a table of contents for the linker, what an actual OpenGL implementation will offer.

On Windows the system opengl32.dll exports only OpenGL-1.1. For any functionality above this there is the so called extension mechanism to load higher version functions. You usually do this through a library (in this case really a library) like GLEW

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top