Updated with back-end changes.

This commit is contained in:
Arron David Nelson 2024-07-27 10:14:28 -07:00
parent 148c10eb08
commit 2121c8b7de
4 changed files with 44 additions and 24 deletions

4
.idea/misc.xml generated
View File

@ -4,8 +4,4 @@
<option name="pythonIntegrationState" value="YES" /> <option name="pythonIntegrationState" value="YES" />
</component> </component>
<component name="CMakeWorkspace" PROJECT_DIR="$PROJECT_DIR$" /> <component name="CMakeWorkspace" PROJECT_DIR="$PROJECT_DIR$" />
<component name="DiscordProjectSettings">
<option name="show" value="ASK" />
<option name="description" value="" />
</component>
</project> </project>

View File

@ -4,6 +4,7 @@ project(TechDemo C CXX)
if (${CMAKE_HOST_SYSTEM_NAME} STREQUAL "Windows") if (${CMAKE_HOST_SYSTEM_NAME} STREQUAL "Windows")
set(IS_OS_WINDOWS TRUE) set(IS_OS_WINDOWS TRUE)
set(USER_HOME_DIRECTORY $ENV{USERPROFILE}) set(USER_HOME_DIRECTORY $ENV{USERPROFILE})
string(REPLACE "\\" "/" USER_HOME_DIRECTORY "${USER_HOME_DIRECTORY}")
message("Building for the Windows operating system.") message("Building for the Windows operating system.")
elseif (${CMAKE_HOST_SYSTEM_NAME} STREQUAL "Linux") elseif (${CMAKE_HOST_SYSTEM_NAME} STREQUAL "Linux")
set(IS_OS_LINUX TRUE) set(IS_OS_LINUX TRUE)
@ -28,18 +29,11 @@ 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
Gui/HealthBarGui.cpp main.cpp
Gui/HealthBarGui.h) Levels/TestLevel.cpp Levels/TestLevel.h
Levels/MainMenu.cpp Levels/MainMenu.h
if (IS_OS_WINDOWS) Gui/HealthBarGui.cpp Gui/HealthBarGui.h)
add_compile_definitions(VK_USE_PLATFORM_WIN32_KHR)
elseif (IS_OS_LINUX)
add_compile_definitions(VK_USE_PLATFORM_WAYLAND_KHR EHS_WS_WAYLAND)
endif()
target_link_directories(TechDemo PRIVATE "${USER_HOME_DIRECTORY}/.local/lib")
target_include_directories(TechDemo PRIVATE "${USER_HOME_DIRECTORY}/.local/include")
find_package(Vulkan REQUIRED) find_package(Vulkan REQUIRED)
if (Vulkan_FOUND) if (Vulkan_FOUND)
@ -62,4 +56,27 @@ else ()
message(STATUS "OpenSSL was not found.") message(STATUS "OpenSSL was not found.")
endif () endif ()
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) if (IS_OS_WINDOWS)
add_compile_definitions(VK_USE_PLATFORM_WIN32_KHR)
target_include_directories(TechDemo PRIVATE "${USER_HOME_DIRECTORY}/EHS/include")
target_include_directories(TechDemo PRIVATE "${USER_HOME_DIRECTORY}/EHE/include")
target_include_directories(TechDemo PRIVATE "${USER_HOME_DIRECTORY}/EHC/include")
target_include_directories(TechDemo PRIVATE "${USER_HOME_DIRECTORY}/LWE/include")
target_link_directories(TechDemo PRIVATE "${USER_HOME_DIRECTORY}/EHS/lib")
target_link_directories(TechDemo PRIVATE "${USER_HOME_DIRECTORY}/EHE/lib")
target_link_directories(TechDemo PRIVATE "${USER_HOME_DIRECTORY}/EHC/lib")
target_link_directories(TechDemo PRIVATE "${USER_HOME_DIRECTORY}/LWE/lib")
target_link_libraries(TechDemo PRIVATE ws2_32 avrt)
elseif (IS_OS_LINUX)
add_compile_definitions(VK_USE_PLATFORM_WAYLAND_KHR EHS_WS_WAYLAND)
target_link_directories(TechDemo PRIVATE "${USER_HOME_DIRECTORY}/.local/lib")
target_include_directories(TechDemo PRIVATE "${USER_HOME_DIRECTORY}/.local/include")
target_link_libraries(TechDemo PRIVATE wayland-client xcb xcb-cursor xcb-xfixes xcb-xinput asound)
endif()
target_link_libraries(TechDemo PRIVATE Vulkan::Headers Vulkan::Vulkan OpenSSL::SSL OpenSSL::Crypto ZLIB::ZLIB LWE EHC EHE EHS_STC)

View File

@ -214,7 +214,12 @@ void TestLevel::Setup(lwe::GpuInterface* inf)
} }
*/ */
//AddSystem(new lwe::AudioSystem()); lwe::AudioSystem *audioSys = new lwe::AudioSystem();
lwe::AudioSource src("Song", "sample");
src.Play();
audioSys->AddSource(src);
AddSystem(audioSys);
AddSystem(new lwe::SkyboxSystem()); AddSystem(new lwe::SkyboxSystem());
AddSystem(new lwe::RigidBodySystem(true)); AddSystem(new lwe::RigidBodySystem(true));
AddSystem(new lwe::CameraSystem()); AddSystem(new lwe::CameraSystem());
@ -344,13 +349,13 @@ void TestLevel::Setup(lwe::GpuInterface* inf)
//ent->AddComponent(new lwe::Networked(false, false, lwe::EndpointOwner::SERVICE)); //ent->AddComponent(new lwe::Networked(false, false, lwe::EndpointOwner::SERVICE));
/*
lwe::AudioSource3D* as = new lwe::AudioSource3D("Song", "sample", 20.0f); lwe::AudioSource3D* as = new lwe::AudioSource3D("Song", "sample", 20.0f);
as->Pause(); as->Pause();
as->EnableLoop(true); as->EnableLoop(true);
as->EnableAutoDelete(false); as->EnableAutoDelete(false);
//as->EnablePanning(false);
//as->EnableAttenuation(false);
ent.AddComponent(as); ent.AddComponent(as);
*/
lwe::Health* entHealth = new lwe::Health(100, 100); lwe::Health* entHealth = new lwe::Health(100, 100);
ent.AddComponent(entHealth); ent.AddComponent(entHealth);
@ -511,9 +516,11 @@ void TestLevel::OnUpdate(lwe::RenderWindow* win, ehs::Input* input, const float
if (cooldown <= 0.0f && mouse->IsDown(ehs::Mouse::LMB)) // Left Mouse Button if (cooldown <= 0.0f && mouse->IsDown(ehs::Mouse::LMB)) // Left Mouse Button
{ {
/*
lwe::AudioSource* gunshot = new lwe::AudioSource("Gunshot_" + ehs::Str_8::FromNum(count), "Gunshot"); lwe::AudioSource* gunshot = new lwe::AudioSource("Gunshot_" + ehs::Str_8::FromNum(count), "Gunshot");
gunshot->SetVolume(1.0f); gunshot->SetVolume(1.0f);
ply->AddComponent(gunshot); ply->AddComponent(gunshot);
*/
lwe::Entity* bullet = CreateEntity("Bullet", "Bullet_" + ehs::Str_8::FromNum(count++)); lwe::Entity* bullet = CreateEntity("Bullet", "Bullet_" + ehs::Str_8::FromNum(count++));
bullet->SetPos(ply->GetPos() + cam->GetTransform().GetForward() * 2.0f); bullet->SetPos(ply->GetPos() + cam->GetTransform().GetForward() * 2.0f);

View File

@ -18,11 +18,9 @@
#include "Levels/MainMenu.h" #include "Levels/MainMenu.h"
#include "Levels/TestLevel.h" #include "Levels/TestLevel.h"
ehs::SInt_32 Main(ehs::Str_8* appName, ehs::Str_8* appVerId, ehs::Version* appVer) int main()
{ {
*appName = "TechDemo"; ehs::Initialize("TechDemo", "Release", {1, 0, 0});
*appVerId = "Release";
*appVer = {1, 0, 0};
ehs::Log::EnableImmediateMode(true); ehs::Log::EnableImmediateMode(true);
@ -128,5 +126,7 @@ ehs::SInt_32 Main(ehs::Str_8* appName, ehs::Str_8* appVerId, ehs::Version* appVe
ehs::Console::Free(); ehs::Console::Free();
ehs::Uninitialize();
return 0; return 0;
} }