From cddd4b6f8dc65014e67292b95c09d7efc0081a18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hatvani=20Tam=C3=A1s?= Date: Sun, 15 Mar 2026 19:46:00 +0100 Subject: [PATCH] Initial commit --- .gitignore | 3 ++ .gitmodules | 7 ++++ CMakeLists.txt | 79 +++++++++++++++++++++++++++++++++++++++++ README.md | 14 ++++++++ SakuraVNE/src/main.cpp | 18 ++++++++++ SakuraVNE/test/test.cpp | 1 + libs/SakuraCore | 1 + libs/imgui-node-editor | 1 + 8 files changed, 124 insertions(+) create mode 100644 .gitignore create mode 100644 .gitmodules create mode 100644 CMakeLists.txt create mode 100644 README.md create mode 100644 SakuraVNE/src/main.cpp create mode 100644 SakuraVNE/test/test.cpp create mode 160000 libs/SakuraCore create mode 160000 libs/imgui-node-editor diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ae2afbb --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +build +Build +.cache diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..0b7c5a3 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,7 @@ +[submodule "libs/imgui-node-editor"] + path = libs/imgui-node-editor + url = https://github.com/htamas1210/imgui-node-editor.git + branch = develop +[submodule "libs/SakuraCore"] + path = libs/SakuraCore + url = http://rpiserver.ddns.net:3000/htamas1210/SakuraCore.git diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..b34cd18 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,79 @@ +# Require a modern version of CMake +cmake_minimum_required(VERSION 3.15) + +# Define the Main Application project +project(SakuraVNE LANGUAGES CXX) + +# ------------------------------------------------------------------------------ +# Default Build Type Configuration +# ------------------------------------------------------------------------------ +if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) + message(STATUS "Setting default build type to 'Debug'") + set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "Choose the type of build." FORCE) + set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo") +endif() + +# Enforce C++20 globally +set(CMAKE_CXX_STANDARD 20) +set(CMAKE_CXX_STANDARD_REQUIRED ON) +set(CMAKE_CXX_EXTENSIONS OFF) + +# ------------------------------------------------------------------------------ +# Output Directory Configuration +# ------------------------------------------------------------------------------ +# We put the final executable in the exact same bin/ folder structure +set(OUTPUT_DIR_SUFFIX "$-${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR}") +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin/${OUTPUT_DIR_SUFFIX}") + +# ------------------------------------------------------------------------------ +# Subdirectories (Dependencies) +# ------------------------------------------------------------------------------ +# 1. Bring in the Engine Core (This automatically brings in SDL3, ImGui, and spdlog) +add_subdirectory(libs/SakuraCore) + +# 2. Bring in the Editor-specific UI library +add_subdirectory(libs/imgui-node-editor) + +# ------------------------------------------------------------------------------ +# Source Gathering +# ------------------------------------------------------------------------------ +# Gather all files in the Editor's src folder (primarily main.cpp for now) +file(GLOB_RECURSE SAKURA_VNE_SRCS "SakuraVNE/src/*.cpp" "SakuraVNE/src/*.h") + +# ------------------------------------------------------------------------------ +# SakuraVNE Executable Target +# ------------------------------------------------------------------------------ +add_executable(SakuraVNE ${SAKURA_VNE_SRCS}) + +# ------------------------------------------------------------------------------ +# Includes & Linking +# ------------------------------------------------------------------------------ +# Note: We do NOT need to include SDL3 or SakuraCore/src here! +# SakuraCore exports those paths automatically because we used PUBLIC in its CMake. +target_include_directories(SakuraVNE PRIVATE + "${CMAKE_CURRENT_SOURCE_DIR}/src" + "libs/imgui-node-editor" + "libs/SakuraCore/SakuraCore/src" +) + +# Link the core engine and the node editor. +target_link_libraries(SakuraVNE PRIVATE + SakuraCore + ImGuiNodeEditor +) + +# ------------------------------------------------------------------------------ +# Platform & Configuration Filters +# ------------------------------------------------------------------------------ +if(WIN32) + target_compile_definitions(SakuraVNE PRIVATE PLATFORM_WINDOWS) + target_link_options(SakuraVNE PRIVATE "/NODEFAULTLIB:MSVCRT") +elseif(UNIX AND NOT APPLE) + target_compile_definitions(SakuraVNE PRIVATE PLATFORM_LINUX) +endif() + +# Debug vs Release definitions +target_compile_definitions(SakuraVNE PRIVATE + $<$:DEBUG> + $<$:RELEASE> +) diff --git a/README.md b/README.md new file mode 100644 index 0000000..24b9956 --- /dev/null +++ b/README.md @@ -0,0 +1,14 @@ +# SakuraVNE +Visual novel creator engine made with SDL2 + +Clone the project: +`git clone https://github.com/htamas1210/SakuraVNE.git --recursive` + +## windows: +Generate a visual studio 2026 solution and build from there: +`cmake -G "Visual Studio 18 2026" -A x64` + +## linux: +`cmake -B build -DCMAKE_BUILD_TYPE=Debug -DCMAKE_EXPORT_COMPILE_COMMANDS=ON` +`ln -sf build/compile_commands.json compile_commands.json` +`cmake --build build -j` diff --git a/SakuraVNE/src/main.cpp b/SakuraVNE/src/main.cpp new file mode 100644 index 0000000..b4e9d54 --- /dev/null +++ b/SakuraVNE/src/main.cpp @@ -0,0 +1,18 @@ +#define SDL_MAIN_HANDLED 1 + +#include "Application.h" +#include "SDL3/SDL_main.h" +// #include "SakuraCore/src/Application.h" + +int main(int argc, char *argv[]) { + SDL_SetMainReady(); + + Application app; + + bool success = app.Init(); + + if (success) + app.Run(); + + return 0; +} diff --git a/SakuraVNE/test/test.cpp b/SakuraVNE/test/test.cpp new file mode 100644 index 0000000..76e8197 --- /dev/null +++ b/SakuraVNE/test/test.cpp @@ -0,0 +1 @@ +int main() { return 0; } diff --git a/libs/SakuraCore b/libs/SakuraCore new file mode 160000 index 0000000..e152bf9 --- /dev/null +++ b/libs/SakuraCore @@ -0,0 +1 @@ +Subproject commit e152bf93b35cd2e4965322134dc4473a4689e9bb diff --git a/libs/imgui-node-editor b/libs/imgui-node-editor new file mode 160000 index 0000000..dcd44ed --- /dev/null +++ b/libs/imgui-node-editor @@ -0,0 +1 @@ +Subproject commit dcd44ed156fa9d043d6e98dbd08e4d43b1882247