Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
6458806
Start workin' on RHI
AR-DEV-1 Apr 7, 2026
b58cba3
Idk how I missed these, they coulda been major security vulnerabilities
AR-DEV-1 Apr 10, 2026
7b92c6b
Do what CodeRabbit said & add Wayland support (still doesn't work)
AR-DEV-1 Apr 13, 2026
64c0d2f
Fix includes
AR-DEV-1 Apr 13, 2026
c955c7d
Add uniform management
AR-DEV-1 Apr 13, 2026
eebea86
Add texture loadin' support
AR-DEV-1 Apr 15, 2026
b433315
Add framebuffer handles, render targets & dynamic/transient buffers s…
AR-DEV-1 Apr 20, 2026
436c405
Add depth & stencil testing, Alpha blending modes, dedicated sampler …
AR-DEV-1 Apr 26, 2026
d1694ef
Draco is 3D!
AR-DEV-1 May 5, 2026
64615cd
Add camera controller & remove all std imports (replaced by the tradi…
AR-DEV-1 May 6, 2026
27f83bc
Apply suggestions
AR-DEV-1 May 6, 2026
80af026
Fix issues
AR-DEV-1 May 6, 2026
43141d2
Minor improvements & fixes
AR-DEV-1 May 7, 2026
b448c46
Add mesh abstraction + compilation of shaders when building
AR-DEV-1 May 8, 2026
97d97ee
Add transform system
AR-DEV-1 May 8, 2026
c2c80b5
Upgrade render pipeline architecture (material + RenderGraph refactor)
AR-DEV-1 May 10, 2026
2f2f08c
Start working on Quad/Sprite renderer
AR-DEV-1 May 12, 2026
e43bcea
Merge branch 'master' of https://github.com/Redot-Engine/DraconicEngi…
AR-DEV-1 May 12, 2026
b117660
Work on QuadRenderer
AR-DEV-1 May 12, 2026
463ab5e
QuadRenderer finally works!
AR-DEV-1 May 17, 2026
e148291
Merge branch 'Redot-Engine:master' into rendering-hardware-abstraction
AR-DEV-1 May 17, 2026
6dcdc0f
Small stuff
AR-DEV-1 May 17, 2026
1046f1d
Apply some suggestions
AR-DEV-1 May 17, 2026
833d9a8
Forgot these
AR-DEV-1 May 17, 2026
d28e09f
Minor fixes
AR-DEV-1 May 17, 2026
62db8b7
Minor fixes
AR-DEV-1 May 17, 2026
7183e07
Fix incorrect declaration
AR-DEV-1 May 17, 2026
1065b03
Fix Wayland
AR-DEV-1 May 17, 2026
570b52a
Wayland works!
AR-DEV-1 May 17, 2026
05c8310
Compile shaderc
AR-DEV-1 May 18, 2026
cb36c8f
Remove sync window SDL loop so Draco may run on Windows [skip ci]
AR-DEV-1 May 18, 2026
4540c3a
PR cleanup
AR-DEV-1 May 19, 2026
c40f59c
Update CMake version
AR-DEV-1 May 19, 2026
abad3ef
Add missing include
AR-DEV-1 May 19, 2026
e94b9de
Add caching to CI
AR-DEV-1 May 20, 2026
dd90c75
Merge branch 'master' into rendering-hardware-abstraction
AR-DEV-1 May 20, 2026
ff5480f
Fix compiler error
AR-DEV-1 May 20, 2026
f8c737c
Apply suggestions
AR-DEV-1 May 21, 2026
5862d99
Merge branch 'master' into rendering-hardware-abstraction
AR-DEV-1 May 21, 2026
9b61dd6
Use our own types & constants
AR-DEV-1 May 21, 2026
3b6f166
Merge branch 'master' into rendering-hardware-abstraction
AR-DEV-1 May 22, 2026
c6007b8
Cleanup + improvements
AR-DEV-1 May 22, 2026
5373a78
Merge branch 'Redot-Engine:master' into rendering-hardware-abstraction
AR-DEV-1 May 24, 2026
e79fa0b
Fix errors
AR-DEV-1 May 24, 2026
de86d2c
Apply some suggestions
AR-DEV-1 May 25, 2026
e720027
Code cleanup
AR-DEV-1 May 26, 2026
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
99 changes: 99 additions & 0 deletions .github/workflows/linux_build.yml
Comment thread
JoltedJon marked this conversation as resolved.
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
name: 🐧 Linux Builds

on:
push:
branches:
- '**'
pull_request:
branches:
- '**'

jobs:
build-linux:
runs-on: ubuntu-24.04

steps:
- name: Checkout Source Code
uses: actions/checkout@v4
with:
submodules: recursive

- name: Set up Clang Compiler
uses: egor-tensin/setup-clang@v1
with:
version: 20

- name: Install System Dependencies
run: |
wget https://github.com/Kitware/CMake/releases/download/v4.3.0/cmake-4.3.0-linux-x86_64.tar.gz
tar -xzf cmake-4.3.0-linux-x86_64.tar.gz
echo "$(pwd)/cmake-4.3.0-linux-x86_64/bin" >> $GITHUB_PATH

sudo apt-get update
sudo apt-get install -y \
ninja-build \
ccache \
llvm-20 \
llvm-20-tools \
clang-tools-20 \
libc++-20-dev \
libc++abi-20-dev \
libgl1-mesa-dev \
libegl1-mesa-dev \
libwayland-egl1-mesa \
libasound2-dev \
libpulse-dev \
libwayland-dev \
libx11-dev \
libxext-dev \
libxrender-dev \
libxrandr-dev \
libxinerama-dev \
libxcursor-dev \
libxi-dev \
libxtst-dev
echo "/usr/lib/llvm-20/bin" >> $GITHUB_PATH

- name: Verify LLVM Toolchain
run: |
which clang
which clang++
which clang-scan-deps
clang --version
clang++ --version
clang-scan-deps --version

- name: Cache Build Artifacts
uses: hendrikmuhs/[email protected]
with:
key: ${{ runner.os }}-ccache-${{ hashFiles('**/CMakeLists.txt', '**/*.cmake') }}
restore-keys: |
${{ runner.os }}-ccache-
max-size: "500M"

- name: Configure Build System
run: |
cmake --preset debug \
-B build/debug \
-DCMAKE_C_COMPILER=clang \
-DCMAKE_CXX_COMPILER=clang++ \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DCMAKE_BUILD_WITH_INSTALL_RPATH=TRUE \
-DCMAKE_INSTALL_RPATH="\$ORIGIN:\$ORIGIN/engine/native"

- name: Compile Target Binary
run: |
cmake --build build/debug -j$(nproc)

- name: Run Unit Tests
run: |
ctest --test-dir build/debug --output-on-failure -j$(nproc)

- name: Upload Engine Artifact
uses: actions/upload-artifact@v4
with:
name: linux_debug
path: build/debug/
if-no-files-found: error
retention-days: 7
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,6 @@
[submodule "engine/native/thirdparty/bgfx"]
path = engine/native/thirdparty/bgfx
url = https://github.com/bkaradzic/bgfx
[submodule "engine/native/thirdparty/sdl"]
path = engine/native/thirdparty/sdl
url = https://github.com/libsdl-org/SDL
49 changes: 48 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ cmake_minimum_required(VERSION 4.0)
project(DraconicEngine LANGUAGES C CXX)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure of the best spot to put it, but Windows headers need _{Architecture}_ defined to compile properly. Something like this will do:

if(WIN32)
    add_compile_definitions("_${CMAKE_SYSTEM_PROCESSOR}_")
endif()

Add this and #27, then Windows will compile fine.

find_package(Git QUIET)
find_package(Threads REQUIRED)

if(GIT_FOUND AND EXISTS "${CMAKE_SOURCE_DIR}/.git")
message(STATUS "Updating submodules...")
Expand All @@ -22,5 +23,51 @@ list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake")
include(CTest)
Comment thread
AR-DEV-1 marked this conversation as resolved.
include(Compiler)
include(Modules)
include(Shaders)
Comment thread
AR-DEV-1 marked this conversation as resolved.

add_subdirectory(engine/native)
# Subdirectories for engine libs
add_subdirectory(engine/native)

# Main Executable
add_executable(draconic engine/native/main/main.cpp)

target_link_libraries(draconic
PRIVATE
core
math
io
memory
platform
input
rendering
scene
bgfx
bx
bimg
)
Comment thread
AR-DEV-1 marked this conversation as resolved.

if(UNIX AND NOT APPLE)
target_link_libraries(draconic PRIVATE SDL3::SDL3-static Threads::Threads dl)
target_link_options(draconic PRIVATE -Wl,--whole-archive $<TARGET_FILE:SDL3::SDL3-static> -Wl,--no-whole-archive)
elseif(APPLE)
target_link_libraries(draconic PRIVATE SDL3::SDL3-static)
target_link_options(draconic PRIVATE -Wl,-force_load,$<TARGET_FILE:SDL3::SDL3-static>)
else()
target_link_libraries(draconic PRIVATE SDL3::SDL3-static)
endif()

compile_shaders(draconic)

set(TEST_IMAGE
"${CMAKE_SOURCE_DIR}/assets/draconic_logo_no_text.png"
)

add_custom_command(
TARGET draconic POST_BUILD

COMMAND ${CMAKE_COMMAND} -E copy_if_different
${TEST_IMAGE}
$<TARGET_FILE_DIR:draconic>/test.png

COMMENT "Copying test texture..."
)
8 changes: 7 additions & 1 deletion cmake/Compiler.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,10 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
# TODO: Make SIMD level configurable or detect at runtime
add_compile_options(-mavx2 -mfma)
endif()
endif()
endif()

if(WIN32)
add_compile_definitions("_${CMAKE_SYSTEM_PROCESSOR}_")
else()
add_compile_definitions(_GNU_SOURCE)
endif()
84 changes: 84 additions & 0 deletions cmake/Shaders.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
include_guard(GLOBAL)

set(SHADER_SRC_DIR "${CMAKE_SOURCE_DIR}/engine/native/rendering/shaders")
set(SHADER_BIN_DIR "${CMAKE_BINARY_DIR}")
set(BGFX_INCLUDE "${CMAKE_SOURCE_DIR}/engine/native/thirdparty/bgfx/src")

function(compile_shaders TARGET_NAME)
file(MAKE_DIRECTORY ${SHADER_BIN_DIR})

if(APPLE)
set(VERTEX_PROFILE "metal")
set(FRAGMENT_PROFILE "metal")
set(SHADER_PLATFORM "osx")
elseif(WIN32)
set(VERTEX_PROFILE "s_5_0")
set(FRAGMENT_PROFILE "s_5_0")
set(SHADER_PLATFORM "windows")
else()
set(VERTEX_PROFILE "spirv")
set(FRAGMENT_PROFILE "spirv")
set(SHADER_PLATFORM "linux")
endif()

set(VERTEX_INPUT "${SHADER_SRC_DIR}/vs.sc")
set(VERTEX_OUTPUT "${SHADER_BIN_DIR}/vs.bin")

set(FRAGMENT_INPUT "${SHADER_SRC_DIR}/fs.sc")
set(FRAGMENT_OUTPUT "${SHADER_BIN_DIR}/fs.bin")

set(QUAD_VERTEX_INPUT "${SHADER_SRC_DIR}/vs_quad.sc")
set(QUAD_VERTEX_OUTPUT "${SHADER_BIN_DIR}/vs_quad.bin")

set(QUAD_FRAGMENT_INPUT "${SHADER_SRC_DIR}/fs_quad.sc")
set(QUAD_FRAGMENT_OUTPUT "${SHADER_BIN_DIR}/fs_quad.bin")

set(VARYING_DEF "${SHADER_SRC_DIR}/varying.def.sc")
set(QUAD_VARYING_DEF "${SHADER_SRC_DIR}/varying_quad.def.sc")

add_custom_command(
TARGET draconic POST_BUILD
COMMENT "Compiling asset pipelines and core engine shaders via native tools..."

COMMAND $<TARGET_FILE:shaderc>
-f ${VERTEX_INPUT}
-o ${VERTEX_OUTPUT}
--type vertex
--platform ${SHADER_PLATFORM}
-p ${VERTEX_PROFILE}
--varyingdef ${VARYING_DEF}
-i ${BGFX_INCLUDE}

COMMAND $<TARGET_FILE:shaderc>
-f ${FRAGMENT_INPUT}
-o ${FRAGMENT_OUTPUT}
--type fragment
--platform ${SHADER_PLATFORM}
-p ${FRAGMENT_PROFILE}
--varyingdef ${VARYING_DEF}
-i ${BGFX_INCLUDE}

COMMAND $<TARGET_FILE:shaderc>
-f ${QUAD_VERTEX_INPUT}
-o ${QUAD_VERTEX_OUTPUT}
--type vertex
--platform ${SHADER_PLATFORM}
-p ${VERTEX_PROFILE}
--varyingdef ${QUAD_VARYING_DEF}
-i ${BGFX_INCLUDE}

COMMAND $<TARGET_FILE:shaderc>
-f ${QUAD_FRAGMENT_INPUT}
-o ${QUAD_FRAGMENT_OUTPUT}
--type fragment
--platform ${SHADER_PLATFORM}
-p ${FRAGMENT_PROFILE}
--varyingdef ${QUAD_VARYING_DEF}
-i ${BGFX_INCLUDE}

COMMAND ${CMAKE_COMMAND} -E copy_if_different ${VERTEX_OUTPUT} $<TARGET_FILE_DIR:draconic>
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${FRAGMENT_OUTPUT} $<TARGET_FILE_DIR:draconic>
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${QUAD_VERTEX_OUTPUT} $<TARGET_FILE_DIR:draconic>
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${QUAD_FRAGMENT_OUTPUT} $<TARGET_FILE_DIR:draconic>
)
endfunction()
12 changes: 10 additions & 2 deletions engine/native/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
add_modules_library(core SHARED)
add_modules_library(input)
add_modules_library(rendering)
add_modules_library(scene)

add_subdirectory(thirdparty SYSTEM)
add_subdirectory(platform)

add_modules_library(core SHARED)
target_link_libraries(core PUBLIC definitions math memory)
target_link_libraries(core PUBLIC definitions math io memory)
target_link_libraries(input PRIVATE SDL3::SDL3-static core)
target_link_libraries(rendering PUBLIC rhi rendergraph mesh material quad_renderer renderer)
target_link_libraries(scene PUBLIC renderable transform_component camera)
7 changes: 5 additions & 2 deletions engine/native/core/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
add_modules_library(definitions PIC)
add_modules_library(math)
add_modules_library(io)
add_modules_library(memory)
target_link_libraries(math PUBLIC definitions)
target_link_libraries(memory PUBLIC definitions)

target_link_libraries(math PUBLIC definitions bx)
target_link_libraries(io PUBLIC definitions stb_image)
target_link_libraries(memory PUBLIC definitions math)
1 change: 1 addition & 0 deletions engine/native/core/core.cppm
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ export module core;
export import core.defs;
export import core.math;
export import core.memory;
export import core.io;
45 changes: 45 additions & 0 deletions engine/native/core/io/filesystem.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
module;

#include <vector>
#include <string>
#include <fstream>
#include <print>

module core.io.filesystem;

import core.stdtypes;

namespace draco::core::io::filesystem
{
std::vector<u8> load_binary(const std::string& path)
{
// Open at the end (ate) to get size and in binary mode
std::ifstream file(path, std::ios::binary | std::ios::ate);

if (!file.is_open()) {
std::println("Error: Could not open file at: {}", path);
// Return an empty vector
return {};
}

std::streamsize size = file.tellg();
if (size < 0) {
std::println("Error: File is empty or unreadable: {}", path);
return {};
}

if (size == 0) {
return {};
}

file.seekg(0, std::ios::beg);

std::vector<u8> buffer(static_cast<std::size_t>(size));
if (file.read(reinterpret_cast<char*>(buffer.data()), size)) {
return buffer;
}

std::println("Error: Failed to read file contents: {}", path);
return {};
Comment thread
AR-DEV-1 marked this conversation as resolved.
}
}
15 changes: 15 additions & 0 deletions engine/native/core/io/filesystem.cppm
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
module;

#include <vector>
#include <string>
#include <fstream>

export module core.io.filesystem;

import core.stdtypes;

export namespace draco::core::io::filesystem
{
// Returns a buffer of the file data
std::vector<u8> load_binary(const std::string& path);
}
Loading