Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
5478ac7
Add world editor, gamepad support, SDL3 bindings, and audio system
Mar 6, 2026
64319dd
Engine Core and Scene System
Mar 6, 2026
aab9834
2D and UI System
Mar 6, 2026
568adf7
Added UI Transpiler
Mar 6, 2026
653d525
Added OpenAL as suggestion and Audio system
Mar 6, 2026
41703c6
Added OpenAL as suggestion and Audio system
Mar 6, 2026
e2a8443
Add MP3 support via minimp3 FFI with pre-built cross-platform binaries
Mar 6, 2026
48b84d2
Fix macOS fullscreen phantom input events, FUICard border rendering, …
Mar 7, 2026
8b4dde2
Add PBR 3D rendering pipeline with cascaded shadow maps
Mar 7, 2026
70a86a9
Add 3D camera system with orbit, first-person, and third-person modes
Mar 7, 2026
f1f11c7
Add 3D collision system with box, sphere, capsule colliders and rayca…
Mar 7, 2026
b24107f
Add impulse-based 3D physics system with rigid body dynamics
Mar 7, 2026
7460356
Add SpotLightComponent with cone-shaped lighting support
Mar 7, 2026
4286952
Add point light cubemap shadow mapping
Mar 7, 2026
dfcd5e8
Add particle system with GPU-instanced billboard rendering
Mar 7, 2026
af0839b
Add skeletal animation system with bone hierarchy, keyframe interpola…
Mar 7, 2026
efa8d28
Add terrain system with heightmap mesh generation and texture splatting
Mar 7, 2026
5db4f68
Add post-processing stack with bloom, depth of field, and motion blur
Mar 7, 2026
05d68c8
Add behaviour tree and finite state machine AI systems
Mar 7, 2026
c0e4fea
Add JSON-based dialogue system with branching, conditions, and variab…
Mar 7, 2026
656b6fe
Add A* grid pathfinding and NavMesh triangle-graph pathfinding
Mar 7, 2026
94ef504
Fix all 176 PHPStan Level 8 errors across the codebase
Mar 7, 2026
7d4914b
Add comprehensive PHPBench performance benchmarks for engine systems
Mar 7, 2026
e8e7db8
Fix benchmark namespaces to VISU\Tests\Benchmark and rename GLConetxt…
Mar 7, 2026
527188c
Fix ShaderProgramUniformMat4Bench to use FloatBuffer instead of array
Mar 7, 2026
4f0561e
Fix rendering examples: shader duplicate main(), setParent API, Vec3 …
Mar 7, 2026
1d53274
Complete World Editor with WebSocket live-preview, UI Layout Editor, …
Mar 8, 2026
52ac9f5
Add automatic project setup when VISU is used as a Composer dependency
Mar 8, 2026
af629b0
Add visu build command for game distribution packaging
Mar 14, 2026
d87bd2a
Add build system tests and update CI workflow
Mar 14, 2026
85b4ce6
Fix PHPStan errors in BuildConfig file_get_contents
Mar 14, 2026
5f03ffe
Add missing PHP extensions to CI workflow
Mar 14, 2026
eb43cb7
Fix CI: remove :glfw from extensions, it was disabling other extensions
Mar 14, 2026
678b641
Fix CI: install versioned php-xml and php-curl packages
Mar 14, 2026
c90cde5
Add PHPStan ignore rules for FFI\CData properties and PHP 8.4 depreca…
Mar 14, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
164 changes: 164 additions & 0 deletions .github/workflows/build-runtime.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,164 @@
name: Build Runtime (micro.sfx)

on:
workflow_dispatch:
inputs:
php_version:
description: 'PHP version (8.3, 8.4, 8.5)'
required: true
default: '8.4'
type: choice
options:
- '8.3'
- '8.4'
- '8.5'

jobs:
build:
name: micro.sfx / ${{ matrix.os }}-${{ matrix.arch }} / PHP ${{ inputs.php_version }}
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
matrix:
include:
- os: macos
arch: arm64
runner: macos-14
- os: macos
arch: x86_64
runner: macos-13
- os: linux
arch: x86_64
runner: ubuntu-latest
- os: linux
arch: arm64
runner: ubuntu-24.04-arm
- os: windows
arch: x86_64
runner: windows-latest

steps:
- name: Checkout static-php-cli
uses: actions/checkout@v4
with:
repository: crazywhalecc/static-php-cli
ref: main

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
tools: composer

- name: Install Composer dependencies
run: composer install --no-dev --no-interaction

# ── Unix builds (macOS + Linux) ──

- name: Download sources (Unix)
if: runner.os != 'Windows'
run: |
php bin/spc download \
--with-php=${{ inputs.php_version }} \
--for-extensions=glfw,mbstring,zip,phar \
--prefer-pre-built

- name: Install build tools (Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y \
build-essential cmake pkg-config \
libx11-dev libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev \
libwayland-dev libxkbcommon-dev wayland-protocols extra-cmake-modules

- name: Install build tools (macOS)
if: runner.os == 'macOS'
run: brew install cmake pkg-config

- name: Build micro.sfx (Unix)
if: runner.os != 'Windows'
run: php bin/spc build glfw,mbstring,zip,phar --build-micro

# ── Windows build ──

- name: Download sources (Windows)
if: runner.os == 'Windows'
shell: powershell
run: |
php bin/spc download `
--with-php=${{ inputs.php_version }} `
--for-extensions=glfw,mbstring,zip,phar `
--prefer-pre-built

- name: Setup Windows build environment
if: runner.os == 'Windows'
shell: powershell
run: php bin/spc doctor --auto-fix

- name: Build micro.sfx (Windows)
if: runner.os == 'Windows'
shell: powershell
run: php bin/spc build glfw,mbstring,zip,phar --build-micro

# ── Upload ──

- name: Upload micro.sfx
uses: actions/upload-artifact@v4
with:
name: micro-${{ matrix.os }}-${{ matrix.arch }}
path: buildroot/bin/micro.sfx
retention-days: 90

release:
name: Create Release
needs: build
runs-on: ubuntu-latest
permissions:
contents: write

steps:
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts

- name: Prepare release files
run: |
mkdir release
for dir in artifacts/micro-*/; do
platform=$(basename "$dir")
cp "$dir/micro.sfx" "release/${platform}.sfx"
done
ls -lh release/

- name: Create Release
uses: softprops/action-gh-release@v2
with:
tag_name: runtime-php${{ inputs.php_version }}
name: "VISU Runtime — PHP ${{ inputs.php_version }}"
body: |
## VISU Runtime Binaries

Static PHP micro.sfx binaries for VISU game distribution.

**PHP Version:** ${{ inputs.php_version }}
**Extensions:** glfw, mbstring, zip, phar

### Downloads

| Platform | Architecture | File |
|----------|-------------|------|
| macOS | arm64 (Apple Silicon) | `micro-macos-arm64.sfx` |
| macOS | x86_64 (Intel) | `micro-macos-x86_64.sfx` |
| Linux | x86_64 | `micro-linux-x86_64.sfx` |
| Linux | arm64 | `micro-linux-arm64.sfx` |
| Windows | x86_64 | `micro-windows-x86_64.sfx` |

### Usage

These binaries are automatically downloaded by `visu build`.
Manual: `cat micro-<platform>-<arch>.sfx game.phar > MyGame && chmod +x MyGame`
files: release/*
draft: false
prerelease: false
132 changes: 84 additions & 48 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,57 +1,93 @@
name: VISU CI
name: VISU CI

on:
push:
branches: [ '*' ]
branches: ['*']
pull_request:
branches: [ '*' ]
branches: ['*']

jobs:
ubuntu:

runs-on: ${{ matrix.operating-system }}
tests:
name: PHP ${{ matrix.php }} — Tests
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
operating-system: ['ubuntu-latest']
php-versions: ['8.1', '8.2']
phpunit-versions: ['9.6']

php: ['8.3', '8.4', '8.5']

steps:
- uses: actions/checkout@v3

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: :glfw
coverage: xdebug
tools: cs2pr, phpunit:${{ matrix.phpunit-versions }}

- name: Install dependenies
run: sudo apt-get update && sudo apt-get install -y php-dev build-essential cmake libglfw3-dev xvfb libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev gdb

- name: Build PHP-GLFW
run: >
git clone https://github.com/mario-deluna/php-glfw &&
cd php-glfw &&
sudo phpize &&
./configure --enable-glfw &&
make -j$(nproc) &&
sudo make install &&
cd ../ &&
grep -qxF 'extension=glfw.so' /etc/php/${{ matrix.php-versions }}/cli/php.ini ||
echo 'extension=glfw.so' >> /etc/php/${{ matrix.php-versions }}/cli/php.ini

- name: Run composer install
run: composer install

#- name: Install PHPUnit
# run: composer require "phpunit/phpunit"

- name: Run PHPUnit
run: xvfb-run --auto-servernum phpunit

- name: Run PHPStan
if: ${{ matrix.php-versions == '8.2' }}
run: php vendor/bin/phpstan analyse src --error-format=github -l8

- uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: dom, curl, mbstring, xml, tokenizer
coverage: none
tools: phpunit:9.6

- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
php${{ matrix.php }}-dev php${{ matrix.php }}-xml php${{ matrix.php }}-curl \
build-essential cmake \
libglfw3-dev xvfb \
libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev

- name: Build PHP-GLFW
run: |
git clone https://github.com/mario-deluna/php-glfw
cd php-glfw
sudo phpize
./configure --enable-glfw
make -j$(nproc)
sudo make install
cd ../
echo 'extension=glfw.so' | sudo tee -a $(php -r "echo php_ini_loaded_file();")

- name: Install Composer dependencies
run: composer install --no-interaction

- name: Run PHPUnit
run: xvfb-run --auto-servernum phpunit

static-analysis:
name: PHPStan (Level 8)
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.4'
extensions: dom, curl, mbstring, xml, tokenizer
coverage: none

- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
php8.4-dev php8.4-xml php8.4-curl \
build-essential cmake \
libglfw3-dev \
libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev

- name: Build PHP-GLFW
run: |
git clone https://github.com/mario-deluna/php-glfw
cd php-glfw
sudo phpize
./configure --enable-glfw
make -j$(nproc)
sudo make install
cd ../
echo 'extension=glfw.so' | sudo tee -a $(php -r "echo php_ini_loaded_file();")

- name: Install Composer dependencies
run: composer install --no-interaction

- name: Run PHPStan
run: php vendor/bin/phpstan analyse src --error-format=github -l8
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
composer.phar
composer.lock
CLAUDE.md
/vendor/
/coverage/
/var/
docs/docs-assets/
.phpdoc/
docs/api
bin/phpDocumentor.phar
node_modules/
.phpunit.result.cache
57 changes: 44 additions & 13 deletions bin/visu
Original file line number Diff line number Diff line change
@@ -1,33 +1,64 @@
<?php
if (!defined('DS')) { define('DS', DIRECTORY_SEPARATOR); }

$binDir = $_composer_bin_dir ?? __DIR__ . '/../vendor/bin';
// VISU engine root is always relative to this script's real location
// (__DIR__ resolves symlinks, so this always points to the engine)
$engineRoot = dirname(__DIR__);

// we assume the applications bootstrap file to be in the application root
$bootstrapFile = $binDir . DS . '..' . DS . '..' . DS . 'bootstrap.php';
// Determine project root and autoloader:
// When run via `vendor/bin/visu` in a consumer project, Composer sets $_composer_bin_dir.
// Otherwise we assume VISU itself is the project (standalone / development mode).
if (isset($_composer_bin_dir)) {
// Running as a dependency inside a consumer project.
// $_composer_bin_dir = .../vendor/bin
// autoload.php = .../vendor/autoload.php
// project root = .../
$vendorDir = realpath($_composer_bin_dir . DS . '..');
$projectRoot = realpath($vendorDir . DS . '..');
$autoloadFile = $vendorDir . DS . 'autoload.php';
} else {
// Running directly from VISU's own bin/ directory
$projectRoot = $engineRoot;
$autoloadFile = $engineRoot . DS . 'vendor' . DS . 'autoload.php';
}

if (!file_exists($bootstrapFile)) {
throw new \Exception('Could not find bootstrap file: ' . $bootstrapFile);
if (!file_exists($autoloadFile)) {
throw new \Exception('Could not find autoloader at: ' . $autoloadFile);
}

require $autoloadFile;

/**
*---------------------------------------------------------------
* Project Paths
*---------------------------------------------------------------
*
* Set path constants for the project being loaded.
* These can be overridden by the project before calling this script.
*/
if (!defined('VISU_PATH_ROOT')) define('VISU_PATH_ROOT', $projectRoot);
if (!defined('VISU_PATH_CACHE')) define('VISU_PATH_CACHE', $projectRoot . DS . 'var' . DS . 'cache');
if (!defined('VISU_PATH_STORE')) define('VISU_PATH_STORE', $projectRoot . DS . 'var' . DS . 'store');
if (!defined('VISU_PATH_RESOURCES')) define('VISU_PATH_RESOURCES', $projectRoot . DS . 'resources');
if (!defined('VISU_PATH_APPCONFIG')) define('VISU_PATH_APPCONFIG', $projectRoot);

set_time_limit(0);

/**
*---------------------------------------------------------------
* Autoloader / Compser
* Engine Bootstrap
*---------------------------------------------------------------
*
* We need to access our dependencies & autloader..
* Load VISU's own bootstrap (always from the engine directory).
*/
$bootstrapFile = realpath($bootstrapFile);
$container = require $bootstrapFile;
$container = require $engineRoot . DS . 'bootstrap.php';

/**
*---------------------------------------------------------------
* Forwrard to VISU command line interface handler
* Forward to VISU command line interface handler
*---------------------------------------------------------------
*
* VISU will evaluate the argument vector here and forward
*
* VISU will evaluate the argument vector here and forward
* to the appropriate command.
*/
$container->get('visu.command.cli_loader')->pass($argv);
$container->get('visu.command.cli_loader')->pass($argv);
Loading