diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..73435d4 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,118 @@ +cmake_minimum_required(VERSION 3.20) + +if (POLICY CMP0141) + cmake_policy(SET CMP0141 NEW) + set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT "$,$>,$<$:EditAndContinue>,$<$:ProgramDatabase>>") +endif() + +set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/") + +project(openvr_ambient_light) + +set(CMAKE_CXX_STANDARD 20) +set(CMAKE_CXX_STANDARD_REQUIRED ON) +set(CMAKE_CXX_EXTENSIONS OFF) + +set(OpenVR_ROOT ${CMAKE_SOURCE_DIR}/external/openvr) +find_package(OpenVR REQUIRED) + +# Include rest of the CMake bindings +add_subdirectory(external) + +find_program(FXC fxc REQUIRED) + +set(SHADER_DIR ${CMAKE_SOURCE_DIR}/shaders) +set(GEN_DIR ${CMAKE_BINARY_DIR}/generated/shaders) +set(BIN_DIR ${CMAKE_BINARY_DIR}/shader_bin) + +file(GLOB_RECURSE HLSL_SHADERS CONFIGURE_DEPENDS + ${SHADER_DIR}/*.hlsl +) + +set(GENERATED_HEADERS) + +foreach(SHADER ${HLSL_SHADERS}) + + file(RELATIVE_PATH REL ${SHADER_DIR} ${SHADER}) + + get_filename_component(BASE_NAME ${REL} NAME_WE) + + string(REPLACE "/" "_" BASE_NAME ${BASE_NAME}) + string(REPLACE "\\" "_" BASE_NAME ${BASE_NAME}) + + set(OUT "${GEN_DIR}/${BASE_NAME}.h") + set(BIN "${BIN_DIR}/${BASE_NAME}.bin") + + add_custom_command( + OUTPUT ${OUT} + + COMMAND ${CMAKE_COMMAND} -E make_directory ${GEN_DIR} + COMMAND ${CMAKE_COMMAND} -E make_directory ${BIN_DIR} + + COMMAND ${FXC} + -T cs_5_0 + -E main + -Fo ${BIN} + ${SHADER} + + COMMAND powershell -ExecutionPolicy Bypass + -File ${CMAKE_SOURCE_DIR}/scripts/hlsl2bin.ps1 + -InputPath "${BIN}" + -OutputPath "${OUT}" + -Name "${BASE_NAME}" + + DEPENDS ${SHADER} ${CMAKE_SOURCE_DIR}/scripts/hlsl2bin.ps1 + VERBATIM + ) + + list(APPEND GENERATED_HEADERS ${OUT}) + +endforeach() + +set(SOURCES + "src/main.cpp" + "src/d3d11_renderer.cpp" + "src/settings_menu.cpp" + "src/settings_manager.cpp" + "src/ambient_light_sampler.cpp" + "src/adalight_led_interface.cpp" +) + +add_executable(openvr_ambient_light WIN32 ${SOURCES}) + +target_sources(openvr_ambient_light PRIVATE ${GENERATED_HEADERS}) + +target_include_directories(openvr_ambient_light PRIVATE + ${CMAKE_BINARY_DIR}/generated +) + +add_custom_target(shader_headers ALL + DEPENDS ${GENERATED_HEADERS} +) + +if (UNIX AND NOT APPLE) + set_target_properties(openvr_ambient_light PROPERTIES + BUILD_RPATH "$ORIGIN" + INSTALL_RPATH "$ORIGIN" + INSTALL_RPATH_USE_LINK_PATH FALSE + ) +endif() + +target_include_directories(openvr_ambient_light PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include) + +# Windows executable icon +if (WIN32) + target_sources(openvr_ambient_light PRIVATE "resources/openvr_ambient_light.rc") +endif() + +target_compile_features(openvr_ambient_light PUBLIC cxx_std_20) + +target_link_libraries(openvr_ambient_light + PRIVATE + OpenVR::API + ImGui + spdlog_header_only + SimpleINI + renderdoc + d3d11 dxgi dxguid uxtheme pathcch onecore +) \ No newline at end of file diff --git a/cmake/Modules/FindOpenVR.cmake b/cmake/Modules/FindOpenVR.cmake new file mode 100644 index 0000000..a11d6a2 --- /dev/null +++ b/cmake/Modules/FindOpenVR.cmake @@ -0,0 +1,96 @@ +# Note: this bitness check does not work for universal builds. +if (CMAKE_SIZEOF_VOID_P EQUAL 8) + set(_openvr_bitness 64) +else () + set(_openvr_bitness 32) +endif () + +if (CMAKE_SYSTEM_NAME MATCHES "Darwin") + set(_openvr_platform_base osx) + set(OpenVR_PLATFORM osx32) +elseif (CMAKE_SYSTEM_NAME MATCHES "Linux") + set(_openvr_platform_base linux) + set(OpenVR_PLATFORM "${_openvr_platform_base}${_openvr_bitness}") +elseif (WIN32) + set(_openvr_platform_base win) + set(OpenVR_PLATFORM "${_openvr_platform_base}${_openvr_bitness}") +endif () + +find_path(OpenVR_INCLUDE_DIR + NAMES + openvr.h + openvr_driver.h + PATH_SUFFIXES + headers) +mark_as_advanced(OpenVR_INCLUDE_DIR) + +set(_openvr_lib_name "") +if (WIN32) + set(_openvr_lib_name openvr_api) +elseif (CMAKE_SYSTEM_NAME MATCHES "Linux") + set(_openvr_lib_name openvr_api) +elseif (CMAKE_SYSTEM_NAME MATCHES "Darwin") + set(_openvr_lib_name openvr_api) +endif() + +find_library(OpenVR_LIBRARY + NAMES ${_openvr_lib_name} + PATHS ${OpenVR_ROOT} + PATH_SUFFIXES "lib/${OpenVR_PLATFORM}") +mark_as_advanced(OpenVR_LIBRARY) + +if (WIN32) + find_file(OpenVR_BINARY + NAMES openvr_api.dll + PATHS ${OpenVR_ROOT} + PATH_SUFFIXES "bin/${OpenVR_PLATFORM}") + mark_as_advanced(OpenVR_BINARY) +else() + set(OpenVR_BINARY ${OpenVR_LIBRARY}) +endif() + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(OpenVR + REQUIRED_VARS OpenVR_LIBRARY OpenVR_INCLUDE_DIR) + +if (OpenVR_FOUND) + set(OpenVR_INCLUDE_DIRS "${OpenVR_INCLUDE_DIR}") + set(OpenVR_LIBRARIES "${OpenVR_LIBRARY}") + get_filename_component(OpenVR_LIBRARY_DIR "${OpenVR_LIBRARY}" DIRECTORY) + + if (NOT TARGET OpenVR::API) + if (WIN32) + add_library(OpenVR::API SHARED IMPORTED) + set_target_properties(OpenVR::API + PROPERTIES + IMPORTED_IMPLIB "${OpenVR_LIBRARY}" + IMPORTED_LOCATION "${OpenVR_BINARY}" + INTERFACE_INCLUDE_DIRECTORIES "${OpenVR_INCLUDE_DIR}") + elseif (CMAKE_SYSTEM_NAME MATCHES "Linux") + # Link by name/search path so the executable does not embed an absolute OpenVR path. + add_library(OpenVR::API INTERFACE IMPORTED) + set_target_properties(OpenVR::API + PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES "${OpenVR_INCLUDE_DIR}" + INTERFACE_LINK_DIRECTORIES "${OpenVR_LIBRARY_DIR}" + INTERFACE_LINK_LIBRARIES "openvr_api") + else() + add_library(OpenVR::API SHARED IMPORTED) + set_target_properties(OpenVR::API + PROPERTIES + IMPORTED_LOCATION "${OpenVR_LIBRARY}" + INTERFACE_INCLUDE_DIRECTORIES "${OpenVR_INCLUDE_DIR}") + endif() + endif () + + if (NOT TARGET OpenVR::Driver) + add_library(OpenVR::Driver INTERFACE IMPORTED) + set_target_properties(OpenVR::Driver + PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES "${OpenVR_INCLUDE_DIR}") + endif () +endif () + +unset(_openvr_bitness) +unset(_openvr_platform_base) +unset(_openvr_lib_name) \ No newline at end of file diff --git a/external/CMakeLists.txt b/external/CMakeLists.txt new file mode 100644 index 0000000..2b62a53 --- /dev/null +++ b/external/CMakeLists.txt @@ -0,0 +1,39 @@ +include(${CMAKE_ROOT}/Modules/ExternalProject.cmake) + +set(ImGui_ROOT ${CMAKE_SOURCE_DIR}/external/imgui) +set(ImPlot_ROOT ${CMAKE_SOURCE_DIR}/external/implot) +set(SimpleINI_ROOT ${CMAKE_SOURCE_DIR}/external/simpleini) +set(RenderDoc_ROOT ${CMAKE_SOURCE_DIR}/external/renderdoc) + +# imgui & implot +add_library(ImGui STATIC + ${ImGui_ROOT}/backends/imgui_impl_dx11.cpp + ${ImGui_ROOT}/backends/imgui_impl_win32.cpp + ${ImGui_ROOT}/imgui.cpp + ${ImGui_ROOT}/imgui_demo.cpp + ${ImGui_ROOT}/imgui_draw.cpp + ${ImGui_ROOT}/imgui_tables.cpp + ${ImGui_ROOT}/imgui_widgets.cpp + ${ImGui_ROOT}/misc/cpp/imgui_stdlib.cpp + # ImPlot + ${ImPlot_ROOT}/implot.cpp + ${ImPlot_ROOT}/implot_items.cpp +) + +target_include_directories(ImGui PUBLIC ${ImGui_ROOT}) +target_include_directories(ImGui PUBLIC ${ImPlot_ROOT}) + +# spdlog +add_subdirectory(spdlog) + +# simpleini +add_library(SimpleINI STATIC + ${SimpleINI_ROOT}/ConvertUTF.c +) + +target_include_directories(SimpleINI PUBLIC ${SimpleINI_ROOT}) + +# rederdoc +add_library(renderdoc INTERFACE) + +target_include_directories(renderdoc INTERFACE ${RenderDoc_ROOT}) \ No newline at end of file diff --git a/external/renderdoc_app.h b/external/renderdoc/renderdoc_app.h similarity index 100% rename from external/renderdoc_app.h rename to external/renderdoc/renderdoc_app.h diff --git a/Resource.h b/include/Resource.h similarity index 100% rename from Resource.h rename to include/Resource.h diff --git a/adalight_led_interface.h b/include/adalight_led_interface.h similarity index 100% rename from adalight_led_interface.h rename to include/adalight_led_interface.h diff --git a/ambient_light_sampler.h b/include/ambient_light_sampler.h similarity index 100% rename from ambient_light_sampler.h rename to include/ambient_light_sampler.h diff --git a/async_data.h b/include/async_data.h similarity index 100% rename from async_data.h rename to include/async_data.h diff --git a/d3d11_renderer.h b/include/d3d11_renderer.h similarity index 100% rename from d3d11_renderer.h rename to include/d3d11_renderer.h diff --git a/framework.h b/include/framework.h similarity index 100% rename from framework.h rename to include/framework.h diff --git a/led_interface.h b/include/led_interface.h similarity index 100% rename from led_interface.h rename to include/led_interface.h diff --git a/main.h b/include/main.h similarity index 100% rename from main.h rename to include/main.h diff --git a/mathutil.h b/include/mathutil.h similarity index 100% rename from mathutil.h rename to include/mathutil.h diff --git a/profiling.h b/include/profiling.h similarity index 100% rename from profiling.h rename to include/profiling.h diff --git a/settings_manager.h b/include/settings_manager.h similarity index 100% rename from settings_manager.h rename to include/settings_manager.h diff --git a/settings_menu.h b/include/settings_menu.h similarity index 100% rename from settings_menu.h rename to include/settings_menu.h diff --git a/structures.h b/include/structures.h similarity index 100% rename from structures.h rename to include/structures.h diff --git a/targetver.h b/include/targetver.h similarity index 100% rename from targetver.h rename to include/targetver.h diff --git a/openvr_ambient_light.sln b/openvr_ambient_light.sln deleted file mode 100644 index 674d043..0000000 --- a/openvr_ambient_light.sln +++ /dev/null @@ -1,22 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 17 -VisualStudioVersion = 17.12.35521.163 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "openvr_ambient_light", "openvr_ambient_light.vcxproj", "{E77809F8-4A7E-4CF6-A44F-A3DC75EA96CB}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|x64 = Debug|x64 - Release|x64 = Release|x64 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {E77809F8-4A7E-4CF6-A44F-A3DC75EA96CB}.Debug|x64.ActiveCfg = Debug|x64 - {E77809F8-4A7E-4CF6-A44F-A3DC75EA96CB}.Debug|x64.Build.0 = Debug|x64 - {E77809F8-4A7E-4CF6-A44F-A3DC75EA96CB}.Release|x64.ActiveCfg = Release|x64 - {E77809F8-4A7E-4CF6-A44F-A3DC75EA96CB}.Release|x64.Build.0 = Release|x64 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/openvr_ambient_light.vcxproj b/openvr_ambient_light.vcxproj deleted file mode 100644 index d0d61c7..0000000 --- a/openvr_ambient_light.vcxproj +++ /dev/null @@ -1,250 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - Debug - x64 - - - Release - x64 - - - - 17.0 - Win32Proj - {e77809f8-4a7e-4cf6-a44f-a3dc75ea96cb} - openvrambientlight - 10.0 - - - - Application - true - v143 - Unicode - - - Application - false - v143 - true - Unicode - - - Application - true - v143 - Unicode - - - Application - false - v143 - true - Unicode - - - - - - - - - - - - - - - - - - - - - $(SolutionDir)build\$(Platform)\$(Configuration)\ - build\intermediate\$(Platform)\$(Configuration)\ - - - $(SolutionDir)build\$(Platform)\$(Configuration)\ - build\intermediate\$(Platform)\$(Configuration)\ - - - - Level3 - true - WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - true - - - Windows - true - - - - - Level3 - true - true - true - WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - true - - - Windows - true - true - true - - - - - Level3 - true - _DEBUG;_WINDOWS;%(PreprocessorDefinitions) - true - stdcpp20 - stdc17 - $(SolutionDir)\external\openvr\headers;$(SolutionDir)\external\imgui;$(SolutionDir)\external\implot;$(SolutionDir)\external\spdlog\include;$(SolutionDir)\external\simpleini;%(AdditionalIncludeDirectories) - AdvancedVectorExtensions2 - /utf-8 %(AdditionalOptions) - - - Windows - true - $(SolutionDir)\external\openvr\lib\win64;$(SolutionDir)\external\spdlog\build\RelWithDebInfo;%(AdditionalLibraryDirectories) - kernel32.lib;user32.lib;gdi32.lib;winspool.lib;d3d11.lib;dxgi.lib;openvr_api.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;pathcch.lib;Dwmapi.lib;UxTheme.lib;spdlog.lib;dxguid.lib;OneCore.lib;%(AdditionalDependencies) - - - copy $(SolutionDir)\external\openvr\bin\win64\openvr_api.dll $(OutDir) -copy $(SolutionDir)\openvr_ambient_light.vrmanifest $(OutDir) -copy $(SolutionDir)\readme.md $(OutDir) - - - 5.0 - - - - - - Level3 - true - true - true - NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - true - stdcpp20 - stdc17 - $(SolutionDir)\external\openvr\headers;$(SolutionDir)\external\imgui;$(SolutionDir)\external\implot;$(SolutionDir)\external\spdlog\include;$(SolutionDir)\external\simpleini;%(AdditionalIncludeDirectories) - AdvancedVectorExtensions2 - /utf-8 %(AdditionalOptions) - - - Windows - true - true - true - $(SolutionDir)\external\openvr\lib\win64;$(SolutionDir)\external\spdlog\build\RelWithDebInfo;%(AdditionalLibraryDirectories) - kernel32.lib;user32.lib;gdi32.lib;winspool.lib;d3d11.lib;dxgi.lib;openvr_api.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;pathcch.lib;Dwmapi.lib;UxTheme.lib;spdlog.lib;dxguid.lib;OneCore.lib;%(AdditionalDependencies) - - - copy $(SolutionDir)\external\openvr\bin\win64\openvr_api.dll $(OutDir) -copy $(SolutionDir)\openvr_ambient_light.vrmanifest $(OutDir) -copy $(SolutionDir)\readme.md $(OutDir) - - - 5.0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - shaders/combine_light_cs.h - shaders/combine_light_cs.h - g_combineLightCS - g_combineLightCS - Compute - Compute - - - Compute - 5.0 - Compute - 5.0 - g_gatherLightCS - shaders/gather_light_cs.h - g_gatherLightCS - shaders/gather_light_cs.h - - - - - - - - - - - - \ No newline at end of file diff --git a/openvr_ambient_light.vcxproj.filters b/openvr_ambient_light.vcxproj.filters deleted file mode 100644 index fb586f6..0000000 --- a/openvr_ambient_light.vcxproj.filters +++ /dev/null @@ -1,181 +0,0 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd - - - {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms - - - {6ad17205-77de-47b0-9af6-8eed081c5b05} - - - {bb8d1aa1-da51-40c9-8d5f-2781fc3a9a50} - - - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - External - - - External - - - External - - - External - - - External - - - External - - - External - - - External - - - External - - - Header Files - - - Header Files - - - External - - - External - - - Header Files - - - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - External - - - External - - - External - - - External - - - External - - - External - - - External - - - External - - - External - - - External - - - - - Resource Files - - - - - Resource Files - - - Resource Files - - - - - Shaders - - - Shaders - - - - - External - - - - - External - - - \ No newline at end of file diff --git a/icon.kra b/resources/icon.kra similarity index 100% rename from icon.kra rename to resources/icon.kra diff --git a/icon_off.ico b/resources/icon_off.ico similarity index 100% rename from icon_off.ico rename to resources/icon_off.ico diff --git a/icon_on.ico b/resources/icon_on.ico similarity index 100% rename from icon_on.ico rename to resources/icon_on.ico diff --git a/icon_small.kra b/resources/icon_small.kra similarity index 100% rename from icon_small.kra rename to resources/icon_small.kra diff --git a/openvr_ambient_light.rc b/resources/openvr_ambient_light.rc similarity index 100% rename from openvr_ambient_light.rc rename to resources/openvr_ambient_light.rc diff --git a/openvr_ambient_light.vrmanifest b/resources/openvr_ambient_light.vrmanifest similarity index 100% rename from openvr_ambient_light.vrmanifest rename to resources/openvr_ambient_light.vrmanifest diff --git a/scripts/hlsl2bin.ps1 b/scripts/hlsl2bin.ps1 new file mode 100644 index 0000000..b5b3b8d --- /dev/null +++ b/scripts/hlsl2bin.ps1 @@ -0,0 +1,35 @@ +param( + [Parameter(Mandatory=$true)][string]$InputPath, + [Parameter(Mandatory=$true)][string]$OutputPath, + [Parameter(Mandatory=$true)][string]$Name +) + +if (-not $InputPath -or -not (Test-Path $InputPath)) { + throw "Invalid input path: '$InputPath'" +} + +$bytes = [System.IO.File]::ReadAllBytes($InputPath) + +$sb = [System.Text.StringBuilder]::new() +[void]$sb.AppendLine("#pragma once") +[void]$sb.AppendLine("") +[void]$sb.AppendLine("static const unsigned char g_$Name[] = {") + +$perLine = 16 +for ($i = 0; $i -lt $bytes.Length; $i += $perLine) { + $end = [Math]::Min($i + $perLine, $bytes.Length) - 1 + $chunk = $bytes[$i..$end] | ForEach-Object { "0x{0:x2}" -f $_ } + [void]$sb.Append(" ") + [void]$sb.Append(($chunk -join ", ")) + if ($end -lt $bytes.Length - 1) { [void]$sb.Append(",") } + [void]$sb.AppendLine() +} + +[void]$sb.AppendLine("};") +[void]$sb.AppendLine("static const unsigned int g_${Name}_size = $($bytes.Length);") + +$outDir = Split-Path -Parent $OutputPath +if ($outDir -and -not (Test-Path $outDir)) { + New-Item -ItemType Directory -Path $outDir -Force | Out-Null +} +Set-Content -Encoding ASCII -Path $OutputPath -Value $sb.ToString() -NoNewline \ No newline at end of file diff --git a/adalight_led_interface.cpp b/src/adalight_led_interface.cpp similarity index 100% rename from adalight_led_interface.cpp rename to src/adalight_led_interface.cpp diff --git a/ambient_light_sampler.cpp b/src/ambient_light_sampler.cpp similarity index 100% rename from ambient_light_sampler.cpp rename to src/ambient_light_sampler.cpp diff --git a/d3d11_renderer.cpp b/src/d3d11_renderer.cpp similarity index 97% rename from d3d11_renderer.cpp rename to src/d3d11_renderer.cpp index f2c78e6..acee92d 100644 --- a/d3d11_renderer.cpp +++ b/src/d3d11_renderer.cpp @@ -1,15 +1,13 @@ #include -#include "external/renderdoc_app.h" +#include #include #include "shaders/gather_light_cs.h" #include "shaders/combine_light_cs.h" - - #include "d3d11_renderer.h" @@ -119,17 +117,16 @@ bool D3D11Renderer::InitRenderer() return false; } - - if (FAILED(m_device->CreateComputeShader(g_gatherLightCS, sizeof(g_gatherLightCS), nullptr, &m_gatherLightCS))) + if (FAILED(m_device->CreateComputeShader(g_gather_light_cs, sizeof(g_gather_light_cs), nullptr, &m_gatherLightCS))) { - g_logger->error("g_gatherLightCS creation failure!"); + g_logger->error("g_gather_light_cs creation failure!"); return false; } SET_DXGI_DEBUGNAME(m_gatherLightCS); - if (FAILED(m_device->CreateComputeShader(g_combineLightCS, sizeof(g_combineLightCS), nullptr, &m_combineLightCS))) + if (FAILED(m_device->CreateComputeShader(g_combine_light_cs, sizeof(g_combine_light_cs), nullptr, &m_combineLightCS))) { - g_logger->error("g_gatherLightCS creation failure!"); + g_logger->error("g_combine_light_cs creation failure!"); return false; } SET_DXGI_DEBUGNAME(m_combineLightCS); diff --git a/fonts/cousine_regular.cpp b/src/fonts/cousine_regular.cpp similarity index 100% rename from fonts/cousine_regular.cpp rename to src/fonts/cousine_regular.cpp diff --git a/fonts/roboto_medium.cpp b/src/fonts/roboto_medium.cpp similarity index 100% rename from fonts/roboto_medium.cpp rename to src/fonts/roboto_medium.cpp diff --git a/main.cpp b/src/main.cpp similarity index 99% rename from main.cpp rename to src/main.cpp index 011e1e6..78e18c1 100644 --- a/main.cpp +++ b/src/main.cpp @@ -79,8 +79,8 @@ int APIENTRY wWinMain(_In_ HINSTANCE hInstance, _In_opt_ HINSTANCE hPrevInstance { g_hInstance = hInstance; - g_iconOn = LoadIconW(g_hInstance, MAKEINTRESOURCE(IDI_ICON1_ON)); - g_iconOff = LoadIconW(g_hInstance, MAKEINTRESOURCE(IDI_ICON2_OFF)); + g_iconOn = LoadIconW(g_hInstance, MAKEINTRESOURCEW(IDI_ICON1_ON)); + g_iconOff = LoadIconW(g_hInstance, MAKEINTRESOURCEW(IDI_ICON2_OFF)); LoadStringW(g_hInstance, IDS_APP_TITLE, g_titleString, MAX_LOADSTRING); LoadStringW(g_hInstance, IDC_OPENVRAMBIENTLIGHT, g_windowClass, MAX_LOADSTRING); @@ -116,7 +116,7 @@ int APIENTRY wWinMain(_In_ HINSTANCE hInstance, _In_opt_ HINSTANCE hPrevInstance g_instanceMutex = CreateMutexW(NULL, TRUE, MUTEX_APP_KEY); if (GetLastError() == ERROR_ALREADY_EXISTS) { - HWND window = FindWindow(NULL, g_titleString); + HWND window = FindWindowW(NULL, g_titleString); if (bStartWindow && window != NULL) { SendMessage(window, WM_COMMAND, IDM_TRAYOPEN, 0); diff --git a/settings_manager.cpp b/src/settings_manager.cpp similarity index 100% rename from settings_manager.cpp rename to src/settings_manager.cpp diff --git a/settings_menu.cpp b/src/settings_menu.cpp similarity index 99% rename from settings_menu.cpp rename to src/settings_menu.cpp index 58669c4..277ad70 100644 --- a/settings_menu.cpp +++ b/src/settings_menu.cpp @@ -7,6 +7,7 @@ #include "misc/cpp/imgui_stdlib.h" #include "implot.h" #include +#include #include "mathutil.h" #include "settings_menu.h"