Browse Source

fixed button state check

pull/1/head
Leonard Ritter 10 years ago
parent
commit
8977f16d27
2 changed files with 5 additions and 0 deletions
  1. +4
    -0
      example.cpp
  2. +1
    -0
      oui.h

+ 4
- 0
example.cpp View File

@@ -763,6 +763,10 @@ void errorcb(int error, const char* desc)
static void mousebutton(GLFWwindow *window, int button, int action, int mods) {
NVG_NOTUSED(window);
NVG_NOTUSED(mods);
switch(button) {
case 1: button = 2; break;
case 2: button = 1; break;
}
uiSetButton(button, (action==GLFW_PRESS)?1:0);
}



+ 1
- 0
oui.h View File

@@ -1596,6 +1596,7 @@ void uiProcess(int timestamp) {
uiGetHandle(active_item):0;

ui_context->last_timestamp = timestamp;
ui_context->last_buttons = ui_context->buttons;
}

static int uiIsActive(int item) {


Loading…
Cancel
Save