LeprovostQuentin / mt4j

Automatically exported from code.google.com/p/mt4j
GNU General Public License v2.0
0 stars 0 forks source link

PImage/MTImage load from background thread broken in 0.98 #30

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Run Flickr example in mt4j-desktop, 0.98

What is the expected output? What do you see instead?
Images fail to load, or show up all white.

What version of the product are you using? On what operating system?
MT4j v0.98 from branches/new - Windows 7

Please provide any additional information below.

calling setupGLTexture() in updateGLTexture() since texture wasnt initialized!
Exception in thread "Thread-5" javax.media.opengl.GLException: May not call 
this between glBegin and glEnd
    at com.sun.opengl.impl.GLImpl.checkBufferObject(GLImpl.java:30652)
    at com.sun.opengl.impl.GLImpl.checkUnpackPBODisabled(GLImpl.java:30674)
    at com.sun.opengl.impl.GLImpl.glTexSubImage2D(GLImpl.java:21387)
    at org.mt4j.util.opengl.JoglGL20Plus.glTexSubImage2D(JoglGL20Plus.java:615)
    at org.mt4j.util.opengl.GLTexture.updateGLTexture(GLTexture.java:835)
    at org.mt4j.util.opengl.GLTexture.updateGLTexture(GLTexture.java:733)
    at org.mt4j.util.opengl.GLTexture.updateGLTextureFromPImage(GLTexture.java:853)
    at org.mt4j.util.opengl.GLTexture.<init>(GLTexture.java:420)
    at org.mt4j.AbstractMTApplication.loadImage(AbstractMTApplication.java:1042)
    at advanced.flickrMT.FlickrMTFotoLoader.processFoto(FlickrMTFotoLoader.java:80)
    at advanced.flickrMT.FlickrLoader.run(FlickrLoader.java:221)

Original issue reported on code.google.com by nicholas...@gmail.com on 26 Apr 2011 at 6:40

GoogleCodeExporter commented 8 years ago
yes I confirmed this.

This happens because we've overridden the loadImage() method to create a 
GLTexture directly instead of a PImage. But if we arent on the render thread 
this will fail to create the gl texture object.
So I added a check to only create a gltexture if on the render thread - else we 
just create a PImage as in the old verions.

So fixed for the lates branches/new

thx for reporting

Original comment by sirhc.f...@gmail.com on 27 Apr 2011 at 12:13