A simple SFML application that displays a green circle on a black background.
- CMake 3.14 or higher
- C++20 compatible compiler
- Git (for FetchContent to download SFML)
- Internet connection (for the first build to download SFML)
This project uses CMake's FetchContent module to automatically download and build SFML, so you don't need to install SFML separately.
-
Make sure you have MinGW installed (this project is configured to use CodeBlocks MinGW).
-
Run the provided batch file:
configure.batThis will:
- Create a build directory
- Configure the project with CMake
- Build the project
- Copy necessary DLLs
-
Alternatively, you can do it manually:
mkdir build cd build cmake .. -G "MinGW Makefiles" cmake --build .
- Open a command prompt in the project directory.
- Create a build directory and navigate to it:
mkdir build cd build - Generate Visual Studio solution:
(Replace with your Visual Studio version if different)
cmake .. -G "Visual Studio 16 2019" -A x64 - Open the generated solution in Visual Studio and build it, or build from command line:
cmake --build . --config Release
-
Install deps:
sudo apt install libxi-dev sudo apt-get install freeglut3-dev sudo apt install libudev-dev sudo apt-get install libxrandr-dev sudo apt-get install libxcursor-dev sudo apt-get install libfreetype-dev sudo apt-get install libfreetype6-dev sudo apt-get install libasound2-dev libx11-dev sudo apt-get install libxext-dev ## sudo apt install clang-format clang-tidy -
Create a build directory and navigate to it:
mkdir build cd build -
Generate Makefiles:
cmake .. -
Build the project:
cmake --build .
After building, you can find the executable in the build directory (or in build/Release on Windows with Visual Studio).
Run the application:
- Windows:
SFMLProject.exe - Linux:
./SFMLProject
- Press the Escape key or click the close button to exit the application.