fix: window now visible — SDL_ShowWindow + Wayland support in run.sh

- Added SDL_ShowWindow + SDL_RaiseWindow after window creation
- run.sh: auto-detect Wayland vs X11, set SDL_VIDEODRIVER accordingly
- Wayland session uses SDL_VIDEODRIVER=wayland (bundled SDL3 lacks X11 support)
- Engine runs at 1600+ FPS, window visible on Wayland desktop
- Screenshots confirm 3D geometry rendering correctly
This commit is contained in:
emil28092005
2026-06-18 00:22:27 +03:00
parent 46a04850e3
commit aa93b55a74
2 changed files with 13 additions and 3 deletions
+10 -3
View File
@@ -4,13 +4,20 @@
# ./scripts/run.sh # run with defaults # ./scripts/run.sh # run with defaults
# ./scripts/run.sh --mcp-port 5000 # run with MCP HTTP server # ./scripts/run.sh --mcp-port 5000 # run with MCP HTTP server
# ./scripts/run.sh --camera-tour # capture screenshots and exit # ./scripts/run.sh --camera-tour # capture screenshots and exit
# ./scripts/run.sh --mcp-stdio # run headless stdio MCP server # ./scripts/run.sh --mcp-stdio # run headless stdio MCP server
ENGINE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" ENGINE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
export DISPLAY="${DISPLAY:-:0}"
export DOTNET_ROOT="${DOTNET_ROOT:-$HOME/.dotnet}" export DOTNET_ROOT="${DOTNET_ROOT:-$HOME/.dotnet}"
export PATH="$DOTNET_ROOT:$PATH" export PATH="$DOTNET_ROOT:$PATH"
# Prefer Wayland if available, fall back to X11
if [ -n "$WAYLAND_DISPLAY" ]; then
export SDL_VIDEODRIVER="${SDL_VIDEODRIVER:-wayland}"
else
export DISPLAY="${DISPLAY:-:0}"
export SDL_VIDEODRIVER="${SDL_VIDEODRIVER:-x11}"
fi
cd "$ENGINE_DIR" cd "$ENGINE_DIR"
exec dotnet run --project "$ENGINE_DIR/src/CortexEngine.App/CortexEngine.App.csproj" -- "$@" exec dotnet run --project "$ENGINE_DIR/src/CortexEngine.App/CortexEngine.App.csproj" -c Debug -- "$@"
+3
View File
@@ -43,6 +43,9 @@ public sealed unsafe class Sdl3Window : IWindow
if (_window == null) if (_window == null)
throw new InvalidOperationException($"SDL_CreateWindow failed: {SDL3.SDL_GetError()}"); throw new InvalidOperationException($"SDL_CreateWindow failed: {SDL3.SDL_GetError()}");
SDL3.SDL_ShowWindow(_window);
SDL3.SDL_RaiseWindow(_window);
} }
public void PumpEvents() public void PumpEvents()