Horde3D

Next-Generation Graphics Engine
It is currently 26.11.2024, 15:28

All times are UTC + 1 hour




Post new topic Reply to topic  [ 1 post ] 
Author Message
PostPosted: 29.05.2009, 15:37 
Offline

Joined: 10.05.2009, 07:55
Posts: 30
Hello

I will report to this thread the work log and information about how to run Horde3D + mono WinForms on Linux. Any help is much appreciated. :roll:

Current status:

1. OpenGL context is created without errors to child X-window opened on top of chosen Panel.
2. Horde3D is initialized without errors.
3. Window is drawn with the color defined in the pipeline xml.
4. No objects are rendered but there is no initialization errors on application log nor engine log. :!:

Approach:

New X-windows is created as child window to the Panel as the panel window is not directly OpenGL compliant on X11. The X-window requires explicit resizes when panel is resized. The Horde3d changes are attached as patch file. The C# application is initialized with the following code:

Code:
   
                Type xplatui = Type.GetType("System.Windows.Forms.XplatUIX11, System.Windows.Forms");
                if (xplatui != null)
                {

                    IntPtr display = (IntPtr) xplatui.GetField("DisplayHandle",
                                                               System.Reflection.BindingFlags.Static |
                                                               System.Reflection.BindingFlags.NonPublic).GetValue(null);


                    if (!Horde3DNET.Utils.Horde3DUtils.initOpenGLX11(display, this.renderPanel.Handle))
         throw new Exception("Failed to initialize OpenGL");
                }
                else
                {
                    if (!Horde3DUtils.initOpenGL(GetDC(renderPanel.Handle).ToInt32()))
                        throw new Exception("Failed to initialize OpenGL");
                }


Resizing the X-window on panel resize requires:
Code:
                Horde3DUtils.setOpenGLWindowSize(width,height);


Information from mono windows mailing list :!: :

Code:
Ivan N. Zlatev to me, mono-winforms-.
show details May 27 (2 days ago)

In X11 we have 2 X windows for each control - one for the client
(ClientWindow) and one for the non-client areas (WholeWindow).
Control.Handle is the handle for the Client window returned by
XCreateWindow. You can see more details in CreateWindow () in
http://anonsvn.mono-project.com/viewvc/trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIX11.cs
and http://anonsvn.mono-project.com/viewvc/trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Hwnd.cs
for details.


Attachments:
horde3d_x11.patch [11.21 KiB]
Downloaded 1013 times
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 27 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group