Drive GLFW-powered Windows with PHP

Maintainers

Package info

github.com/DeptOfScrapyardRobotics/glfw-display

Homepage

pkg:composer/dept-of-scrapyard-robotics/glfw-display

Transparency log

Statistics

Installs: 3

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

0.6.2 2026-07-28 23:17 UTC

This package is auto-updated.

Last update: 2026-07-28 23:18:08 UTC


README

Latest Version on Packagist License

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

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.phpwindowed.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