Please note that this is only a demo and may contain non-optimal, crazy and completely unbelievable programming techniques.
If your psyche was injured please consult a doctor.
Peace <3
Oh yes, according to my information, nobody has ever done such things in pure PHP.
Demo in action: https://www.youtube.com/watch?v=vsBbJbhKeeU
- PHP 7.4+ NTS
- ext-ffi
- Composer
- SDL2 (only MacOS and Linux)
- SDL2 Image (only MacOS and Linux)
Please note that when using the Thread Safe version of the PHP there will be throw an error like "Failed loading libpng16-16.dll" See: https://bugs.php.net/bug.php?id=79439&thanks=4
composer install
php app.php
sudo apt install libsdl2-2.0-0 -y
sudo apt install libsdl2-image-2.0-0 -y
composer install
php app.php
docker run -it -v /tmp/.X11-unix:/tmp/.X11-unix -e DISPLAY=$DISPLAY -e XAUTHORITY=$XAUTHORITY $(docker build -q .)
brew install sdl2
brew install sdl2_image
composer install
php app.php