Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » OpenGL rendering to an SWT Image
OpenGL rendering to an SWT Image [message #532291] Fri, 07 May 2010 15:25 Go to next message
Anonymous Coward is currently offline Anonymous Coward
Messages: 6
Registered: May 2010
Junior Member
I'm attempting to render an OpenGL scene running in an Eclipse RCP project view to an SWT image, and am not finding a lot of resources regarding this.

I'm able to do this in a regular (non-Eclipse) Java application using the (albeit non-standard) class com.sun.opengl.util.Screenshot, by redrawing the canvas, making the OpenGL context current, and capturing the contents using Screenshot.readToBufferedImage(width, height).

Now, I realize that i can continue to do the above, and simply convert between the Java AWT BufferedImage and the SWT Image classes, but this is kind of resource intensive, and I feel rather unnecessary.

Anyone have any suggestions?

Thanks in advance!
R
Re: OpenGL rendering to an SWT Image [message #535771 is a reply to message #532291] Tue, 25 May 2010 10:42 Go to previous message
Grant Gayed is currently offline Grant Gayed
Messages: 2148
Registered: July 2009
Senior Member
Hi, sorry for the late response,

I've posted a snippet that demonstrates this, see
http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.swt.sni ppets/src/org/eclipse/swt/snippets/Snippet341.java?view=co .

Grant


"Anonymous Coward" <rkausch@gmail.com> wrote in message
news:hs1pes$d7f$1@build.eclipse.org...
> I'm attempting to render an OpenGL scene running in an Eclipse RCP project
view to an SWT image, and am not finding a lot of resources regarding this.
>
> I'm able to do this in a regular (non-Eclipse) Java application using the
(albeit non-standard) class com.sun.opengl.util.Screenshot, by redrawing the
canvas, making the OpenGL context current, and capturing the contents using
Screenshot.readToBufferedImage(width, height).
>
> Now, I realize that i can continue to do the above, and simply convert
between the Java AWT BufferedImage and the SWT Image classes, but this is
kind of resource intensive, and I feel rather unnecessary.
>
> Anyone have any suggestions?
>
> Thanks in advance!
> R
Previous Topic:SWT and JFace unresolved after project import
Next Topic:runtime jar loading
Goto Forum:
  


Current Time: Fri Aug 22 04:11:44 EDT 2014

Powered by FUDForum. Page generated in 0.10532 seconds