java - LibGdx (OpenGl ES/Android) - Calling Texture.createGLHandle multiple times returns textureid of newly created texture overwriting it -
java - LibGdx (OpenGl ES/Android) - Calling Texture.createGLHandle multiple times returns textureid of newly created texture overwriting it -
android 2.1 - eclipse
what steps reproduce problem?
1.
create new texture(managed) using new texture(filehandle, format, bool); - glgentextures called - glhandle created (logcat: 100271) "bg_plainred.png" - uploadimagedata calls glbindtexture(100271) create new texture(managed) using new texture(filehandle, format, bool); - glgentextures called - glhandle created (logcat: 315638026) "body2.png" - uploadimagedata calls glbindtexture(315638026)
at point, textured sprites render correctly..
2.
call texture.dispose(); "bg_plainred.png" - gldeletetextures(glhandle) (logcat: glhandle = 100271)
3.
create new texture(managed) using new texture(filehandle, format, bool); - glgentextures called - glhandle created (logcat: 100271) "bg_wallpaper.png" - uploadimagedata calls glbindtexture(100271) create new texture(managed) using new texture(filehandle, format, bool); - glgentextures called - glhandle created (logcat: 100271) "clothes.png" - uploadimagedata calls glbindtexture(100271)
so essentially, createglhandle() returns 100271 twice overwriting bg_wallpaper.png clothes.png. if seek reference "bg_wallpaper" texture in sprite, writes "clothes.png".
if forcefulness context loss , refocus, textures right due textures beingness reloaded (managed) gdx.
opengl.org/glgentextures states:
glgentextures returns n texture names in textures. there no guarantee names form contiguous set of integers; however, guaranteed none of returned names in utilize before phone call glgentextures.
my question if there can phone call in gl forcefulness texture 'in use' , not homecoming same glhandle id twice?
i'm not sure bug should submit libgdx issues?
texture.java code can referenced here farther clarification:
code.google.com/gdx/src/texture.java
any help appreciated!
identified issue:
i calling texture.dispose() outside screen.update() or screen.render() methods resulted in error:
call opengl es api no current context (logged 1 time per thread)
switching code executed screen.update solved problem.
java android opengl-es libgdx
Comments
Post a Comment