Skip to content

Port ArrowVortex to Linux#281

Open
uvcat7 wants to merge 82 commits into
betafrom
linux
Open

Port ArrowVortex to Linux#281
uvcat7 wants to merge 82 commits into
betafrom
linux

Conversation

@uvcat7

@uvcat7 uvcat7 commented Jun 10, 2026

Copy link
Copy Markdown
Owner

Finally, we're ready for multiplatform support.
This PR was only tested on Windows WSL so far. I'll test more during the review process but this seems to work well enough for now.
The following changes were made:

  • GCC did not handle Vortex::Vector properly and would throw runtime exceptions, so Vortex::Vector was ported to std::vector (this was a big change, as a lot of ArrowVortex's vector iteration did out-of-array access for position checking).
  • min and max are part of MSVC so they were replaced with std::min/std::max/std::clamp as appropriate.
  • ArrowVortex now behaves properly with Visual Studio 2026's clang-tidy (apparently 2022 was missing some files/checks?)
  • Similarly, CMake Settings are deprecated in VS2026 and are not multiplatform, so CMakeSettings.json was converted to CMakePresets.json.
  • I had so many problems with Visual Studio/CMake caching that I modified the CMakeLists.txt to work even when not called with the proper environment variables. In theory, this should make user presets easier to use, but still, it's CMake.
  • Linux's clang-format gave some mutually exclusive results against Windows' clang-format, so the format checking runs only on Windows.
  • A menu bar was written in OpenGL (Editor/Menubar.cpp, System/Menu.cpp) to behave the same as the Windows menu bar for Linux builds in lieu of messing with Wayland/X11. Note that to prevent rewriting all the rendering logic, the menu bar is rendered with negative coordinates and the rendering offset with glTranslated(). This can be revisited when SDL adds support for integrated menu bars.
image
  • windows.yml has been renamed to release.yml and an entry for Linux builds on Ubuntu added.
  • Of course, making C++ code that plays nicely with both GCC and MSVC deserves a special mention. Did you know that MSVC still doesn't implement std::aligned_alloc?

I would like some review of the CMakeLists.txt for any simplifications/optimizations.

For testing builds you may need to install all the packages listed in release.yml with your distro's package manager:

          sudo apt-get install -qq -y mono-devel nasm libltdl-dev \
            autoconf autoconf-archive automake libtool \
            libx11-dev libxft-dev libxext-dev \
            libwayland-dev libxkbcommon-dev libegl1-mesa-dev \
            libibus-1.0-dev zenity clang-tidy clang-format build-essential git \
            pkg-config cmake ninja-build gnome-desktop-testing libasound2-dev libpulse-dev \
            libaudio-dev libjack-dev libsndio-dev libusb-1.0-0-dev libx11-dev libxext-dev \
            libxrandr-dev libxcursor-dev libxfixes-dev libxi-dev libxss-dev libwayland-dev \
            libxkbcommon-dev libdrm-dev libgbm-dev libgl1-mesa-dev libgles2-mesa-dev \
            libegl1-mesa-dev libdbus-1-dev libibus-1.0-dev fcitx-libs-dev \
            libasound2-dev libdecor-0-dev

uvcat7 and others added 30 commits August 27, 2025 15:04
@uvcat7 uvcat7 requested a review from Psycast June 10, 2026 19:15
@uvcat7 uvcat7 requested a review from convextriangle June 10, 2026 21:40
@uvcat7

uvcat7 commented Jun 11, 2026

Copy link
Copy Markdown
Owner Author

I added build documentation for Linux as well.

Comment thread BUILDING.md
### With CMake CLI
In the terminal at the root folder of this project run:
```
cmake -Bbuild -S. -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE="$env:VCPKG_ROOT\scripts\buildsystems\vcpkg.cmake" -DVCPKG_TARGET_TRIPLET=x64-linux -DPRESET_NAME={linux-debug | linux-release}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should probably be $VCPKG_ROOT, iirc $env:<something> is a powershell thing

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and -Bbuild seems to not be working; CMake presets seem to force -Bout/build/linux-debug? (same for the cmake --build command)

Comment thread BUILDING.md
### Build Packages
For Ubuntu/Debian install:
```
sudo apt-get install build-essential git \

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

python3-jinja2 might be missing on some debian installs

Comment thread src/Core/Texture.h
@@ -1 +1 @@
#pragma once

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#include <vector> seems to be missing in this header? seems to cause build errors at least on my machine

Comment thread BUILDING.md
cmake -Bbuild -S. -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE="$env:VCPKG_ROOT\scripts\buildsystems\vcpkg.cmake" -DVCPKG_TARGET_TRIPLET=x64-linux -DPRESET_NAME={linux-debug | linux-release}
cmake --build build
```
The resulting binary will be located at `out\install\{linux-debug | linux-release}\bin\ArrowVortex`

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems to be located in out/build/linux-debug/src/System/ArrowVortex, maybe this is for the installation, not building?

Comment thread src/System/System.cpp
float getScaleFactor() const override { return myScale; }

bool getWindowState() const override {
auto temp = SDL_GetWindowFlags(window);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the temp variable required?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants