Porting GZDoom Builder to Linux

Any utility that assists in the creation of mods, assets, etc, go here.
Forum rules
The Projects forums are ONLY for YOUR PROJECTS! If you are asking questions about a project, either find that project's thread, or start a thread in the General section instead.

Got a cool project idea but nothing else? Put it in the project ideas thread instead!

Projects for any Doom-based engine (especially 3DGE) are perfectly acceptable here too.

Please read the full rules for more details.

Re: Porting GZDoom Builder to Linux

Postby axredneck » Sat Aug 17, 2019 3:53 pm

polyzium wrote:Can you please provide a binary so I can test this out?

+1. At least Windows binary to try it under Wine if it doesn't compile for Linux yet.
User avatar
axredneck
excuse me for my bad English
 
Joined: 11 Dec 2017
Location: Russia
Github ID: axredneck
Operating System: Other Linux 64-bit
Graphics Processor: nVidia with Vulkan support

Re: Porting GZDoom Builder to Linux

Postby polyzium » Sat Aug 17, 2019 5:17 pm

I got a friend of mine to compile dpJudas' fork for me. Both 32 and 64 bit builds ask for BuilderNative.dll that don't exist:
"Unable to load DLL 'BuilderNative.dll': Module not found. (Exception from HRESULT: 0x8007007E)"
I have no experience with .NET, so I have no idea how can I get that file.
polyzium
 
Joined: 14 Aug 2019
Location: Moscow, Russia
Discord: polyzium#0481
Twitch ID: polyzium
Github ID: polyzium
Operating System: Other Linux 64-bit
Graphics Processor: nVidia with Vulkan support

Re: Porting GZDoom Builder to Linux

Postby boris » Sat Aug 17, 2019 6:17 pm

BuilderNative is part of the solution and thus built with the rest of the code. Maybe something went wrong when compiling?
boris
I post less than Manc and Hobo
 
Joined: 15 Jul 2003

Re: Porting GZDoom Builder to Linux

Postby dpJudas » Sat Aug 17, 2019 7:43 pm

BuilderNative is indeed part of the solution - your friend probably didn't have the C++ compiler part of Visual Studio installed.

Essentially I had a choice to make when porting to OpenGL: either use a 3rd party OpenGL C# bindings assembly, or create my own library and use P/Invoke. I opted for the second one as I think C# is a horrible language for managing limited resources and wanted to create a managed environment for its rendering where IDisposable objects are kept at an absolute minimum, or preferrably completely removed.

BuilderNative.dll/BuilderNative.so is a C++ library with C exports for P/Invoke so that it can be built safely with gcc/clang on Linux. Note that it will currently not build on Linux because the OpenGLContext.cpp and RawMouse.cpp files needs a different implementation there.

Someone needs to find out exactly what System.Windows.Forms.Control.Handle returns (some gtk object? qwidget? x11 window handle?). I have source code for initializing OpenGL on Linux, but I can't add it without knowing this piece of information.

About providing a Windows binary, I don't think it makes much sense at this point as the OpenGL port isn't 100% complete yet. No user can live with the offsetting bug it currently has in 2D mode.
dpJudas
 
 
 
Joined: 28 May 2016

Re: Porting GZDoom Builder to Linux

Postby dpJudas » Sat Aug 17, 2019 10:18 pm

Okay looking at the Mono Winforms code I can see Handle returns a X11 Window handle. So far so good, except X11 is such garbage that you cannot get the Display (connection) handle from the Window one, and the Display handle is required for OpenGL context creation. Without some way of obtaining such a Display handle a native Linux build of GZDB is going nowhere.

Edit: it doesn't look good:

Code: Select allExpand view
Find all "class X11", Subfolders, Find Results 1, "C:\Development\mono\mcs\class\System.Windows.Forms", ""
  C:\Development\mono\mcs\class\System.Windows.Forms\System.Windows.Forms\X11DesktopColors.cs(34):   internal class X11DesktopColors {
  C:\Development\mono\mcs\class\System.Windows.Forms\System.Windows.Forms\X11Dnd.cs(43):   internal class X11Dnd {
  C:\Development\mono\mcs\class\System.Windows.Forms\System.Windows.Forms\X11Keyboard.cs(52):   internal class X11Keyboard : IDisposable {
  C:\Development\mono\mcs\class\System.Windows.Forms\System.Windows.Forms.X11Internal\X11Atoms.cs(29):   internal class X11Atoms {
  C:\Development\mono\mcs\class\System.Windows.Forms\System.Windows.Forms.X11Internal\X11Display.cs(41):   internal class X11Display {
  C:\Development\mono\mcs\class\System.Windows.Forms\System.Windows.Forms.X11Internal\X11Exception.cs(31):   internal class X11Exception : ApplicationException {
  C:\Development\mono\mcs\class\System.Windows.Forms\System.Windows.Forms.X11Internal\X11Hwnd.cs(34):   internal class X11Hwnd : Hwnd
  C:\Development\mono\mcs\class\System.Windows.Forms\System.Windows.Forms.X11Internal\X11RootHwnd.cs(30):   internal class X11RootHwnd : X11Hwnd
  C:\Development\mono\mcs\class\System.Windows.Forms\System.Windows.Forms.X11Internal\X11ThreadQueue.cs(34):   internal class X11ThreadQueue {
  Matching lines: 9    Matching files: 9    Total files searched: 2218

Game over, I guess. Unless someone can spot a public accessor to X11Display.display somewhere.
dpJudas
 
 
 
Joined: 28 May 2016

Re: Porting GZDoom Builder to Linux

Postby Gustavo6046 » Sun Aug 18, 2019 8:48 am

Isn't the X11 display handle basically that string set as an environment variable in any terminal environment within X? Like

Code: Select allExpand view
DISPLAY=":0"

?

Plus, that's Mono's API for X11. You shouldn't blame X11 if Mono's API for it sucks.
User avatar
Gustavo6046
 
Joined: 13 May 2017
Location: In an urban area in Brazil.
Discord: Gustavo6046#9009

Re: Porting GZDoom Builder to Linux

Postby dpJudas » Sun Aug 18, 2019 9:01 am

Yes, strictly speaking it is mono’s fault, but it was also a terrible decision in xlib to require a pair of handles when one would have sufficed. In any case, I think it requires patching mono’s winforms assembly before OpenGL can be used.
dpJudas
 
 
 
Joined: 28 May 2016

Re: Porting GZDoom Builder to Linux

Postby polyzium » Sun Aug 18, 2019 9:06 am

Isn't it possible to use a separate X11 library like X11.Net?
polyzium
 
Joined: 14 Aug 2019
Location: Moscow, Russia
Discord: polyzium#0481
Twitch ID: polyzium
Github ID: polyzium
Operating System: Other Linux 64-bit
Graphics Processor: nVidia with Vulkan support

Re: Porting GZDoom Builder to Linux

Postby dpJudas » Sun Aug 18, 2019 9:19 am

No, I need the Display* xlib object that mono’s winforms assembly used to create the window. Now in principle a fix in mono is very simple: create a IX11Window interface with a DisplayHandle and WindowHandle methods, then add it to the Control class. Question is if the mono project would apply it.
dpJudas
 
 
 
Joined: 28 May 2016

Re: Porting GZDoom Builder to Linux

Postby Graf Zahl » Sun Aug 18, 2019 9:31 am

You got to ask them if they are willing to add it, but don't forget explaining the actual use case.
User avatar
Graf Zahl
Lead GZDoom Developer
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: Porting GZDoom Builder to Linux

Postby dpJudas » Sun Aug 18, 2019 9:44 am

That's the thing - I just cba to do the red tape myself. I know developers well enough to know you have to fight for getting even the most simple things in. :)
dpJudas
 
 
 
Joined: 28 May 2016

Re: Porting GZDoom Builder to Linux

Postby Graf Zahl » Sun Aug 18, 2019 10:17 am

I know. Which is why I can't be bothered to support any project that doesn't have a contribution-friendly setup, like Github's pull requests.
So many projects are still being hosted on shit servers with shit software (cough, SVN, cough...) that any hope of them getting properly maintained is futile. And external contributors have no chance in such environments.
User avatar
Graf Zahl
Lead GZDoom Developer
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: Porting GZDoom Builder to Linux

Postby dpJudas » Sun Aug 18, 2019 10:32 am

Mono is on github, so I could probably just open a pull request. What I fear is that someone will reply "that's a bad idea because blah blah multiple backend drivers blah blah" where it basically boils down to them not wanting supporting anything except a picture perfect solution that only works for the most basic winforms projects.
dpJudas
 
 
 
Joined: 28 May 2016

Re: Porting GZDoom Builder to Linux

Postby Graf Zahl » Sun Aug 18, 2019 11:39 am

That's why I said to lay out the use case, and allowing to create an OpenGL canvas sounds like a viable one, if they reject it anyway we can openly brand them as morons. :twisted:
But if you don't even try we'll never know.
User avatar
Graf Zahl
Lead GZDoom Developer
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: Porting GZDoom Builder to Linux

Postby polyzium » Tue Aug 27, 2019 1:29 pm

Even if it is impossible to have a native Linux build, please provide us a Windows build when the OpenGL renderer is finished. The transparency bug is annoying as hell!
polyzium
 
Joined: 14 Aug 2019
Location: Moscow, Russia
Discord: polyzium#0481
Twitch ID: polyzium
Github ID: polyzium
Operating System: Other Linux 64-bit
Graphics Processor: nVidia with Vulkan support

PreviousNext

Return to Editors / Asset Manipulation

Who is online

Users browsing this forum: No registered users and 1 guest