microscrap / glfw-gfx
GLFW-native Rendering Package for the ScrapyardIO Framework
Requires
- php: ^8.3
- ext-glfw: ^0.5.0
- fabricate/contracts: ^0.6.0
- fabricate/framebuffers: ^0.6.0
- fabricate/nuts-and-bolts: ^0.6.0
- fabricate/rendering: ^0.6.0
- microscrap/glfw: ^0.5.0
Requires (Dev)
- pestphp/pest: ^4
README
GLFW-native rendering for the ScrapyardIO Framework.
This package registers the glfw-ogl framebuffer strategy and the glfw GFX render driver so Fabricate can draw through a GLFW OpenGL context.
It is the rendering half of the GLFW desktop stack. For an actual windowed display panel, install dept-of-scrapyard-robotics/glfw-display.
Requirements
- PHP 8.3+
- ext-glfw ^0.5.0 — php-io-extensions/glfw
microscrap/glfw^0.5.0- ScrapyardIO Framework 0.6 (
fabricate/framebuffers,fabricate/rendering, …)
Installation
Confirm the extension is loaded:
php -m | grep glfw
Via Composer
composer require microscrap/glfw-gfx
Package discovery registers Microscrap\GFX\GLFW\Providers\GLFWGfxServiceProvider automatically.
Via Workshop (recommended in a Scrapyard app)
From a ScrapyardIO application:
workshop install:gfx --glfw
Or interactively:
workshop install:gfx
That installs this package (and optional siblings), then can activate GLFW as the default rendering backend.
What it registers
| Registry key | Role |
|---|---|
Framebuffer glfw-ogl |
GLFWOpenGLFramebuffer |
Renderer glfw |
GLFWRenderDriver |
Typical config/gfx.php after activation:
return [ 'rendering' => [ 'default' => 'glfw', 'engines' => [ 'glfw' => [], // ... ], ], ];
Pair with a windowed display
This package alone does not open a desktop window. Once GFX is installed, Workshop exposes:
workshop install:glfw-display
That command is hidden when dept-of-scrapyard-robotics/glfw-display is already required. When visible, it:
composer require dept-of-scrapyard-robotics/glfw-display:^0.6.0- Runs
workshop config:glfw-displayto add a defaultwindowed.glfwentry
Options:
workshop install:glfw-display workshop install:glfw-display --force workshop install:glfw-display --composer=/path/to/composer
Manual wiring (without install:gfx)
composer require microscrap/glfw-gfx php workshop package:discover
Then set config/gfx.php rendering.default to glfw (or keep another default and select glfw / glfw-ogl per display).
Stack overview
ext-glfw
└── microscrap/glfw (bindings)
└── microscrap/glfw-gfx (framebuffer + renderer) ← this package
└── dept-of-scrapyard-robotics/glfw-display (windowed panel)
License
MIT