PHPackages                             serafim/opengl-demo - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. serafim/opengl-demo

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

serafim/opengl-demo
===================

Simple PHP Game Demo (using OpenGL/DX/Vulkan over SDL)

0.0.1(3y ago)167012[1 PRs](https://github.com/SerafimArts/opengl-demo/pulls)MITPHP

Since Aug 27Pushed 2y ago8 watchersCompare

[ Source](https://github.com/SerafimArts/opengl-demo)[ Packagist](https://packagist.org/packages/serafim/opengl-demo)[ RSS](/packages/serafim-opengl-demo/feed)WikiDiscussions master Synced today

READMEChangelog (1)Dependencies (20)Versions (4)Used By (0)

PHP OpenGL (SDL) Demo
=====================

[](#php-opengl-sdl-demo)

 [![PHP 8.1+](https://camo.githubusercontent.com/a37f41e7152892d60c130c3abf09a0edf1205e52d6e6ee5fc22d7c076cd8c009/68747470733a2f2f706f7365722e707567782e6f72672f7365726166696d2f6f70656e676c2d64656d6f2f726571756972652f7068703f7374796c653d666f722d7468652d6261646765)](https://packagist.org/packages/serafim/opengl-demo) [![Latest Stable Version](https://camo.githubusercontent.com/b02a2d1f5ba91e2c6dc53b09b9a2524aa5a0914d3f78fe0f05802e7e0978bf7f/68747470733a2f2f706f7365722e707567782e6f72672f7365726166696d2f6f70656e676c2d64656d6f2f76657273696f6e3f7374796c653d666f722d7468652d6261646765)](https://packagist.org/packages/serafim/opengl-demo) [![Latest Unstable Version](https://camo.githubusercontent.com/fbd0b22e8bfc5d50ada44c051da88a0f2673f237cc3168407724456d2f44a074/68747470733a2f2f706f7365722e707567782e6f72672f7365726166696d2f6f70656e676c2d64656d6f2f762f756e737461626c653f7374796c653d666f722d7468652d6261646765)](https://packagist.org/packages/serafim/opengl-demo) [![License MIT](https://camo.githubusercontent.com/dbdd77816e3babbd88d4633446c335bb61810b85474d6a94d2555f90817b04f1/68747470733a2f2f706f7365722e707567782e6f72672f7365726166696d2f6f70656e676c2d64656d6f2f6c6963656e73653f7374796c653d666f722d7468652d6261646765)](https://raw.githubusercontent.com/serafim/opengl-demo/master/LICENSE.md)

 [![](https://github.com/SerafimArts/opengl-demo/workflows/build/badge.svg)](https://github.com/SerafimArts/opengl-demo/actions)

Please note that this is only a demo and may contain non-optimal, crazy and completely unbelievable programming techniques (Well, besides the fact that this code is written by a PHP 🐒 developer who has never encountered game development).

If your psyche was injured please consult a doctor.

Peace &lt;3

---

Oh yes, according to my information, nobody has ever done such things in **pure PHP**.

[![](https://camo.githubusercontent.com/ef91fd7924223e84bd5e877c96e27ed238847f398a39210ddee70538164294f2/68747470733a2f2f686162726173746f726167652e6f72672f776562742f78642f38752f646e2f78643875646e636a64627973626a3464676c61686a386b66697a772e706e67)](https://camo.githubusercontent.com/ef91fd7924223e84bd5e877c96e27ed238847f398a39210ddee70538164294f2/68747470733a2f2f686162726173746f726167652e6f72672f776562742f78642f38752f646e2f78643875646e636a64627973626a3464676c61686a386b66697a772e706e67)

Demo in action:

Requirements
------------

[](#requirements)

- PHP 8.1+
- ext-ffi
- [Composer](https://getcomposer.org/download/)
- Windows, Linux or Unix (over X11 and Wayland), MacOS

### Additional Requirements (MacOS and Linux only)

[](#additional-requirements-macos-and-linux-only)

- SDL 2.0+
- SDL Image 2.0+
- SDL TTF 2.0+

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

[](#installation)

### Windows

[](#windows)

- `composer install`
- `php app.php`

### Linux

[](#linux)

- `sudo apt install libsdl2-2.0-0 -y`
- `sudo apt install libsdl2-image-2.0-0 -y`
- `sudo apt install libsdl2-ttf-2.0-0 -y`
- `composer install`
- `php app.php`

### MacOS

[](#macos)

- `brew install sdl2`
- `brew install sdl2_image`
- `brew install sdl2_ttf`
- `composer install`
- `php app.php`

### Docker

[](#docker)

- `docker run -it -v /tmp/.X11-unix:/tmp/.X11-unix -e DISPLAY=$DISPLAY -e XAUTHORITY=$XAUTHORITY $(docker build -q .)`

General Information
-------------------

[](#general-information)

- The "`./engine/`" directory contains deprecated code that will be removed in the future (for now it is required for the demo to work). All actual code is currently contained in the `./libs/` directory and some part of the old code has already been replaced with the current one.
- It is planned to move away from separate installation of binaries (SDL, SDL Image, etc...) and ship them together with the application. The `./libs/binaries-downloader` package is responsible for their installation. Assemblies are available here in the "assets" section here:
- It is planned to move away from SDL support and switch to native OpenGL API (This is one of the reasons why MacOS can disappear from the list of available operating systems), and then Vulkan API.
- After rewriting the graphics pipeline, it is planned to add a sound/audio engine (fuck knows how to do it).

###  Health Score

25

—

LowBetter than 35% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community20

Small or concentrated contributor base

Maturity39

Early-stage or recently created project

 Bus Factor1

Top contributor holds 89.6% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

1406d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/150420?v=4)[Ruslan Sharipov](/maintainers/Serafim)[@serafim](https://github.com/serafim)

---

Top Contributors

[![SerafimArts](https://avatars.githubusercontent.com/u/2461257?v=4)](https://github.com/SerafimArts "SerafimArts (60 commits)")[![bobimicroweber](https://avatars.githubusercontent.com/u/50577633?v=4)](https://github.com/bobimicroweber "bobimicroweber (3 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (1 commits)")[![GhostWalkers](https://avatars.githubusercontent.com/u/100309290?v=4)](https://github.com/GhostWalkers "GhostWalkers (1 commits)")[![PurHur](https://avatars.githubusercontent.com/u/5864315?v=4)](https://github.com/PurHur "PurHur (1 commits)")[![xslackx](https://avatars.githubusercontent.com/u/4943632?v=4)](https://github.com/xslackx "xslackx (1 commits)")

---

Tags

openglphpsdl2

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Type Coverage Yes

### Embed Badge

![Health badge](/badges/serafim-opengl-demo/health.svg)

```
[![Health](https://phpackages.com/badges/serafim-opengl-demo/health.svg)](https://phpackages.com/packages/serafim-opengl-demo)
```

###  Alternatives

[tempest/framework

The PHP framework that gets out of your way.

2.2k34.4k15](/packages/tempest-framework)[laravel/framework

The Laravel Framework.

34.8k543.8M20.1k](/packages/laravel-framework)[matomo/matomo

Matomo is the leading Free/Libre open analytics platform

21.7k38.9k](/packages/matomo-matomo)[pimcore/pimcore

Content &amp; Product Management Framework (CMS/PIM/E-Commerce)

3.8k3.8M508](/packages/pimcore-pimcore)[shopware/platform

The Shopware e-commerce core

3.4k1.5M3](/packages/shopware-platform)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

585.6M574](/packages/shopware-core)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
