Skip to content

Commit bf906c3

Browse files
authored
Spelling and formatting corrections for .md files (#1671)
* DevSetup.md spelling and style * Updated CODING_STYLE.md for Axmol * Update DevSetup.md * Corrections for DevSetup.md * Corrections in README.md
1 parent 5317dd8 commit bf906c3

File tree

3 files changed

+118
-111
lines changed

3 files changed

+118
-111
lines changed

README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,14 @@ Axmol Engine has iterated and improved over the Cocos2d-x v4.0 base. Now is fast
6666
* ANGLE GLES 3.0+ for Win32 and UWP
6767
* WebGL 2.0 (OpenGL ES 3.0): WASM
6868

69-
**Architecture**:
69+
**Architectures**:
7070
* iOS (x64, arm64)
7171
* Android (x86, x64, armv7, arm64)
72-
* win (x86, x64), linux_x64
73-
* osx (x64, arm64)
74-
* UWP (x64, arm64), wasm32
72+
* Windows (x86, x64),
73+
* Linux (x64)
74+
* OSX (x64, arm64)
75+
* UWP (x64, arm64)
76+
* wasm32
7577

7678
**Supported 2D physics engines** ([more info here](https://github.com/axmolengine/axmol/wiki/2D-Physics-Engines-informations)):
7779
* Box2D

docs/CODING_STYLE.md

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
# ![][1] C++ coding style
1+
<p align="center"><a href="https://axmol.org" target="_blank" rel="noopener noreferrer"><img width="160" src="logo.png" alt="axmol logo"></a></p>
22

3-
_v0.2 - Last updated November 8, 2013_
3+
# Axmol Engine - C++ coding style
4+
5+
_v0.21 - Last updated November 12, 2024_
46

57
_Forked from [Google's C++ coding style](http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml) rev. 3.274_
68

@@ -144,15 +146,15 @@ The following rules will guide you through the various pitfalls of using header
144146

145147
All header files should have `#define` guards to prevent multiple inclusion. The format of the symbol name should be `<PROJECT>_<PATH>_<FILE>_H_.`
146148

147-
To guarantee uniqueness, they should be based on the full path in a project's source tree. For example, the file `cocos2dx/sprites_nodes/CCSprite.h` in project foo should have the following guard:
149+
To guarantee uniqueness, they should be based on the full path in a project's source tree. For example, the file `axmol/core/2d/Sprite.h` in project foo should have the following guard:
148150

149151
```cpp
150-
#ifndef COCOS2DX_SPRITE_NODES_CCSPRITE_H_
151-
#define COCOS2DX_SPRITE_NODES_CCSPRITE_H_
152+
#ifndef AX_CORE_2D_SPRITE_H_
153+
#define AX_CORE_2D_SPRITE_H_
152154

153155
...
154156

155-
#endif // COCOS2DX_SPRITE_NODES_CCSPRITE_H_
157+
#endif // AX_CORE_2D_SPRITE_H_
156158
```
157159

158160
```cpp
@@ -2844,6 +2846,3 @@ The point of having style guidelines is to have a common vocabulary of coding so
28442846

28452847
OK, enough writing about writing code; the code itself is much more interesting. Have fun!
28462848

2847-
2848-
[1]: https://lh3.googleusercontent.com/-glwwzmFyUmk/UQgPnlx40uI/AAAAAAAArzg/WPRW10kkecM/s144/cocos2d-x-logo.png
2849-

docs/DevSetup.md

Lines changed: 104 additions & 98 deletions
Original file line numberDiff line numberDiff line change
@@ -1,137 +1,145 @@
1-
# Development setup
1+
# Axmol Engine - Development setup
22

3-
## Common Requirements
3+
## Common requirements
44

5-
- [PowerShell](https://learn.microsoft.com/en-us/powershell/scripting/install/installing-powershell)
6-
- powershell-7 is recommended, it's support Windows,macOS,Linux
7-
- How to Install:
8-
- Quick Install
9-
- macOS, Ubuntu, ArchLinux: you can simply run `1k/install-pwsh.sh` in axmol root directory [`Recommended`]
10-
- win10+, system installed PowerShell 5.x should works, but you need run command `Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy Bypass -Force` to allow run powershell script file
11-
- Manually Install: [installing-powershell](https://learn.microsoft.com/en-us/powershell/scripting/install/installing-powershell) or download from [github release](https://github.com/PowerShell/PowerShell/releases)
12-
- [cmake-3.28.1+](https://cmake.org/download/), install it on your host system manully is recommended(ensure add cmake bin to system `PATH``), otherwise the `axmol build` will auto setup it to `tools/external/cmake`
5+
- **PowerShell**: used to install Axmol. PowerShell 7 is recommended, it supports Windows, macOS and Linux.
6+
- Quick installation:
7+
- macOS, Ubuntu, ArchLinux: run `1k/install-pwsh.sh` in `axmol` root directory (recommended).
8+
- Windows 10+: system installed PowerShell 5.x should work, but in that case you'll need to run the command `Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy Bypass -Force` in order to allow PowerShell script file to run.
9+
- Manual installation: [Instructions](https://learn.microsoft.com/en-us/powershell/scripting/install/installing-powershell) / [Download](https://github.com/PowerShell/PowerShell/releases)
10+
- **CMake 3.28.1**
11+
- Manual installation is recommended ([download](https://cmake.org/download/)). Make sure to add CMake bin to the system `PATH`, otherwise `axmol build` will auto-setup it to `tools/external/cmake`.
1312

1413
## Prerequisites
1514

16-
1. Enter `axmol` root directory
17-
2. Run `pwsh setup.ps1`, restart the console after it has finished for environment variables to take effect
18-
3. Ensure C/C++ compiler toolset installed on your host machine
19-
- Windows: visual studio 2022 with desktop workflow
20-
- macOS: xcode14.2+
21-
- Linux: GCC(G++)
15+
1. Download or clone Axmol from GitHub ([https://github.com/axmolengine/axmol](https://github.com/axmolengine/axmol)).
16+
2. Enter `axmol` root directory.
17+
3. Run `pwsh setup.ps1`. Restart the console after it has finished for environment variables to take effect.
18+
4. Ensure that the C / C++ compiler toolset is installed on your host machine.
19+
- Windows: Visual Studio 2022 with desktop workflow
20+
- macOS: XCode 14.2+
21+
- Linux: GCC (G++)
2222

23-
## Creating A New Project
23+
## Creating a new project
2424

25-
Using a powershell console window, an example of a command to generate a new project is as follows:
25+
Enter to PowerShell (`pwsh`). This is the command to generate a new project:
2626

2727
```axmol new -p YOUR.UNIQUE.ID -d PROJECT_PATH -l [cpp|lua] [--portrait] PROJECT_NAME```
2828

29-
Type `axmol new --help` at the command line for more options you can pass to `axmol new`
29+
Note: Avoid using special characters in `YOUR.UNIQUE.ID`
30+
31+
Type `axmol new --help` at the command line for more options.
3032

3133
Examples:
3234

3335
- Cpp: `axmol new -p org.axmol.hellocpp -d D:\dev\projects\ -l cpp --portrait HelloCpp`
3436
- Lua: `axmol new -p org.axmol.hellolua -d D:\dev\projects\ -l lua --portrait HelloLua`
3537

36-
## Quick build your new project by `axmol build` for all target platforms [`Recommended`]
38+
## Quick build for all target platforms (recommended)
3739

38-
The `axmol build` command will auto setup general depended toolsets, so you can simply build your project for all platform targets, i.e.
40+
The `axmol build` command will auto-setup the general toolsets, so you'll be able to easily build your project for any platform. For example:
3941

40-
- win32: `axmol build -p win32`
41-
- winuwp: `axmol build -p winuwp`
42-
- linux: `axmol build`
43-
- osx: `axmol build -p osx -a x64`
44-
- android: `axmol build -p android -a arm64` can runs on Windows,Linux,macOS and script will auto setup android sdk
45-
- ios:
46-
- for device: `axmol build -p ios -a arm64 -c`, generate xcodeproj, open by xcode to setup code sign cert and build
42+
- Win32: `axmol build -p win32`
43+
- WinUWP: `axmol build -p winuwp`
44+
- Linux: `axmol build`
45+
- OSX: `axmol build -p osx -a x64`
46+
- Android: `axmol build -p android -a arm64` (can run on Windows, Linux and macOS, and script will auto setup Android SDK)
47+
- iOS:
48+
- for devices: `axmol build -p ios -a arm64 -c` (generate a xcodeproj, open with XCode to setup the code sign cert and build)
4749
- for simulator: `axmol build -p ios -a x64`
48-
- tvos:
49-
- for device: `axmol build -p tvos -a arm64 -c`, generate xcodeproj, open by xcode to setup code sign cert and build
50+
- tvOS:
51+
- for devices: `axmol build -p tvos -a arm64 -c` (generate a xcodeproj, open with XCode to setup code sign cert and build)
5052
- for simulator: `axmol build -p tvos -a x64`
51-
- wasm: `axmol build -p wasm` can runs on Windows 8.1+, Linux, macOS, require a preinstalled [python3](https://www.python.org/) should be in env `PATH`
53+
- WASM: `axmol build -p wasm` (it can run on Windows 8.1+, Linux and macOS, it requires a preinstalled [python3](https://www.python.org/) in env `PATH`)
5254

5355
### Supported options for `axmol build`
5456
```
55-
-p: build target platform: win32,winuwp,linux,android,osx,ios,tvos,watchos,wasm
56-
for android: will search ndk in sdk_root which is specified by env:ANDROID_HOME first,
57-
if not found, by default will install ndk-r16b or can be specified by option: -cc 'ndk-r23c'
58-
-a: build arch: x86,x64,armv7,arm64
59-
-d: the build workspace, i.e project root which contains root CMakeLists.txt, empty use script run working directory aka cwd
60-
-cc: The C/C++ compiler toolchain: clang, msvc, gcc(mingw) or empty use default installed on current OS
57+
-p: build target platforms: win32, winuwp, linux, android, osx, ios, tvos, watchos, wasm
58+
For android: it will search the NDK in sdk_root first, which is specified by env ANDROID_HOME.
59+
If not found, by default it will install ndk-r16b, or you can specify by the option: -cc 'ndk-r23c'
60+
-a: build architecture: x86, x64, armv7, arm64
61+
-d: the build workspace. For example, the project root which contains root CMakeLists.txt, empty use script run working directory (aka cwd)
62+
-cc: The C/C++ compiler toolchain: clang, msvc or gcc(mingw). Leave it empty tou use the current installed default.
6163
msvc: msvc-120, msvc-141
6264
ndk: ndk-r16b, ndk-r16b+
63-
-xt: cross build tool, default: cmake, for android can be gradlew, can be path of cross build tool program
64-
-xc: cross build tool configure options: i.e. -xc '-Dbuild'
65-
-xb: cross build tool build options: i.e. -xb '--config','Release'
66-
-prefix: the install location for missing tools in system, default is "$HOME/build1k"
67-
-sdk: specific windows sdk version, i.e. -sdk '10.0.19041.0', leave empty, cmake will auto choose latest avaiable
68-
-setupOnly: this param present, only execute step: setup
69-
-configOnly: if this param present, will skip build step
65+
-xt: cross build tool. Default: cmake. For Android it can be gradlew, or it can be the path of the cross-build tool program
66+
-xc: cross build tool configure options. For example, -xc '-Dbuild'
67+
-xb: cross build tool build options. For example, -xb '--config','Release'
68+
-prefix: the install location for missing tools in the system. Default is "$HOME/build1k"
69+
-sdk: specific Windows SDK version. For example, -sdk '10.0.19041.0'. Leaved empty, cmake will auto-choose the latest available
70+
-setupOnly: this parameter is present, it only will execute the 'setup' step
71+
-configOnly: if this parameter is present, it will skip the 'build' step
7072
```
7173

72-
## Quick build engine for host targets?
74+
## How to quick build the engine for host targets
75+
76+
Go to `axmol` root directory and run `build.ps1` without any parameters. It will build `HelloCpp` by default.
7377

74-
Goto axmol root directory, double click or run `build.ps1` without any parameters, it will build `HelloCpp` by default
78+
## How to quick build a test project (e.g. 'cpp-tests')
7579

76-
## Quick build a test project e.g. 'cpp-tests'?
77-
Using a powershell console window, goto `axmol\tests\<testdir e.g. 'cpp-tests'>` directory, perform`axmol build -p android -a arm64`, it will build `cpp-tests` for android.
80+
Using a PowerShell console window (command `pwsh`), go to `axmol\tests\<testdir e.g. 'cpp-tests'>` directory and perform `axmol build -p android -a arm64`. It will build `cpp-tests` for Android.
7881

79-
## Manually build with cmake
82+
## Manually build with CMake
8083

81-
### Windows (Visual Studio)
84+
### Windows (Visual Studio 2022)
8285

83-
1. Install [CMake](https://cmake.org/) 3.27.4+
84-
2. Install Visual Studio 2022 (VS2019 should be support, but VS2022 is recommended)
85-
3. Create a new project as shown [here](#creating-a-new-project)
86-
4. In a console window, navigate into the root directory of the project you created in the previous step
86+
1. Install [CMake 3.27.4+](https://cmake.org/download/).
87+
2. Install Visual Studio 2022 (VS 2019 should be supported, but VS 2022 is recommended).
88+
3. Create a new project as shown [here](#creating-a-new-project).
89+
4. In a console window, navigate into the root directory of the project you created in the previous step.
8790
5. Generate the relevant Visual Studio project using the cmake command:
8891

8992
```cmake -S SOURCE_DIR -B BUILD_DIR -G VISUAL_STUDIO_VERSION_STRING -A [Win32|x64]```
9093

91-
For example, say `SOURCE_DIR` is the current path `"."`, and `BUILD_DIR` (out-of-source build directory) is named `"build"`:
94+
For example, let's say `SOURCE_DIR` is the current path `"."`, and `BUILD_DIR` (out-of-source build directory) is named `"build"`:
9295

93-
since axmol-2.1 c++20 required for all platforms
94-
- for 32 bit Visual Studio 2019:
96+
(Since Axmol 2.1 c++20 is required for all platforms)
97+
- 32 bit Visual Studio 2019:
9598
```cmake -S . -B build -G "Visual Studio 16 2019" -A Win32```
96-
- for 64 bit Visual Studio 2019:
99+
- 64 bit Visual Studio 2019:
97100
```cmake -S . -B build -G "Visual Studio 16 2019" -A x64```
98-
- for 32 bit Visual Studio 2022:
101+
- 32 bit Visual Studio 2022:
99102
```cmake -S . -B build -G "Visual Studio 17 2022" -A Win32```
100-
- for 64 bit Visual Studio 2022:
103+
- 64 bit Visual Studio 2022:
101104
```cmake -S . -B build -G "Visual Studio 17 2022" -A x64```
102105

103-
6. Use Visual Studio to open the newly created solution file. For example, `./build/ProjectName.sln`
106+
6. Use Visual Studio to open the newly created solution file. For example, `./build/ProjectName.sln`.
107+
108+
#### Windows UWP (Visual Studio 2022)
109+
110+
~~It only supports C++17.~~ Since Axmol 2.1 migration to CppWinRT it has C++20 support.
104111

105-
#### Windows UWP (Visual Studio 2022), ~because microsoft limit, only support C++17~. Since axmol-2.1, migrated to CppWinRT, with c++20 support
106112
```cmake -B build_uwp -DCMAKE_SYSTEM_NAME=WindowsStore "-DCMAKE_SYSTEM_VERSION=10.0" "-DAX_VS_DEPLOYMENT_TARGET=10.0.17763.0"```
107113

108-
##### Creating the Visual Studio solution for all axmol test projects (Win/UWP)
114+
#### Creating the Visual Studio solution for all Axmol test projects (Win / UWP)
115+
116+
First, perform the steps 1. to 6., or the Windows UWP step above (if not is already done).
109117

110-
- Perform steps 1.-6. or the Windows UWP step above (if not done)
111118
7. Open the solution (".\build\axmol.sln" or ".\build_uwp\axmol.sln") in Visual Studio and build any of the test projects via the IDE.
112119

113-
#### Improve 'Visual Studio' workflow, support linking with engine prebuilt libs
120+
#### Improving the Visual Studio workflow, supporting linking with engine prebuilt libraries
114121

115-
See [windows workflow guide](https://github.com/axmolengine/axmol/issues/564)
122+
Please see the [Windows workflow guide](https://github.com/axmolengine/axmol/issues/564).
116123

117124
### Android (Android Studio)
118125

119-
1. Install Android Studio 2023.1.1+
120-
2. When starting Android Studio for the first time, it will guide you to install the SDK and other tools, so ensure that you do install them.
121-
3. Start Android and choose [Open an existing Android Studio Project] and select your project. For example, the existing cpp-test project located in ```axmol\tests\cpp-tests\proj.android```
122-
4. Start Android Studio and Open [Tools][SDKManager], then switch to ```SDK Tools```, check the ```Show Package Details```, choose the following tools and click the button ```Apply``` to install them:
126+
1. Install [Android Studio 2023.1.1+](https://developer.android.com/studio).
127+
2. When starting Android Studio for the first time, it will guide you through the installation of the SDK and other tools. Please make sure that you do install them.
128+
3. Start Android Studio and choose [Open an existing Android Studio Project] and select your project. For example, the existing `cpp-test` project located in `axmol\tests\cpp-tests\proj.android`.
129+
4. Start Android Studio and open 'Tools' -> 'SDKManager', then switch to 'SDK Tools', check the 'Show Package Details' field, and choose the following tools clicking the button 'Apply' to install them:
123130
- Android SDK Platform 34
124131
- Android Gradle Plugin (AGP) 8.2.1
125132
- Android SDK Build-Tools 34.0.0 match with AGP, refer to: <https://developer.android.com/studio/releases/gradle-plugin>
126133
- Gradle 8.5
127134
- NDK r23c
128-
5. Wait for ```Gradle sync``` finish.
129-
6. Note: If you use non-sdk provided CMake edition, you will need to download ```ninja``` from <https://github.com/ninja-build/ninja/releases>, and copy ```ninja.exe``` to cmake's bin directory
135+
5. Wait for the `Gradle sync` to finish.
136+
137+
Note: if you use non-SDK provided CMake, you will need to download `ninja` from <https://github.com/ninja-build/ninja/releases>, and copy `ninja.exe` to CMake's bin directory.
130138

131139
### Android Studio (without Android Studio)
132140

133-
1. Download command-tools from <https://developer.android.com/studio#command-tools>, for example: https://dl.google.com/android/repository/commandlinetools-win-9477386_latest.zip
134-
2. Install Android devtools (for example in windows)
141+
1. Download [Android command-tools](https://developer.android.com/studio#command-tools).
142+
2. Install Android devtools. Example in Windows:
135143

136144
```bat
137145
# unzip command-tools at D:\dev\adt\
@@ -147,44 +155,42 @@ See [windows workflow guide](https://github.com/axmolengine/axmol/issues/564)
147155

148156
### iOS, tvOS and macOS
149157

150-
1. Ensure xcode 13+ are installed
151-
2. Create a new project as shown [here](#creating-a-new-project)
152-
3. In a console window, navigate into the root directory of the project you created in the previous step
153-
4. Execute the following command
158+
1. Ensure that XCode 13+ is installed.
159+
2. Create a new project as shown [here](#creating-a-new-project).
160+
3. In a console window, navigate into the root directory of the project you created in the previous step.
161+
4. Execute the following command:
154162
```sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer```
155-
5. Generate the relevant xcode project using one of the following commands:
156-
- for ios arm64:
163+
5. Generate the relevant XCode project using one of the following commands:
164+
- for iOS arm64:
157165
```axmol build -p ios -a arm64 -c```
158-
- for ios simulator x86_64:
166+
- for iOS simulator x86_64:
159167
```axmol build -p ios -a x64 -c```
160-
- for tvos arm64:
168+
- for tvOS arm64:
161169
```axmol build -p tvos -a arm64 -c```
162-
- for tvos simulator x86_64:
170+
- for tvOS simulator x86_64:
163171
```axmol build -p tvos -a x64 -c```
164-
- for macos x86_64(Intel)
172+
- for macOS x86_64(Intel)
165173
```axmol build -p osx -c```
166-
- for macos arm64(M1)
174+
- for macOS arm64(M1)
167175
```axmol build -p osx -a arm64 -c```
168176

169-
6. After cmake finishes generating, you can open the xcode project at ```build_${plat}_${arch}``` folder and run cpp-tests or other test targets, for osx x64 should be `build_x64`
170-
7. Notes
171-
- **The code signing is required to run the ios/tvos app on your device, just change the bundle identifier until the auto manage signing is solved**
172-
- **axmol only provides arm64, x86_64 prebuilt libraries for ios/tvos**
177+
6. After CMake finishes generating, you can open the XCode project at `build_${plat}_${arch}` folder and run cpp-tests or other test targets. For OSC x64 should be `build_x64`.
178+
7. Notes:
179+
- **Code signing is required to run the iOS / tvOS app on your device. Just change the bundle identifier until the auto manage signing is solved.**
180+
- **Axmol only provides arm64, x86_64 prebuilt libraries for iOS / tvOS.**
173181

174182
### Linux (VSCode)
175183

176-
1. run `pwsh ./setup.ps1`
177-
2. Open axmol source folder with vscode
178-
3. Install C++, CMake extensions for vscode
179-
4. vscode will auto prompt you to choose toolset for building, just select gcc match with your system installed default gcc
184+
1. Run `pwsh ./setup.ps1`.
185+
2. Open axmol source folder with VSCode.
186+
3. Install C++, CMake extensions for VSCode.
187+
4. VSCode will auto prompt you to choose the toolset for building. Select the gcc matching with your system installed default gcc:
180188
```sh
181189
# check gcc version
182190
gcc -v
183191
```
184192
i.e. `gcc version 11.3.0 (Ubuntu 11.3.0-1ubuntu1~22.04)`
185-
5. vscode will run cmake config automatically, after done, click `build` in taskbar, you can also choose specific target
186-
to build and run
187-
188-
189-
Notes: if you needs debug by vscode, remember ensure choose `CMake: [Debug]` in vscode taskbar
193+
5. VSCode will run CMake config automatically. After done, click `build` in taskbar. You can also choose specific target
194+
to build and run.
190195

196+
Notes: if you need debug in VSCode, remember to choose `CMake: [Debug]` in the WSCode taskbar.

0 commit comments

Comments
 (0)