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, ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access