Tin engine is a small modular game engine written in c++ using the SDL2 library. Since the project is still in its pre-release state, expect incomaptiblities between versions.
Clone the git repository from github using
git clone https://github.com/TinCan2/Tin-Engine.git
If you are aiming to use the engine in you own CMake project, refer to the section "Using with CMake". If not, follow the below given steps.
- Create a build directory and change into it with the
mkdir Build
command followed bycd Build
. - Run the command
ccmake ..
orcmake-gui
to specify build options. - Decide whether the engine and the SDL2 libraries should be built statically or dynamically using the
TIN_BUILD_SHARED
andTIN_LINK_SDL_DYNAMIC
options respectively. - Choose which modules should be included in the compilation using the
TIN_MODULES_INCLUDE_
options. - Exit cmake configuration and run the build system of you choice. On unix this is probably the command
make
.
The output of the build process should now be accumulated under the "Tin-Engine Build" directory.
How you can use the engine for your given platform can be found in the below given subsections.
- Tin: Static
SDL: Staticg++ files.cpp -Ipath/to/engine/includes -Lpath/to/engine -Lpath/to/SDL -ltinEngine -lSDL2 -lSDL2_image
- Tin: Dynamic
SDL: Staticg++ files.cpp -Ipath/to/engine/includes -Lpath/to/engine -ltinEngine -Wl,-rpath=path/to/engine
- Tin: Static
SDL: Dynamicg++ files.cpp -Ipath/to/engine/includes -Lpath/to/engine -Lpath/to/SDL -ltinEngine -ltinEngine -lSDL2-2.0 -lSDL2_image-2.0 -Wl,-rpath=path/to/SDL
- Tin: Dynamic
SDL: Dynamicg++ files.cpp -Ipath/to/engine/includes -Lpath/to/engine -Lpath/to/SDL -ltinEngine -ltinEngine -lSDL2-2.0 -lSDL2_image-2.0 -Wl,-rpath=path/to/engine:path/to/SDL
After building the engine, you can link the engine and SDL2 libraries using the visual studios linker option. See, the document on the matter at Microsoft Learn for more info.
Once the engine repository is in yout project directory, you can use the following cmake commands to link the engine to your project.
add_subdirectory(Tin-Engine)
target_link_libraries(yourTarget PUBLIC|PRIVATE|INTERFACE tinEngine)
target_include_directories(yourTarget PUBLIC|PRIVATE|INTERFACE ${CMAKE_BINARY_DIR}/Tin-Engine Build/include)
Tin engine is distributed under the MIT license.
As of the time of writing, I am the only person working on the engine. You can contact me at [email protected].