Updated for recent back-end changes.

This commit is contained in:
Arron David Nelson 2024-07-05 13:17:24 -07:00
parent 75b6eb66d3
commit c1b83d07fd
5 changed files with 31 additions and 15 deletions

15
.idea/editor.xml generated
View File

@ -53,13 +53,11 @@
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_EXTENDS_COLON/@EntryValue" value="true" type="bool" /> <option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_EXTENDS_COLON/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_FOR_COLON/@EntryValue" value="true" type="bool" /> <option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_FOR_COLON/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_FOR_COLON/@EntryValue" value="false" type="bool" /> <option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_FOR_COLON/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_REF_IN_DATA_MEMBER/@EntryValue" value="true" type="bool" /> <option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_REF_IN_DATA_MEMBER/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_REF_IN_DATA_MEMBERS/@EntryValue" value="false" type="bool" /> <option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_PTR_IN_ABSTRACT_DECL/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_PTR_IN_ABSTRACT_DECL/@EntryValue" value="false" type="bool" /> <option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_REF_IN_ABSTRACT_DECL/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_REF_IN_ABSTRACT_DECL/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_TEMPLATE_ARGS/@EntryValue" value="false" type="bool" /> <option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_TEMPLATE_ARGS/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_TEMPLATE_PARAMS/@EntryValue" value="false" type="bool" /> <option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_TEMPLATE_PARAMS/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_DECLARATION_PARENTHESES/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_EMPTY_BLOCKS/@EntryValue" value="false" type="bool" /> <option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_EMPTY_BLOCKS/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_EMPTY_TEMPLATE_PARAMS/@EntryValue" value="false" type="bool" /> <option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_EMPTY_TEMPLATE_PARAMS/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_TEMPLATE_ARGS/@EntryValue" value="false" type="bool" /> <option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_TEMPLATE_ARGS/@EntryValue" value="false" type="bool" />
@ -83,5 +81,12 @@
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/CONTINUOUS_LINE_INDENT/@EntryValue" value="Double" type="string" /> <option name="/Default/CodeStyle/CodeFormatting/CppFormatting/CONTINUOUS_LINE_INDENT/@EntryValue" value="Double" type="string" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/TAB_WIDTH/@EntryValue" value="4" type="int" /> <option name="/Default/CodeStyle/CodeFormatting/CppFormatting/TAB_WIDTH/@EntryValue" value="4" type="int" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/LINKAGE_SPECIFICATION_BRACES/@EntryValue" value="NEXT_LINE" type="string" /> <option name="/Default/CodeStyle/CodeFormatting/CppFormatting/LINKAGE_SPECIFICATION_BRACES/@EntryValue" value="NEXT_LINE" type="string" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_PTR_IN_DATA_MEMBER/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_PTR_IN_DATA_MEMBER/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_PTR_IN_METHOD/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_PTR_IN_METHOD/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_REF_IN_DATA_MEMBER/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_REF_IN_METHOD/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_REF_IN_METHOD/@EntryValue" value="false" type="bool" />
</component> </component>
</project> </project>

3
.idea/misc.xml generated
View File

@ -1,5 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<component name="CMakePythonSetting">
<option name="pythonIntegrationState" value="YES" />
</component>
<component name="CMakeWorkspace" PROJECT_DIR="$PROJECT_DIR$" /> <component name="CMakeWorkspace" PROJECT_DIR="$PROJECT_DIR$" />
<component name="DiscordProjectSettings"> <component name="DiscordProjectSettings">
<option name="show" value="ASK" /> <option name="show" value="ASK" />

View File

@ -24,6 +24,8 @@ elseif ("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "ARM64" OR "${CMAKE_SYSTEM_PROCESSO
set(IS_ARCH_ARM64 TRUE) set(IS_ARCH_ARM64 TRUE)
endif () endif ()
message("Home Dir: ${USER_HOME_DIRECTORY}")
set(CMAKE_CXX_STANDARD 20) set(CMAKE_CXX_STANDARD 20)
add_executable(TechDemo main.cpp Levels/TestLevel.cpp Levels/TestLevel.h Levels/MainMenu.cpp Levels/MainMenu.h add_executable(TechDemo main.cpp Levels/TestLevel.cpp Levels/TestLevel.h Levels/MainMenu.cpp Levels/MainMenu.h
@ -33,7 +35,7 @@ add_executable(TechDemo main.cpp Levels/TestLevel.cpp Levels/TestLevel.h Levels/
if (IS_OS_WINDOWS) if (IS_OS_WINDOWS)
add_compile_definitions(VK_USE_PLATFORM_WIN32_KHR) add_compile_definitions(VK_USE_PLATFORM_WIN32_KHR)
elseif (IS_OS_LINUX) elseif (IS_OS_LINUX)
add_compile_definitions(VK_USE_PLATFORM_XCB_KHR EHS_WS_XCB) add_compile_definitions(VK_USE_PLATFORM_WAYLAND_KHR EHS_WS_WAYLAND)
endif() endif()
target_link_directories(TechDemo PRIVATE "${USER_HOME_DIRECTORY}/.local/lib") target_link_directories(TechDemo PRIVATE "${USER_HOME_DIRECTORY}/.local/lib")
@ -60,4 +62,4 @@ else ()
message(STATUS "OpenSSL was not found.") message(STATUS "OpenSSL was not found.")
endif () endif ()
target_link_libraries(TechDemo PRIVATE Vulkan::Headers Vulkan::Vulkan xcb xcb-cursor xcb-xfixes xcb-xinput OpenSSL::SSL OpenSSL::Crypto ZLIB::ZLIB asound LWE EHC EHE EHS) target_link_libraries(TechDemo PRIVATE Vulkan::Headers Vulkan::Vulkan wayland-client xcb xcb-cursor xcb-xfixes xcb-xinput OpenSSL::SSL OpenSSL::Crypto ZLIB::ZLIB asound LWE EHC EHE EHS)

View File

@ -1,6 +1,6 @@
#include "TestLevel.h" #include "TestLevel.h"
#include <ehs/GarbageCollector.h> #include <ehs/GC.h>
#include <ehs/io/Console.h> #include <ehs/io/Console.h>
#include <ehs/io/File.h> #include <ehs/io/File.h>
#include <ehs/io/socket/DNS.h> #include <ehs/io/socket/DNS.h>
@ -87,6 +87,7 @@ void TestLevel::SetupResources(lwe::GpuInterface* inf)
lwe::GpuModel* vampire = new lwe::GpuModel("resources/models/Vampire.ehm", inf); lwe::GpuModel* vampire = new lwe::GpuModel("resources/models/Vampire.ehm", inf);
AddResource(vampire); AddResource(vampire);
AddResource(new lwe::GpuImg("resources/textures/Character_Diffuse.png", inf, lwe::IMG_ASPECT_COLOR)); AddResource(new lwe::GpuImg("resources/textures/Character_Diffuse.png", inf, lwe::IMG_ASPECT_COLOR));
AddResource(new lwe::GpuImg("resources/textures/Character_Normal.png", inf, lwe::IMG_ASPECT_COLOR)); AddResource(new lwe::GpuImg("resources/textures/Character_Normal.png", inf, lwe::IMG_ASPECT_COLOR));
AddResource(new lwe::GpuImg("resources/textures/Character_Specular.png", inf, lwe::IMG_ASPECT_COLOR)); AddResource(new lwe::GpuImg("resources/textures/Character_Specular.png", inf, lwe::IMG_ASPECT_COLOR));
@ -100,7 +101,6 @@ void TestLevel::SetupResources(lwe::GpuInterface* inf)
AddResource(new lwe::GpuModel("resources/models/Cube.ehm", inf)); AddResource(new lwe::GpuModel("resources/models/Cube.ehm", inf));
AddResource(new lwe::GpuModel("resources/models/Sphere.ehm", inf)); AddResource(new lwe::GpuModel("resources/models/Sphere.ehm", inf));
AddResource(new lwe::GpuModel("resources/models/PointLight.ehm", inf));
lwe::GpuCubeMap* cm = new lwe::GpuCubeMap(inf, "resources/textures/skybox", "Skybox"); lwe::GpuCubeMap* cm = new lwe::GpuCubeMap(inf, "resources/textures/skybox", "Skybox");
AddResource(cm); AddResource(cm);
@ -285,7 +285,7 @@ void TestLevel::Setup(lwe::GpuInterface* inf)
deltaTime->SetText("Delta Time: " + ehs::Str_8::FromNum(gl->GetRawDeltaTime())); deltaTime->SetText("Delta Time: " + ehs::Str_8::FromNum(gl->GetRawDeltaTime()));
lwe::LabelGui* gbg = (lwe::LabelGui*)stats->GetChild("Garbage"); lwe::LabelGui* gbg = (lwe::LabelGui*)stats->GetChild("Garbage");
gbg->SetText("Garbage: " + ehs::Str_8::FromNum(ehs::GarbageCollector::Size())); gbg->SetText("Garbage: " + ehs::Str_8::FromNum(ehs::GC::Size()));
}}); }});
/* /*
@ -486,7 +486,7 @@ void TestLevel::OnUpdate(lwe::RenderWindow* win, ehs::Input* input, const float
if (!ent) if (!ent)
return; return;
ent->SetRot(ent->GetRot() + ehs::Vec3_f(50.0f) * delta); //ent->SetRot(ent->GetRot() + ehs::Vec3_f(50.0f) * delta);
lwe::Entity* ply = GetEntity("Player"); lwe::Entity* ply = GetEntity("Player");
if (ply && win->IsCursorConstrained() && !win->IsCursorVisible()) if (ply && win->IsCursorConstrained() && !win->IsCursorVisible())

View File

@ -1,6 +1,6 @@
#include <ehs/Str.h> #include <ehs/Str.h>
#include <ehs/Log.h> #include <ehs/Log.h>
#include <ehs/GarbageCollector.h> #include <ehs/GC.h>
#include <ehs/Array.h> #include <ehs/Array.h>
#include <ehs/io/File.h> #include <ehs/io/File.h>
#include <ehs/io/Console.h> #include <ehs/io/Console.h>
@ -24,6 +24,8 @@ ehs::SInt_32 Main(ehs::Str_8* appName, ehs::Str_8* appVerId, ehs::Version* appVe
*appVerId = "Release"; *appVerId = "Release";
*appVer = {1, 0, 0}; *appVer = {1, 0, 0};
ehs::Log::EnableImmediateMode(true);
ehs::File configFile("Config.json", ehs::Mode::READ_WRITE, ehs::Disposition::OPEN_PERSISTENT); ehs::File configFile("Config.json", ehs::Mode::READ_WRITE, ehs::Disposition::OPEN_PERSISTENT);
if (!configFile.Size()) if (!configFile.Size())
@ -74,7 +76,7 @@ ehs::SInt_32 Main(ehs::Str_8* appName, ehs::Str_8* appVerId, ehs::Version* appVe
ehs::Console::SetTitle_8("TechDemo"); ehs::Console::SetTitle_8("TechDemo");
EHS_LOG("Info", 0, "Initializing server, standby."); EHS_LOG(ehs::LogType::INFO, 0, "Initializing server, standby.");
lwe::GameLoop gl((ehs::UInt_8)*(ehs::JsonNum*)config.RetrieveValue("engine.threadCount"), 0); lwe::GameLoop gl((ehs::UInt_8)*(ehs::JsonNum*)config.RetrieveValue("engine.threadCount"), 0);
gl.EnableTimeLock(*(ehs::JsonBool*)config.RetrieveValue("engine.timeLocked")); gl.EnableTimeLock(*(ehs::JsonBool*)config.RetrieveValue("engine.timeLocked"));
@ -93,11 +95,15 @@ ehs::SInt_32 Main(ehs::Str_8* appName, ehs::Str_8* appVerId, ehs::Version* appVe
#if defined(EHS_OS_WINDOWS) #if defined(EHS_OS_WINDOWS)
lwe::GpuInstance::AddExtension(VK_KHR_WIN32_SURFACE_EXTENSION_NAME); lwe::GpuInstance::AddExtension(VK_KHR_WIN32_SURFACE_EXTENSION_NAME);
#elif defined(EHS_OS_LINUX) #elif defined(EHS_OS_LINUX)
lwe::GpuInstance::AddExtension(VK_KHR_XCB_SURFACE_EXTENSION_NAME); #if defined(EHS_WS_WAYLAND)
lwe::GpuInstance::AddExtension(VK_KHR_WAYLAND_SURFACE_EXTENSION_NAME);
#elif defined(EHS_WS_XCB)
lwe::GpuInstance::AddExtension(VK_KHR_XCB_SURFACE_EXTENSION_NAME);
#endif
#endif #endif
lwe::GpuInstance::AddExtension(VK_KHR_SURFACE_EXTENSION_NAME); lwe::GpuInstance::AddExtension(VK_KHR_SURFACE_EXTENSION_NAME);
lwe::GpuInstance::Initialize(false); lwe::GpuInstance::Initialize(true);
lwe::GpuDevice device = std::move(lwe::GpuDevice::GetBest()); lwe::GpuDevice device = std::move(lwe::GpuDevice::GetBest());
lwe::GpuQueueFamily* family = device.GetQueueFamily(lwe::QueueType::GRAPHICS); lwe::GpuQueueFamily* family = device.GetQueueFamily(lwe::QueueType::GRAPHICS);