Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,17 @@
"dev": false
},
"cacheVariables": {
"CMAKE_C_COMPILER": "clang",
"CMAKE_C_STANDARD": "17",
"CMAKE_C_STANDARD_REQUIRED": "ON",
"CMAKE_C_EXTENSIONS": "OFF",
"CMAKE_C_FLAGS_INIT": "-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0",
"CMAKE_CXX_COMPILER": "clang++",
"CMAKE_CXX_STANDARD": "23",
"CMAKE_CXX_STANDARD_REQUIRED": "ON",
"CMAKE_CXX_EXTENSIONS": "OFF",
"CMAKE_CXX_SCAN_FOR_MODULES": "ON"
"CMAKE_CXX_SCAN_FOR_MODULES": "ON",
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON"
}
},
{
Expand Down
29 changes: 28 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,31 @@
**Draconic Engine is an open-source, multi-purpose game engine designed to bridge the gap between the accessibility of indie tools and the raw power required for AAA production. Built with a "performance-forward" & "modularity" philosophy, it provides a robust alternative to industry giants like Unreal, Unity, and Godot.**

> [!NOTE]
> The engine is still a W.I.P & so is this document. Help us out by adding new features or information!
> The engine is still a W.I.P., including this documentation.
>
> Help us out by adding new features or information!


## Compiling DraconicEngine

### Linux

In order to build DraconicEngine, one currently needs the following tools:

* CMake 4.x with CTest
* Ninja (`ninja-build`)
* Clang (at least 18, but 21 or newer strongly recommended)

Make sure these tools are installed in your system.

After cloning this repository, call (for configuring a release build):

```cmake --preset release```

To build, call:

```cmake --build build/release -j$(nproc)```

After the build successfully completed, unit tests can be executed via CTest.

```ctest --test-dir build/release```
2 changes: 1 addition & 1 deletion cmake/Compiler.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ check_ipo_supported(RESULT IPO_SUPPORTED OUTPUT ERROR)
if (CMAKE_BUILD_TYPE STREQUAL "Release")
if(IPO_SUPPORTED)
message(STATUS "IPO / LTO enabled")
add_link_options(-flto)
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE)
else()
message(STATUS "IPO / LTO not supported: <${ERROR}>")
endif()
Expand Down
10 changes: 0 additions & 10 deletions cmake/Modules.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,6 @@ set(NATIVE_THIRD_PARTY_DIR "${NATIVE_SOURCE_DIR}/thirdparty")

if (BUILD_TESTING)
set(DOCTEST_INCLUDE_DIR "${NATIVE_THIRD_PARTY_DIR}/doctest")
# message(STATUS "Bootstrapping unit tests module boost.ut")
# add_library(boost_ut_main "${NATIVE_THIRD_PARTY_DIR}/boost/ut_main.cpp")
# target_sources(boost_ut_main
# PUBLIC
# FILE_SET CXX_MODULES
# BASE_DIRS "${NATIVE_THIRD_PARTY_DIR}/boost"
# FILES "${NATIVE_THIRD_PARTY_DIR}/boost/ut.cppm"
# )
# target_compile_features(boost_ut_main PUBLIC cxx_std_23)
endif()

function(add_modules_library)
Expand Down Expand Up @@ -81,7 +72,6 @@ function(add_modules_library)
add_executable(${UNIT_TEST_TARGET} ${UNIT_TEST_FILE})
set_target_properties(${UNIT_TEST_TARGET} PROPERTIES CXX_SCAN_FOR_MODULES ON)
target_compile_features(${UNIT_TEST_TARGET} PUBLIC cxx_std_23)
#target_compile_options(${UNIT_TEST_TARGET} PUBLIC -fmodules-ts)
target_include_directories(${UNIT_TEST_TARGET} PUBLIC ${DOCTEST_INCLUDE_DIR})
target_link_libraries(${UNIT_TEST_TARGET} PRIVATE ${LIB_TARGET})
message(STATUS "Unit test ${UNIT_TEST_TARGET}")
Expand Down
2 changes: 1 addition & 1 deletion engine/native/core/definitions/definitions.cppm
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module;
export module core.defs;
export import core.version;

static_assert(__cplusplus >= 202302L, "Minimum of C++23 required.");
static_assert(__cplusplus >= 202207L, "Minimum of C++23 required. Consider upgrading your compiler.");

export namespace draco {

Expand Down
20 changes: 10 additions & 10 deletions engine/native/core/math/math.cppm
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export import core.defs;

export namespace draco::math {
template <arithmetic T>
constexpr T sqr(T x) noexcept { return x*x; }
[[nodiscard]] constexpr T sqr(T x) noexcept { return x*x; }

template <std::floating_point T>
[[nodiscard]] constexpr bool is_nan(T val) noexcept {
Expand All @@ -31,7 +31,7 @@ export namespace draco::math {
}

template <arithmetic T>
constexpr T abs(T value) noexcept {
[[nodiscard]] constexpr T abs(T value) noexcept {
// Manually compute abs for signed types.
// Also avoids potential int8_t -> int issues.
if constexpr (std::floating_point<T>) {
Expand All @@ -48,27 +48,27 @@ export namespace draco::math {
}

template <std::floating_point T>
constexpr T deg_to_rad(T y) noexcept {
[[nodiscard]] constexpr T deg_to_rad(T y) noexcept {
return y * (T{PI} / T{180.});
}

template <std::floating_point T>
constexpr T rad_to_deg(T y) noexcept {
[[nodiscard]] constexpr T rad_to_deg(T y) noexcept {
return y * (T{180.} / T{PI});
}

template <std::floating_point T>
T pow(T x, T y) {
[[nodiscard]] T pow(T x, T y) noexcept {
return static_cast<T>(std::pow(x, y));
}

template <std::floating_point T>
constexpr T lerp(T from, T to, T weight) noexcept {
[[nodiscard]] constexpr T lerp(T from, T to, T weight) noexcept {
return std::lerp(from, to, weight);
}

template <std::floating_point T>
constexpr T cubic_interpolate(T from, T to, T before, T after, T weight) noexcept {
[[nodiscard]] constexpr T cubic_interpolate(T from, T to, T before, T after, T weight) noexcept {
// weight squared.
T w2 = weight * weight;
// weight cubed.
Expand All @@ -92,7 +92,7 @@ export namespace draco::math {
}

template <std::floating_point T>
constexpr T cubic_interpolate_in_time(
[[nodiscard]] constexpr T cubic_interpolate_in_time(
T from, T to,
T before, T after, T weight,
T to_t, T before_t, T after_t) noexcept {
Expand Down Expand Up @@ -126,7 +126,7 @@ export namespace draco::math {
}

template <std::floating_point T>
constexpr T bezier_interpolate(T start, T control_1, T control_2, T end, T t) noexcept {
[[nodiscard]] constexpr T bezier_interpolate(T start, T control_1, T control_2, T end, T t) noexcept {
/* Formula from Wikipedia article on Bezier curves. */
// one minus t.
T omt = T{1.} - t;
Expand All @@ -141,7 +141,7 @@ export namespace draco::math {
}

template <std::floating_point T>
constexpr T bezier_derivative(T start, T control_1, T control_2, T end, T t) noexcept {
[[nodiscard]] constexpr T bezier_derivative(T start, T control_1, T control_2, T end, T t) noexcept {
/* Formula from Wikipedia article on Bezier curves. */
T omt = T{1.} - t;
T omt2 = omt * omt;
Expand Down
22 changes: 0 additions & 22 deletions engine/native/thirdparty/boost/ut.cppm

This file was deleted.

Loading