1. Go to this page and download the library: Download microscrap/sdl3-gfx library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
microscrap / sdl3-gfx example snippets
use ScrapyardIO\Tubes\Core\MagicAliases\Framebuffer;
use Microscrap\GFX\SDL3\Sdl3Framebuffer;
$buffer = Framebuffer::driver('sdl3')
->size(320, 240)
->format(Sdl3Framebuffer::rgbaSpec())
->create(); // DeferredFramebuffer — SDL owns pixels
use ScrapyardIO\Tubes\Core\MagicAliases\Window;
use Microscrap\GFX\SDL3\SDL3Renderer2D;
$window = Window::driver('sdl3')->title('SDL3')->size(800, 600)->open();
$gfx = (new SDL3Renderer2D)->setFramebuffer($window->framebuffer());
$gfx->fill(0xFF203040)->fillCircle(400, 300, 80, 0xE0E0E0FF);
$window->present()->pollEvents();
$window->close();