Login  Register

Best way to prepare an Image

Posted by Vasilij on Feb 25, 2014; 5:13pm
URL: https://forum.jogamp.org/Best-way-to-prepare-an-Image-tp4031731.html

Hello dear Community,

I have a problem and I hope you can put me to right way.
I make an application with JOGL but it does not run smoothly.

What i have done is:
in the init-Methode I load Images from Raspi. Its need a lot of Time, but it is not a problem. I use this images as backstage and they are always the same.
After init I make a Thread, that makes BuffferedImages. That BufferedImage should be placed in the middle of the screen.
In the draw method I make a texture from the BufferedImage and an VBO with vertices. I do this at this step because texture and VBO needs current GLContext. And that step take a lot of time.

I think the draw-method should paint and not calculate.


How can i do that in another way? - How can I prepare texture in a Thread? I have read there is some Solution: FBO, PBuffer, multilpe Context... something else?

In this repositories i don't see Threads:
https://github.com/xranby/jogl-demos/tree/master/src/demos/es2
http://jogamp.org/git/?p=jogl.git;a=tree;f=src/test/com/jogamp/opengl/test/junit/jogl/acore

And maybe you can write a little bit more words for solution and not only "use FBO" =)

Best Regards,
Vasilij