Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [gef3d-dev] Rendering SWT as OpenGL Texture

 Hi,

On 27.04.11 15:45, Christoph Caks wrote:
This is somewhat off topic, but I think you may have already evaluated the possibilities of drawing SWT stuff in OpenGL for gef3d and hope you would share your experiences with me.

Has anybody ever spend some thoughts about this?

While this is an interesting idea, I never did this. We have three open bugs in GEF3D describing possible new features for how to improve text editing and embedding SWT widgets into GEF3D. However, two of them will reuse the original 2D SWT widgets and use popups (http://bugs.eclipse.org/300333) or camera tracks (http://bugs.eclipse.org/300332) to "integrate" these 2D stuff into the 3D scene. http://bugs.eclipse.org/300334 describes 3D direct edit. But none of these features is implemented yet. Personally I like the idea with camera tracks best, and this may be s solution in your case as well?

I am currently trying to render a swt formular in opengl and then redirect the interactions back to the swt components.

My current approach is to spawn a shell, position it somewhere offscreen and capture its contents via Control.print(GC). This works fine, however I still need to figure out how to route SWT Events from the GLCanvas back to the appropriate Control.
This sounds pretty much like a hack ;-) Well, GEF3D is a kind of hack itself... In GEF3D, or better to say in Draw3D, all events are encapsulated in Draw2D events. So, you won't see any SWT events in Draw2D/3D or GEF/GEF3D. Also, I have no experiences with how to handle SWT events.

BTW: We do not use any textures anymore (or at least: almost no textures). We did this in earlier versions to render all 2D content. However, we replaced this with real 3D rendering for 2D content as well, improving the render quality, getting rid of some restrictions, and---at the same time-- improving performance! This part was mainly implemented by Kristian, so if you have questions about that, you may ask him (he described the new mechanism in http://gef3d.blogspot.com/2010/02/improving-visual-rendering-quality.html). Maybe this would be a solution in case of SWT3D as well, as you will no longer have to "render" the SWT widgets off-screen. Maybe -- depending on your project -- it would be possible not to use SWT, but instead use GEF's Figures and provide some extensions for editing in 3D etc.?

Cheers,

Jens


Back to the top