Archived
1
Fork 0

Add missing stubs for platform functions on windows

This commit is contained in:
redstrate 2020-08-13 08:02:30 -04:00
parent 94953c62f0
commit c7f8de0632
3 changed files with 76 additions and 2 deletions

View file

@ -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()

View file

@ -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());
}
}
std::tuple<float, float> platform::get_right_stick_position() {
return {0.0f, 0.0f};
}
std::tuple<float, float> 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<uint32_t>(width), static_cast<uint32_t>(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<float, float> platform::get_wheel_delta() {
return {0.0f, 0.0f};
}

View file

@ -82,3 +82,11 @@ char* platform::translate_keycode(const unsigned int keycode) {
return uc;
}
void platform::mute_output() {
}
void platform::unmute_output() {
}