Add linux support
This commit is contained in:
4
.gitignore
vendored
4
.gitignore
vendored
@@ -5,4 +5,6 @@ destrum/assets_runtime
|
|||||||
lightkeeper/assets_runtime
|
lightkeeper/assets_runtime
|
||||||
|
|
||||||
.vs/**
|
.vs/**
|
||||||
.idea/**
|
.idea/**
|
||||||
|
|
||||||
|
build/**
|
||||||
|
|||||||
124
Readme.md
Normal file
124
Readme.md
Normal file
@@ -0,0 +1,124 @@
|
|||||||
|
# Destrum
|
||||||
|
|
||||||
|
Destrum is a C++20 Vulkan rendering/game-engine playground. It contains the core `destrum` engine library, a demo application called `lightkeeper`, and an asset-cooking toolchain powered by `TheChef`.
|
||||||
|
|
||||||
|
## Features
|
||||||
|
|
||||||
|
* Vulkan rendering backend
|
||||||
|
* SDL2 window/input setup
|
||||||
|
* Scene, GameObject, Component, and Transform systems
|
||||||
|
* Mesh and material caching
|
||||||
|
* GLTF/FBX model loading
|
||||||
|
* Skeletal animation support
|
||||||
|
* Skybox/cubemap rendering
|
||||||
|
* Asset cooking pipeline for engine and game assets
|
||||||
|
* CMake-based build setup with third-party dependencies as submodules
|
||||||
|
|
||||||
|
## Repository layout
|
||||||
|
|
||||||
|
```txt
|
||||||
|
.
|
||||||
|
├── cmake/ # Shader compilation CMake helpers
|
||||||
|
├── destrum/ # Core engine library
|
||||||
|
│ ├── include/ # Public engine headers
|
||||||
|
│ ├── src/ # Engine implementation
|
||||||
|
│ ├── assets_src/ # Source engine assets
|
||||||
|
│ └── third_party/# Vendored/submodule dependencies
|
||||||
|
├── lightkeeper/ # Demo/game executable using Destrum
|
||||||
|
│ ├── include/
|
||||||
|
│ ├── src/
|
||||||
|
│ └── assets_src/
|
||||||
|
├── TheChef/ # Asset cooking tool
|
||||||
|
└── CMakeLists.txt
|
||||||
|
```
|
||||||
|
|
||||||
|
## Requirements
|
||||||
|
|
||||||
|
* CMake 3.31 or newer
|
||||||
|
* C++20 compiler
|
||||||
|
* Vulkan SDK
|
||||||
|
* Git with submodule support
|
||||||
|
|
||||||
|
On Windows, MSVC is supported.
|
||||||
|
|
||||||
|
## Dependencies
|
||||||
|
|
||||||
|
Most dependencies are included as Git submodules:
|
||||||
|
|
||||||
|
* SDL2
|
||||||
|
* volk
|
||||||
|
* vk-bootstrap
|
||||||
|
* Vulkan Memory Allocator
|
||||||
|
* GLM
|
||||||
|
* nlohmann/json
|
||||||
|
* spdlog
|
||||||
|
* stb
|
||||||
|
* tinygltf
|
||||||
|
* tinyexr
|
||||||
|
* Assimp
|
||||||
|
* FreeType
|
||||||
|
* fmt
|
||||||
|
|
||||||
|
## Getting started
|
||||||
|
|
||||||
|
Clone the repository with submodules:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
git clone --recurse-submodules https://git.brammie15.dev/brammie15/Destrum.git
|
||||||
|
cd Destrum
|
||||||
|
```
|
||||||
|
|
||||||
|
Configure the project:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cmake -S . -B build
|
||||||
|
```
|
||||||
|
|
||||||
|
Build everything:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cmake --build build
|
||||||
|
```
|
||||||
|
|
||||||
|
Run the demo executable:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
./build/lightkeeper/lightkeeper
|
||||||
|
```
|
||||||
|
|
||||||
|
## Asset cooking
|
||||||
|
|
||||||
|
Assets are cooked automatically as part of the build through the `TheChef` tool.
|
||||||
|
|
||||||
|
You can also run the top-level custom targets manually:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cmake --build build --target CookAssets
|
||||||
|
cmake --build build --target CleanupAssets
|
||||||
|
```
|
||||||
|
|
||||||
|
`CookAssets` processes both engine and game assets. `CleanupAssets` removes generated runtime asset output.
|
||||||
|
|
||||||
|
## Demo app
|
||||||
|
|
||||||
|
`lightkeeper` is the current demo application. It creates an SDL window, initializes the Destrum app, loads assets, sets up a scene, renders meshes, skyboxes, and a skinned animated character.
|
||||||
|
|
||||||
|
## Development notes
|
||||||
|
|
||||||
|
The engine code lives in `destrum/`. Public headers are under `destrum/include/destrum`, and implementation files are under `destrum/src`.
|
||||||
|
|
||||||
|
The main engine target is exposed as:
|
||||||
|
|
||||||
|
```cmake
|
||||||
|
destrum::destrum
|
||||||
|
```
|
||||||
|
|
||||||
|
Game/demo targets can link against it:
|
||||||
|
|
||||||
|
```cmake
|
||||||
|
target_link_libraries(my_game PRIVATE destrum::destrum)
|
||||||
|
```
|
||||||
|
|
||||||
|
## License
|
||||||
|
|
||||||
|
Do what you want dawgs :pray:
|
||||||
@@ -90,15 +90,13 @@ target_compile_definitions(destrum
|
|||||||
)
|
)
|
||||||
|
|
||||||
if (WIN32)
|
if (WIN32)
|
||||||
if (BUILD_SHARED_LIBS)
|
target_link_libraries(destrum PUBLIC SDL2::SDL2main)
|
||||||
target_link_libraries(destrum
|
endif ()
|
||||||
PUBLIC SDL2::SDL2main SDL2::SDL2
|
|
||||||
)
|
if (BUILD_SHARED_LIBS)
|
||||||
else ()
|
target_link_libraries(destrum PUBLIC SDL2::SDL2)
|
||||||
target_link_libraries(destrum
|
else ()
|
||||||
PUBLIC SDL2::SDL2main SDL2::SDL2-static
|
target_link_libraries(destrum PUBLIC SDL2::SDL2-static)
|
||||||
)
|
|
||||||
endif ()
|
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
target_compile_definitions(destrum
|
target_compile_definitions(destrum
|
||||||
|
|||||||
@@ -2,6 +2,8 @@
|
|||||||
#define UTIL_H
|
#define UTIL_H
|
||||||
|
|
||||||
#include <filesystem>
|
#include <filesystem>
|
||||||
|
#include <optional>
|
||||||
|
|
||||||
#include <vulkan/vulkan.h>
|
#include <vulkan/vulkan.h>
|
||||||
|
|
||||||
#include "glm/vec4.hpp"
|
#include "glm/vec4.hpp"
|
||||||
|
|||||||
@@ -7,7 +7,6 @@
|
|||||||
class GameObject;
|
class GameObject;
|
||||||
class Transform;
|
class Transform;
|
||||||
|
|
||||||
|
|
||||||
class Component: public Object {
|
class Component: public Object {
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
|||||||
@@ -6,6 +6,8 @@
|
|||||||
#include <destrum/ObjectModel/Object.h>
|
#include <destrum/ObjectModel/Object.h>
|
||||||
#include <destrum/ObjectModel/Transform.h>
|
#include <destrum/ObjectModel/Transform.h>
|
||||||
|
|
||||||
|
class Scene;
|
||||||
|
|
||||||
class GameObject final: public Object {
|
class GameObject final: public Object {
|
||||||
public:
|
public:
|
||||||
friend class Scene;
|
friend class Scene;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#include <destrum/Graphics/Frustum.h>
|
#include <destrum/Graphics/Frustum.h>
|
||||||
|
#include <algorithm>
|
||||||
Frustum edge::createFrustumFromCamera(const Camera& camera) {
|
Frustum edge::createFrustumFromCamera(const Camera& camera) {
|
||||||
// TODO: write a non-horrible version of this, lol
|
// TODO: write a non-horrible version of this, lol
|
||||||
Frustum frustum;
|
Frustum frustum;
|
||||||
|
|||||||
1
destrum/third_party/CMakeLists.txt
vendored
1
destrum/third_party/CMakeLists.txt
vendored
@@ -63,4 +63,5 @@ set(BUILD_SHARED_LIBS OFF CACHE BOOL "" FORCE)
|
|||||||
set(ASSIMP_BUILD_TESTS OFF CACHE BOOL "" FORCE)
|
set(ASSIMP_BUILD_TESTS OFF CACHE BOOL "" FORCE)
|
||||||
set(ASSIMP_INJECT_DEBUG_POSTFIX OFF CACHE BOOL "" FORCE)
|
set(ASSIMP_INJECT_DEBUG_POSTFIX OFF CACHE BOOL "" FORCE)
|
||||||
set(ASSIMP_INSTALL OFF CACHE BOOL "" FORCE)
|
set(ASSIMP_INSTALL OFF CACHE BOOL "" FORCE)
|
||||||
|
set(ASSIMP_WARNINGS_AS_ERRORS OFF CACHE BOOL "" FORCE)
|
||||||
add_subdirectory(assimp)
|
add_subdirectory(assimp)
|
||||||
|
|||||||
Reference in New Issue
Block a user