Category Archives: Tutorial

OpenGL 2D Facade (10): Layers

In this post, we extend the facade to handle several layers. We also see how to draw with transparency.

Posted in Tutorial | Tagged , , | Leave a comment

OpenGL 2D Facade (9): Load a level

Before handling the rendering of several layers, we need data to build them. Rather than copy and paste many ids from a Tiled map file, I propose to read them using the TMX library.

Posted in Tutorial | Tagged , , | Leave a comment

OpenGL 2D Facade (8): Facade

I have enough content to start a facade: I refactorize all the code to satisfy the properties of the Facade pattern and get a more robust and extensible implementation.

Posted in Tutorial | Tagged , , , | Leave a comment

OpenGL 2D Facade (7): Draw a level

In this post, I show how to draw many tiles from a single-layer level created with Tiled. I also show how to take a screen capture with OpenGL.

Posted in Tutorial | Tagged , | Leave a comment

OpenGL 2D Facade (6): Draw a tile

Textures in the previous post allow the drawing of tiles, but the aspect ratio is not correct. In this post, I show how to draw a tile on a grid location correctly.

Posted in Tutorial | Tagged , | Leave a comment

OpenGL 2D Facade (5): Textures

In this post, I introduce OpenGL textures and use them to draw tiles from tilesets.

Posted in Tutorial | Tagged , | Leave a comment

OpenGL 2D Facade (4): Shaders

Shaders are one of the powerful features of OpenGL. I introduce them in this post and show how to color vertices using vertex and fragment shaders.

Posted in Tutorial | Tagged , | Leave a comment

OpenGL 2D Facade (3): Vertex Array Objects

Vertex Arrays Objects allow us to send large meshes to the GPU. It is a bit technical, but this is something we only have to do once.

Posted in Tutorial | Tagged , | Leave a comment

OpenGL 2D Facade (2): Mesh data

We get the best performance when sending mesh data to the GPU in a single operation. In this post, I present the numpy library that can create such data.

Posted in Tutorial | Tagged , | Leave a comment

OpenGL 2D Facade (1): Window and basic drawing

In this new series, I propose to create a GUI facade for the 2D tileset-based games using OpenGL.

Posted in Tutorial | Tagged , | Leave a comment