dotgnu-pnet
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Pnet-developers] Handle problem


From: Dmitriy
Subject: Re: [Pnet-developers] Handle problem
Date: Tue, 12 Oct 2004 12:51:33 +0600

If this handle (drawable handle from "Control.Handle") is not required to be
re requested at every frame.. I need this...

----- Original Message ----- 
From: "Rhys Weatherley" <address@hidden>
To: "Dmitriy" <address@hidden>; "Gopal V" <address@hidden>;
<address@hidden>
Sent: Tuesday, October 12, 2004 4:26 AM
Subject: Re: [Pnet-developers] Handle problem


On Tuesday 12 October 2004 06:02 am, Dmitriy wrote:
> How to link(bind) OpenGL to window, which was created with PNET SWF?
>
> for Windows and Microsoft .NET it is not a problem:
> We get a handle from window in C# code and in C++ code:
> void Create(HWND hwnd)
> {
>   dc=GetDC(cwnd);
>
>   int iPixelFormat = ChoosePixelFormat(dc,&rPFD);
>   if(!SetPixelFormat(dc,iPixelFormat,&rPFD)) FAIL("SetPixelFormat
> failed!"); if(!(hRC = wglCreateContext(dc))) FAIL("wglCreateContext
> failed!"); //we have OpenGL context
> }
>
> How TODO so under PNET and linux?

Depends upon what you need.  Do you need the X11 window handle or the
graphics
context?  The display pointer?  The "Handle" property on a control should
work in the Win32 version of pnet winforms to get the HWND, but returns
IntPtr.Zero in the X11 version.

It is possible to get it via a round-about method.  "Graphics.Hdc" will
return
a GC handle that can be used to access the "Xsharp.Graphics" object
underneath a control (see the code in
System.Drawing.Xsharp/DrawingGraphics.cs for details).  From this, you can
get the drawable handle, display pointer, and other X11 details.

The current interface is perhaps a little awkward, and could be improved by
returning the drawable handle from "Control.Handle", if that's what you
need.

Cheers,

Rhys.

_______________________________________________
Pnet-developers mailing list
address@hidden
http://dotgnu.org/mailman/listinfo/pnet-developers




reply via email to

[Prev in Thread] Current Thread [Next in Thread]