Hi,

GLSurfaceView creates a thread for you. This is the thread that calls
your renderer's onDrawFrame(). You must call glGenTextures, or any
other gl-command for that matter, only from this thread.
GLSurfaceView automatically calls onSurfaceChanged (and
onSurfaceCreated) for you from this thread, this is why your
glGenTextures calls work.

On of the facilities GLSurfaceView gives you is the 'queueEvent'
method, to queue runnables for execution on the GL thread.

If you don't want to use the queue (which might be wasteful), you can
simply raise a flag, and make you onDrawFrame query that flag, and
create textures as necessary.

Regards,
Lior Gonnen
UltimateFaves / UltimateFavesPRO developer
http://ultimatefaves.wordpress.com/


On Dec 5, 9:09 pm, Shaka <[email protected]> wrote:
> Hi!
>
> I'm using GLSurfaceView for one of my applications and I've
> encountered a problem. It seems I can only create textures when in
> onSurfaceChanged, after that glGenTextures only returns 0. I've tried
> without glGenTextures and keeping track of texture indices myself, but
> the textures generated just turn up white.
> Is it only possible to load these types of resources in
> onSurfaceChanged (and possible onSurfaceCreated)? Or am I missing
> something?
>
> Regards/Per

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to