An open API service indexing awesome lists of open source software.

https://github.com/ponup/php-opengl

PHP-OpenGL source code
https://github.com/ponup/php-opengl

opengl php

Last synced: 7 days ago
JSON representation

PHP-OpenGL source code

Awesome Lists containing this project

README

        

[![Build and test](https://github.com/Ponup/php-opengl/actions/workflows/build-test.yml/badge.svg)](https://github.com/Ponup/php-opengl/actions/workflows/build-test.yml)

# PHP-OpenGL

PHP bindings of the OpenGL library. This library allows you to create inmersive 3D applications and games for the desktop with the comfort of the PHP language.

The extension only supports modern OpenGL and the core profile. The OpenGL compatibility profile (which provides functions such as glRotate, glBegin, glLight, etc...) is not supported.

[](opengl-camera-demo.gif)

## Requirements

- PHP8.1
- [SDL extension for PHP](https://github.com/Ponup/php-sdl)
- OpenGL library/framework
- Linux/MacOS (Windows support coming soon)
- The PHP GD extension is required to run some of the examples.

## Installation

### Linux

```bash
pecl install opengl-devel
```

Or

```bash
git clone [email protected]:Ponup/php-opengl.git --recursive phpopengl
cd php-opengl
phpize
./configure --with-opengl
make
sudo make install
```

## Examples

```php
type == SDL_KEYDOWN) break;
SDL_Delay(50);
}

SDL_DestroyWindow($window);
```

Complete examples can be found in the [examples](examples) folder.