Download the PHP package php-io-extensions/glfw without Composer
On this page you can find all versions of the php package php-io-extensions/glfw. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download php-io-extensions/glfw
More information about php-io-extensions/glfw
Files in php-io-extensions/glfw
Package glfw
Short Description PHP-Controllable GLFW Windowing Extension
License MIT
Informations about the package glfw
php-glfw
PHP extension for GLFW 3.4 — built with Zephir, installable via PHP PIE.
glfw exposes GLFW's init, window, monitor, input, context, and Vulkan APIs to
PHP 8.2+ as namespaced static classes under Glfw\GLFW\…. Methods mirror the C
API 1:1 and return values with the same semantics (opaque handles as int,
structs as arrays, PHP callables for GLFW callbacks).
This extension is the binding layer used by ScrapyardIO's Windowed Visual Output
stack (alongside php-io-extensions/sdl3). GLFW #define constants live in a
companion microscrap wrapper package, not in this extension.
Requirements
| Component | Minimum version | Notes |
|---|---|---|
| PHP | 8.2 | ZTS and NTS builds both supported. |
| GLFW | 3.4.0 | Must be discoverable via pkg-config glfw3 or the usual search paths. |
| OS | Linux / macOS | x86_64 + aarch64 Linux, Darwin. Windows is not currently supported. |
| Compiler | C11 toolchain | gcc, clang, or Apple Clang. |
php-dev / phpize |
matches PHP | Required for any build path that is not PIE. |
Installation
Via PHP PIE (recommended)
Platform installers
macOS (Homebrew):
Debian Trixie / Raspberry Pi OS (amd64, arm64):
JetPack 6 / Ubuntu 22.04:
Manual build with Zephir (maintainers)
scripts/prepare-ext.sh is what you run before committing / tagging for Packagist.
It rewrites ext/config.m4 to the portable form (pkg-config + OS OpenGL link) and
strips Makefile / configure / modules/ / *.lo so absolute host paths never ship.
Zephir 0.19 truncates
ZEPHIR_REGISTER_CLASSnames forglfw/glfw/...paths — the prepare script applies that fix automatically.
Quick start
Examples
API surface
| Class | Namespace | Coverage |
|---|---|---|
GLFW |
Glfw\GLFW |
init, terminate, version, platform, error callback |
GLFWError |
Glfw\GLFW |
glfwGetError → ["code","description"] |
GLFWMonitor |
Glfw\GLFW\Monitor |
monitors, video modes, gamma, monitor callback |
GLFWWindow |
Glfw\GLFW\Window |
windows, attributes, event loop, window callbacks |
GLFWInput |
Glfw\GLFW\Input |
keyboard/mouse/cursor/joystick/gamepad/clipboard/time |
GLFWContext |
Glfw\GLFW\Context |
OpenGL context + swap |
GLFWVulkan |
Glfw\GLFW\Vulkan |
Vulkan helpers |
All 124 GLFWAPI functions from GLFW 3.4 are bound.
Binding conventions
- Opaque handles (
GLFWwindow*,GLFWmonitor*,GLFWcursor*) →int - Out-parameters → associative arrays
GLFWvidmode→width/height/redBits/greenBits/blueBits/refreshRateGLFWimage→["width","height","pixels"](pixelsis binary RGBA string)- Callbacks accept
callable|null(nullclears) - Hard create failures throw
\RuntimeException
Version
0.7.1 — ecosystem docs line 0.7.x. IDE stubs under ide/0.7.1/. Input scalars: glfwGetCursorX / glfwGetCursorY / glfwGetGamepadButton / glfwGetGamepadAxis.
Published companion docs (human narrative) live on the ScrapyardIO ecosystem site for php-io-extensions / glfw when synced — prefer this repo’s .okf/ for agent-facing package knowledge.
License
MIT — see LICENSE.