Login  Register

Re: Native SWT Binding Test

Posted by Sven Gothel on Mar 01, 2011; 8:54pm
URL: https://forum.jogamp.org/Re-Native-SWT-Binding-Test-tp2600231p2606404.html

On Tuesday, March 01, 2011 04:09:10 Wade Walker [via jogamp] wrote:
>
> I know this is just an experimental demo, but I'm a little scared looking at
> it  Does this mean that createExternalGLContext() won't get its last few
> bugs fixed, so this would be the only supported method of using JOGL 2 in
> SWT?
No. We need the external stuff for other things as well :)

Let's talk about this bug (SWT related IMHO) in a diff thread.

>
> On the good side, this would give SWT a GL 3+ context on Windows and Linux
> (and eventually Mac, once Apple upgrades their GL support).

> I guess there's
> no alternative to using reflection, since we can't extend the SWT classes
> directly (because they're platform-specific and we're not).
Yes, we need this hack :)

> But is it
> possible for the ProxySurface to automatically track the size and position
> of the Composite? It would be nice if I could just write this:
>
> GLContext glcontext = factory.createExternalContext(swtcanvas, caps);
>
> without having the ProxySurface and GLDrawable be visible (since they
> shouldn't get used in an SWT app anyway).

This demos 'just' shows that you can do something with the native handles
and we got 'em right.

This is not yet enough for an SWT binding,
since on some platforms (X11/GTK) the native pixel format (FBConfigID ..)
is already chosen.

We would need the same procedure as for NewtCanvasAWT,
  - get the native SWT handle
  - create our own child window to the native SWT one,
    using our pixelformat selection.
  - maybe fwd a few native/SWT events

Then we have it well integrated.

>
>

On Tuesday, March 01, 2011 04:53:48 Wade Walker [via jogamp] wrote:
>
> Hmm, the more I think about this new method, the more I like it, assuming the
> use case can be made simple enough
>
> It could provide a clear motivation for engineering/scientific SWT users to
> switch to JOGL 2, since it would fix the lack of multisampling on Windows (I
> think engineering/scientific users probably care more about multisampling
> than they do about a GL 3/4 context).

Sure, any GL profile, even on mobile platform, and pixelformat.

~Sven

>