void draw() { unsigned char mbut = 0; int scrollarea1 = 0; int i; background(gray(122)); uiSetCursor((int)mouseX,(int)mouseY); for (i=0; i<3; i++) uiSetButton(i, 0); if (mousePressed) uiSetButton(mouseButton, 1); createUI(vg, width, height); uiProcess(); drawUI(vg, 0, 0, 0); { int x = mouseX - width/2; int y = mouseY - height/2; if (abs(x) > width/4) { bndJoinAreaOverlay(vg, 0, 0, width, height, 0, (x > 0)); } else if (abs(y) > height/4) { bndJoinAreaOverlay(vg, 0, 0, width, height, 1, (y > 0)); } } if (key == GLFW_KEY_ESCAPE) { quit(); } else if (key == GLFW_KEY_SPACE) { saveFrame("screenshot.png"); } }
static void cursorpos(GLFWwindow *window, double x, double y) { NVG_NOTUSED(window); uiSetCursor((int)x,(int)y); }