Chris
Chris

Reputation: 844

Checking GL_MAX_TEXTURE_SIZE in Activity.onLoadResources()

I am developing an android app with HD graphics. My HTC Desire HD has no problem loading my large graphics, but my (older) HTC Magic only shows a white texture. I have read that the GL_MAX_TEXTURE_SIZE is different on the older and newer devices. When trying to load a smaller texture my HTC Magic was also able to load the texture

I want to check the GL_MAX_TEXTURE_SIZE in onLoadResources() of my Activity, to decide which texture I will load for the device I am currently on. I want to access the GL object, that gives me access to this information, but I can't find a way to get this object in my onLoadResources() function. How can I access the object this early in the app?

Upvotes: 1

Views: 1001

Answers (1)

Yuriy
Yuriy

Reputation: 837

It seems for me not really right way to do this. GL instance is (and should be) accessible only within Surface (EGL) context. There is no really good way to do get it earlier.

I would recommend you to load your resources in onSurfaceCreated method.

In case if you do not want to block openGL drawing - get texture info at onSurfaceCreated and load resources in separate thread.

Upvotes: 2

Related Questions