Merge remote-tracking branch 'origin/main' into main

This commit is contained in:
Xiao Qi 2022-09-15 09:32:23 +08:00
commit ff3f5db397
6 changed files with 65 additions and 34 deletions

View File

@ -8,34 +8,34 @@ echo "A - All"
echo "B - VMA" echo "B - VMA"
echo "C - msdf" echo "C - msdf"
echo "D - assimp" echo "D - assimp"
echo "E - ktx" echo "E - spdlog"
echo "F - spdlog" echo "F - reactphysics3d"
echo "G - reactphysics3d" echo "G - imgui"
echo "H - imgui" echo "H - imguizmo"
echo "I - imguizmo" echo "I - imnodes"
echo "J - imnodes" echo "J - tracy"
echo "K - tracy" echo "K - RTTR"
echo "L - RTTR" echo "L - yamlcpp"
echo "M - yamlcpp" echo "N - SDL"
echo --------------------------------------------------- echo ---------------------------------------------------
echo. echo.
choice /C ABCDEFGHIJKLM /T 10 /D A choice /C ABCDEFGHIJKLMNO /T 10 /D A
set _e=%ERRORLEVEL% set _e=%ERRORLEVEL%
if %_e%==1 goto VMA if %_e%==1 goto VMA
if %_e%==2 goto VMA if %_e%==2 goto VMA
if %_e%==3 goto MSDF if %_e%==3 goto MSDF
if %_e%==4 goto assimp if %_e%==4 goto assimp
if %_e%==5 goto ktx if %_e%==5 goto spdlog
if %_e%==6 goto spdlog if %_e%==6 goto reactphysics3d
if %_e%==7 goto reactphysics3d if %_e%==7 goto imgui
if %_e%==8 goto imgui if %_e%==8 goto imguizmo
if %_e%==9 goto imguizmo if %_e%==9 goto imnodes
if %_e%==10 goto imnodes if %_e%==10 goto tracy
if %_e%==11 goto tracy if %_e%==11 goto RTTR
if %_e%==12 goto RTTR if %_e%==12 goto yamlcpp
if %_e%==13 goto yamlcpp if %_e%==14 goto SDL
:VMA :VMA
echo -----------------------VMA---------------------------- echo -----------------------VMA----------------------------
@ -55,58 +55,71 @@ rmdir "Dependencies/assimp" /S /Q
git clone https://github.com/SHADE-DP/assimp.git "Dependencies/assimp" git clone https://github.com/SHADE-DP/assimp.git "Dependencies/assimp"
if %_e%==4 (goto :done) else (goto :ktx) if %_e%==4 (goto :done) else (goto :ktx)
:ktx @REM :ktx
rmdir "Dependencies/ktx" /S /Q @REM rmdir "Dependencies/ktx" /S /Q
echo -----------------------ktx---------------------------- @REM echo -----------------------ktx----------------------------
git clone https://github.com/SHADE-DP/ktx.git "Dependencies/ktx" @REM git clone https://github.com/SHADE-DP/ktx.git "Dependencies/ktx"
if %_e%==5 (goto :done) else (goto :spdlog) @REM if %_e%==5 (goto :done) else (goto :spdlog)
:spdlog :spdlog
echo -----------------------spdlog---------------------------- echo -----------------------spdlog----------------------------
rmdir "Dependencies/spdlog" /S /Q rmdir "Dependencies/spdlog" /S /Q
git clone https://github.com/SHADE-DP/spdlog.git "Dependencies/spdlog" git clone https://github.com/SHADE-DP/spdlog.git "Dependencies/spdlog"
if %_e%==6 (goto :done) else (goto :reactphysics3d) if %_e%==5 (goto :done) else (goto :reactphysics3d)
:reactphysics3d :reactphysics3d
echo -----------------------reactphysics3d---------------------------- echo -----------------------reactphysics3d----------------------------
rmdir "Dependencies/reactphysics3d" /S /Q rmdir "Dependencies/reactphysics3d" /S /Q
git clone https://github.com/SHADE-DP/reactphysics3d.git "Dependencies/reactphysics3d" git clone https://github.com/SHADE-DP/reactphysics3d.git "Dependencies/reactphysics3d"
if %_e%==7 (goto :done) else (goto :imgui) if %_e%==6 (goto :done) else (goto :imgui)
:imgui :imgui
echo -----------------------imgui---------------------------- echo -----------------------imgui----------------------------
rmdir "Dependencies/imgui" /S /Q rmdir "Dependencies/imgui" /S /Q
git clone https://github.com/SHADE-DP/imgui.git "Dependencies/imgui" git clone https://github.com/SHADE-DP/imgui.git "Dependencies/imgui"
if %_e%==8 (goto :done) else (goto :imguizmo) if %_e%==7 (goto :done) else (goto :imguizmo)
:imguizmo :imguizmo
echo -----------------------imguizmo---------------------------- echo -----------------------imguizmo----------------------------
rmdir "Dependencies/imguizmo" /S /Q rmdir "Dependencies/imguizmo" /S /Q
git clone https://github.com/SHADE-DP/ImGuizmo.git "Dependencies/imguizmo" git clone https://github.com/SHADE-DP/ImGuizmo.git "Dependencies/imguizmo"
if %_e%==9 (goto :done) else (goto :imnodes) if %_e%==8 (goto :done) else (goto :imnodes)
:imnodes :imnodes
echo -----------------------imnodes---------------------------- echo -----------------------imnodes----------------------------
rmdir "Dependencies/imnodes" /S /Q rmdir "Dependencies/imnodes" /S /Q
git clone https://github.com/SHADE-DP/imnodes.git "Dependencies/imnodes" git clone https://github.com/SHADE-DP/imnodes.git "Dependencies/imnodes"
if %_e%==10 (goto :done) else (goto :tracy) if %_e%==9 (goto :done) else (goto :tracy)
:tracy :tracy
echo -----------------------tracy---------------------------- echo -----------------------tracy----------------------------
rmdir "Dependencies/tracy" /S /Q rmdir "Dependencies/tracy" /S /Q
git clone https://github.com/SHADE-DP/tracy.git "Dependencies/tracy" git clone https://github.com/SHADE-DP/tracy.git "Dependencies/tracy"
if %_e%==11 (goto :done) else (goto :RTTR) if %_e%==10 (goto :done) else (goto :RTTR)
:RTTR :RTTR
echo -----------------------RTTR---------------------------- echo -----------------------RTTR----------------------------
rmdir "Dependencies/RTTR" /S /Q rmdir "Dependencies/RTTR" /S /Q
git clone https://github.com/SHADE-DP/RTTR.git "Dependencies/RTTR" git clone https://github.com/SHADE-DP/RTTR.git "Dependencies/RTTR"
if %_e%==12 (goto :done) else (goto :yamlcpp) if %_e%==11 (goto :done) else (goto :yamlcpp)
:yamlcpp :yamlcpp
echo -----------------------yamlcpp---------------------------- echo -----------------------yamlcpp----------------------------
rmdir "Dependencies/yamlcpp" /S /Q rmdir "Dependencies/yamlcpp" /S /Q
git clone https://github.com/SHADE-DP/yaml-cpp.git "Dependencies/yamlcpp" git clone https://github.com/SHADE-DP/yaml-cpp.git "Dependencies/yamlcpp"
if %_e%==12 (goto :done) else (goto :SDL)
:SDL
echo -----------------------SDL----------------------------
rmdir "Dependencies/SDL" /S /Q
mkdir "Dependencies/SDL/include"
mkdir "Dependencies/SDL/lib"
powershell -Command "& {wget https://github.com/libsdl-org/SDL/releases/download/release-2.24.0/SDL2-devel-2.24.0-VC.zip -OutFile "Dependencies/SDL/SDL.zip"}"
powershell -Command "& {Expand-Archive -LiteralPath Dependencies/SDL/SDL.zip -DestinationPath Dependencies/SDL/tmp}"
robocopy "Dependencies/SDL/tmp/SDL2-2.24.0/lib/x64" "Dependencies/SDL/lib/" /ns /nfl /ndl /nc /njh
robocopy "Dependencies/SDL/tmp/SDL2-2.24.0/include/" "Dependencies/SDL/include/" /ns /nfl /ndl /nc /njh
rmdir "Dependencies/SDL/tmp/" /s /q
powershell -Command "& {Remove-Item "Dependencies/SDL/SDL.zip"}"
:done :done
echo DONE! echo DONE!

View File

@ -10,6 +10,6 @@ IncludeDir["tracy"] = "%{wks.location}/Dependencies/tracy"
IncludeDir["VMA"] = "%{wks.location}/Dependencies/VMA" IncludeDir["VMA"] = "%{wks.location}/Dependencies/VMA"
IncludeDir["yamlcpp"] = "%{wks.location}/Dependencies/yamlcpp/include" IncludeDir["yamlcpp"] = "%{wks.location}/Dependencies/yamlcpp/include"
IncludeDir["RTTR"] = "%{wks.location}/Dependencies/RTTR" IncludeDir["RTTR"] = "%{wks.location}/Dependencies/RTTR"
IncludeDir["ktx"] = "%{wks.location}/Dependencies/ktx"
IncludeDir["reactphysics3d"] = "%{wks.location}/Dependencies/reactphysics3d" IncludeDir["reactphysics3d"] = "%{wks.location}/Dependencies/reactphysics3d"
IncludeDir["SDL"] = "%{wks.location}/Dependencies/SDL"
IncludeDir["VULKAN"] = "$(VULKAN_SDK)" IncludeDir["VULKAN"] = "$(VULKAN_SDK)"

View File

@ -26,6 +26,7 @@ project "SHADE_Application"
"../SHADE_Engine/src", "../SHADE_Engine/src",
"src", "src",
"%{IncludeDir.dotnet}/include", "%{IncludeDir.dotnet}/include",
"%{IncludeDir.SDL}/include",
} }
flags flags
@ -36,6 +37,14 @@ project "SHADE_Application"
links links
{ {
"SHADE_Engine", "SHADE_Engine",
"SDL2.lib",
"SDL2main.lib"
}
libdirs
{
"%{IncludeDir.spdlog}/lib",
"%{IncludeDir.SDL}/lib",
} }
warnings 'Extra' warnings 'Extra'

View File

@ -12,6 +12,7 @@
#include <chrono> #include <chrono>
#include <ratio> #include <ratio>
#include <ctime> #include <ctime>
#include <SDL.h>
namespace Sandbox namespace Sandbox
{ {
@ -27,7 +28,9 @@ namespace Sandbox
// Set working directory // Set working directory
SHADE::SHFileUtilities::SetWorkDirToExecDir(); SHADE::SHFileUtilities::SetWorkDirToExecDir();
SDL_Init(SDL_INIT_VIDEO);
window.Create(hInstance, hPrevInstance, lpCmdLine, nCmdShow); window.Create(hInstance, hPrevInstance, lpCmdLine, nCmdShow);
SDL_CreateWindowFrom(window.GetHWND());
#ifdef SHEDITOR #ifdef SHEDITOR
#else #else
@ -49,6 +52,7 @@ namespace Sandbox
void SBApplication::Exit(void) void SBApplication::Exit(void)
{ {
SDL_DestroyWindow(sdlWindow);
#ifdef SHEDITOR #ifdef SHEDITOR
#else #else
#endif #endif

View File

@ -1,6 +1,7 @@
#ifndef SB_APPLICATION_H #ifndef SB_APPLICATION_H
#define SB_APPLICATION_H #define SB_APPLICATION_H
#include <Graphics/Windowing/SHWindow.h> #include <SDL_video.h>
#include "Graphics/Windowing/SHWindow.h"
//using namespace SHADE; //using namespace SHADE;
namespace Sandbox namespace Sandbox
@ -9,6 +10,7 @@ namespace Sandbox
{ {
private: private:
SHADE::SHWindow window; SHADE::SHWindow window;
SDL_Window* sdlWindow;
//SHAppConfig config; //SHAppConfig config;
public: public:
SBApplication() = default; SBApplication() = default;

View File

@ -31,7 +31,7 @@ project "SHADE_Engine"
"%{IncludeDir.tracy}", "%{IncludeDir.tracy}",
"%{IncludeDir.VMA}/include", "%{IncludeDir.VMA}/include",
"%{IncludeDir.yamlcpp}", "%{IncludeDir.yamlcpp}",
"%{IncludeDir.ktx}/include", "%{IncludeDir.SDL}/include",
"%{IncludeDir.RTTR}/include", "%{IncludeDir.RTTR}/include",
"%{IncludeDir.reactphysics3d}/include", "%{IncludeDir.reactphysics3d}/include",
"%{IncludeDir.VULKAN}/include", "%{IncludeDir.VULKAN}/include",
@ -45,6 +45,7 @@ project "SHADE_Engine"
"%{IncludeDir.assimp}/lib/Debug", "%{IncludeDir.assimp}/lib/Debug",
"%{IncludeDir.assimp}/lib/Release", "%{IncludeDir.assimp}/lib/Release",
"%{IncludeDir.RTTR}/lib", "%{IncludeDir.RTTR}/lib",
"%{IncludeDir.SDL}/lib",
"%{IncludeDir.spdlog}/lib" "%{IncludeDir.spdlog}/lib"
} }
@ -56,6 +57,8 @@ project "SHADE_Engine"
"reactphysics3d", "reactphysics3d",
"imgui", "imgui",
"vulkan-1.lib", "vulkan-1.lib",
"SDL2.lib",
"SDL2main.lib",
"shaderc_shared.lib", "shaderc_shared.lib",
"shlwapi" "shlwapi"
} }