From c7f8de063267c4fd03d300304e7c60bcdd5fe90a Mon Sep 17 00:00:00 2001 From: redstrate <54911369+redstrate@users.noreply.github.com> Date: Thu, 13 Aug 2020 08:02:30 -0400 Subject: [PATCH] Add missing stubs for platform functions on windows --- platforms/windows/CMakeLists.txt | 6 ++- platforms/windows/main.cpp.in | 64 +++++++++++++++++++++++++++++++- platforms/windows/windows.cpp | 8 ++++ 3 files changed, 76 insertions(+), 2 deletions(-) diff --git a/platforms/windows/CMakeLists.txt b/platforms/windows/CMakeLists.txt index 036237a..56be10f 100755 --- a/platforms/windows/CMakeLists.txt +++ b/platforms/windows/CMakeLists.txt @@ -11,6 +11,10 @@ add_platform( Core GFXVulkan ) - add_custom_target(PlatformWindows_IDE SOURCES main.cpp.in) + +function(add_platform_commands target) + set_target_properties(${target} PROPERTIES + LINK_FLAGS /SUBSYSTEM:WINDOWS) +endfunction() diff --git a/platforms/windows/main.cpp.in b/platforms/windows/main.cpp.in index 096b834..8b46d7b 100755 --- a/platforms/windows/main.cpp.in +++ b/platforms/windows/main.cpp.in @@ -258,4 +258,66 @@ LRESULT CALLBACK WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) void platform::set_window_title(const int identifier, const std::string_view title) { SetWindowTextA(window, title.data()); -} \ No newline at end of file +} + +std::tuple platform::get_right_stick_position() { + return {0.0f, 0.0f}; +} + +std::tuple platform::get_left_stick_position() { + return {0.0f, 0.0f}; +} + +bool platform::is_window_focused(const int index) { + return false; +} + +void platform::set_window_focused(const int index) { + +} + +prism::Extent platform::get_window_drawable_size(const int identifier) { + RECT rect; + GetClientRect(window, &rect); + + int width = rect.right - rect.left; + int height = rect.bottom- rect.top; + + return {static_cast(width), static_cast(height)}; +} + +void platform::set_window_size(const int index, const prism::Extent extent) { + +} + +void platform::set_window_position(const int index, const prism::Offset offset) { + +} + +prism::Rectangle platform::get_monitor_resolution() { + return prism::Rectangle(); +} + +prism::Rectangle platform::get_monitor_work_area() { + return prism::Rectangle(); +} + +prism::Offset platform::get_screen_cursor_position() { + return prism::Offset(); +} + +float platform::get_window_dpi(const int index) { + return 1.0f; +} + +bool platform::get_mouse_button_down(const int index) { + return false; +} + +float platform::get_monitor_dpi() { + return 1.0f; +} + +std::tuple platform::get_wheel_delta() { + return {0.0f, 0.0f}; +} diff --git a/platforms/windows/windows.cpp b/platforms/windows/windows.cpp index f52c051..7e6659c 100755 --- a/platforms/windows/windows.cpp +++ b/platforms/windows/windows.cpp @@ -82,3 +82,11 @@ char* platform::translate_keycode(const unsigned int keycode) { return uc; } + +void platform::mute_output() { + +} + +void platform::unmute_output() { + +} \ No newline at end of file