GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - Ponup/php-sdl: SDL2 bindings for the PHP language

BranchesTags
Open more actions menu

Latest commit

 

History

331 Commits
331 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
examples
examples
 
 
src
src
 
 
tests
tests
 
 
.dockerignore
.dockerignore
 
 
.gitattributes
.gitattributes
 
 
.gitignore
.gitignore
 
 
CREDITS
CREDITS
 
 
Dockerfile
Dockerfile
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
check-files-are-in-package-xml.sh
check-files-are-in-package-xml.sh
 
 
config.m4
config.m4
 
 
config.w32
config.w32
 
 
docker-entrypoint.sh
docker-entrypoint.sh
 
 
input-handling-example.gif
input-handling-example.gif
 
 
package.xml
package.xml
 
 

Repository files navigation

Build and test

PHP-SDL

SDL (Simple DirectMedia Layer) bindings for the PHP language. The extension allows you to create multimedia desktop applications with windows, input handling, events, and more.

Installation

Requirements

  • C compiler
  • Automake tools
  • PHP8.1 devel
  • libSDL2 devel libraries and headers
  • UN*X OS (eg Linux, Macos)

Via PECL

pecl install sdl-beta

Then add

extension=sdl.so

to your php.ini file.

If you have no idea about your ini file position you can run php -i | grep ini and see the list of you ini files.

Documentation

The SDL extension mimics in almost every single aspect to the official C library, so until we write our own documentation, refer to the C counterpart.

Examples

Standard SDL2 API is available in procedural style:

$window = SDL_CreateWindow( "Foo window", 500, 50, 350, 300, SDL_WINDOW_SHOWN+SDL_WINDOW_RESIZABLE);
SDL_SetWindowTitle($window, "Some new title");
SDL_DestroyWindow($window);

Complete examples can be found in the examples folder.

Related projects

  • PHP-SDL_TTF
  • PHP-SDL_Mixer
  • PHP-SDL_Image
  • PHP-OpenGL
  • PHP-OpenAL

Projects using the extension

  • CubeCraft
  • Conway's game of life
  • PhpOkoban
  • Inphpinity
  • PhPresent

Building

To compile your new extension, you will have to execute the following steps:

phpize
./configure [--with--sdl] 
make
make test
sudo make install

About

SDL2 bindings for the PHP language

pecl.php.net/package/sdl

Topics

chacktoberfestphpsdl

Resources

Readme
MIT license
Activity
Custom properties

Stars

121 stars

Watchers

10 watching

Forks

23 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.