I tried summing all the score events from my game loop and calling runOnUiThread() only once per loop, but it doesn't seem to make much of a difference - the lag is still noticeable. For example the character gets a coin, but the coin count is not updated quickly. It implements textures and shaders loading from the application resources. The problem is that there's a very noticeable lag between the event and the score update. OpenGL ES 2.0 Android tutorial is coded in Java and compiled in Eclipse. OpenGL ES 3.0 - This API specification is supported by Android 4. From my understanding, using runOnUiThread() from the OpenGL thread is standard practice - otherwise you'll get an exception, I can't remember its name. OpenGL ES 2.0 - This API specification is supported by Android 2.2 (API level 8) and higher. Here's how I'm updating the score TextView based on what happens in my game loop: whenever an event happens that increases the score, I call nOnUiThread(updater), where activity is the activity that has the above FrameLayout (my main game activity) and updater is just a Runnable that increments the score. One of those Views is a TextView that displays the current score. I'm using a FrameLayout where I have a GLSurfaceView at the bottom and a few Views on top of it.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |