Questions tagged [opengl]

OpenGL (Open Graphics Library) is a graphics standard and API which is platform independent and available for desktop, workstation and mobile devices. It is designed to provide hardware-accelerated rendering, and hence gives greatly improved performance over traditional software rendering. OpenGL is used for applications like CAD software and computer games. The OpenGL standard, as well as OpenGL ES, is controlled by the Khronos group.

OpenGL (Open Graphics Library) is an API used to interact with GPUs (Graphics Processing Units). Originally developed by SGI (Silicon Graphics Inc.) in the early 90's, the current API is being developed by the Khronos Group.

OpenGL is platform independent and available for desktop, workstation and mobile devices. It is designed to provide hardware-accelerated rendering and is typically used for applications such as CAD software and computer games.

The tag should only be used for questions about desktop OpenGL. OpenGL ES (OpenGL for Embedded Systems) and WebGL have their own tags - and . When posting in the tag, remember to always specify your target OpenGL version in order to get more precise answers. The tags , , and exist for this purpose.

Official Documentation

  • The Red Book - Tutorial GL
  • The Orange Book - Tutorial for GLSL
  • The Green Book - Tutorial for GLX
  • The Blue Book - API references for GL (out of print; replaced by online reference pages)
  • The White Book - Tutorial for WGL

Successor

Khronos Group announced API at GDC (Game Developers Conference) 2015. Vulkan, previously known as glNext or the "Next Generation OpenGL Initiative", is widely thought of as the successor to OpenGL and shares many similarities to the API. It is a complete redesign aimed to unify the OpenGL and OpenGL-ES API's into one common API that will not be backwards compatible.

External resources

Unofficial Tutorials

Books

Release Dates

  • OpenGL 1.0 - January 1992
  • OpenGL 1.1 - January 1997
  • OpenGL 1.2.1 - October 1998
  • OpenGL 1.3 - August 2001
  • OpenGL 1.4 - July 2002
  • OpenGL 1.5 - July 2003
  • OpenGL 2.0 - September 2004
  • OpenGL 2.1 - July 2006
  • OpenGL 3.0 - August 2008
  • OpenGL 3.1 - March 2009
  • OpenGL 3.2 - August 2009
  • OpenGL 3.3 - March 2010
  • OpenGL 4.0 - March 2010
  • OpenGL 4.1 - July 2010
  • OpenGL 4.2 - August 2011
  • OpenGL 4.3 - August 2012
  • OpenGL 4.4 - July 2013
  • OpenGL 4.5 - August 2014
  • OpenGL 4.6 - July 31, 2017
36259 questions
7
votes
1 answer

Texture mapping a circle made using GL_POLYGON

I am trying to map a texture to a circle using GL_POLYGON using this code: void drawCircleOutline(Circle c, int textureindex) { float angle, radian, x, y; // values needed by drawCircleOutline glEnable(GL_TEXTURE_2D); …
Mike Tarrant
  • 281
  • 1
  • 7
  • 19
7
votes
3 answers

Dumping 3d geometry data of a running Direct3D or OpenGL application

For a hobby project of mine involving a 3d printer I would like to capture 3d models from various computer games. The games are running on Windows and are usually using DirectX9 but there is also one which can be configured to use OpenGL. Is there…
CodeTwice
  • 2,756
  • 3
  • 15
  • 17
7
votes
4 answers

How do I set the close operation on a GLUT program written in C? (as in the red button in the top left corner to work)

I'm writing a really simple program using GLUT and C in XCode 4.2. int main(int argc, char** argv) { glutInit(&argc, argv); glutInitDisplayMode(GLUT_RGBA | GLUT_DOUBLE | GLUT_DEPTH); glutInitWindowSize(640, 480); …
Eric Thoma
  • 5,045
  • 6
  • 26
  • 39
7
votes
4 answers

Resizing point sprites based on distance from the camera

I'm writing a clone of Wolfenstein 3D using only core OpenGL 3.3 for university and I've run into a bit of a problem with the sprites, namely getting them to scale correctly based on distance. From what I can tell, previous versions of OGL would in…
Lex R
  • 1,473
  • 1
  • 15
  • 33
7
votes
2 answers

What advantages exist in C++ over C# when working with OpenGL

I am starting to get interested learning in OpenGL and I am trying to figure out what the best direction to go as far as which language to use in the learning process. I am already very familiar with C# and from what I have read, I can utilize the…
jdavis
  • 6,625
  • 11
  • 48
  • 60
7
votes
3 answers

XCode project cannot recognize certain GLUT commands

I'm creating a GLUT/OpenGL project in XCode 4. I've added the glut/opengl frameworks, linked all my libraries together-all is good, except for some reason my main() function won't accept glutInit(&argc, argv) and gives me the error message that…
Chris
  • 71
  • 1
  • 2
7
votes
1 answer

How to disable mipmaps in OpenGL

I am making 2D sprite engine in OpenGL and I want to disable mipmaps, as I do not need them. When I call: glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, internal->internal_w, internal->internal_h, 0, GL_RGBA, GL_UNSIGNED_BYTE,…
PiotrK
  • 3,689
  • 6
  • 37
  • 56
7
votes
3 answers

How to get color from the pixel? OpenGL

I would like to get color from the pixel in my game and save this color in variable. How to do it in opengl?
user1019901
  • 561
  • 3
  • 5
  • 11
7
votes
2 answers

Is there a way to apply a sinewave distortion effect purely in shaders?

Sinewave distortion of a 2D image is a classic visual effect: taking a 2D image and warping it along either the X or the Y axis by shifting pixels according to a sine wave. It ends up looking something like this: I've seen a few examples of code…
Mason Wheeler
  • 77,748
  • 42
  • 247
  • 453
7
votes
4 answers

Incorrect texture in 3d model loading using ASSIMP & OpenGL

I'm trying to modify the sample code for loading 3d model included in ASSIMP's sample code, by using GLUT instead of WGL. However, i got a problem with the texture, as illustrated below: while it is supposed to be as illustrated below: and the…
snowball147
  • 499
  • 10
  • 19
7
votes
1 answer

Why is GLUT so bad?

I've seen a lot of bad comments about GLUT, although openFrameworks uses it. Cinder developers have stated that they want to stay as far away from GLUT as possible... So what's so bad about it?
Pier
  • 8,313
  • 12
  • 54
  • 97
7
votes
1 answer

GLU NURBS rendered wrongly

EDIT: This is a library bug. I reported it to the HOpenGL mail list. I use 9-point rectangular method to represent a circle/ellipse as a NURBS. The points are p1, p2, ..., p9, p9 = p1. They lay as shown: y2 | p2 p3 p4 y1 | p1 p5 y0 | p8 p7…
modular
  • 1,051
  • 7
  • 22
7
votes
2 answers

How to setup OpenGL1.4 environment in Firemonkey App?

In older days I would create a TForm, place a TMyPanel on it (with overriden WM_PAINT message) and pass its Handle to a bunch of WGL functions that find a compatible pixelformat and create rendering context. Just like NeHe tutorials did it. Now…
Kromster
  • 6,665
  • 7
  • 55
  • 98
7
votes
5 answers

Learning OpenGL through Java

I'm interested in learning OpenGL and my favorite language at the time is Java. Can I reap its full (or most) benefits using things like JOGL or should I instead focus on getting stronger C++ skills? Btw, which is your Java OpenGL wrapper library…
andandandand
  • 20,448
  • 55
  • 163
  • 248
7
votes
2 answers

glReadPixels from FBO fails with multisampling

I have an FBO object with a color and depth attachment which I render to and then read from using glReadPixels() and I'm trying to add to it multisampling support. Instead of glRenderbufferStorage() I'm calling glRenderbufferStorageMultisampleEXT()…
shoosh
  • 70,450
  • 50
  • 199
  • 310