Learn OpenGL ES

Learn how to develop mobile graphics using OpenGL ES 2

Category: Articles

How Powerful Is Your Nexus 7?

The following post is based on a paper generously contributed by Jerome Huck, a senior aerospace/defence engineer, scientist, and author. A link to figures and the code can be found at the bottom of this post. So you want to run some heavy-duty algorithms on your Android device, and you’re wondering what is the best environment … Continue reading How Powerful Is Your Nexus 7?»

Finishing Up Our Native Air Hockey Project With Touch Events and Basic Collision Detection

In this post in the air hockey series, we’re going to wrap up our air hockey project and add touch event handling and basic collision detection with support for Android, iOS, and emscripten. Prerequisites This lesson continues the air hockey project series, building upon the code from GitHub for ‘article-3-matrices-and-objects’. Here are the previous posts in this series: … Continue reading Finishing Up Our Native Air Hockey Project With Touch Events and Basic Collision Detection»

Adding a 3d Perspective and Object Rendering to Our Air Hockey Project in Native C Code

For this post in the air hockey series, we’ll learn how to render our scene from a 3D perspective, as well as how to add a puck and two mallets to the scene. We’ll also see how easy it is to bring these changes to Android, iOS, and emscripten. Prerequisites This lesson continues the air … Continue reading Adding a 3d Perspective and Object Rendering to Our Air Hockey Project in Native C Code»

Loading a PNG into Memory and Displaying It as a Texture with OpenGL ES 2: Adding Support for Emscripten

In the last two posts in this series, we added support for loading a PNG file into OpenGL as a texture, and then we displayed that texture on the screen: Loading a PNG into Memory and Displaying It as a Texture with OpenGL ES 2, Using (Almost) the Same Code on iOS, Android, and Emscripten. … Continue reading Loading a PNG into Memory and Displaying It as a Texture with OpenGL ES 2: Adding Support for Emscripten»

Loading a PNG into Memory and Displaying It as a Texture with OpenGL ES 2: Adding Support for iOS

In the previous post, we looked at loading in texture data from a PNG file and uploading it to an OpenGL texture, and then displaying that on the screen in Android. To do that, we used libpng and loaded in the data from our platform-independent C code. In this post, we’ll add supporting files to … Continue reading Loading a PNG into Memory and Displaying It as a Texture with OpenGL ES 2: Adding Support for iOS»

Loading a PNG into Memory and Displaying It as a Texture with OpenGL ES 2, Using (Almost) the Same Code on iOS, Android, and Emscripten

In the last post in this series, we setup a system to render OpenGL to Android, iOS and the web via WebGL and emscripten. In this post, we’ll expand on that work and add support for PNG loading, shaders, and VBOs. TL;DR We can put most of our common code into a core folder, and … Continue reading Loading a PNG into Memory and Displaying It as a Texture with OpenGL ES 2, Using (Almost) the Same Code on iOS, Android, and Emscripten»

Calling OpenGL from C on the Web by Using Emscripten, Sharing Common Code with Android and iOS

In the last two posts, we started building up a simple system to reuse a common set of C code in Android and iOS: OpenGL from C on Android by using the NDK Calling OpenGL from C on iOS, Sharing Common Code with Android In this post, we’ll also add support for emscripten, an LLVM-to-JavaScript compiler … Continue reading Calling OpenGL from C on the Web by Using Emscripten, Sharing Common Code with Android and iOS»

Calling OpenGL from C on iOS, Sharing Common Code with Android

In the last post, we covered how to call OpenGL from C on Android by using the NDK; in this post, we’ll call into the same common code from an Objective-C codebase which will run on an iOS device. Prerequisites A Mac with a suitable IDE installed. An iOS emulator, or a provisioned iPhone or … Continue reading Calling OpenGL from C on iOS, Sharing Common Code with Android»

Calling OpenGL from C on Android, Using the NDK

For this first post in the Developing a Simple Game of Air Hockey Using C++ and OpenGL ES 2 for Android, iOS, and the Web series, we’ll create a simple Android program that initializes OpenGL, then renders simple frames from native code. Prerequisites The Android SDK & NDK installed, along with a suitable IDE. An … Continue reading Calling OpenGL from C on Android, Using the NDK»

Understanding OpenGL’s Matrices

I often get questions related to OpenGL’s matrices: how do they work, how do they get built, and so forth. This is a topic that I have been frequently confused by, myself, and I feel that it warrants further explanation. To better understand OpenGL’s matrices, and how and why we use them, we first need … Continue reading Understanding OpenGL’s Matrices»