Reputation: 11
I have a problem with samsung s5360 and using textureatlas.
My project is using the libgdx framework, and I load textures by textureatlas:
atlas = new TextureAtlas( Gdx.files.internal( "res-atlases/pages-info" ) );
When I run it in htc mytouch, htc one v and huawei, everything is ok. But when I run it in samsung s5360 I receive an error:
E/(2288): RTOS COMMON MEM zero linear buffer allocated 5603328 0 205
E/(2288): BIG MEM OUT OF HANDLES
08-17 15:02:36.867: E/AndroidRuntime(2288): java.lang.RuntimeException: OpenGL error code while loading texture: 1285 - textureFileHandle
08-17 15:02:36.867: E/AndroidRuntime(2288): at com.p666.services.AtlasManager.newTextureAtlas(AtlasManager.java:50)
08-17 15:02:36.867: E/AndroidRuntime(2288): at com.p666.screens.AbstractScreen.<init>(AbstractScreen.java:100)
08-17 15:02:36.867: E/AndroidRuntime(2288): at com.p666.gamelogic.GameControl.create(GameControl.java:135)
08-17 15:02:36.867: E/AndroidRuntime(2288): at com.badlogic.gdx.backends.android.AndroidGraphics.onSurfaceChanged(AndroidGraphics.java:292)
08-17 15:02:36.867: E/AndroidRuntime(2288): at com.badlogic.gdx.backends.android.surfaceview.GLSurfaceViewCupcake$GLThread.guardedRun(GLSurfaceViewCupcake.java:708)
08-17 15:02:36.867: E/AndroidRuntime(2288): at com.badlogic.gdx.backends.android.surfaceview.GLSurfaceViewCupcake$GLThread.run(GLSurfaceViewCupcake.java:646)
And the texture & font are shown in white color. How can i fix it? Thanks :)
Upvotes: 1
Views: 1123
Reputation: 25177
This:
OpenGL error code while loading texture: 1285
means you've run out of OpenGL video memory.
What is the size, file format and image format (RGB8888?) of the file you're loading. How many other textures are you loading before this one?
You might find the Android doc on Displaying Bitmaps Efficiently useful.
For libGDX, you may also benefit from using a different (smaller) texture format on older/smaller phones. Use the ResolutionFileResolver
with an AssetManager
(See AssetManager in LibGDX).
Upvotes: 3