Releases: mario-deluna/php-glfw
Release list
v2.4.0
Features
Draw Call Assembler
A new native rendering component (GL\Rendering\DrawCallAssembler) between your scene and OpenGL. Submit per-object draw requests (mesh + transform + material); it handles frustum culling, LOD selection, sorting, and instanced batching in C, then draws for you or hands back GPU-ready buffers - built to push millions of instances per frame.
The 09_drawcall_assembler.php example renders a 10,000,000-instance asteroid field with live camera culling. On my MacBook M1:
octree | submitted 10000000, visible 35 (100.0% culled), draw calls: 28, avg execute: 2.129ms, avg frame: 8.558ms (116.9 FPS)
- Mesh registry & instancing - register a VAO once, then
submit()transforms against its handle. Adjacent draws sharing mesh/material/pass/program auto-collapse into a single instanced call (indexed or array draws). - Culling -
CULL_NONE,CULL_LINEAR(per-instance frustum test), orCULL_OCTREE(persistent tree reused across frames, ideal for large static scenes). Frustum derived fromsetCameraData()or set manually. - LOD - per-mesh distance tables via
setLodTable(), with per-instance caching. - Sorting - front-to-back / back-to-front / per-pass, using packed 64-bit keys and an adaptive radix/quicksort/insertion sort to minimize state changes.
- Two render paths -
execute(callback)draws for you (owns the transform VBO internally), orbuild()fills GPU-ready buffers for your own loop. - Per-instance payload - attach arbitrary per-instance float data that travels through culling and sorting (
bindPayloadData()/bindPayloadBuffer()). - Stats -
instanceCount(),builtInstanceCount(),commandCount()for cull rate and draw-call counts.
SVG parsing & rendering
Parse SVG documents and draw them straight into the NanoVG vector-graphics context as real vector paths - no rasterization step.
- Parse from anywhere -
SVGImage::fromDisk()loads a.svgfile;SVGImage::fromString()parses in-memory markup. Parsed images are reusable and expose their nativewidth/height. - Vector rendering -
VGContext::drawSVG($svg, $x, $y, $w, $h)renders the paths into the current frame; omit$w/$hto draw at native size, or pass them to scale to fit. - Fills, strokes & masks - solid fills and strokes are rendered, and alpha masks (
mask="url(#id)")are honoured as a 1-bit hard-edged clip. Gradient paints are skipped for now.
HDR texture support
GL\Texture\Texture2D now handles High Dynamic Range images end to end. LDR images continue to load into a UByteBuffer; HDR images load into a FloatBuffer so pixel values are preserved beyond the 0–1 range.
- Automatic detection -
Texture2D::fromDisk()detects.hdrfiles and loads them into aFloatBufferautomatically; useisHDR()to tell which buffer type you got. - Load from memory -
Texture2D::fromBufferHDR()builds an HDR texture directly from a floatFloatBuffer. - Write to disk -
writeHDR()exports HDR textures to.hdr.
What's Changed
- PHP 8.5 Compatibility by @hmennen90 in #40
- Drawcall assembler by @mario-deluna in #39
New Contributors
- @hmennen90 made their first contribution in #40
Full Changelog: v2.3.0...v2.4.0
v2.3.0 Audio Support!
What's Changed
- We now officially support PHP 8.4.
- We now support Audio!
- We now support
glDrawElementsfor element based rendering. - You can now upload buffers of all types to the GPU.
- We have added an experimental .vox (MagicaVoxel) file parser.
Audio Support
You can now manage and play audio / sounds inside your php-glfw context.
- Master and per sound volume control
- Pitch control
- Panning support
- Raw data extraction
- Seeking support
- 3D Audio support, sounds can have a position and velocity in 3D space
- Volume fade support
Example Code
Basic usage of the sound engine is incredibly simple.
// start an audio engine
$audioEngine = new \GL\Audio\Engine();
// load piece of sound from disk
$music = $audioEngine->soundFromDisk(__DIR__ . '/my_music.mp3');
// play the music
$music->play();Quick Demo Video:
audio-support-glfw.mp4
Voxel file support (Experimental)
We now support reading MagicaVoxel .vox files, to easily import and render voxel models.
This is very experimental and still subject to change.
PR's
- Audio Support by @mario-deluna in #37
Full Changelog: v2.2.1...v2.3.0
v2.2.1
What's Changed
- We now officially support PHP 8.3.
- You can now install php-glfw via
pieon linux and macOS. Windows will follow.
Gamepad and Joystick Support
- New GLFW Functions Implemented:
glfwGetJoystickAxesglfwGetJoystickButtonsglfwGetGamepadAxesglfwGetGamepadButtons
- Examples:
- Joystick Input Example: Demonstrates accessing joystick/gamepad input.
- Asteroids Game Example: A simple game showcasing the vector graphics library with gamepad support.
Video Mode Functions
- New GLFW Functions Implemented:
glfwGetVideoModesglfwGetVideoMode
- Features:
- Retrieve available video modes for monitors.
- Access current video mode settings.
New Examples Added
- Joystick Input:
examples/vg/input_joystick.php - Asteroids Game:
examples/vg/fun_asteroids.php - Video Modes Display:
examples/vg/videomodes.php
GLFW Functionality Enhancements
- Nullable Parameters:
glfwSetWindowMonitornow accepts a nullablemonitorparameter, allowing the function to set a window to windowed mode by passingNULL.
Fixes
NanoVG Library Update
- Texture Wrapping Fix:
- Vector Graphics API images changed
GL_CLAMP_TO_EDGEtoGL_CLAMP_TO_BORDER, addressing potential texture wrapping issues.
- Vector Graphics API images changed
PRs
- Gamepad & Joystick Support by @mario-deluna in #34
Full Changelog: v2.2.0...v2.2.1
Windows DLL
You can find the windows dll files attached to the release:
- PHP 8.x Thread Safe x64
glfw_php8.x_ts_x64.zip - PHP 8.x Non Thread Safe x64
glfw_php8.x_nts_x64.zip
v2.2.0
What's Changed
Version 2.2 of PHP-GLFW brings a ton of new and major features. The library remains fully backward compatible with version 2.1, which is why this is not a major release.
Vector Graphics API
Version 2.2 introduces the Vector Graphics API, an HTML5 Canvas-inspired rendering API that simplifies the process of rendering shapes and elements on the screen. This API utilizes OpenGL under the hood, allowing you to combine the raw power of OpenGL with the simplicity of the VG API.
With the PHP-GLFW Vector Graphics API, you can:
- Render simple shapes, such as rectangles, circles, paths, etc.
- Render text from font files efficiently and effortlessly.
- Render gradients and images.
- Create GUIs.
- And much more.
Please see the documentation here: https://phpgl.net/user-guide/vector-graphics/creating_a_vgcontext.html
Statically Compiled Binaries
In this version, we also introduce statically compiled PHP binaries that already include the PHP-GLFW extension, making it easy to ship native applications using PHP-GLFW.
This is currently only supported on macOS. On Windows, the DLL and EXE files are already quite portable.
You will find these directly attached to the release, for example php-8.2-glfw-cli-macos-arm64.zip.
Noise Functions
Generating noise can be quite computationally intensive, making it difficult and inefficient to implement directly in PHP. This is why PHP-GLFW now includes a collection of noise functions for common use cases.
You can also directly fill a buffer with noise, enabling real-time procedural effects from PHP.
Documentation about the noise: https://phpgl.net/user-guide/noise/noise_functions.html
Other Notable Changes:
- Added support for PHP 8.3.
- Buffers, Vec, Mat4, and Color Objects can now be serialized.
- Added the ability to retrieve textures from the GPU.
- Added the ability to create texture objects from buffers.
- Added
quantizeToUChar, allowing float buffers to be easily quantized. - You can now push strings into
UByteBuffers. - Texture Objects can now be saved to disk as
jpg,png,bmp, andtga. - Major improvements to the styling of the documentation page, enhancing readability.
- We have a new logo 🎉
PRs
- Static CLI Build by @mario-deluna in #17
- Vector Graphics Support (HTML Canvas-like API) by @mario-deluna in #22
- VG Color Improvements by @mario-deluna in #28
- Noise Functions by @mario-deluna in #31
Full Changelog: v2.1.3...v2.2.0
Windows DLL
You can find the windows dll files attached to the release:
- PHP 8.x Thread Safe x64
glfw_php8.x_ts_x64.zip - PHP 8.x Non Thread Safe x64
glfw_php8.x_nts_x64.zip
v2.1.3
Changes
- Updated documentation.
- Updated the linux and macOS .m4 autoconf to properly include vendor dependencies when compiled inline.
Full Changelog: v2.1.2...v2.1.3
Windows DLL
You can find the windows dll files attached to the release:
- PHP 8.0 Thread Safe x64
glfw_php8.0_ts_x64.zip - PHP 8.1 Thread Safe x64
glfw_php8.1_ts_x64.zip - PHP 8.2 Thread Safe x64
glfw_php8.2_ts_x64.zip
- PHP 8.0 Non Thread Safe x64
glfw_php8.0_nts_x64.zip - PHP 8.1 Non Thread Safe x64
glfw_php8.1_nts_x64.zip - PHP 8.2 Non Thread Safe x64
glfw_php8.2_nts_x64.zip
v2.1.2
Changes
- Updated documentation.
- Added support for float buffers with GlReadPixels.
- Added basic serialization of math objects.
- Added support for vec3 * mat4 multiplication.
- Added support for vec4 * mat4 multiplication.
Full Changelog: v2.1.1...v2.1.2
Windows DLL
You can find the windows dll files attached to the release:
- PHP 8.0 Thread Safe x64
glfw_php8.0_ts_x64.zip - PHP 8.1 Thread Safe x64
glfw_php8.1_ts_x64.zip - PHP 8.2 Thread Safe x64
glfw_php8.2_ts_x64.zip
- PHP 8.0 Non Thread Safe x64
glfw_php8.0_nts_x64.zip - PHP 8.1 Non Thread Safe x64
glfw_php8.1_nts_x64.zip - PHP 8.2 Non Thread Safe x64
glfw_php8.2_nts_x64.zip
v2.1.1
In this release:
- Added a few more utility functions to the quaternion math object.
- Quat can now be multiplied with Vec3 and Mat4.
- Added
glDrawBufferssupport. - Added
glReadPixelssupport. - Added AABB generator for mesh loading, in obj loader.
Full Changelog: v2.1.0...v2.1.1
Windows DLL
You can find the windows dll files attached to the release:
- PHP 8.0 Thread Safe x64
glfw_php8.0_ts_x64.zip - PHP 8.1 Thread Safe x64
glfw_php8.1_ts_x64.zip - PHP 8.2 Thread Safe x64
glfw_php8.2_ts_x64.zip
- PHP 8.0 Non Thread Safe x64
glfw_php8.0_nts_x64.zip - PHP 8.1 Non Thread Safe x64
glfw_php8.1_nts_x64.zip - PHP 8.2 Non Thread Safe x64
glfw_php8.2_nts_x64.zip
v2.1.0
- This release mostly introduces a few small breaking naming changes around the math functions to be more consistent.
- Also this release introduces a built-in quaternion object.
- Support for PHP8.2
Full Changelog: v2.0.0...v2.1.0
Windows DLL
You can find the windows dll files attached to the release:
-
PHP 8.0 Thread Safe x64
glfw_php8.0_ts_x64_dll.zip -
PHP 8.1 Thread Safe x64
glfw_php8.1_ts_x64_dll.zip -
PHP 8.0 Non Thread Safe x64
glfw_php8.0_nts_x64_dll.zip -
PHP 8.1 Non Thread Safe x64
glfw_php8.1_nts_x64_dll.zip
v2.0.0
Full Changelog: https://github.com/mario-deluna/php-glfw/commits/v2.0.0
Windows DLL
You can find the windows dll files attached to the release:
-
PHP 8.0 Thread Safe x64
glfw_php8.0_ts_x64_dll.zip -
PHP 8.1 Thread Safe x64
glfw_php8.1_ts_x64_dll.zip -
PHP 8.0 Non Thread Safe x64
glfw_php8.0_nts_x64_dll.zip -
PHP 8.1 Non Thread Safe x64
glfw_php8.1_nts_x64_dll.zip


