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

glVertexAttribPointer needed everytime glBindBuffer is called?

In OpenGL (OpenGL ES 2.0 in particular), is glVertexAttribPointer required to be called each time a new VBO is bound? For example: glBindBuffer(GL_ARRAY_BUFFER, vertexBuffer1); glVertexAttribPointer(ATTRIB_POSITION, 2, GL_FLOAT, GL_FALSE,…
OpenUserX03
  • 1,440
  • 1
  • 13
  • 20
7
votes
1 answer

glVertexAttribPointer on built-in vertex attributes like gl_Vertex, gl_Normal

I have to send vertex attributes using glVertexAttribPointer to shaders expecting them as built-in (gl_Vertex, gl_Color, etc.). The glVertexAttribPointer function needs to specify the index (or location) of each built-in attribute. I can do it on…
Pau Baiget
  • 73
  • 3
7
votes
1 answer

Can OpenGL rendering be used for 3D monitors?

We have been considering buying a 3D-ready LCD monitor along with a machine with a 3D-stereoscopic vision capable graphics card (ATI Radeon 5870 or better). This is for displaying some scientific data that we are rendering in 3D using OpenGL. Now…
subhacom
  • 774
  • 8
  • 24
7
votes
2 answers

*BaseVertex and gl_VertexID

I've skimmed through the specs and OpenGL forum but couldn't really make sense of this: Are the *BaseVertex version of the drawing commands supposed to add to the GLSL variable gl_VertexID? As it works, gl_VertexID contains the index taken from the…
palle8x
  • 73
  • 5
7
votes
2 answers

glTexImage2D Segfault related to width/height

I got a segfault when I tried to load a 771x768 image. Tried with a 24x24 and 768x768 image and they worked, no problem. Is this expected? Why wouldn't it just fail gracefully with a GL Error? The segmentation fault occurs in the glTexImage2D…
Steven Lu
  • 36,733
  • 50
  • 179
  • 328
7
votes
2 answers

How does a GLSL sampler determine the minification, and thus the mipmap level, of a texture?

I am working with OpenGL ES (via WebGL), but I think this question is applicable to the full OpenGL profile as well. Suppose I create an OpenGL texture with full mipmap levels, and I set its TEXTURE_MIN_FILTER to NEAREST_MIPMAP_NEAREST. Also suppose…
Daniel Yankowsky
  • 6,754
  • 1
  • 31
  • 39
7
votes
3 answers

lightweight UI library for OpenGL

Like the title says, I'm looking for a library that's platform-agnostic and lightweight, for the purpose of displaying buttons, slider bars, check boxes, etc. in OpenGL. Ideally, something that is not directly coupled with OpenGL is best (ie. so…
MarkP
  • 3,868
  • 9
  • 39
  • 76
7
votes
3 answers

What bad things may happen without calling to ReleaseDC?

Programming with C++, once we get the context device by GetDC to use. What bad things may happen if we exit the program without calling to ReleaseDC?
jondinham
  • 7,515
  • 15
  • 71
  • 130
7
votes
2 answers

Efficient way of reading depth values from depth buffer

For an algorithm of mine I need to be able to access the depth buffer. I have no problem at all doing this using glReadPixels, but reading an 800x600 window is extremely slow (From 300 fps to 20 fps) I'm reading a lot about this and I think dumping…
Kevin
  • 765
  • 1
  • 12
  • 27
7
votes
1 answer

low resolution in OpenGL to mimic older games

I'm interested in know how is the right way to mimic the low resolution of the older games (like Atari 2600) in OpenGL to do a fps game. I imagine the best way to do it is writing the buffer into a texture, put onto a quad and display it to the…
xbelanch
  • 784
  • 1
  • 10
  • 20
7
votes
3 answers

Minimal Windowless OpenGL Context Initialization

How can I initialize a windowless OpenGL context with the minimal amount of code? I've read here that you can use wglCreateContextAttribsARB to create windowless context, however it doesn't explain how?
ronag
  • 43,567
  • 23
  • 113
  • 204
7
votes
2 answers

Vertex Buffer Objects in OpenGL 2.1

(I specified 2.1 because my laptop won't go past that version. I would have probably done this anyway since 3.x and on introduces shaders as mandatory?). Thanks to Wikipedia: http://en.wikipedia.org/wiki/Vertex_Buffer_Object I am starting to grasp…
MintGrowth
  • 4,831
  • 9
  • 58
  • 88
7
votes
1 answer

Selecting the face of a Cubemap in GLSL

Ok, I'm trying to understand how the face of a cubemap is selected using the coordinates supplied to textureCube(). From the spec, I gather the coord with the biggest magnitude defines the face. For example these coords (-0.2, 0.7, 0.65) would…
Albus Dumbledore
  • 11,500
  • 22
  • 60
  • 102
7
votes
2 answers

Opengl Unsynchronized/Non-blocking Map

I just found the following OpenGL specification for ARB_map_buffer_range. I'm wondering if it is possible to do non-blocking map calls using this extension? Currently in my application im rendering to an FBO which I then map to a host PBO…
ronag
  • 43,567
  • 23
  • 113
  • 204
7
votes
4 answers

Speeding up transform calculations

I am programming an OpenGL3 2D Engine. Currently, I am trying to solve a bottleneck. Please hence the following output of the AMD Profiler: http://h7.abload.de/img/profilerausa.png The data was made using several thousand sprites. However, at…
user852830