2022-12-17 16:32:20 +08:00
< p align = "center" > < a href = "https://axmolengine.github.io/axmol" target = "_blank" rel = "noopener noreferrer" > < img width = "160" src = "docs/logo.png" alt = "axmol logo" > < / a > < / p >
2023-03-25 11:18:21 +08:00
# Axmol引擎
2020-11-15 17:56:03 +08:00
2023-03-25 08:37:51 +08:00
## A Multi-platform Engine for Desktop, XBOX (UWP) and Mobile games. (A radical fork of Cocos2d-x-4.0)
2022-10-01 16:24:52 +08:00
[![dev ](https://img.shields.io/github/v/release/axmolengine/axmol?include_prereleases&label=release )](https://github.com/axmolengine/axmol/releases)
[![LICENSE ](https://img.shields.io/badge/license-MIT-blue.svg )](https://github.com/axmolengine/axmol/blob/master/LICENSE)
[![Codacy Badge ](https://app.codacy.com/project/badge/Grade/81fa1aba09ab41a98b949064b928d06e )](https://www.codacy.com/gh/axmolengine/axmol/dashboard?utm_source=github.com& utm_medium=referral& utm_content=axmolengine/axmol& utm_campaign=Badge_Grade)
[![PRs Welcome ](https://img.shields.io/badge/PRs-welcome-blue.svg )](https://github.com/axmolengine/axmol/pulls)
2023-03-25 11:18:21 +08:00
**[English](README.md)**
2023-03-11 23:34:10 +08:00
## 支持平台列表
| Build | Status (github) |
|-------|-----------------|
| Windows Desktop|[![Win32 CI](https://github.com/axmolengine/axmol/actions/workflows/win32-ci.yml/badge.svg)](https://github.com/axmolengine/axmol/actions/workflows/win32-ci.yml)|
| Windows UWP|[![Win32 CI](https://github.com/axmolengine/axmol/actions/workflows/winuwp-ci.yml/badge.svg)](https://github.com/axmolengine/axmol/actions/workflows/winuwp-ci.yml)|
| Android | [![Android Build Status ](https://github.com/axmolengine/axmol/workflows/android/badge.svg )](https://github.com/axmolengine/axmol/actions?query=workflow%3Aandroid)|
| iOS |[![iOS Build Status](https://github.com/axmolengine/axmol/workflows/ios/badge.svg)](https://github.com/axmolengine/axmol/actions?query=workflow%3Aios)|
| tvOS |[![tvOS Build Status](https://github.com/axmolengine/axmol/workflows/tvos/badge.svg)](https://github.com/axmolengine/axmol/actions?query=workflow%3Atvos)|
| Linux |[![Linux Build Status](https://github.com/axmolengine/axmol/workflows/linux/badge.svg)](https://github.com/axmolengine/axmol/actions?query=workflow%3Alinux)|
| macOS |[![macOS Build Status](https://github.com/axmolengine/axmol/workflows/osx/badge.svg)](https://github.com/axmolengine/axmol/actions?query=workflow%3Aosx)|
2020-10-24 18:41:20 +08:00
2023-03-25 08:37:51 +08:00
## 基于VideoTexture的适配播放引擎
| Platform | MediaEngine/VideoTexture | Video Texture Format | MediaEngine Backend |
|-----------------|------------------------------|------------------------------|------------------------------|
| Windows Desktop | complete | YUY2, NV12, RGB32 | MS-Media: IMFMediaSession |
| Windows UWP | complete | BGR32 | MS-Media: IMFMediaEngine |
| Mac OS X | in progress | NV12, BGR32 | AVFoundation |
| iOS/tvOS | in progress | NV12, BGR32 | AVFoundation |
| Android | planned | RGB32 | |
2020-08-03 19:12:07 +08:00
2022-10-13 23:57:50 +08:00
### 关于预编译库
- 所有预编译库均通过[buildware](https://github.com/axmolengine/buildware)使用GitHub Actions自动构建
- 预编译库支持架构
- windows: x86,x64
- linux: x64
- macos: x64, arm64(M1芯片)
- android: armv7, arm64, x86, x64
- ios: arm64, x64
- tvos: arm64, x64
2020-08-04 16:48:47 +08:00
### 宗旨:
2022-10-13 23:57:50 +08:00
* C++17/20
* 专注C++
2020-08-04 16:48:47 +08:00
* Fix bugs ASAP
* Review PR ASAP
### 主要特性:
2023-03-11 23:08:08 +08:00
* Windows UWP 支持,请参考: https://github.com/axmolengine/axmol/pull/1108
2022-10-13 23:57:50 +08:00
* 增加tvos支持
2022-10-01 16:24:52 +08:00
* 增强Windows下工作流, 支持链接引擎预编译库, 用法请查看: [windows workflow guide ](https://github.com/axmolengine/axmol/issues/564 )
2022-02-24 17:57:08 +08:00
* Windows 视频播放支持
2021-08-27 12:45:03 +08:00
* Windows x64编译支持
2021-06-26 17:13:05 +08:00
* 基于yasio重构HttpClient以支持并发Http请求, 不再需要sendImmidate接口
2020-08-15 18:17:03 +08:00
* 重构AudioEngine, 全平台OpenAL
2022-02-17 17:11:17 +08:00
* [openal-soft ](https://github.com/kcat/openal-soft ), pass -DAX_USE_ALSOFT=ON to cmake to force enable it
* [OpenAL.framework ](https://opensource.apple.com/tarballs/OpenAL ), if no and ```AX_USE_ALSOFT``` option specified, cmake script will choose it on osx/ios, even through it was mark as deprecated, but still avaiable.
2020-08-04 16:48:47 +08:00
* 重构UserDefault, 全平台基于内存映射文件 [mio ](https://github.com/mandreyel/mio ), 性能提升百倍
* 模块化所有引擎扩展库, 所有扩展库放到extensions目录下, 如cocostudio, spine
* AudioEngine实现wav所有 ```openal-soft``` 支持的封装格式, 例如MS-ADPCM, ADPCM等
* 使用现代化的GL加载器glad代替glew
* 增加google angle渲染后端支持
2022-10-13 23:57:50 +08:00
* C++最低标准要求: C++17/20
2020-08-04 16:48:47 +08:00
* 设置ios下最低目标平台为ios9.0
* 使用更快的xml解析库pugixml代替tinyxml2
2021-07-17 16:14:16 +08:00
* Downloader全平台统一实现, 均基于curl
2020-08-04 16:48:47 +08:00
* 全平台统一使用XML SAX解析plist文件, 移除Apple平台的实现
2020-08-05 18:11:52 +08:00
* Spine 3.8支持
2020-08-05 18:45:21 +08:00
* 新增FairyGUI支持
2020-09-08 15:53:56 +08:00
* 新增硬件压缩纹理格式ASTC 4x4/6x6/8x8支持, 支持软解
2020-08-31 15:56:50 +08:00
* 新增硬件压缩纹理格式ETC2 RGB/RGBA支持, 支持软解
2022-02-26 14:33:48 +08:00
* **ImGui集成, 非常方便写游戏内嵌小工具, 用法详见[ImGui](extensions/ImGui/README.md)**
2022-02-24 17:57:08 +08:00
* 完整改动列表,请查看[CHANGELOG](CHANGELOG)
2020-08-04 16:48:47 +08:00
2020-08-03 19:12:07 +08:00
### 快速开始
2020-08-05 18:31:24 +08:00
#### 必要工具 [python](https://www.python.org/downloads/)
2023-02-13 17:52:05 +08:00
* python-3.7+
2020-08-05 18:31:24 +08:00
2020-10-22 16:58:56 +08:00
#### 准备步骤
2022-10-01 16:24:52 +08:00
1. 进入引擎```axmol```根目录
2020-10-22 16:53:28 +08:00
3. 执行```python setup.py```后重启控制台
2020-08-03 19:12:07 +08:00
#### Windows
2022-10-13 23:57:50 +08:00
1. 安装CMake, 要求3.22以上
2. 确保 Visual Studio 2019/2022 已正确安装
2020-08-03 19:12:07 +08:00
3. 执行下面的命令
2023-03-14 08:24:27 +08:00
- PC: ```cmake -S . -B build -G "Visual Studio 16 2019"```
- UWP: ```cmake -S . -B build -G "Visual Studio 17 2022" -A x64 -DCMAKE_SYSTEM_NAME=WindowsStore "-DCMAKE_SYSTEM_VERSION=10.0" "-DAX_VS_DEPLOYMENT_TARGET=10.0.17763.0"```
2022-10-01 16:24:52 +08:00
4. 之后就可以用vs打开```axmol/build/axmol.sln```启动cpp-tests等测试工程了
2020-08-03 19:12:07 +08:00
#### Android
2022-01-28 12:47:05 +08:00
1. 安装 Android Studio 2021.1.1+
2020-08-06 15:45:59 +08:00
2. 第一次启动Android Studio, 会引导安装一些工具,默认安装即可,如果不需要模拟器可以把```Virutal Device```勾选去掉
2022-10-01 16:24:52 +08:00
2. 启动 Android Studio并打开axmol\tests\cpp-tests\proj.android
2020-08-10 15:04:12 +08:00
3. 通过 [Tools][SdkManagers] 打开sdk管理工具, 选择如下SDK Platforms和SDK Tools后, 点击按钮 ```Apply``` 一路跟着引导安装即可:
2022-08-06 19:47:45 +08:00
* Android SDK Platform 33 (在SDK Platforms页签)
2022-08-06 20:05:12 +08:00
* Android Gradle Plugin (AGP) 7.2.2
2022-08-06 19:47:45 +08:00
* Android SDK Build-Tools 30.0.3 和 AGP 版本对应
* Gradle 7.4.2
2022-06-11 16:16:47 +08:00
* NDK r23c+
2022-08-06 19:47:45 +08:00
* CMake 3.22.1+
2020-08-03 19:12:07 +08:00
2020-08-06 15:45:59 +08:00
5. 等待Gradle sync完成后, Build APKs, 安装运行
2021-05-18 20:23:43 +08:00
6. 如果使用非sdk自动安装的CMake版本, 需要下载[ninja](https://github.com/ninja-build/ninja/releases), 并且拷贝```ninja.exe```到CMake的bin目录
2020-08-03 19:12:07 +08:00
#### iOS
2022-06-13 20:12:14 +08:00
1. 确保已安装xcode12+和[cmake3.21+](https://github.com/Kitware/CMake/releases), 安装CMake命令行支持: ```sudo "/Applications/CMake.app/Contents/bin/cmake-gui" --install```
2020-08-27 12:51:35 +08:00
2. 执行如下命令确保cmake能成功生成xcode工程:
2020-08-03 19:12:07 +08:00
```sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer```
2022-10-01 16:24:52 +08:00
3. 生成xcode工程, 进入axmol根目录执行如下命令之一:
2022-09-05 14:13:52 +08:00
- for ios arm64:
```cmake -S . -B build -GXcode -DCMAKE_TOOLCHAIN_FILE=$AX_ROOT/cmake/ios.toolchain.cmake -DPLATFORM=OS64```
- for ios armv7,arm64 combined:
```cmake -S . -B build -GXcode -DCMAKE_TOOLCHAIN_FILE=$AX_ROOT/cmake/ios.toolchain.cmake -DPLATFORM=OS```
- for ios simulator x86_64:
```cmake -S . -B build -GXcode -DCMAKE_TOOLCHAIN_FILE=$AX_ROOT/cmake/ios.toolchain.cmake -DPLATFORM=SIMULATOR64```
- for tvos arm64:
```cmake -S . -B build -GXcode -DCMAKE_TOOLCHAIN_FILE=$AX_ROOT/cmake/ios.toolchain.cmake -DPLATFORM=TVOS```
- for tvos simulator x86_64:
```cmake -S . -B build -GXcode -DCMAKE_TOOLCHAIN_FILE=$AX_ROOT/cmake/ios.toolchain.cmake -DPLATFORM=SIMULATOR_TVOS```
- for macos x86_64(Intel)
```cmake -S . -B build -GXcode -DCMAKE_OSX_ARCHITECTURES=x86_64```
- for macos arm64(M1)
```cmake -S . -B build -GXcode -DCMAKE_OSX_ARCHITECTURES=arm64```
2020-08-24 16:26:12 +08:00
2020-08-27 12:51:35 +08:00
4. 之后就可以用xcode打开, 选择cpp-tests编译运行
2020-08-03 19:12:07 +08:00
2022-10-01 16:24:52 +08:00
### 一些基于axmol有趣的项目
2022-08-02 17:54:18 +08:00
- https://github.com/solan-solan/HeightMap/tree/smooth_lod_passing
- https://github.com/wzhengsen/StarryX
- https://github.com/aismann/SimpleSnake
- https://github.com/EugenyN/TanksKombat
2020-08-03 19:12:07 +08:00
### 注意
* ThreadLocalStorage线程本地存储
2022-10-01 16:24:52 +08:00
- ios x86 simulator ios>=10 and axmol no longer provide x86 libraries
2022-10-13 23:57:50 +08:00
- ios x64 or devices arm64 ios sdk>=9.0
2020-08-03 19:12:07 +08:00
- the openal-soft maintained by kcat use TLS
### QQ交流群
2022-10-01 16:24:52 +08:00
点击链接加入群聊【axmol 交流群】: https://jq.qq.com/?_wv=1027& k=nvNmzOIY
2020-08-03 19:12:07 +08:00
### 参考链接
2020-08-30 00:28:20 +08:00
* official v4: https://gitee.com/mirrors/cocos2d-x
2022-10-01 16:24:52 +08:00
* Git快速手册: https://github.com/axmolengine/axmol/discussions/411
2021-05-26 14:46:15 +08:00
2022-10-01 16:24:52 +08:00
### axmol项目活跃状态
2021-05-26 14:46:15 +08:00
2022-11-09 11:41:17 +08:00
![Alt ](https://repobeats.axiom.co/api/embed/6fcb8168a3af91ba9e797a1f14a3c2edc42ac56a.svg "Repobeats analytics image" )