Introduction
No doubt, any game needs to render some graphics. In this chapter, we will learn how to create a portable graphics rendering subsystem for your game. The chapter is titled Unifying OpenGL ES 3 and OpenGL 3; however, in this book we deal with portable development, so we start our recipes with the OpenGL 3 desktop API. This serves two purposes. First, OpenGL 3 is almost a superset of OpenGL ES 3. This will allow us to port applications between two versions of OpenGL API easily. Second, we can create a simple but very effective wrapper to abstract both APIs from the game code, so that we are able to develop our games on a desktop PC.
Note
OpenGL ES 3 support was introduced in Android 4.3 and Android NDK r9. However, all of the examples in this book are backwards-compatible with the previous version of this mobile API, OpenGL ES 2.
OpenGL itself is a huge topic which merits a dedicated book. We recommend starting with The OpenGL Programming Guide, Pearson Publications (the red book...