GPUDevice: Remove mouse pointer position
This commit is contained in:
@@ -793,7 +793,6 @@ void GPUDevice::ClearDisplayTexture()
|
||||
m_display_texture_view_y = 0;
|
||||
m_display_texture_view_width = 0;
|
||||
m_display_texture_view_height = 0;
|
||||
m_display_changed = true;
|
||||
}
|
||||
|
||||
void GPUDevice::SetDisplayTexture(GPUTexture* texture, s32 view_x, s32 view_y, s32 view_width, s32 view_height)
|
||||
@@ -804,7 +803,6 @@ void GPUDevice::SetDisplayTexture(GPUTexture* texture, s32 view_x, s32 view_y, s
|
||||
m_display_texture_view_y = view_y;
|
||||
m_display_texture_view_width = view_width;
|
||||
m_display_texture_view_height = view_height;
|
||||
m_display_changed = true;
|
||||
}
|
||||
|
||||
void GPUDevice::SetDisplayTextureRect(s32 view_x, s32 view_y, s32 view_width, s32 view_height)
|
||||
@@ -813,7 +811,6 @@ void GPUDevice::SetDisplayTextureRect(s32 view_x, s32 view_y, s32 view_width, s3
|
||||
m_display_texture_view_y = view_y;
|
||||
m_display_texture_view_width = view_width;
|
||||
m_display_texture_view_height = view_height;
|
||||
m_display_changed = true;
|
||||
}
|
||||
|
||||
void GPUDevice::SetDisplayParameters(s32 display_width, s32 display_height, s32 active_left, s32 active_top,
|
||||
@@ -826,7 +823,6 @@ void GPUDevice::SetDisplayParameters(s32 display_width, s32 display_height, s32
|
||||
m_display_active_width = active_width;
|
||||
m_display_active_height = active_height;
|
||||
m_display_aspect_ratio = display_aspect_ratio;
|
||||
m_display_changed = true;
|
||||
}
|
||||
|
||||
bool GPUDevice::GetHostRefreshRate(float* refresh_rate)
|
||||
|
||||
@@ -506,15 +506,6 @@ public:
|
||||
ALWAYS_INLINE GPUSampler* GetLinearSampler() const { return m_linear_sampler.get(); }
|
||||
ALWAYS_INLINE GPUSampler* GetNearestSampler() const { return m_nearest_sampler.get(); }
|
||||
|
||||
// Position is relative to the top-left corner of the window.
|
||||
ALWAYS_INLINE s32 GetMousePositionX() const { return m_mouse_position_x; }
|
||||
ALWAYS_INLINE s32 GetMousePositionY() const { return m_mouse_position_y; }
|
||||
ALWAYS_INLINE void SetMousePosition(s32 x, s32 y)
|
||||
{
|
||||
m_mouse_position_x = x;
|
||||
m_mouse_position_y = y;
|
||||
}
|
||||
|
||||
ALWAYS_INLINE const void* GetDisplayTextureHandle() const { return m_display_texture; }
|
||||
ALWAYS_INLINE s32 GetDisplayWidth() const { return m_display_width; }
|
||||
ALWAYS_INLINE s32 GetDisplayHeight() const { return m_display_height; }
|
||||
@@ -714,9 +705,6 @@ private:
|
||||
|
||||
u64 m_last_frame_displayed_time = 0;
|
||||
|
||||
s32 m_mouse_position_x = 0;
|
||||
s32 m_mouse_position_y = 0;
|
||||
|
||||
s32 m_display_width = 0;
|
||||
s32 m_display_height = 0;
|
||||
s32 m_display_active_left = 0;
|
||||
@@ -736,8 +724,6 @@ private:
|
||||
std::unique_ptr<GPUPipeline> m_imgui_pipeline;
|
||||
std::unique_ptr<GPUTexture> m_imgui_font_texture;
|
||||
|
||||
bool m_display_changed = false;
|
||||
|
||||
std::unique_ptr<PostProcessingChain> m_post_processing_chain;
|
||||
};
|
||||
|
||||
|
||||
@@ -1038,9 +1038,18 @@ void InputManager::UpdatePointerAbsolutePosition(u32 index, float x, float y)
|
||||
const float dy = y - std::exchange(s_host_pointer_positions[index][static_cast<u8>(InputPointerAxis::Y)], y);
|
||||
|
||||
if (dx != 0.0f)
|
||||
UpdatePointerRelativeDelta(index, InputPointerAxis::X, dx);
|
||||
{
|
||||
s_pointer_state[index][static_cast<u8>(InputPointerAxis::X)].delta.fetch_add(static_cast<s32>(dx * 65536.0f),
|
||||
std::memory_order_release);
|
||||
}
|
||||
if (dy != 0.0f)
|
||||
UpdatePointerRelativeDelta(index, InputPointerAxis::Y, dy);
|
||||
{
|
||||
s_pointer_state[index][static_cast<u8>(InputPointerAxis::Y)].delta.fetch_add(static_cast<s32>(dy * 65536.0f),
|
||||
std::memory_order_release);
|
||||
}
|
||||
|
||||
if (index == 0)
|
||||
ImGuiManager::UpdateMousePosition(x, y);
|
||||
}
|
||||
|
||||
void InputManager::UpdatePointerRelativeDelta(u32 index, InputPointerAxis axis, float d, bool raw_input)
|
||||
@@ -1048,8 +1057,12 @@ void InputManager::UpdatePointerRelativeDelta(u32 index, InputPointerAxis axis,
|
||||
if (raw_input != IsUsingRawInput())
|
||||
return;
|
||||
|
||||
s_host_pointer_positions[index][static_cast<u8>(axis)] += d;
|
||||
s_pointer_state[index][static_cast<u8>(axis)].delta.fetch_add(static_cast<s32>(d * 65536.0f),
|
||||
std::memory_order_release);
|
||||
|
||||
if (index == 0 && axis <= InputPointerAxis::Y)
|
||||
ImGuiManager::UpdateMousePosition(s_host_pointer_positions[0][0], s_host_pointer_positions[0][1]);
|
||||
}
|
||||
|
||||
void InputManager::UpdateHostMouseMode()
|
||||
|
||||
Reference in New Issue
Block a user