On Nov 25, 4:44 pm, Phil Endecott <[email protected]>
wrote:
> I'm porting some iPhone OpenGL code that uses a separate thread for
> OpenGL texture loading. To do this, I create a new OpenGL context in
> the same "sharegroup" as the main rendering context, and then the
> textures loaded in one context are available to the other.
Is that an OpenGL ES feature, or something specific to iOS?
Generally, all your Android threads run in one process, and it's not
hard to share data between them. Might it be possible to save your
OpenGL context from your rendering thread, then use it to create
textures in another thread? One approach would be static vars in your
rendering subclass:
static GL10 glContext;
static int textures[] = new int[3];
public void onSurfaceCreated(GL10 gl, EGLConfig config) {
glContext = gl;
gl.glGenTextures(3, textures, 0);
...
}
Something like that might work, anyway.
String
--
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