Graphics Programs Reference
In-Depth Information
Figure 3-3 . LogCat view, filtering log by text
If you look at the debug messages in the LogCat view, you will see that the messages
are in an order similar to that in Figure 3-3 . As mentioned, rendering begins with a
call to the onSurfaceCreated method. Then the onSurfaceChanged meth-
od gets called to accommodate any change in orientation, and both of these methods
are called again if we change the device's orientation. The onDrawFrame method
is always called (repeatedly) after these two.
You can also make changes to the manifest file for this application to see what hap-
pens when the attributes and values given in Listing 2-3 are added to the activity
element. When you run the application after making these changes, you will see a
modifed order of debug messages in the LogCat view.
Although I talked about the purpose of abstract methods inherited by the
GLE20Renderer class, I did not mention anything about the arguments passed to
those methods. The only arguments that matter here are the int width and int
height arguments, which are passed to the onSurfaceChanged method. The
following section discusses the use of width and height arguments.
Until now, we have been addressing the OpenGL ES 2.0 environment on Android, as
well as how ES 2.0 is invoked inside our activity. The following sections introduce
 
Search WWH ::




Custom Search