O'Reilly logo

Android NDK Game Development Cookbook by Viktor Latypov, Sergey Kosarevsky

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating a canvas for immediate rendering

In the previous recipes, we learned how to make abstractions for main OpenGL entities: vertex buffers, shader programs, and textures. This basis is enough to render many sophisticated effects using OpenGL. However, there are a lot of tiny rendering tasks where you need to render only one triangle or a rectangle with a single texture, or render a fullscreen quad with a specific shader to apply some image-space effect. In this case, the code for managing buffers, shaders, and textures may become a serious burden. Let's organize a place for such a helper code, that is, a canvas that will help us to render simple things in a single line of code.

Getting ready

This recipe uses the clGLSLShaderProgram, clGLTexture ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required