PHPackages                             php-io-extensions/glfw - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. php-io-extensions/glfw

ActivePhp-ext

php-io-extensions/glfw
======================

PHP-Controllable GLFW Windowing Extension

0.7.1(2w ago)014↓75%MITPHP &gt;=8.2

Since Jul 16Compare

[ Source](https://github.com/php-io-extensions/glfw)[ Packagist](https://packagist.org/packages/php-io-extensions/glfw)[ RSS](/packages/php-io-extensions-glfw/feed)WikiDiscussions Synced 1w ago

READMEChangelogDependenciesVersions (6)Used By (0)

php-glfw
========

[](#php-glfw)

[![PHP](https://camo.githubusercontent.com/c43902a50e55ff766fc179e27d9b9a292ef8fcadbdd4d855bb077a334e2f9b46/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d254532253839254135253230382e322d3737376262343f6c6f676f3d706870266c6f676f436f6c6f723d7768697465)](https://www.php.net)[![GLFW](https://camo.githubusercontent.com/2aa18835b099ec67934ae38308626ee906f3c97cf5e375368bdf712b55ff2c9a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f474c46572d254532253839254135253230332e342e302d353538366134)](https://www.glfw.org/)[![Built with Zephir](https://camo.githubusercontent.com/8e72a9e9874ec036e66f84af12bd028857d1f200674b7acaa9eb97271a123f7c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6275696c74253230776974682d5a65706869722d666636613030)](https://zephir-lang.com/)[![Platform](https://camo.githubusercontent.com/37c663164df6eec24d0327668403be1782ab3245cf57963be37d9b6873a823a8/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f706c6174666f726d2d6c696e75782532302537432532306d61634f532d6c6967687467726579)](#requirements)[![License: MIT](https://camo.githubusercontent.com/f8df3091bbe1149f398a5369b2c39e896766f9f6efba3477c63e9b4aa940ef14/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d677265656e)](#license)

> PHP extension for GLFW 3.4 — built with [Zephir](https://zephir-lang.com/), installable via [PHP PIE](https://github.com/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
------------

[](#requirements)

ComponentMinimum versionNotesPHP8.2ZTS and NTS builds both supported.GLFW3.4.0Must be discoverable via `pkg-config glfw3` or the usual search paths.OSLinux / macOSx86\_64 + aarch64 Linux, Darwin. Windows is not currently supported.CompilerC11 toolchain`gcc`, `clang`, or Apple Clang.`php-dev` / `phpize`matches PHPRequired for any build path that is not PIE.---

Installation
------------

[](#installation)

### Via PHP PIE (recommended)

[](#via-php-pie-recommended)

```
pie install php-io-extensions/glfw
```

### Platform installers

[](#platform-installers)

**macOS** (Homebrew):

```
bash install-macos.sh
```

**Debian Trixie / Raspberry Pi OS** (amd64, arm64):

```
bash install-debian-trixie.sh
```

**JetPack 6 / Ubuntu 22.04**:

```
bash install-jetpack6.sh
```

### Manual build with Zephir (maintainers)

[](#manual-build-with-zephir-maintainers)

```
export PKG_CONFIG_PATH="/opt/homebrew/lib/pkgconfig:/usr/local/lib/pkgconfig:${PKG_CONFIG_PATH:-}"
bash scripts/prepare-ext.sh   # generate + REGISTER fixup + portable config.m4 + strip phpize junk
cd ext && phpize && ./configure --enable-glfw && make
php -n -d extension=modules/glfw.so --ri glfw
```

`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_CLASS` names for `glfw/glfw/...` paths — the prepare script applies that fix automatically.

---

Quick start
-----------

[](#quick-start)

```
