Skip to content

Commit eb7a0f2

Browse files
authored
Update README.md
1 parent bbe8085 commit eb7a0f2

File tree

1 file changed

+17
-96
lines changed

1 file changed

+17
-96
lines changed

README.md

Lines changed: 17 additions & 96 deletions
Original file line numberDiff line numberDiff line change
@@ -1,104 +1,25 @@
1-
# CMake SFML Project Template
1+
# SFML 3.0 RPG game base (ECS)
22

3-
This repository template should allow for a fast and hassle-free kick start of your next SFML project using CMake.
4-
Thanks to [GitHub's nature of templates](https://docs.github.com/en/repositories/creating-and-managing-repositories/creating-a-repository-from-a-template), you can fork this repository without inheriting its Git history.
3+
An ECS base for RPG games written with [EnTT](https://github.com/skypjack/entt).
54

6-
The template starts out very basic, but might receive additional features over time:
5+
![image](https://github.com/user-attachments/assets/32de2e5b-7732-4120-997b-6d6ac50957ab)
6+
![image](https://github.com/user-attachments/assets/46dbff91-f569-4939-a272-523c2490a044)
77

8-
- Basic CMake script to build your project and link SFML on any operating system
9-
- Basic [GitHub Actions](https://github.com/features/actions) script for all major platforms
8+
## Dependencies
9+
[SFML](https://github.com/SFML/SFML)
10+
[spdlog](https://github.com/gabime/spdlog)
11+
[json](https://github.com/nlohmann/json)
12+
[TGUI](https://github.com/texus/TGUI)
1013

11-
## How to Use
12-
13-
1. Install [Git](https://git-scm.com/downloads) and [CMake](https://cmake.org/download/). Use your system's package manager if available.
14-
2. Follow [GitHub's instructions](https://docs.github.com/en/repositories/creating-and-managing-repositories/creating-a-repository-from-a-template) for how to use their project template feature to create your own project. If you don't want to use GitHub, see the section below.
15-
3. Clone your new GitHub repo and open the repo in your text editor of choice.
16-
4. Open [CMakeLists.txt](CMakeLists.txt). Rename the project and the target name of the executable to whatever name you want. Make sure to change all occurrences.
17-
5. If you want to add or remove any .cpp files, change the source files listed in the `add_executable` call in CMakeLists.txt to match the source files your project requires. If you plan on keeping the default main.cpp file then no changes are required.
18-
6. If your code uses the Audio or Network modules then add `sfml-audio` or `sfml-network` to the `target_link_libraries` call alongside the existing `sfml-graphics` library that is being linked.
19-
7. If you use Linux, install SFML's dependencies using your system package manager. On Ubuntu and other Debian-based distributions you can use the following commands:
20-
```
21-
sudo apt update
22-
sudo apt install \
23-
libxrandr-dev \
24-
libxcursor-dev \
25-
libudev-dev \
26-
libfreetype-dev \
27-
libopenal-dev \
28-
libflac-dev \
29-
libvorbis-dev \
30-
libgl1-mesa-dev \
31-
libegl1-mesa-dev
32-
```
33-
8. Configure and build your project. Most popular IDEs support CMake projects with very little effort on your part.
34-
35-
- [VS Code](https://code.visualstudio.com) via the [CMake extension](https://code.visualstudio.com/docs/cpp/cmake-linux)
36-
- [Visual Studio](https://docs.microsoft.com/en-us/cpp/build/cmake-projects-in-visual-studio?view=msvc-170)
37-
- [CLion](https://www.jetbrains.com/clion/features/cmake-support.html)
38-
- [Qt Creator](https://doc.qt.io/qtcreator/creator-project-cmake.html)
39-
40-
Using CMake from the command line is straightforward as well.
41-
Be sure to run these commands in the root directory of the project you just created.
42-
43-
```
44-
cmake -B build
45-
cmake --build build
46-
```
47-
48-
9. Enjoy!
49-
50-
## Upgrading SFML
51-
52-
SFML is found via CMake's [FetchContent](https://cmake.org/cmake/help/latest/module/FetchContent.html) module.
53-
FetchContent automatically downloads SFML from GitHub and builds it alongside your own code.
54-
Beyond the convenience of not having to install SFML yourself, this ensures ABI compatibility and simplifies things like specifying static versus shared libraries.
55-
56-
Modifying what version of SFML you want is as easy as changing the [`GIT_TAG`](CMakeLists.txt#L7) argument.
57-
Currently it uses the latest in-development version of SFML 2 via the `2.6.x` tag.
58-
If you're feeling adventurous and want to give SFML 3 a try, use the `master` tag.
59-
Beware, this requires changing your code to suit the modified API!
60-
The nice folks in the [SFML community](https://github.com/SFML/SFML#community) can help you with that transition and the bugs you may encounter along the way.
61-
62-
## But I want to...
63-
64-
Modify CMake options by adding them as configuration parameters (with a `-D` flag) or by modifying the contents of CMakeCache.txt and rebuilding.
65-
66-
### Not use GitHub
67-
68-
You can use this project without a GitHub account by [downloading the contents](https://github.com/SFML/cmake-sfml-project/archive/refs/heads/master.zip) of the repository as a ZIP archive and unpacking it locally.
69-
This approach also avoids using Git entirely if you would prefer to not do that.
70-
71-
### Change Compilers
72-
73-
See the variety of [`CMAKE_<LANG>_COMPILER`](https://cmake.org/cmake/help/latest/variable/CMAKE_LANG_COMPILER.html) options.
74-
In particular you'll want to modify `CMAKE_CXX_COMPILER` to point to the C++ compiler you wish to use.
75-
76-
### Change Compiler Optimizations
77-
78-
CMake abstracts away specific optimizer flags through the [`CMAKE_BUILD_TYPE`](https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html) option.
79-
By default this project recommends `Release` builds which enable optimizations.
80-
Other build types include `Debug` builds which enable debug symbols but disable optimizations.
81-
If you're using a multi-configuration generator (as is often the case on Windows), you can modify the [`CMAKE_CONFIGURATION_TYPES`](https://cmake.org/cmake/help/latest/variable/CMAKE_CONFIGURATION_TYPES.html#variable:CMAKE_CONFIGURATION_TYPES) option.
82-
83-
### Change Generators
84-
85-
While CMake will attempt to pick a suitable default generator, some systems offer a number of generators to choose from.
86-
Ubuntu, for example, offers Makefiles and Ninja as two potential options.
87-
For a list of generators, click [here](https://cmake.org/cmake/help/latest/manual/cmake-generators.7.html).
88-
To modify the generator you're using you must reconfigure your project providing a `-G` flag with a value corresponding to the generator you want.
89-
You can't simply modify an entry in the CMakeCache.txt file unlike the above options.
90-
Then you may rebuild your project with this new generator.
91-
92-
## More Reading
93-
94-
Here are some useful resources if you want to learn more about CMake:
95-
96-
- [Official CMake Tutorial](https://cmake.org/cmake/help/latest/guide/tutorial/)
97-
- [How to Use CMake Without the Agonizing Pain - Part 1](https://alexreinking.com/blog/how-to-use-cmake-without-the-agonizing-pain-part-1.html)
98-
- [How to Use CMake Without the Agonizing Pain - Part 2](https://alexreinking.com/blog/how-to-use-cmake-without-the-agonizing-pain-part-2.html)
99-
- [Better CMake YouTube series by Jefferon Amstutz](https://www.youtube.com/playlist?list=PL8i3OhJb4FNV10aIZ8oF0AA46HgA2ed8g)
14+
## Building
15+
```
16+
mkdir build && cd build
17+
cmake ..
18+
cmake --build .
19+
```
10020

10121
## Resource editor
22+
![image](https://github.com/user-attachments/assets/99e17122-8028-4776-8a20-ce17b89ff694)
10223

10324
### Setup
10425

@@ -117,4 +38,4 @@ Here are some useful resources if you want to learn more about CMake:
11738

11839
## License
11940

120-
UNLICENSED
41+
MIT

0 commit comments

Comments
 (0)