Native Windows with basic features

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

Native Windows with basic features

Christian Catchpole
Michael Bien suggested I post this question here:

I'm building a data model visualization app.  I want the app to be an OpenGL view but I'd like the app to have all the standard features that would make it a "real application", using native windows if possible.

- windowed view / fullscreen (including screen selection) / maximize (full screen without blanking other screens)
- resizable windows
- application icon / title control
- key and mouse inputs

nice to haves
- drop down menus
- multiple windows / displays

In the past i could do all of these using SWT + LWJGL.  But it seems like overkill to include SWT to get these.

On principal I'd also like to not use AWT because they are not real windows and the performance problems documented on the JOGL site.

michael says: (all features should be already in or on the immediate TODO list, the only issue i see are the drop down menus.... not implemented yet)

thanks,
christian
Reply | Threaded
Open this post in threaded view
|

Re: Native Windows with basic features

Sven Gothel
Administrator
On Friday, May 14, 2010 02:08:01 Christian Catchpole [via jogamp] wrote:

>
> Michael Bien suggested I post this question here:
>
> I'm building a data model visualization app.  I want the app to be an OpenGL
> view but I'd like the app to have all the standard features that would make
> it a "real application", using native windows if possible.
>
> - windowed view / fullscreen (including screen selection) / maximize (full
> screen without blanking other screens)
> - resizable windows
> - application icon / title control
> - key and mouse inputs
I guess NEWT supports that right now.

>
> nice to haves
> - drop down menus
This is something we cannot support, since it would fight NEWT's purpose
of being just a simple windowing toolkit only.
However, it would be possible to add these high level features directly in Java
utilizing NEWT/JOGL. One may implement these using text rendering,
undecorated windows or z stacked GL objects / overlays.

Actually the idea of NEWT is that most features are supported by the
underlying windowing toolkit, especially mobile platforms.
A project using NEWT may want to implement UI elements by its own.

A feature which might be of interest here is to integrate drag&drop into NEWT ..

> - multiple windows / displays
NEWT supports that.

>
> In the past i could do all of these using SWT + LWJGL.  But it seems like
> overkill to include SWT to get these.
>
> On principal I'd also like to not use AWT because they are not real windows
> and the performance problems documented on the JOGL site.

There is a new feature, overlaying a native NEWT window on top of an AWT component,
http://jogamp.org/deployment/jogl-next/javadoc_public/com/jogamp/newt/NewtFactory.html#createWindow%28java.lang.Object,%20com.jogamp.newt.Screen,%20javax.media.nativewindow.Capabilities,%20boolean%29

as well as writing all input even listeners AWT agnostic ..
http://jogamp.org/git/?p=jogl.git;a=commit;h=1ad8c39df6b097c80ba7a85badf555e7f669cc3f
http://jogamp.org/git/?p=jogl.git;a=blob;f=src/junit/com/jogamp/test/junit/jogl/demos/gl2/gears/TestGearsAWT.java;h=36146df58bcde14ebfa90fe7def7c5902dc78735;hb=1ad8c39df6b097c80ba7a85badf555e7f669cc3f
  line 80/81 :)

Well, the above is a bit new, but they will be enhanced as we go,
e.g. I want to map some of our demos using NEWT this way ..

However .. when you are about to cross the embedded device line,
you probably will face the needs of having using some UI (gadgets) implementation.

~Sven

>
> michael says: (all features should be already in or on the immediate TODO
> list, the only issue i see are the drop down menus.... not implemented yet)
>
> thanks,
> christian
>
>
> ______________________________________
> View message @ http://jogamp.762907.n3.nabble.com/Native-Windows-with-basic-features-tp816127p816127.html
> To start a new topic under jogamp, email [hidden email]
> To unsubscribe from jogamp, click http://jogamp.762907.n3.nabble.com/subscriptions/Unsubscribe.jtp?code=c2dvdGhlbEBqYXVzb2Z0LmNvbXw3NjI5MDd8MzkxNDI4MzU5
>

--
health & wealth
mailto:[hidden email] ; www  : http://www.jausoft.com ; pgp: http://www.jausoft.com/gpg/
land : +49 (471) 4707742 ; cell: +49 (151) 28145941
Timezone CET: PST+9, EST+6, UTC+1
Reply | Threaded
Open this post in threaded view
|

Re: Native Windows with basic features

Christian Catchpole
Awesome.  Thanks for your help.

I'm hoping to make a UI that really has no dependancy on a traditional windowing desktop.  And I hope it will spend most of it's time in full screen.  But if it does have to be launched and coexist on a desktop, it should still play nicely.

Yeah, I'm not convinced about drop downs. Perhaps they are a distraction.

And yes, drag and drop was something else I was thinking of today.

So I can understand how much work has gone into this project and haven't found any direct doco or examples for NEWT (maybe there are, i just need to get my head around it).  I'll check out all the code over the weekend.  My first step was to convert my LWJGL code to JOGL and test with FBCubes.. but my first issue on OS X..

Exception in thread "main" java.lang.RuntimeException: Unable to initialize JAWT
        at com.sun.nativewindow.impl.jawt.JAWT$1.run(JAWT.java:100)
        at java.security.AccessController.doPrivileged(Native Method)
        at com.sun.nativewindow.impl.jawt.JAWT.getJAWT(JAWT.java:95)
Reply | Threaded
Open this post in threaded view
|

Re: Native Windows with basic features

Christian Catchpole
Found the NEWT examples.. I have a native window! :)
Reply | Threaded
Open this post in threaded view
|

Re: Native Windows with basic features

Bill
You may be interested in the drag-drop from swing to the GLCanvas as demonstrated in my app.  I uses swing (no native requirements) next to (and interacting with) GLCanvas.  www.insparia.com
Best wishes on your project.
Bill
Reply | Threaded
Open this post in threaded view
|

Re: Native Windows with basic features

Christian Catchpole
Thanks bill. Looks impressive.

I couldn't find an example which rendered GL to a native window.  But i did find 2 examples, one which did the native window dispatch and another which did the GLContext selection and rendering.  so i combined them and this is what i came up with..

http://code.google.com/p/kumi/source/browse/trunk/src/java/net/catchpole/view/scene/Scene.java

I use NewtFactory.createDisplay(null); and GLWindow.create(capabilities, false) so the Display and Screen are not properly associated I assume.  Next step is detecting multiple screens, managing those and switching to fullscreen / borderless maximised.

I then delegate to my own Renderer interface.  When I used LWJGL I made my own runtime proxy to an identical GL interface (to be LWJGL independent).  But JOGL seems so far ahead, especially with the profiles, I'm happy to have JOGL as a dependancy with all the benefits.

And here are some spinning tutti frutti cubes..

http://twitpic.com/1o8ukc
Reply | Threaded
Open this post in threaded view
|

Re: Native Windows with basic features

Bill
Thanks for the kind words and the solution.  Why create a new SceneRender object (Render render = new SceneRender(glContext.getGL()) ) in the render loop?
Thanks,
Bill
Reply | Threaded
Open this post in threaded view
|

Re: Native Windows with basic features

Christian Catchpole
I did? That's bad. :) oops. Thanks.