From 0e48af235dc5b7caa4579919182c246d337f2321 Mon Sep 17 00:00:00 2001 From: Atdunbg <979541498@qq.com> Date: Sat, 15 Nov 2025 14:14:20 +0800 Subject: [PATCH] init commit --- .gitignore | 19 +++++++++++++++ CMakeLists.txt | 21 ++++++++++++++++ Editor/CMakeLists.txt | 7 ++++++ Editor/Editor/Editor.cpp | 12 +++++++++ Editor/Editor/Editor.h | 10 ++++++++ Prism/CMakeLists.txt | 43 +++++++++++++++++++++++++++++++++ Prism/src/Prism.h | 8 ++++++ Prism/src/Prism/Application.cpp | 12 +++++++++ Prism/src/Prism/Application.h | 20 +++++++++++++++ Prism/src/Prism/Core/Core.h | 19 +++++++++++++++ Sandbox/CMakeLists.txt | 8 ++++++ Sandbox/Sandbox/Sandbox.cpp | 5 ++++ Sandbox/Sandbox/Sandbox.h | 12 +++++++++ 13 files changed, 196 insertions(+) create mode 100644 .gitignore create mode 100644 CMakeLists.txt create mode 100644 Editor/CMakeLists.txt create mode 100644 Editor/Editor/Editor.cpp create mode 100644 Editor/Editor/Editor.h create mode 100644 Prism/CMakeLists.txt create mode 100644 Prism/src/Prism.h create mode 100644 Prism/src/Prism/Application.cpp create mode 100644 Prism/src/Prism/Application.h create mode 100644 Prism/src/Prism/Core/Core.h create mode 100644 Sandbox/CMakeLists.txt create mode 100644 Sandbox/Sandbox/Sandbox.cpp create mode 100644 Sandbox/Sandbox/Sandbox.h diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..62a16ec --- /dev/null +++ b/.gitignore @@ -0,0 +1,19 @@ +# Directories +.vs/ +.vscode/ +bin/ +bin-int/ +.idea/ +out/ + + +# Clion +#cmake-build-debug/ +#cmake-build-release/ +cmake-build-*/ + +# directories +build/ + +# Files +*.user \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..14c50ae --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,21 @@ +cmake_minimum_required(VERSION 3.31) +project(Prism) + +set(CMAKE_CXX_STANDARD 20) + +set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin-int) +set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin-int) +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) + +# set MSVC output directory +if(MSVC) + set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}) + set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}) + set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELWITHDEBINFO ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}) + set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_MINSIZEREL ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}) +endif () + + +add_subdirectory(Prism) +add_subdirectory(Sandbox) +add_subdirectory(Editor) \ No newline at end of file diff --git a/Editor/CMakeLists.txt b/Editor/CMakeLists.txt new file mode 100644 index 0000000..7da06b9 --- /dev/null +++ b/Editor/CMakeLists.txt @@ -0,0 +1,7 @@ +project(PrismEditor) + +file(GLOB_RECURSE SRC_SOURCE ./**.cpp) + +add_executable(${PROJECT_NAME} ${SRC_SOURCE}) + +target_link_libraries(${PROJECT_NAME} PRIVATE Prism-shared) \ No newline at end of file diff --git a/Editor/Editor/Editor.cpp b/Editor/Editor/Editor.cpp new file mode 100644 index 0000000..5c04441 --- /dev/null +++ b/Editor/Editor/Editor.cpp @@ -0,0 +1,12 @@ +// +// Created by sfd on 25-11-15. +// + +#include "Editor.h" +#include + +int main() +{ + std::cout << "Hello World!\n"; +} + diff --git a/Editor/Editor/Editor.h b/Editor/Editor/Editor.h new file mode 100644 index 0000000..b46f979 --- /dev/null +++ b/Editor/Editor/Editor.h @@ -0,0 +1,10 @@ +// +// Created by sfd on 25-11-15. +// + +#ifndef EDITOR_H +#define EDITOR_H + + + +#endif //EDITOR_H diff --git a/Prism/CMakeLists.txt b/Prism/CMakeLists.txt new file mode 100644 index 0000000..28e5445 --- /dev/null +++ b/Prism/CMakeLists.txt @@ -0,0 +1,43 @@ +project(Prism) + +file(GLOB_RECURSE SRC_SOURCE src/**.cpp) + + + +# static library +set(STATIC_LIBRARY ${PROJECT_NAME}-static) + +add_library(${STATIC_LIBRARY} STATIC ${SRC_SOURCE}) + +target_compile_definitions(${STATIC_LIBRARY} PRIVATE PRISM_STATIC) + +target_include_directories(${STATIC_LIBRARY} PUBLIC + $ +) +set_target_properties(${STATIC_LIBRARY} PROPERTIES + OUTPUT_NAME ${PROJECT_NAME} + ARCHIVE_OUTPUT_NAME ${PROJECT_NAME} +) + + +# shared library +set(SHARED_LIBRARY ${PROJECT_NAME}-shared) + +add_library(${SHARED_LIBRARY} SHARED ${SRC_SOURCE}) + +target_compile_definitions(${SHARED_LIBRARY} PRIVATE PRISM_SHARED BUILD_PRISM_DLL) + +target_include_directories(${SHARED_LIBRARY} PUBLIC + $ +) + +set_target_properties(${SHARED_LIBRARY} PROPERTIES + OUTPUT_NAME ${PROJECT_NAME}d + LIBRARY_OUTPUT_NAME ${PROJECT_NAME}d +) + + +# alias +add_library(Prism::static ALIAS Prism-static) +add_library(Prism::shared ALIAS Prism-shared) +add_library(Prism ALIAS Prism-shared) diff --git a/Prism/src/Prism.h b/Prism/src/Prism.h new file mode 100644 index 0000000..b1b23f2 --- /dev/null +++ b/Prism/src/Prism.h @@ -0,0 +1,8 @@ +// +// Created by sfd on 25-11-15. +// + +#ifndef PRISM_H +#define PRISM_H + +#endif //PRISM_H diff --git a/Prism/src/Prism/Application.cpp b/Prism/src/Prism/Application.cpp new file mode 100644 index 0000000..bd79159 --- /dev/null +++ b/Prism/src/Prism/Application.cpp @@ -0,0 +1,12 @@ +// +// Created by sfd on 25-11-15. +// + +#include "Application.h" + +namespace Prism +{ + Application::Application() + { + } +} diff --git a/Prism/src/Prism/Application.h b/Prism/src/Prism/Application.h new file mode 100644 index 0000000..4ab85f3 --- /dev/null +++ b/Prism/src/Prism/Application.h @@ -0,0 +1,20 @@ +// +// Created by sfd on 25-11-15. +// + +#ifndef APPLICATION_H +#define APPLICATION_H + +#include "Core/Core.h" + +namespace Prism +{ + class PRISM_API Application + { + public: + Application(); + }; +} + + +#endif //APPLICATION_H diff --git a/Prism/src/Prism/Core/Core.h b/Prism/src/Prism/Core/Core.h new file mode 100644 index 0000000..139bade --- /dev/null +++ b/Prism/src/Prism/Core/Core.h @@ -0,0 +1,19 @@ +// +// Created by sfd on 25-11-15. +// + +#ifndef CORE_H +#define CORE_H + +#if defined(PRISM_SHARED) && defined(_WIN32) + #ifdef BUILD_PRISM_DLL + #define PRISM_API __declspec(dllexport) + #else + #define PRISM_API __declspec(dllimport) + #endif +#else + #define PRISM_API +#endif + + +#endif //CORE_H diff --git a/Sandbox/CMakeLists.txt b/Sandbox/CMakeLists.txt new file mode 100644 index 0000000..f693f3d --- /dev/null +++ b/Sandbox/CMakeLists.txt @@ -0,0 +1,8 @@ +project(Sandbox) + +file(GLOB_RECURSE SRC_SOURCE ./**.cpp) + + +add_executable(${PROJECT_NAME} ${SRC_SOURCE}) + +target_link_libraries(${PROJECT_NAME} PRIVATE Prism) \ No newline at end of file diff --git a/Sandbox/Sandbox/Sandbox.cpp b/Sandbox/Sandbox/Sandbox.cpp new file mode 100644 index 0000000..1d71f5c --- /dev/null +++ b/Sandbox/Sandbox/Sandbox.cpp @@ -0,0 +1,5 @@ +// +// Created by sfd on 25-11-15. +// + +#include "Sandbox.h" diff --git a/Sandbox/Sandbox/Sandbox.h b/Sandbox/Sandbox/Sandbox.h new file mode 100644 index 0000000..53253db --- /dev/null +++ b/Sandbox/Sandbox/Sandbox.h @@ -0,0 +1,12 @@ +// +// Created by sfd on 25-11-15. +// + +#ifndef SANDBOX_H +#define SANDBOX_H + + + + + +#endif //SANDBOX_H