The goal for Scion2D is to make a simple 2D game engine where I can teach what I am learning through my youtube channel. This is for educational purposes and to constantly learn more about programming and gaming everyday. There are definitely better engines out there; however, I find it more fun to try to build your own, learn from others, and grow as a developer.
The documentation is still a work in progress; however, you can check it out here: Scion2D Docs
Requires CMake 3.26 and vcpkg
git clone https://github.com/microsoft/vcpkg
./vcpkg/bootstrap-vcpkg.bat -disableMetrics
VCPKG_ROOT=[path_to_vcpkg]
VCPKG_DEFAULT_TRIPLET=x64-windows
Windows
Add the following line in your Path environnment variable:
<path_to_vcpkg_installation_folder>
Open a terminal and type the following:
vcpkg integrate install
vcpkg integrate powershell
Linux
Edit your profile's bashrc file:
nano ~/.bashrc
Add the following lines at the end:
export PATH=<path_to_vcpkg_installation_folder>:$PATH
export VCPKG_ROOT=<path_to_vcpkg_installation_folder>
export VCPKG_DEFAULT_TRIPLET=x64-linux
Apply changes:
source ~/.bashrc
Open a terminal and type the following:
vcpkg integrate install
vcpkg integrate bash
vcpkg install fmt glm entt glad soil2 sdl2 sdl2-mixer box2d lua sol2 stb tinyfiledialogs rapidjson imgui[docking-experimental,opengl3-binding,sdl2-binding]
sudo apt install python-jinja2 autoconf automake libtool pkg-config libibus-1.0-dev
sudo apt install libx11-dev libxft-dev libxext-dev
sudo apt install libwayland-dev libxkbcommon-dev libegl1-mesa-dev
sudo apt install build-essential
vcpkg install fmt glm entt glad soil2 sdl2[alsa] sdl2-mixer box2d lua sol2 stb tinyfiledialogs rapidjson imgui[docking-experimental,opengl3-binding,sdl2-binding]
git clone https://github.com/dwjclark11/Scion2D.git
cd Scion2D
cmake -S . -B build
Note: this requires a graphics adapter with OpenGL version >= 4.3 capabilities.
In Scion2D/CMakeLists.txt:
SCION_OPENGL_DEBUG_CALLBACK
to ON
.SCION_OPENGL_DEBUG_FORWARD_COMPATIBILITY
to ON
in order to enable warnings about deprecated OpenGL functions.Activate the debugger in your code as soon as you have a valid OpenGL context made current:
SCION_RENDERING::OpenGLDebugger::init()
.
Optionnaly, you can opt out a list of warning wy doing the following:
std::vector<unsigned int> ignore{ 1281, 131169, 131185, 131204, 31218 };
SCION_RENDERING::OpenGLDebugger::init( ignore );
To allow the debugger to break, call SCION_RENDERING::OpenGLDebugger::breakOnError( true/false )
and/or SCION_RENDERING::OpenGLDebugger::breakOnWarning( true/false )
.
To ignore a specific warning, call SCION_RENDERING::OpenGLDebugger::push( Id )
.
To reinstate, call SCION_RENDERING::OpenGLDebugger::pop( Id )
.
To set the severity level, call SCION_RENDERING::OpenGLDebugger::setSeverityLevel( SCION_RENDERING::OpenGLDebuggerSeverity::Disable/Notification/Low/Medium/High )
.
In Scion2D/CMakeLists.txt:
SCION_OPENGL_FORCE_DISCRETE_GPU
to ON
.Note: Ids can differ between platforms or drivers. Note for linux users: this is currently working only on nVidia GPUs.