This is a C headers of the OpenGL adopted for PHP.
- PHP >= 8.1
Library is available as composer repository and can be installed using the following command in a root of your project.
$ composer require ffi-headers/opengl-headers
use FFI\Headers\OpenGL;
use FFI\Headers\OpenGL\Extension;
$gl = OpenGL::create(
coreProfile: false, // Core Profile vs Compat
platform: OpenGL\Platform::GLX, // GLX (Unix/Linux) or WGL (Windows)
extensions: [ // List of additional extensions
Extension::GL_EXT_TEXTURE_COMPRESSION_DXT1,
],
);
echo $gl;