Making the Data Accessible to OpenGL
We’ve finished defining our vertices, but we need to do an extra step before OpenGL can access them. The main problem is that the environment where our code runs and the environment where OpenGL runs don’t speak the same language. There are two main concepts that we need to understand:
-
When we compile and run our Java code in the emulator or on a device, it doesn’t run directly on the hardware. Instead, it runs through a special environment known as the Dalvik virtual machine. Code running in this virtual machine has no direct access to the native environment other than via special APIs.
-
The Dalvik virtual machine also uses garbage collection. This means that when the virtual machine detects that a variable, ...
Get OpenGL ES 2 for Android now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.