Lazy Foo' Productions

SDL Forums SDL Tutorials Articles OpenGL Tutorials OpenGL Forums
News FAQs Games Contact Donations

Introduction to OpenGL Graphics Programming

Last Updated 12/21/12
OpenGL is a powerful cross platform graphics API. With OpenGL, you can get hardware accelerated 2D and 3D rendering. This tutorial set was made to give beginners a head start by going through the basics of OpenGL usage.

For this tutorial we'll be starting using the OpenGL 2.1 era code to get started with the basics. Then we'll transition to modern OpenGL 3.0+ shader based programs.

Make sure to check out the Frequently Asked OpenGL Tutorial Questions. If you're having trouble with vector math, check out my OpenGL Math Primer.
Table of Contents
Introduction
We'll be talking about what these tutorials will cover and what they're designed to do.
Lesson 01
Hello OpenGL
Here we set up an OpenGL window using freeGLUT and render a quad to the screen.
Lesson 02
Matrices and Coloring Polygons
Here we learn how to set up our rendering coordinates and give color to our polygons. We'll also go over the very basics of how a GPU pipeline works.
Lesson 03
The Viewport
Here we learn how to control where on our screen we want OpenGL to render using the viewport.
Lesson 04
Scrolling and the Matrix Stack
In many if not most games, the game environments are larger than one screen. Here we'll learn to scroll through large environments.
Lesson 05
Texture Mapping and Pixel Manipulation
If you want to do 2D images in OpenGL, you want to use textured quads. Here we'll apply a checkerboard texture to our geometry.
Lesson 06
Loading a Texture
We created a texture from memory, now we'll load a texture from a file using DevIL.
Lesson 07
Clipping Textures
Often times multiple images are put onto one texture. Here we'll render a part of a texture.
Lesson 08
Non-Power-of-Two Textures
Here we'll render an image that doesn't have power of two dimensions.
Lesson 09
Updating Textures
Here we'll update a texture's pixels after creating it.
Lesson 10
Color Keying and Blending
In this lesson we'll give our image a transparent background and blend our image with the background.
Lesson 11
Stretching and Filters
Here we'll learn to stretch our texture to different sizes.
Lesson 12
Rotation
In this lesson, we'll make a texture rotate to make it spin.
Lesson 13
Matrix Transformations
Here we'll learn better way to stretch and rotate our textured quads using matrices.
Lesson 14
Repeating Textures
Here we'll show the same texture multiple times on the same quad.
Lesson 15
Extensions and GLEW
Here we'll get the latest OpenGL functionality using GLEW to get the OpenGL extensions.
Lesson 16
Vertex Arrays
Here we'll send vertex data to the GPU in sets instead of one by one using vertex arrays.
Lesson 17
Vertex Buffer Objects
In this tutorial, we'll store our vertex data on the GPU for drawing.
Lesson 18
Textured Vertex Buffers
Here we'll render our textured quad as a VBO.
Lesson 19
Sprite Sheets
Here we'll preallocate our vertex/index data for all of our sprites.
Lesson 20
Bitmap Fonts
Bitmap fonts are a basic way to render text to the screen.
Lesson 21
Alpha Textures
Up until now we've always used 32bit RGBA textures. In this tutorial we'll make a special type of texture that only has an alpha component.
Lesson 22
Texture Blitting and Texture Padding
Time to do some more advanced pixel manipulation to copy textures and manually pad them.
Lesson 23
FreeType Fonts
Here we'll render text using a True Type font.
Lesson 24
Text Alignment
Learn how to align your text to the top/bottom/left/right of whatever area you define.
Lesson 25
Transforming Text
Here we'll apply matrix transformations to text.
Lesson 26
The Stencil Buffer
Using the stencil buffer, you can define the portions of the screen you want to render to with geometry.
Lesson 27
Frame Buffer Objects and Render to Texture
Using frame buffer objects, you can render off screen. Here, we're going to render to an off screen frame buffer to render to a texture.
Lesson 28
Antialiasing and Multisampling
Tired of jaggies on your polygons? Using antialiasing and multisampling you can smooth out those edges.
Lesson 29
Hello GLSL
Modern OpenGL does its graphics operations with programmable pipelines. This tutorial will get you started with your first GLSL shader program.
Lesson 30
Loading Text File Shaders
Why recompile code you don't have to? In this tutorial we'll be loading our GLSL shader source code from an external file.
Lesson 31
GLSL Matrices, Color, and Uniforms
In this tutorial we'll be interfacing our OpenGL application with our shader programs using uniforms.
Lesson 32
GLM Matrices
We'll be using the GL Math library to help with matrix operations for modern OpenGL applications.
Lesson 33
Multi-Color Polygons and Attributes
Using attributes we can have custom per-vertex variables in our shader to draw a polygon with per-vertex coloring.
Lesson 34
GLSL Texturing
We'll finally use textures in our GLSL shader programs.
Lesson 35
GLSL Font
We'll be using a GLSL shader program to render fonts.
Lesson 36
Vertex Array Objects
We'll be binding all our vertex attributes to a single vertex array object.
Conclusion
Here's some additional tips to continue learning OpenGL.
I am not claiming to know everything there is to know about programming/C++/OpenGL, but I have gained knowledge from the OpenGL projects I've worked on. These tutorials are made to pass on the knowledge I gained to those just starting out and to make OpenGL much less intimidating to beginners. I try to keep my code and tutorials as bug free as possible. If you find any errors please report them to me. Suggestions are also welcome.

So if you have any suggestions, comments, questions, bugs reports, typos, or anything else you want to say about the tutorials, feel free to contact me.
SDL Forums SDL Tutorials Articles OpenGL Tutorials OpenGL Forums
News FAQs Games Contact Donations
Copyright Lazy Foo' Productions 2004-2013
gipoco.com is neither affiliated with the authors of this page nor responsible for its contents. This is a safe-cache copy of the original web site.