GLWindow to GLCanvas

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

GLWindow to GLCanvas

kaeffin
Hello,

The GLWindowobject will create in a extern Library.
With a getter-Method i can use this object.. but how can i display it in JPanel?

Is it possible to convert the value of the GLWindow object to a GLCanvas?
Reply | Threaded
Open this post in threaded view
|

Re: GLWindow to GLCanvas

Xerxes Rånby
Hi you can use NewtCanvasAWT to add a GLWindow to a JPanel.

import com.jogamp.newt.awt.NewtCanvasAWT;

//1. create the GLWindow
GLWindow glWindow = GLWindow.create(glCaps);

//2. wrap the GLWindow into a NewtCanvasAWT
NewtCanvasAWT newtCanvasAWT = new NewtCanvasAWT(glWindow);

//3. connect the NewtCanvasAWT into the JPanel
JPanel jPanel = new JPanel();
jPanel.setLayout(new BorderLayout());
jPanel.add(newtCanvasAWT, BorderLayout.CENTER);

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

NEWT Overview:
http://jogamp.org/jogl/doc/NEWT-Overview.html

Cheers
Xerxes

2016-06-13 13:16 GMT+02:00 Kevin [via jogamp] <
ml-node+s762907n4036829h62@n3.nabble.com>:

> Hello,
>
> The GLWindowobject will create in a extern Library.
> With a getter-Method i can use this object.. but how can i display it in
> JPanel?
>
> Is it possible to convert the value of the GLWindow object to a GLCanvas?
>
> ------------------------------
> If you reply to this email, your message will be added to the discussion
> below:
> http://forum.jogamp.org/GLWindow-to-GLCanvas-tp4036829.html
> To start a new topic under jogl, email
> ml-node+s762907n782158h61@n3.nabble.com
> To unsubscribe from jogamp, click here
> <http://forum.jogamp.org/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=762907&code=eGVyeGVzQGd1ZGlubmEuY29tfDc2MjkwN3wtNTE5NjUwMzEw>
> .
> NAML
> <http://forum.jogamp.org/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>
Reply | Threaded
Open this post in threaded view
|

Re: GLWindow to GLCanvas

kaeffin
Thank you very much it works.!!

You safed my day :)