SwingToTexture: How to update a part of an image (texture)?

Hi!



I’ve written a SwingToTexture renderer with LWJGL. Now i want to port it to jme3… Swing only updates the “dirty regions” of a BufferedImage and i only want to update these regions for performance reasons, too. With LWJGL its pretty simple using the OpenGL command glTexSubImage2D. But i guess, its not a good idea to mix openGl commands and jme, is it ?



What i found is the Image.setData() method which calls “setUpdateNeeded” internally. But i guess that this method causes a full update of the whole texture !?



Please dont ask why i want to use Swing instead of Nifty. I just dont like Nifty …



I also had a look at the JMEDesktop class from JME2, which uses ImageGraphics to render the dirty regions. Actually i dont need this because i already have the image data but it must be uploaded to the texture…



Regards,



Chris

2 Likes

Hi Chris,

Were you able to do this? If so, how did you do it?

Thanks, Philip