Texture issue when created ouside onSurfaceCreated

Problems with Canvas, OpenGL, etc...

Texture issue when created ouside onSurfaceCreated

Postby bsegonnes » Wed Oct 13, 2010 1:24 pm

Hi,

I can successfully create 2 rectangles using 2 differents textures from inside onSurfaceCreated() (or a method called by onSurfaceCreated() ). They display OK.

In a Menu, I have added (for debug/learning) the creation of a 3th rectangle using a 3th texure.

Than : the OpenGL surface loose all textures and display 3 white rectangles.

I is not possible to call texImage2D(), eventuall glGenTextures() from outside onSurfaceCreated() ?

I can not upload texture at the begining, as they are dynamic (text)

Could you help me ? Thanks
Bernard Segonnes

http://bsegonnes.free.fr
bsegonnes
Freshman
Freshman
 
Posts: 9
Joined: Fri Jun 19, 2009 1:09 pm
Location: Paris, France

Top

Re: Texture issue when created ouside onSurfaceCreated

Postby Codehead » Fri May 27, 2011 5:35 pm

Revisiting this post since I just happened to run into the same problem after I refactored part of my Android GL renderer to accommodate more dynamic resource creation/destruction. In my case was just a stupid freaking typo on my part that wasted a whole day of my time. Doh!

So for future reference - the short of it is that it doesn't matter when you upload the textures to video memory via glTexImage2D().. so long as the context exists - i.e. anytime after android.opengl.GLSurfaceView.Renderer.surfaceCreated() is called is fine.


-M
User avatar
Codehead
Freshman
Freshman
 
Posts: 2
Joined: Fri May 27, 2011 5:26 pm

Top

Return to Android 2D/3D Graphics - OpenGL Problems

Who is online

Users browsing this forum: No registered users and 5 guests