Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I'm used to mainly working with the Canvas SurfaceView API on Android and have recently been learning openGL ES 2.0

With canvas I know that surfaceView gives you the ability to start a new thread to render on, but it doesn't specifically do this for you, so I was creating a new thread and managing that thread when the app was ended / paused etc....

However, from what I've read with glSurfaceView it seems that this is actually done for you automatically? Does this mean I don't actually need to manually create / start and manage my own rendering thread? (I'm talking specifically about a rendering thread (which could also be used for logic updates) which is separate the main UI thread.

Clarification on this matter would be greatly appreciated.

share|improve this question
add comment

1 Answer

All rendering is done on a separate thread, and this is done for you automatically. The documentation is very explicit about this (quoted from http://developer.android.com/reference/android/opengl/GLSurfaceView.Renderer.html) :

Threading

The renderer will be called on a separate thread, so that rendering performance is decoupled from the UI thread. Clients typically need to communicate with the renderer from the UI thread, because that's where input events are received. Clients can communicate using any of the standard Java techniques for cross-thread communication, or they can use the queueEvent(Runnable) convenience method.

This means you do NOT have to create and manage a rendering thread yourself.

I hope this clarifies the matter :)

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.