In Review

In this tutorial, you have learned about the following:

OpenGL Functions of Note


Creates/destroys one or more vertex array objects.


Binds a vertex array object to the GL_VERTEX_ARRAY target.


Performs indexed rendering with the currently bound GL_ELEMENT_ARRAY_BUFFER (provided via the VAO) and the current attribute arrays.


Performs indexed rendering as glDrawElements, except that each element index is offset by a constant value before performing the array lookup. This is useful for minimizing the number of buffer object binds performed in a program.


Enables/disables the per-fragment depth test. If the depth test is enabled, then the result of applying the depth function, set by glDepthFunc, to the incoming fragment's depth and the destination pixel's depth will determine if the incoming fragment is written or not.


Sets or unsets the writing of values to the depth buffer.


Sets the depth comparison function for depth testing. Has no effect if GL_DEPTH_TEST is not enabled.


Sets the mapping between NDC space and window space for the Z coordinate of the position. The XY counterpart to this function is glViewport. The range for the window-space depth must be [0, 1], though the near does not have to be less than the far. The range zNear value, the first value, is the window-space value that will map to -1 in NDC space. The range zFar is the window-space value that maps to +1 in NDC space.


Sets the clear depth value. This is the value that the depth buffer will be cleared to when calling glClear with the GL_DEPTH_BUFFER_BIT bit set.


Enables/disables depth clamping behavior. When enabled, clipping is deactivated, and any fragments that an object would render that are outside of the [-1, 1] range in NDC space are clamped to this range.

Fork me on GitHub