commit 4c491a9378c2261a6328f07a8fbf101a35cc9d71 Author: HOEGLER Stefan Date: Wed Feb 5 20:58:58 2020 +0100 Setup build system diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..1ff0c42 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,63 @@ +############################################################################### +# Set default behavior to automatically normalize line endings. +############################################################################### +* text=auto + +############################################################################### +# Set default behavior for command prompt diff. +# +# This is need for earlier builds of msysgit that does not have it on by +# default for csharp files. +# Note: This is only used by command line +############################################################################### +#*.cs diff=csharp + +############################################################################### +# Set the merge driver for project and solution files +# +# Merging from the command prompt will add diff markers to the files if there +# are conflicts (Merging from VS is not affected by the settings below, in VS +# the diff markers are never inserted). Diff markers may cause the following +# file extensions to fail to load in VS. An alternative would be to treat +# these files as binary and thus will always conflict and require user +# intervention with every merge. To do so, just uncomment the entries below +############################################################################### +#*.sln merge=binary +#*.csproj merge=binary +#*.vbproj merge=binary +#*.vcxproj merge=binary +#*.vcproj merge=binary +#*.dbproj merge=binary +#*.fsproj merge=binary +#*.lsproj merge=binary +#*.wixproj merge=binary +#*.modelproj merge=binary +#*.sqlproj merge=binary +#*.wwaproj merge=binary + +############################################################################### +# behavior for image files +# +# image files are treated as binary by default. +############################################################################### +#*.jpg binary +#*.png binary +#*.gif binary + +############################################################################### +# diff behavior for common document formats +# +# Convert binary document formats to text before diffing them. This feature +# is only available from the command line. Turn it on by uncommenting the +# entries below. +############################################################################### +#*.doc diff=astextplain +#*.DOC diff=astextplain +#*.docx diff=astextplain +#*.DOCX diff=astextplain +#*.dot diff=astextplain +#*.DOT diff=astextplain +#*.pdf diff=astextplain +#*.PDF diff=astextplain +#*.rtf diff=astextplain +#*.RTF diff=astextplain diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4ce6fdd --- /dev/null +++ b/.gitignore @@ -0,0 +1,340 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. +## +## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore + +# User-specific files +*.rsuser +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +[Aa][Rr][Mm]/ +[Aa][Rr][Mm]64/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ + +# Visual Studio 2015/2017 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# Visual Studio 2017 auto generated files +Generated\ Files/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUNIT +*.VisualState.xml +TestResult.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# Benchmark Results +BenchmarkDotNet.Artifacts/ + +# .NET Core +project.lock.json +project.fragment.lock.json +artifacts/ + +# StyleCop +StyleCopReport.xml + +# Files built by Visual Studio +*_i.c +*_p.c +*_h.h +*.ilk +*.meta +*.obj +*.iobj +*.pch +*.pdb +*.ipdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*_wpftmp.csproj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# Visual Studio Trace Files +*.e2e + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# JustCode is a .NET coding add-in +.JustCode + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# AxoCover is a Code Coverage Tool +.axoCover/* +!.axoCover/settings.json + +# Visual Studio code coverage results +*.coverage +*.coveragexml + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# Note: Comment the next line if you want to checkin your web deploy settings, +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# The packages folder can be ignored because of Package Restore +**/[Pp]ackages/* +# except build/, which is used as an MSBuild target. +!**/[Pp]ackages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/[Pp]ackages/repositories.config +# NuGet v3's project.json files produces more ignorable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt +*.appx + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!?*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +orleans.codegen.cs + +# Including strong name files can present a security risk +# (https://github.com/github/gitignore/pull/2483#issue-259490424) +#*.snk + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm +ServiceFabricBackup/ +*.rptproj.bak + +# SQL Server files +*.mdf +*.ldf +*.ndf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings +*.rptproj.rsuser +*- Backup*.rdl + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat +node_modules/ + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) +*.vbw + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# JetBrains Rider +.idea/ +*.sln.iml + +# CodeRush personal settings +.cr/personal + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc + +# Cake - Uncomment if you are using it +# tools/** +# !tools/packages.config + +# Tabs Studio +*.tss + +# Telerik's JustMock configuration file +*.jmconfig + +# BizTalk build output +*.btp.cs +*.btm.cs +*.odx.cs +*.xsd.cs + +# OpenCover UI analysis results +OpenCover/ + +# Azure Stream Analytics local run output +ASALocalRun/ + +# MSBuild Binary and Structured Log +*.binlog + +# NVidia Nsight GPU debugger configuration file +*.nvuser + +# MFractors (Xamarin productivity tool) working folder +.mfractor/ + +# Local History for Visual Studio +.localhistory/ + +# BeatPulse healthcheck temp database +healthchecksdb \ No newline at end of file diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..ec0e8b9 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,12 @@ +[submodule "external/boost"] + path = external/boost + url = https://github.com/boostorg/boost +[submodule "external/glm"] + path = external/glm + url = https://github.com/g-truc/glm.git +[submodule "external/glfw"] + path = external/glfw + url = https://github.com/glfw/glfw.git +[submodule "external/slang"] + path = external/slang + url = https://github.com/shader-slang/slang.git diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..b5d1b87 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,37 @@ +cmake_minimum_required(VERSION 3.15) + +# Handle superbuild first +option (USE_SUPERBUILD "Whether or not a superbuild should be invoked" ON) + +set (GLOBAL_OUTPUT_PATH ${CMAKE_BINARY_DIR}) + +set(Boost_USE_STATIC_LIBS ON) +set(Boost_LIB_PREFIX lib) +set(Boost_USE_RELEASE_LIBS OFF) + +if (USE_SUPERBUILD) + project (SUPERBUILD NONE) + # execute the superbuild (this script will be invoked again without the + # USE_SUPERBUILD option this time) + include (cmake/SuperBuild.cmake) + return() # stop processing this file further +else() + project (Seele) +endif() + +find_package(Vulkan REQUIRED) +find_package(Boost REQUIRED COMPONENTS serialization) + +include_directories(${GLFW_INCLUDE_DIRS}) +include_directories(${GLM_INCLUDE_DIRS}) +include_directories(${Vulkan_INCLUDE_DIR}) +include_directories(${Boost_INCLUDE_DIRS}) +add_definitions(${GLM_DEFINITIONS}) +add_definitions(${VULKAN_DEFINITIONS}) +add_definitions(${BOOST_DEFINITIONS}) +add_executable(SeeleEngine src/Engine/main.cpp src/Engine/Graphics/Graphics.cpp) +target_link_libraries(SeeleEngine ${Boost_LIBRARIES}) +target_link_libraries(SeeleEngine ${Vulkan_LIBRARY}) +target_link_libraries(SeeleEngine ${GLFW_LIBRARY}) + +message(STATUS "TEST") \ No newline at end of file diff --git a/CMakeSettings.json b/CMakeSettings.json new file mode 100644 index 0000000..94a4610 --- /dev/null +++ b/CMakeSettings.json @@ -0,0 +1,17 @@ +{ + "configurations": [ + { + "name": "x64-Debug", + "generator": "Ninja", + "configurationType": "Debug", + "inheritEnvironments": [ "msvc_x64" ], + "buildRoot": "${projectDir}\\bin\\${name}", + "installRoot": "${projectDir}\\out\\install\\${name}", + "cmakeCommandArgs": "", + "buildCommandArgs": "", + "ctestCommandArgs": "", + "variables": [], + "intelliSenseMode": "windows-clang-x86" + } + ] +} \ No newline at end of file diff --git a/cmake/SuperBuild.cmake b/cmake/SuperBuild.cmake new file mode 100644 index 0000000..226d7f8 --- /dev/null +++ b/cmake/SuperBuild.cmake @@ -0,0 +1,68 @@ +include (ExternalProject) + +set_property(DIRECTORY PROPERTY EP_BASE external) + +set(DEPENDENCIES) +set(EXTRA_CMAKE_ARGS) + +#-------------BOOST---------------- +list(APPEND DEPENDENCIES boost) +ExternalProject_Add(boost + SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/external/boost + CONFIGURE_COMMAND ./bootstrap.sh --with-libraries=serialization + BUILD_COMMAND ./b2 link=static + BUILD_IN_SOURCE 1 + INSTALL_COMMAND "") + +list (APPEND EXTRA_CMAKE_ARGS + -DBOOST_ROOT=${CMAKE_CURRENT_SOURCE_DIR}/external/boost + -DBoost_NO_SYSTEM_PATHS=ON) + +#----------------GLM----------------------- +list(APPEND DEPENDENCIES glm) +ExternalProject_Add(glm + SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/external/glm + BINARY_DIR ${CMAKE_BINARY_DIR}/lib + CONFIGURE_COMMAND "" + BUILD_COMMAND "" + INSTALL_COMMAND "") + +list(APPEND EXTRA_CMAKE_ARGS + -DGLM_INCLUDE_DIRS=${CMAKE_CURRENT_SOURCE_DIR}/external/glm + ) + +#--------------GLFW------------------------------ +list(APPEND DEPENDENCIES glfw) +set(GLFW_BUILD_DOCS OFF CACHE BOOL "" FORCE) +set(GLFW_BUILD_TESTS OFF CACHE BOOL "" FORCE) +set(GLFW_BUILD_EXAMPLES OFF CACHE BOOL "" FORCE) + +ExternalProject_Add(glfw + SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/external/glfw + BINARY_DIR ${CMAKE_BINARY_DIR}/lib/glfw + INSTALL_COMMAND "") + +list(APPEND EXTRA_CMAKE_ARGS + -DGLFW_INCLUDE_DIRS=${CMAKE_CURRENT_SOURCE_DIR}/external/glfw/include + -DGLFW_LIBRARY=${CMAKE_BINARY_DIR}/lib/glfw/src/glfw3.lib + ) + +#--------------SLang------------------------------ +list(APPEND DEPENDENCIES slang) +ExternalProject_Add(slang + SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/external/slang + BINARY_DIR ${CMAKE_BINARY_DIR}/lib + CONFIGURE_COMMAND "" + + BUILD_COMMAND msbuild -m /p:WindowsTargetPlatformVersion=10.0 ${CMAKE_SOURCE_DIR}/external/slang/slang.sln + + INSTALL_COMMAND "") + + +#-----------------SeeleEngine-------------------- +ExternalProject_Add(SeeleEngine + DEPENDS ${DEPENDENCIES} + SOURCE_DIR ${PROJECT_SOURCE_DIR} + CMAKE_ARGS -DUSE_SUPERBUILD=OFF ${EXTRA_CMAKE_ARGS} + INSTALL_COMMAND "" + BINARY_DIR ${CMAKE_CURRENT_SOURCE_DIR}/bin) \ No newline at end of file diff --git a/external/boost b/external/boost new file mode 160000 index 0000000..4d8de5a --- /dev/null +++ b/external/boost @@ -0,0 +1 @@ +Subproject commit 4d8de5a695430fec0856bf667b6c73855428d83b diff --git a/external/glfw b/external/glfw new file mode 160000 index 0000000..d973acc --- /dev/null +++ b/external/glfw @@ -0,0 +1 @@ +Subproject commit d973acc123826666ecc9e6fd475682e3d84c54a6 diff --git a/external/glm b/external/glm new file mode 160000 index 0000000..8e58cdb --- /dev/null +++ b/external/glm @@ -0,0 +1 @@ +Subproject commit 8e58cdbbf8dbaddd52b0703da4cf61f484f0ac24 diff --git a/external/slang b/external/slang new file mode 160000 index 0000000..17c6c60 --- /dev/null +++ b/external/slang @@ -0,0 +1 @@ +Subproject commit 17c6c6044965629a3ae7e8ef004cc0b2ca657c55 diff --git a/src/Engine/Graphics/Graphics.cpp b/src/Engine/Graphics/Graphics.cpp new file mode 100644 index 0000000..0f5b812 --- /dev/null +++ b/src/Engine/Graphics/Graphics.cpp @@ -0,0 +1,11 @@ +#include "Graphics.h" + +Graphics::Graphics() +{ + +} + +Graphics::~Graphics() +{ + +} \ No newline at end of file diff --git a/src/Engine/Graphics/Graphics.h b/src/Engine/Graphics/Graphics.h new file mode 100644 index 0000000..9a3ae32 --- /dev/null +++ b/src/Engine/Graphics/Graphics.h @@ -0,0 +1,6 @@ +class Graphics +{ +public: + Graphics(); + ~Graphics(); +}; \ No newline at end of file diff --git a/src/Engine/main.cpp b/src/Engine/main.cpp new file mode 100644 index 0000000..2ad59ef --- /dev/null +++ b/src/Engine/main.cpp @@ -0,0 +1,71 @@ +#include + +// include headers that implement a archive in simple text format +#include +#include +#include +#include +#include +#include + +///////////////////////////////////////////////////////////// +// gps coordinate +// +// illustrates serialization for a simple type +// +class gps_position +{ +private: + friend class boost::serialization::access; + // When the class Archive corresponds to an output archive, the + // & operator is defined similar to <<. Likewise, when the class Archive + // is a type of input archive the & operator is defined similar to >>. + template + void serialize(Archive& ar, const unsigned int version) + { + ar& degrees; + ar& minutes; + ar& seconds; + } + int degrees; + int minutes; + float seconds; +public: + gps_position() {}; + gps_position(int d, int m, float s) : + degrees(d), minutes(m), seconds(s) + {} +}; + +int main() { + // create and open a character archive for output + std::ofstream ofs("filename"); + + // create class instance + const gps_position g(35, 59, 24.567f); + + // save data to archive + { + boost::archive::text_oarchive oa(ofs); + // write class instance to archive + oa << g; + // archive and stream closed when destructors are called + } + + // ... some time later restore the class instance to its orginal state + gps_position newg; + { + // create and open an archive for input + std::ifstream ifs("filename"); + boost::archive::text_iarchive ia(ifs); + // read class state from archive + ia >> newg; + // archive and stream closed when destructors are called + } + std::cout << "Hello World! " << std::endl; + VkInstance instance; + glm::vec4 vector(0, 1, 0, 1); + std::cout << vector.y << std::endl; + std::cout << glfwInit() << std::endl; + return 0; +} \ No newline at end of file