Bind Win32 app shell and move more legacy platform state
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
|
||||
#include "app.h"
|
||||
#include "log.h"
|
||||
#include "platform_windows/windows_runtime_shell.h"
|
||||
#include "wacom.h"
|
||||
|
||||
namespace pp::platform::windows {
|
||||
@@ -53,6 +54,7 @@ void initialize_stylus_input()
|
||||
void update_stylus_state(float dt)
|
||||
{
|
||||
auto& state = stylus_input_state();
|
||||
auto* app = bound_app();
|
||||
state.timer_stylus += dt;
|
||||
state.timer_ink_touch += dt;
|
||||
state.timer_ink_pen += dt;
|
||||
@@ -61,24 +63,24 @@ void update_stylus_state(float dt)
|
||||
{
|
||||
WacomTablet::I.m_stylus = false;
|
||||
WacomTablet::I.m_eraser = false;
|
||||
App::I->redraw = true;
|
||||
app->redraw = true;
|
||||
}
|
||||
if (state.timer_ink_pen > 0.1f && WacomTablet::I.m_ink_pen)
|
||||
{
|
||||
WacomTablet::I.m_ink_pen = false;
|
||||
App::I->redraw = true;
|
||||
app->redraw = true;
|
||||
}
|
||||
if (state.timer_ink_touch > 0.1f && WacomTablet::I.m_ink_touch)
|
||||
{
|
||||
WacomTablet::I.m_ink_touch = false;
|
||||
App::I->redraw = true;
|
||||
app->redraw = true;
|
||||
}
|
||||
}
|
||||
|
||||
void note_wintab_packet()
|
||||
{
|
||||
auto& state = stylus_input_state();
|
||||
App::I->set_stylus();
|
||||
bound_app()->set_stylus();
|
||||
state.timer_stylus = 0.0f;
|
||||
}
|
||||
|
||||
@@ -118,7 +120,7 @@ void handle_pointer_update_message(WPARAM wp)
|
||||
state.timer_ink_pen = 0.0f;
|
||||
WacomTablet::I.m_ink_pen = true;
|
||||
WacomTablet::I.m_pen_pres = static_cast<float>(pen_info.pressure) / 1024.0f;
|
||||
App::I->set_stylus();
|
||||
bound_app()->set_stylus();
|
||||
return;
|
||||
|
||||
default:
|
||||
|
||||
Reference in New Issue
Block a user