Page 1 of 3

ZGE on Mac

Posted: Wed Mar 09, 2022 12:33 pm
by VilleK
Edit: the latest alpha build is attached here.

----

I'm looking at making the ZGE editor available on Mac. Previously only the runtime engine works on Mac but this is an attempt at making the whole editor working.

The main problem with porting the editor is that it depends on the Delphi VCL which is specific for Windows. However there is a similar library called LCL available in the open source tool Lazarus that use the Freepascal compiler, and that library is cross-platform.

Here is a screenshot at what can be described as a early alpha build. There are many features still missing: OpenGL is only working in separate window, the icons are distorted, there is no script editor yet or any sound. But at least it starts up and is operational which I consider a success for now :)

I hope to continue working on this so I can provide a download when it has reached a more stable state. The sources are in a "lcl" branch on github if anyone is interested.

Re: ZGE on Mac

Posted: Thu Mar 10, 2022 9:12 am
by rrTea
It already looks like ZGE! It's even kind of stylish with monotone icons :D

Re: ZGE on Mac

Posted: Thu Mar 17, 2022 2:07 pm
by VilleK
Here is first alpha build.

I'm posting this mostly to see if rrTea can open it at all :)

Note:
- This is very early and most things do not yet work.
- This is a Intel build so if using on M1 Mac then it requires Rosetta 2 to be installed.
- You may need to enable running applications downloaded from internet in Mac OS Settings - Security.

What works:
- Opening and saving projects.
- Using the "Project - Build Mac OS binary" option. The generated binary can be run on its own without any SDL dependency. It can read mouse input but not yet keyboard input. It doesn't fully close when closing main window so the attached terminal window needs to be closed manually.

Image shows ZGE running on M1 Macbook Air with a generated binary running CleanseCube example.

Re: ZGE on Mac

Posted: Thu Mar 17, 2022 4:28 pm
by rrTea
Yes I can open and run it! I was able to load CleanseCube and run it both from ZGE and make a build. Some warnings were popping up in the process but I guess it's nothing unexpected (although one of the errors did sound a bit scary, warning me that I might end up with corrupt data). I did take screenshots of all the warnings if that's of any help.

Some of my old and super simple projects (20 lines of code) work too, while some slightly bigger projects failed to load (maybe because I was using some Windows specific features).

Re: ZGE on Mac

Posted: Thu Mar 17, 2022 4:39 pm
by VilleK
rrTea wrote: Thu Mar 17, 2022 4:28 pm Yes I can open and run it! I was able to load CleanseCube and run it both from ZGE and make a build. Some warnings were popping up in the process but I guess it's nothing unexpected (although one of the errors did sound a bit scary, warning me that I might end up with corrupt data). I did take screenshots of all the warnings if that's of any help.

Some of my old and super simple projects (20 lines of code) work too, while some slightly bigger projects failed to load (maybe because I was using some Windows specific features).
Great, thanks for testing!

If you get weird warnings or crashes then please let me know how to reproduce it or post screenshots.

Perhaps your larger projects that failed to load use external DLLs? Then you need to find Mac versions of those libraries. I might be able to help with that if you tell me what libraries are needed. If they don't require libraries then please send me such a project so I can investigate.

Re: ZGE on Mac

Posted: Thu Mar 17, 2022 5:14 pm
by rrTea
I usually used SunVOX DLL for sound and Windows IME handler (to prevent Microsoft Chinese IME from grabbing focus during the game). So this should not be a problem, I'll just try to turn it off.

After I downloaded ZGE I just left it in the default Download folder and launched it from there. Should I try to move it to a particular folder instead?

Here are some errors I got while testing, let me know if any of these look like I should investigate it further:
Warnings screenshots
Warnings screenshots
ZGE00.jpg (65.73 KiB) Viewed 42791 times

Re: ZGE on Mac

Posted: Thu Mar 17, 2022 7:49 pm
by rrTea
I know launching programs with ZGE was not listed under "What works" (so probably too early for that) but I tried running demo projects anyway just out of curiosity, and quite a few of them work (some almost perfectly)! So that's great!

Re: ZGE on Mac

Posted: Thu Mar 17, 2022 9:24 pm
by VilleK
It looks like it has problems saving the settings file. This does not happen here. Maybe try moving the application to Application folder or to desktop and see if it makes a difference.

Re: ZGE on Mac

Posted: Thu Mar 17, 2022 9:30 pm
by rrTea
ok I moved it to desktop, yes this helps!

Re: ZGE on Mac

Posted: Fri Mar 18, 2022 2:26 pm
by VilleK
New alpha on top:
- Fixed possible file corruption when saving projects with binary properties (such as BitmapFromFile)
- F9 now works to build and launch project

Still no keyboard support though, hope to fix that soon.

Re: ZGE on Mac

Posted: Wed Mar 23, 2022 10:18 am
by VilleK
Alpha 3 on top:

When generating binary then ZGE will create an application bundle for your project. This is required for an application to receive keypresses.

So if your project is named "test.zgeproj" then it will create the application bundle "test.app". This can be started in Finder as a separate application.

Note that if your binary requires any external files then you need to place those inside the bundle. Right-click on bundle in Finder and choose "Show bundle content". Then browse to Content/MacOS subfolder and place your files there.

Re: ZGE on Mac

Posted: Wed Mar 23, 2022 11:26 am
by rrTea
Just to confirm it works on my end. The initial stutter on freshly generated builds is now completely gone (at least the ones I tried) and even the builds that were causing problems (in alpha 2) are now built normally.

Re: ZGE on Mac

Posted: Fri Apr 01, 2022 8:08 pm
by VilleK
Struggling a bit with how to avoid the detached OpenGL windows. There seems to be a problem with LCL, OpenGL and sharing contexts between views. No new alpha this week but trying again next week! :)

Re: ZGE on Mac

Posted: Wed Apr 06, 2022 4:26 pm
by Imerion
Hi everyone! It was several years ago since I was here last, but I have been following ZGE on Github and noticed the Lazarus branch. Does this mean it would work on Linux too eventually? A native Linux version and I would definitely pick up working in ZGE again. :D

Re: ZGE on Mac

Posted: Thu Apr 07, 2022 7:38 am
by VilleK
Imerion wrote: Wed Apr 06, 2022 4:26 pm Does this mean it would work on Linux too eventually? A native Linux version and I would definitely pick up working in ZGE again. :D
It would at least make it much easier to port to Linux, yes :). But I would need help with the details since I currently do not have a Linux environment configured.