Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*************************************************************************/
- /*************************** Other local data ****************************/
- /*************************************************************************/
- /* Debug UI buttons. */
- typedef struct DebugButton DebugButton;
- struct DebugButton {
- const char * const id; // Arbitrary button ID for this button.
- const float cx, cy; // Center of button in touch coords (0.0-1.0).
- const float width, height; // Size of button in touch coords (0.0-1.0).
- const char *text; // Text to display in the button.
- uint8_t is_touched; // Is this button currently touched?
- float timer; // Touch timer (may also be reset by handler).
- };
- static DebugButton debug_buttons[] = {
- {.id="CPU_DOWN", .cx=0.27f, .cy=0.93f, .width=0.06f, .height=0.08f,
- .text="-"},
- {.id="CPU_UP", .cx=0.53f, .cy=0.93f, .width=0.06f, .height=0.08f,
- .text="+"},
- {.id="MEM_TOGGLE", .cx=0.87f, .cy=0.84f, .width=0.06f, .height=0.08f,
- .text="Off"},
- {.id="CPU_TOGGLE", .cx=0.87f, .cy=0.93f, .width=0.06f, .height=0.08f,
- .text="Off"},
- };
- /*-----------------------------------------------------------------------*/
- /* Have we been initialized? */
- static uint8_t initted;
- /* Current input state. */
- static uint8_t mouse_left, mouse_middle, mouse_right;
- static struct {
- unsigned int id;
- uint8_t new_this_time;
- uint8_t seen_this_time;
- float x, y;
- } active_touches[INPUT_MAX_TOUCHES];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement