Download the PHP package microscrap/glfw without Composer

On this page you can find all versions of the php package microscrap/glfw. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package glfw

microscrap/glfw — LibGLFW bindings for PHP

Docs (production): ScrapyardIO · microscrap/glfw 0.7.x

Docs Requires ext-glfw

PHP library that wraps the glfw extension with global helpers, enums, and data objects. Every helper delegates to a static wrapper class under Microscrap\Bindings\GLFW.

The package covers the entire extension surface (124 GLFWAPI methods + a small OpenGL convenience set across 8 extension classes): init, error, windows, monitors, input/joysticks/gamepads, context, Vulkan, and minimal GL clear/viewport helpers for visual proofs.

Ecosystem docs: 0.7.x. For OpenGL draw APIs prefer microscrap/open-gl; tubes OpenGL deferred buffers live in microscrap/ogx.

Highlights

Requirements

Installation

Confirm ext-glfw is loaded:

Composer autoloads all helper files in src/Helpers/, registering the global glfw* / gl* functions when the package is installed. Helpers are only defined if the name is not already taken (function_exists guard).

The two calling styles

C-ish — global functions with exact GLFW C names:

OO-ish — static wrapper classes, same behavior:

Helpers never touch the extension directly; they delegate one-to-one to the wrapper classes, which are the only layer calling Glfw\GLFW\*. Both styles accept and return the same data objects, and every flag/enum parameter takes EnumType|int.

Name transforms

macOS note: data objects are named GlfwWindow / GlfwMonitor / GlfwCursor (not GLFWwindow) so they do not collide with the extension classes GLFWWindow / GLFWMonitor on case-insensitive filesystems.

Wrapper classes

Class Wraps Methods Subsystem
Init Glfw\GLFW\GLFW 10 init/terminate, version, platform, error callback
Error GLFWError 1 glfwGetError
Window Window\GLFWWindow 47 windows, hints, attributes, event loop
Monitor Monitor\GLFWMonitor 15 monitors, video modes, gamma
Input Input\GLFWInput 40 keys, mouse, cursors, joystick/gamepad, clipboard, time
Context Context\GLFWContext 6 make current, swap, proc address
Vulkan Vulkan\GLFWVulkan 5 Vulkan support + surface
GL GL\GLFWGL 8 minimal OpenGL for visual demos

Data objects live under Microscrap\Bindings\GLFW\DataObjects. Enums live under Microscrap\Bindings\GLFW\Enums (case names match the C macros exactly; TrueFalse holds GLFW_TRUE / GLFW_FALSE because Bool is reserved in PHP).

Examples

Hidden window (init smoke)

OpenGL clear (needs a display)

Error handling

Nothing in src/ throws. The package keeps GLFW's C conventions:

Note: the underlying extension itself may throw RuntimeException from a handful of calls (e.g. failed glfwCreateWindow). Those propagate as-is.

Testing

License

MIT. See LICENSE.


All versions of glfw with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
ext-glfw Version ^0.5.0|^0.7.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package microscrap/glfw contains the following files

Loading the files please wait ...