Tag Archives: Python

OpenGL 2D Facade (24): Z-Buffer

In this post, I show a first application of the OpenGL Z-Buffer, which allows a scene rendering without the need to sort tiles. Objective To check that the implementation works fine, we want to hide the character behind the top … Continue reading

Posted in Tutorial | Tagged , | Leave a comment

OpenGL 2D Facade (22): Load and save game state

We still need game content to test the facade, and it’s even better if we can load and save that content from a file! Objective The expected result is our current level editor able to load and save all the … Continue reading

Posted in Tutorial | Tagged , | Leave a comment

OpenGL 2D Facade (21): Shaders and Layers

In this post, I show how to update shaders based on the current layer. Objective I choose the translation as the property to update for each layer or group of layers. The ground layer has a translation we can control … Continue reading

Posted in Tutorial | Tagged , | Leave a comment

OpenGL 2D Facade (20): Automatic tile borders

I add more game content in this post to test the facade. This time, I want to automatically render borders when a region is updated. Objective We still edit a region as before, but now the renderer displays borders between … Continue reading

Posted in Tutorial | Tagged , | Leave a comment

OpenGL 2D Facade (19): Test content

Before I continue the facade, I want to create some game data to test it. As you may imagine, I use software design for that! Objective The expected result of this post is a simple level editor where we can … Continue reading

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

OpenGL 2D Facade (18): Frame box

In this post, I show how to display text into frame boxes. I also propose a solution to get more dynamism in the layer. For instance, it allows adding/removing faces in the mesh when the program is running. Objective The … Continue reading

Posted in Tutorial | Tagged , | Leave a comment

OpenGL 2D Facade (17): Mixed text styles

In the previous program, we had to create one text layer for each text style (bold, shadowed…). In this post, I propose to render text with mixed styles from a single layer. Objective Using HTML-like source code, we want to … Continue reading

Posted in Tutorial | Tagged , | Leave a comment

OpenGL 2D Facade (16): Text renderers

Before going to text with mixed styles, we need a better solution to render characters. In this post, I propose an approach based on the Composite pattern that allows an effortless combination of text styles. Objective Thanks to this new … Continue reading

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

OpenGL 2D Facade (15): Text styles

In this post, I present text rendering with different styles (bold, italic, underline, …). Some of them are straightforward to implement thanks to Pygame; the others are more tricky! This post is part of the OpenGL 2D Facade series Objective … Continue reading

Posted in Tutorial | Tagged , , | Leave a comment

OpenGL 2D Facade (14): Unicode text

The creation of a tileset for large character sets uses a lot of memory. This post shows an approach based on the Flyweight pattern to allow their usage with minimal memory footprint. This post is part of the OpenGL 2D … Continue reading

Posted in Tutorial | Tagged , , | Leave a comment