dept-of-scrapyard-robotics / glfw-display
Drive GLFW-powered Windows with PHP
Package info
github.com/DeptOfScrapyardRobotics/glfw-display
pkg:composer/dept-of-scrapyard-robotics/glfw-display
Requires
- php: ^8.3
- ext-glfw: ^0.5.0
- fabricate/contracts: ^0.6.0
- fabricate/displays: ^0.6.0
- fabricate/nuts-and-bolts: ^0.6.0
- microscrap/glfw-gfx: ^0.6.0
Requires (Dev)
- pestphp/pest: ^4
README
Drive GLFW-powered windows from ScrapyardIO.
This package registers a glfw windowed display panel (GLFWWindow) that pairs with microscrap/glfw-gfx for rendering. Use it when you want a desktop OpenGL window instead of (or in addition to) an embedded panel.
Requirements
- PHP 8.3+
- ext-glfw ^0.5.0 — php-io-extensions/glfw
microscrap/glfw-gfx^0.6.0
(pulls inmicroscrap/glfw)- ScrapyardIO Framework 0.6 (
fabricate/displays, …)
Installation
Confirm the extension is loaded:
php -m | grep glfw
From GLFW GFX (recommended)
If the app already has microscrap/glfw-gfx:
workshop install:glfw-display
That requires this package and runs workshop config:glfw-display afterward. The install command is hidden once this package is already listed in the app’s composer.json.
Via Composer
composer require dept-of-scrapyard-robotics/glfw-display php workshop package:discover php workshop config:glfw-display
Package discovery registers DeptOfScrapyardRobotics\Displays\GLFW\Providers\GLFWDisplayServiceProvider.
Workshop configuration command
workshop config:glfw-display workshop config:glfw-display --force
Adds a default entry under config/displays.php → windowed.glfw:
'windowed' => [ 'glfw' => [ 'width' => 1024, 'height' => 768, 'title' => env('APP_NAME'), 'boot_now' => true, ], ],
The command is hidden when config('displays.windowed.glfw') already exists. Pass --force to overwrite that block.
When finished, it asks whether to run config:main-display and pre-selects glfw.
Point main at the window (optional)
To make GLFW the primary display:
// config/displays.php 'main' => [ 'type' => 'windowed', 'driver' => 'glfw', 'renderer' => 'glfw', 'buffer' => 'glfw-ogl', ],
And ensure config/gfx.php can resolve the GLFW engine:
'rendering' => [ 'default' => 'glfw', 'engines' => [ 'glfw' => [], ], ],
workshop install:gfx --glfw --default=glfw --force can set both of those for you when installing GFX.
What it registers
| Display driver key | Class |
|---|---|
glfw |
DeptOfScrapyardRobotics\Displays\GLFW\GLFWWindow |
GLFWWindow implements Fabricate’s software panel / boot sequence contracts and expects the GLFW GFX renderer / glfw-ogl framebuffer.
Fresh Scrapyard checklist
# 1. Extension php -m | grep glfw # 2. Rendering workshop install:gfx --glfw --default=glfw # 3. Windowed display (if not pulled in already) workshop install:glfw-display # 4. Confirm config workshop config:show displays.windowed.glfw workshop config:show gfx.rendering.default
Stack overview
ext-glfw
└── microscrap/glfw
└── microscrap/glfw-gfx
└── dept-of-scrapyard-robotics/glfw-display ← this package
License
MIT