Examples: Simplified mouse wheel handling. (#1463)

This commit is contained in:
omar
2018-01-20 12:45:31 +01:00
parent 7dea158175
commit 7e7c017b75
6 changed files with 23 additions and 47 deletions

View File

@ -21,7 +21,6 @@
// Data
static double g_Time = 0.0f;
static bool g_MousePressed[3] = { false, false, false };
static float g_MouseWheel = 0.0f;
static CIwTexture* g_FontTexture = NULL;
static char* g_ClipboardText = NULL;
static bool g_osdKeyboardEnabled = false;
@ -128,9 +127,9 @@ int32 ImGui_Marmalade_PointerButtonEventCallback(void* SystemData, void* pUserDa
if (pEvent->m_Button == S3E_POINTER_BUTTON_MIDDLEMOUSE)
g_MousePressed[2] = true;
if (pEvent->m_Button == S3E_POINTER_BUTTON_MOUSEWHEELUP)
g_MouseWheel += pEvent->m_y;
io.MouseWheel += pEvent->m_y;
if (pEvent->m_Button == S3E_POINTER_BUTTON_MOUSEWHEELDOWN)
g_MouseWheel += pEvent->m_y;
io.MouseWheel += pEvent->m_y;
}
return 0;
@ -282,9 +281,6 @@ void ImGui_Marmalade_NewFrame()
g_MousePressed[i] = false;
}
io.MouseWheel = g_MouseWheel;
g_MouseWheel = 0.0f;
// TODO: Hide OS mouse cursor if ImGui is drawing it
// s3ePointerSetInt(S3E_POINTER_HIDE_CURSOR,(io.MouseDrawCursor ? 0 : 1));