serafim/opengl-demo
Composer 安装命令:
composer require serafim/opengl-demo
包简介
Simple PHP Game Demo (using OpenGL/DX/Vulkan over SDL)
README 文档
README
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 <3
Oh yes, according to my information, nobody has ever done such things in pure PHP.
Demo in action: https://www.youtube.com/watch?v=vsBbJbhKeeU
Requirements
- PHP 8.1+
- ext-ffi
- Composer
- Windows, Linux or Unix (over X11 and Wayland), MacOS
Additional Requirements (MacOS and Linux only)
- SDL 2.0+
- SDL Image 2.0+
- SDL TTF 2.0+
Installation
Windows
composer installphp app.php
Linux
sudo apt install libsdl2-2.0-0 -ysudo apt install libsdl2-image-2.0-0 -ysudo apt install libsdl2-ttf-2.0-0 -ycomposer installphp app.php
MacOS
brew install sdl2brew install sdl2_imagebrew install sdl2_ttfcomposer installphp app.php
Docker
docker run -it -v /tmp/.X11-unix:/tmp/.X11-unix -e DISPLAY=$DISPLAY -e XAUTHORITY=$XAUTHORITY $(docker build -q .)
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-downloaderpackage is responsible for their installation. Assemblies are available here in the "assets" section here: https://github.com/SerafimArts/opengl-demo/releases/tag/0.0.1 - 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).
serafim/opengl-demo 适用场景与选型建议
serafim/opengl-demo 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 0 次下载、GitHub Stars 达 167, 最近一次更新时间为 2022 年 10 月 24 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 serafim/opengl-demo 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 serafim/opengl-demo 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 167
- 点击次数: 18
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-10-24