From ad8f30f26e974750d7f2108eeb5283626cc7d182 Mon Sep 17 00:00:00 2001 From: Dynamitos Date: Wed, 17 Apr 2024 19:45:25 +0200 Subject: [PATCH] Initialize Repository --- .gitignore | 9 ++++++++ CMakeLists.txt | 30 +++++++++++++++++++++++++ CMakeSettings.json | 53 +++++++++++++++++++++++++++++++++++++++++++++ cmake-variants.json | 43 ++++++++++++++++++++++++++++++++++++ src/main.cpp | 34 +++++++++++++++++++++++++++++ 5 files changed, 169 insertions(+) create mode 100644 .gitignore create mode 100644 CMakeLists.txt create mode 100644 CMakeSettings.json create mode 100644 cmake-variants.json create mode 100644 src/main.cpp diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..f899c85 --- /dev/null +++ b/.gitignore @@ -0,0 +1,9 @@ +bin/ +cmake/ +out/ +.vs/ +.vscode/ +*.asset +*.dll +*.exe +.DS_Store \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..5384cca --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,30 @@ +cmake_minimum_required(VERSION 3.7...3.23) + +if(${CMAKE_VERSION} VERSION_LESS 3.12) + cmake_policy(VERSION ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}) +endif() +set(CMAKE_CXX_STANDARD 20) + +project(MeshShadingDemo) + +set(CMAKE_DEBUG_POSTFIX "") +set(CMAKE_BINARY_DIR ${CMAKE_CURRENT_SOURCE_DIR}/bin) +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/bin) +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_CURRENT_SOURCE_DIR}/bin) +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_CURRENT_SOURCE_DIR}/bin) + +find_package(Vulkan REQUIRED) +find_package(assimp CONFIG REQUIRED) +find_package(Stb REQUIRED) +find_package(EnTT CONFIG REQUIRED) +find_package(FreeType CONFIG REQUIRED) +find_package(glfw3 CONFIG REQUIRED) +find_package(glm CONFIG REQUIRED) +find_package(Ktx CONFIG REQUIRED) +find_package(nlohmann_json CONFIG REQUIRED) +find_package(fmt CONFIG REQUIRED) +find_package(VulkanMemoryAllocator CONFIG REQUIRED) +find_package(Seele REQUIRED) + +add_library(MeshShadingDemo main.cpp) +target_link_libraries(MeshShadingDemo PUBLIC Seele::Engine) diff --git a/CMakeSettings.json b/CMakeSettings.json new file mode 100644 index 0000000..800a3c7 --- /dev/null +++ b/CMakeSettings.json @@ -0,0 +1,53 @@ +{ + "configurations": [ + { + "name": "Debug", + "buildCommandArgs": "", + "ctestCommandArgs": "", + "configurationType": "Debug", + "generator": "Visual Studio 17 2022 Win64", + "intelliSenseMode": "windows-msvc-x64", + "inheritEnvironments": [ "msvc_x64" ], + "cmakeCommandArgs": "-DCMAKE_DEBUG_POSTFIX=\"\" -DCMAKE_PLATFORM=x64", + "buildRoot": "C:/Users/Dynamitos/Seele/bin/", + "installRoot": "C:/Program Files/Seele" + }, + { + "name": "Release", + "generator": "Visual Studio 17 2022 Win64", + "configurationType": "Release", + "buildRoot": "C:/Users/Dynamitos/Seele/bin/", + "cmakeCommandArgs": "-DCMAKE_DEBUG_POSTFIX=\"\" -DCMAKE_PLATFORM=x64", + "buildCommandArgs": "", + "ctestCommandArgs": "", + "inheritEnvironments": [ "msvc_x64" ], + "intelliSenseMode": "windows-msvc-x64", + "installRoot": "C:/Program Files/Seele" + }, + { + "name": "RelWithDebInfo", + "generator": "Visual Studio 17 2022 Win64", + "configurationType": "RelWithDebInfo", + "buildRoot": "C:/Users/Dynamitos/Seele/bin/", + "installRoot": "C:/Program Files/Seele", + "cmakeCommandArgs": "-DCMAKE_DEBUG_POSTFIX=\"\" -DCMAKE_PLATFORM=x64", + "buildCommandArgs": "", + "ctestCommandArgs": "", + "inheritEnvironments": [ "msvc_x64" ], + "intelliSenseMode": "windows-msvc-x64" + }, + { + "name": "AddressSanitizer", + "buildCommandArgs": "", + "ctestCommandArgs": "", + "configurationType": "Debug", + "generator": "Visual Studio 17 2022 Win64", + "intelliSenseMode": "windows-msvc-x64", + "inheritEnvironments": [ "msvc_x64" ], + "cmakeCommandArgs": "-DCMAKE_DEBUG_POSTFIX=\"\" -DCMAKE_PLATFORM=x64", + "buildRoot": "C:/Users/Dynamitos/Seele/bin/", + "installRoot": "C:/Program Files/Seele", + "addressSanitizerEnabled": true + } + ] +} \ No newline at end of file diff --git a/cmake-variants.json b/cmake-variants.json new file mode 100644 index 0000000..1c67b3c --- /dev/null +++ b/cmake-variants.json @@ -0,0 +1,43 @@ +{ + "buildType": { + "default": "debug", + "description": "Configuration Type", + "choices": { + "debug": { + "short": "Debug", + "long": "Enable debugging and validation", + "buildType": "Debug" + }, + "release": { + "short": "Release", + "long": "Optimize binary for speed", + "buildType": "Release" + }, + "relwithdebinfo": { + "short": "RelWithDebInfo", + "long": "Release with debug symbols", + "buildType": "RelWithDebInfo" + } + } + }, + "architecture": { + "default": "x64", + "description": "Platform Architecture", + "choices": { + "x64": { + "short": "x64", + "long": "amd64 platform", + "settings": { + "CMAKE_PLATFORM": "x64" + } + }, + "arm64": { + "short": "arm64", + "long": "arm64 platform", + "settings": { + "CMAKE_PLATFORM": "arm64" + } + } + } + } +} \ No newline at end of file diff --git a/src/main.cpp b/src/main.cpp new file mode 100644 index 0000000..e1c3eb9 --- /dev/null +++ b/src/main.cpp @@ -0,0 +1,34 @@ +#include +#include +#include +#include + +using namespace Seele; + +int main() +{ + Gfx::PGraphics graphics = new Vulkan::Graphics(); + GraphicsInitializer initializer; + graphics->init(initializer); + + PWindowManager windowManager = new WindowManager(); + AssetRegistry::init("Assets", graphics); + + WindowCreateInfo mainWindowInfo; + mainWindowInfo.title = "MeshShadingDemo"; + mainWindowInfo.width = 1280; + mainWindowInfo.height = 720; + mainWindowInfo.bFullscreen = false; + mainWindowInfo.numSamples = 1; + mainWindowInfo.pixelFormat = Gfx::SE_FORMAT_B8G8R8A8_UNORM; + auto window = windowManager->addWindow(graphics, mainWindowInfo); + ViewportCreateInfo sceneViewInfo; + sceneViewInfo.dimensions.size.x = 1280; + sceneViewInfo.dimensions.size.y = 720; + sceneViewInfo.dimensions.offset.x = 0; + sceneViewInfo.dimensions.offset.y = 0; + PGameView sceneView = new GameView(graphics, window, sceneViewInfo, ""); + sceneView->setFocused(); + window->render(); + return 0; +}