Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

11991 Posts in 1587 Topics- by 3507 Members - Latest Member: PienueDut

26. May 2012, 01:38:31 pm
Xith3D CommunityGeneral CategorySupport (Moderator: Marvin Fröhlich)integrating xith in an existing jogl application
Pages: [1]
Print
Author Topic: integrating xith in an existing jogl application  (Read 282 times)
gershwinou
Just dropped in

Offline Offline

Posts: 2


View Profile
« on: 24. February 2010, 09:55:26 am »

Hi,
I have developed an app on "raw" JOGL ie doing the OpenGL myself. However i want to use Hud on top of that. How is it possible?
Is there a mechanism to let the user draw his own openGL.
what i may want to to is to replace my frame manager (code is following) with the xith logic but still be able to call mainCanvas.repaint() for each frame. mainCanvas being an instance of javax.media.opengl.GLCanvas

SwingWorker worker = new SwingWorker<Void, Void>() {

            public Void doInBackground() {
                while (true) {
                    try {
                        Thread.sleep(25);
                        //some more logic like idle, force, screenshot etc...
                        mainCanvas.repaint();
                    } catch (InterruptedException ex) {
                       ...
                    }
                }
            }
        };
Logged
Marvin Fröhlich
Xith Lord
Administrator
Guru
*****
Offline Offline

Posts: 4381


May the 4th, be with you...


View Profile
« Reply #1 on: 24. February 2010, 11:36:13 am »

You cannot set xith on top of an existing OpenGL application. But you can do it the other way round, which should be possible pretty close to what you need.

Setup a xith environment, that manages your canvas. Add a RenderCallback to your main RenderPass and use it to invoke your jogl code. And you can either tell the RenderLoop to not loop automatically, but you can proceed to the next frame by calling a method. Or you can work without the RenderLoop and do it on your own. But I definitely wouldn't recommend that.

Marvin
Logged
gershwinou
Just dropped in

Offline Offline

Posts: 2


View Profile
« Reply #2 on: 24. February 2010, 01:18:48 pm »

the RenderCallback sounds interesting. I'll check it out.
Logged
Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic