Creating an OpenGL Context in SDL 2

June 18th, 2013

Filed under: OpenGL, SDL | 5 comments

SDL 2.0 has been released, which changes the way you create OpenGL contexts. This post details the changes so you can convert your old SDL/OpenGL code to SDL 2. If you are new to SDL and OpenGL, you should also read my SDL and OpenGL article, as that article covers some topics that aren’t covered […]


GL_QUADS Replacement

January 24th, 2013

Filed under: OpenGL | Be the first to comment!

When writing a 2D game in OpenGL, you generally draw texture-mapped quads. The most straightforward way to draw a texture-mapped quad with vertex arrays is to supply GL_QUADS as the first argument to glDrawArrays(). But GL_QUADS is not available on OpenGL ES so if you want to port your game to mobile devices you can’t […]


Creating a Custom Orthographic Projection With Pyglet

February 21st, 2012

Filed under: Game Development, OpenGL | Be the first to comment!

When you create a pyglet window, pyglet sets up an OpenGL orthographic projection for the window. The size of the projection matches the size of the window. If the window is 640 pixels wide and 480 pixels wide, the orthographic projection is 640 units wide and 480 units high. Pyglet’s default behavior works well in […]


Installing Pyglet on 64-bit Macs

January 16th, 2012

Filed under: Game Development, OpenGL | 4 comments

Pyglet is a technology to write cross-platform OpenGL games and applications in Python. If you go to the pyglet site, you will find installers for Mac OS X and Windows. The current Mac version of the installer, 1.1.4, uses Carbon, which means it doesn’t work with 64-bit applications. Not working with 64-bit applications is a […]


OpenGL Driver Instrument

December 12th, 2011

Filed under: Instruments, OpenGL | Be the first to comment!

Researching Instruments for Xcode Tools Sensei allowed me to become familiar with most of the built-in instruments. Due to the high number of instruments, there was no way for me to cover them all in the book. I focused on the most commonly used instruments in the book. I can use this blog to explain […]