Application (AWT/NEWT)

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Application (AWT/NEWT)

Itun
Much time I wasted  for graphics implementation and now I need a complete application with GUI.
I use AWT/GLCanvas methods of rendering, but I` ve heard that it is bad. And NEWT is a native good variant. I look through internet and don`t find something  distinct about NEWT, only it is the best variant. May be there is books about NEWT or something certain? Because I have not time to look through all JAVADOC and write my own windows with GUI elements by hands (I think for this major moment must exist an editor, doesn`t it?).
And an other one question, how to create two treads: one for GL rendering and one for windows handling?
Thank you!
Reply | Threaded
Open this post in threaded view
|

Re: Application (AWT/NEWT)

Itun
If nobody could not answer at my questions. I have an other one: Could I use NEWT with Swing and if it is true, how to do this?
Reply | Threaded
Open this post in threaded view
|

Re: Application (AWT/NEWT)

Sven Gothel
Administrator
In reply to this post by Itun
On Sunday, March 20, 2011 21:48:20 Itun [via jogamp] wrote:
>
> Much time I wasted  for graphics implementation and now I need a complete
> application with GUI.
> I use AWT/GLCanvas methods of rendering, but I` ve heard that it is bad. And
> NEWT is a native good variant. I look through internet and don`t find
> something  distinct about NEWT, only it is the best variant. May be there is
> books about NEWT or something certain?

sorry, but we have our unit tests and javadoc api.

NEWT is a good alternative for a windowing system,
but it does not tackle UI rendering.

> Because I have not time to look
> through all JAVADOC and write my own windows with GUI elements by hands (I
> think for this major moment must exist an editor, doesn`t it?).

yes, it's a common problem, sure.

UI is: rendering (output) and input event handling,
probably within an convenient API.

Right now we only offer the very basics, no UI API / tool yet.

However, there are many teams working on UI support right now,
starting with curve and font rendering.
But it will take a while until this becomes production stable.

> And an other one question, how to create two treads: one for GL rendering
> and one for windows handling?

NEWT does the window handling, input/window event/action thread already implicit.
You would only need to take care of your GL rendering thread.

> Thank you!

~Sven
Reply | Threaded
Open this post in threaded view
|

Re: Application (AWT/NEWT)

Sven Gothel
Administrator
In reply to this post by Itun
On Monday, March 21, 2011 17:37:43 Itun [via jogamp] wrote:
>
> If nobody could not answer at my questions. I have an other one: Could I use
> NEWT with Swing and if it is true, how to do this?

just check the JOGL unit tests, check for NEWT and AWT (probably Swing as well)
in the test class name.

You will find something like NewtCanvasAWT, allowing for native parenting a NEWT
child window to an AWT native peer.

~Sven

Reply | Threaded
Open this post in threaded view
|

Re: Application (AWT/NEWT)

Itun
For me it is important to use Swing, because I can use different tools for my application GUI and it is well-known.
But I don`t want to harm to the performance of JOGL. I`ve heard that NEWT is the best variant to display. Due to I look for Swing NEWT bridge.
I look at the Wade Walker tutorials (Using_JOGL_in_AWT_SWT_and_Swing)),where he said:
"GLJPanel is supposed integrate 100% correctly into Swing, but with lower performance due to extra copying of the frame buffer".
And I have found the jUnit test on the advice of Sven Gothel, which, I believe, helps me : TestSwingAWTRobotUsageBeforeJOGLInitBug411.java.
And I was interesting in finction "test01NewtCanvasAWT()".
I'll be glad to hear all the comments about my ideas.
I do not understand very well what does this test do, please explain me.
In my code I do something like this:
        GLProfile glProfile = GLProfile.getDefault();
        GLCapabilities glCapabilities = new GLCapabilities(glProfile);
        GLWindow win1 = GLWindow.create(glCapabilities);
        newtCanvasAWT = new NewtCanvasAWT(win1);
.
.
.
        jFrame.addWindowListener(new WindowListener() {

            public void windowOpened(WindowEvent e) {
            }

            public void windowClosing(WindowEvent e) {
                newtCanvasAWT.destroy();
            }
.....
And I`ve been receiving in my IDE output window this:
run:
Detected screen size 1920x1200                    ////  it was a red
BUILD SUCCESSFUL (total time: 6 seconds)
I think this is a problem.
Thank you, waiting for your help.
Reply | Threaded
Open this post in threaded view
|

Re: Application (AWT/NEWT)

Itun
I try to open the jUnit test, but it doesn`t work, I don`t know what it is a problem. Try to open it yourself : https://github.com/sgothel/jogl/blob/master/src/test/com/jogamp/opengl/test/junit/jogl/newt/TestSwingAWTRobotUsageBeforeJOGLInitBug411.java
Reply | Threaded
Open this post in threaded view
|

Re: Application (AWT/NEWT)

Wade Walker
Administrator
That test works for me when I run it from within Eclipse as a JUnit test (on Windows 7 64-bit, nvidia GeForce 8800 GTX).
Reply | Threaded
Open this post in threaded view
|

Re: Application (AWT/NEWT)

Sven Gothel
Administrator
In reply to this post by Itun
On Saturday, March 26, 2011 14:35:29 Itun [via jogamp] wrote:
>
> For me it is important to use Swing, because I can use different tools for my
> application GUI and it is well-known.
> But I don`t want to harm to the performance of JOGL. I`ve heard that NEWT is
> the best variant to display. Due to I look for Swing NEWT bridge.
> I look at the Wade Walker tutorials (
> http://jogamp.org/wiki/index.php/Using_JOGL_in_AWT_SWT_and_Swing

I was actually having the following in mind:

http://jogamp.org/git/?p=jogl.git;a=tree;f=src/test/com/jogamp/opengl/test/junit/newt/parenting
http://jogamp.org/git/?p=jogl.git;a=blob;f=src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting01cSwingAWT.java

not SWT, however .. choose your cherries :)

~Sven