www.jpct.net

jPCT - a 3d engine for Java => Support => Topic started by: zngga on March 09, 2012, 04:29:36 pm

Title: Integrating with AWT / Swing
Post by: zngga on March 09, 2012, 04:29:36 pm
On the features page it implies that you can integrate jPCT with awt/swing... how would you do this. I am looking for a way to have a hardware render in the back with a standard canvas or jpanel in front (for displaying debugging and eventually a simple gui)
Title: Re: Integrating with AWT / Swing
Post by: EgonOlsen on March 09, 2012, 08:26:14 pm
You have basically three options:


While options 2 and 3 render into some component, it's difficult to make gui elements that are part of this component.
Title: Re: Integrating with AWT / Swing
Post by: zngga on March 09, 2012, 08:34:28 pm
If you use software rendering, is it still hardware accelerated?
Title: Re: Integrating with AWT / Swing
Post by: EgonOlsen on March 09, 2012, 08:49:30 pm
No! Software rendering is...just software rendering. Everything is done on the cpu, i.e. you'll trade speed and quality for the fact that it'll run on everything that supports Java and doesn't need any kind of gpu or OpenGL drivers installed.
Title: Re: Integrating with AWT / Swing
Post by: zngga on March 10, 2012, 09:53:01 pm
If I use the AWTGLRender... how does that actually render? Does it render directly to the canvas, or to a bufferStrategy built from the canvas? I will take a look at the javadocs to see for myself, but thought I'd ask anyway. My thought process it to use this render method and simply have another render method to render the gui and debug to a bufferedImage with alpha support and draw it over top of the gl render. What do you think?