Giter Site home page Giter Site logo

shish / php-sdl Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ponup/php-sdl

0.0 1.0 0.0 694 KB

SDL2 bindings for the PHP language

Home Page: https://pecl.php.net/package/sdl

License: MIT License

Shell 0.05% JavaScript 0.15% C 90.59% PHP 8.69% M4 0.39% Dockerfile 0.12%

php-sdl's Introduction

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

Projects using the extension

Building

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

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

php-sdl's People

Contributors

remicollet avatar santiagolizardo avatar kea avatar b-viguier avatar shish avatar t-geindre avatar zorobabel avatar sensorario avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.