Based on the new guidelines taken by Libtcod and based on the state project, I have decided to take matters into my own hands and fork version 1.5.1, which by then had a minimal support for CMake, but it still served as a starting point to start the refactoring and cleaning of the code.
The guidelines taken by Libtcod are:
-
"stopped adding C++ implementations into libtcod." Reference Issue 71
-
"As much as I liked using C++ over C it has made the code less portable and made the C ABI harder to maintain. I now plan on rewriting the code in C and porting to C++ instead of the other way around." Reference Issue 39
This project leaves aside those guidelines taken by Libtcod and its place took as a starting point the implementation of new functionality in C++.
The code has been completely restructured, modified the structure of the project to match the recommendations made by GitLab about how to structure the project, several modules have been removed, the API has been changed and full support has been given to CMake.
We have chosen to fully support CMake, beyond allowing the construction of the project on various platforms as to allow the use this tool as a Content Package Manager, that will allow you to download Doryen as a dependency without the need to embed the project within of each application you want to use it.
The keyboard module supports both turn-by-turn and real time games.
Don’t limit yourself to monochrome or 16 color roguelikes. True colors create a whole world of new visual possibilities.
Antialiasing makes it possible to have better looking fonts, even when you’re using characters as small as 8×8.
Use a few special characters within a font to simulate pixels half the size of a console cell or directly apply SDL post-processing on the image.
Using Mersenne twister algorithm.
You can blit images onto your console background.
Support for Perlin, simplex and wavelet noises.
Tools to generate heightmaps.
Supported algorithms:
- Basic raycasting.
- Recursive shadowcasting.
- Diamond raycasting.
- Precise permissive fov.
- Restrictive shadowcasting a.k.a. MRPAS.
Using A* or Dijkstra algorithms, with either a builtin map data structure or your own internal data structure through function callbacks.
For regions, cities, dungeons building.
- Compiler with Support to C++17 (GCC, Clang, MSV, etc ...)
- CMake Version >= 3.15
- SDL Version === 1.2.15
You can clone with Git via the GitHub repository.
git clone --recursive --depth=1 https://github.com/Andres6936/Doryen.git
cd Doryen && mkdir Build
cd Build && cmake .. -DDORYEN_BUILD_SAMPLES=ON
make
To use this library, you need the script written by TheLartians,
named CPM.cmake (acronym for CMake
Package Manager). Add it to your project, for example, under the
CMakeModules
and then in your CMakeFiles.txt
write the following:
- The directory
CMakeModules
is used to store CMake Scripts, in case you use another directory for these purposes it will be necessary that references properly CPM.cmake to be able to download the dependency.
Include(CMakeModules/CPM.cmake)
CPMAddPackage(
NAME Doryen
VERSION 2021.0124
GITHUB_REPOSITORY Andres6936/Doryen
)
TARGET_LINK_LIBRARIES(<TARGET> PRIVATE Doryen::Framework)
Please, in the VERSION option you should preferably specify the latest version available consult here
#include <Doryen/Doryen.hpp>
using namespace Doryen;
int main()
{
Console console {50, 50};
while (console.isRunning())
{
console.clear();
console.writeString(1, 1, "The answer is 42.");
console.draw();
}
}