LegitEngine icon indicating copy to clipboard operation
LegitEngine copied to clipboard

GNU/Linux support

Open Panzerschrek opened this issue 1 year ago • 3 comments

I tried to compile the project for GNU/Linux, but it doesn't work. Windows-specific stuff is hardcoded. How hard it would be to support it?

Panzerschrek avatar Feb 09 '24 08:02 Panzerschrek

I never tried to build it on linux, but I never deliberately relied on anything windows-specific. Can you give me examples of stuff that does not build on linux?

Raikiri avatar Feb 09 '24 09:02 Raikiri

https://github.com/Raikiri/LegitEngine/blob/master/src/LegitVulkan/LegitVulkan.h#L2 #define VK_USE_PLATFORM_WIN32_KHR This is obviously windows-specific.

https://github.com/Raikiri/LegitEngine/blob/master/src/LegitVulkan/Surface.h#L5 HWND/HINSTANCE is also Windows-specific stuff.

Maybe i am using the library wrong way and i should just include some other headers instead, which have no Windows-specific stuff dependencies.

Panzerschrek avatar Feb 09 '24 09:02 Panzerschrek

The WindowDesc is the only part of my code contains the platform-specific window handle that glfw returns and CreateWin32Surface is the only function that uses it. VK_USE_PLATFORM_WIN32_KHR just tells vulkan.hpp that I want the createWin32Surface function, and it should just be replaced with the unix version that should just have a different name.

I don't have the need to run it on unix, but I tried to keep platform specific code as isolated as I could, and the swapchain creation is the only place that I remember where I could not abstract it away.

PS since I never tested it on unix, quite possible that something will break in runtime

Raikiri avatar Feb 09 '24 11:02 Raikiri