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
37973 questions
56
votes
2 answers

compiling OpenGL program GL/glew.h missing

I installed OpenGL onto my computer running Linux Mint following the instructions on this tutorial. I am trying to compile a program that uses OpenGL, but I'm getting a compile error: fatal error: GL/glew.h: No such file or directory. I check the…
rurouniwallace
  • 2,027
  • 6
  • 25
  • 47
55
votes
1 answer

Abysmal OpenCL ImageSampling performance vs OpenGL TextureSampling

I've recently ported my volumeraycaster from OpenGL to OpenCL, which decreased the raycaster's performance by about 90 percent. I tracked the performance decrease to the OpenCL's imagesampling functions, which are much slower than the respective…
user1449137
  • 651
  • 5
  • 3
54
votes
4 answers

How to compile GLUT + OpenGL project with CMake and Kdevelop in linux?

As the titles says I can't seem to build the project with OpenGL and Glut. I get Undefined reference errors for OpenGL functions. I tried doing : project(testas) find_package(OpenGL) find_package(GLUT) add_executable(testas main.cpp) But that…
Ren
  • 801
  • 1
  • 8
  • 12
53
votes
5 answers

Is WPF 3D good alternate of DirectX and OpenGL for complex applications?

I have used WPF's 3D capabilities for learning, and for a few implementations, and I have found it to be very capable, and I am also learning DirectX 11, and it is very tricky compared to using 3D classes in WPF. I have only used WPF 3D for very…
SpeedBirdNine
  • 4,610
  • 11
  • 49
  • 67
53
votes
5 answers

What are some best practices for OpenGL coding (esp. w.r.t. object orientation)?

This semester, I took a course in computer graphics at my University. At the moment, we're starting to get into some of the more advanced stuff like heightmaps, averaging normals, tesselation etc. I come from an object-oriented background, so I'm…
fluffels
  • 4,051
  • 7
  • 35
  • 53
53
votes
2 answers

difference of freeglut vs glew?

I've recently started learning OpenGL (> 3.3) & I've noticed a lot of examples & tutorials use both freeglut & glew, but don't really explain the difference at all. The best description I've found, after googling & reading ad nauseum, has been this…
ReturnVoid
  • 1,106
  • 1
  • 11
  • 18
53
votes
3 answers

Why would it be beneficial to have a separate projection matrix, yet combine model and view matrix?

When you are learning 3D programming, you are taught that it's easiest think in terms of 3 transformation matrices: The Model Matrix. This matrix is individual to every single model and it rotates and scales the object as desired and finally moves…
Mecki
  • 125,244
  • 33
  • 244
  • 253
52
votes
3 answers

What can cause glDrawArrays to generate a GL_INVALID_OPERATION error?

I've been attempting to write a two-pass GPU implementation of the Marching Cubes algorithm, similar to the one detailed in the first chapter of GPU Gems 3, using OpenGL and GLSL. However, the call to glDrawArrays in my first pass consistently fails…
Michael Powell
  • 853
  • 2
  • 9
  • 12
51
votes
6 answers

How to draw text using only OpenGL methods?

I don't have the option to use but OpenGL methods (that is glxxx() methods). I need to draw text using gl methods only. After reading the red book, I understand that it is possible only through the glBitmap() method. If this is the only possible…
sathish v
  • 519
  • 1
  • 6
  • 5
51
votes
1 answer

Should I ever use a `vec3` inside of a uniform buffer or shader storage buffer object?

The vec3 type is a very nice type. It only takes up 3 floats, and I have data that only needs 3 floats. And I want to use one in a structure in a UBO and/or SSBO: layout(std140) uniform UBO { vec4 data1; vec3 data2; float…
Nicol Bolas
  • 449,505
  • 63
  • 781
  • 982
51
votes
1 answer

gluPerspective parameters- what do they mean?

I wonder about the gluPerspective parameters. In all examples I see fovy is set to around 45-60degrees I've tried to set it to different values and the object just disappears what's the explanation for it? The aspect value should always be the…
Despair
  • 715
  • 1
  • 6
  • 14
50
votes
2 answers

OpenGL bool uniform?

I'm trying to send a boolean to an OpenGL glsl shader. Currently I have this in the shader: uniform bool foo; And I use this to set it: glUniform1i(glGetUniformLocation(shader, "foo"), true); There doesn't seem to be a glUniform1b, so I'm setting…
Jan Rüegg
  • 9,587
  • 8
  • 63
  • 105
50
votes
11 answers

How do you install GLUT and OpenGL in Visual Studio 2012?

I just installed Visual Studio 2012 today, and I was wondering how can you install GLUT and OpenGL on the platform?
wasabiman
  • 529
  • 1
  • 5
  • 4
49
votes
4 answers

Learning OpenGL in Ubuntu

I'm trying to learn OpenGL and improve my C++ skills by going through the Nehe guides, but all of the examples are for Windows and I'm currently on Linux. I don't really have any idea how to get things to work under Linux, and the code on the site…
victor
  • 6,688
  • 9
  • 44
  • 48
49
votes
4 answers

What are the differences between a Frame Buffer Object and a Pixel Buffer Object in OpenGL?

What is the difference between FBO and PBO? Which one should I use for off-screen rendering?
alvatar
  • 3,340
  • 6
  • 38
  • 50