Advertisement
Guest User

Untitled

a guest
Feb 18th, 2018
173
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.54 KB | None | 0 0
  1.  
  2. /*************************************************************************/
  3. /*************************** Other local data ****************************/
  4. /*************************************************************************/
  5.  
  6. /* Debug UI buttons. */
  7.  
  8. typedef struct DebugButton DebugButton;
  9. struct DebugButton {
  10. const char * const id; // Arbitrary button ID for this button.
  11. const float cx, cy; // Center of button in touch coords (0.0-1.0).
  12. const float width, height; // Size of button in touch coords (0.0-1.0).
  13. const char *text; // Text to display in the button.
  14. uint8_t is_touched; // Is this button currently touched?
  15. float timer; // Touch timer (may also be reset by handler).
  16. };
  17.  
  18. static DebugButton debug_buttons[] = {
  19.  
  20. {.id="CPU_DOWN", .cx=0.27f, .cy=0.93f, .width=0.06f, .height=0.08f,
  21. .text="-"},
  22. {.id="CPU_UP", .cx=0.53f, .cy=0.93f, .width=0.06f, .height=0.08f,
  23. .text="+"},
  24.  
  25. {.id="MEM_TOGGLE", .cx=0.87f, .cy=0.84f, .width=0.06f, .height=0.08f,
  26. .text="Off"},
  27. {.id="CPU_TOGGLE", .cx=0.87f, .cy=0.93f, .width=0.06f, .height=0.08f,
  28. .text="Off"},
  29.  
  30. };
  31.  
  32. /*-----------------------------------------------------------------------*/
  33.  
  34. /* Have we been initialized? */
  35. static uint8_t initted;
  36.  
  37. /* Current input state. */
  38. static uint8_t mouse_left, mouse_middle, mouse_right;
  39. static struct {
  40. unsigned int id;
  41. uint8_t new_this_time;
  42. uint8_t seen_this_time;
  43. float x, y;
  44. } active_touches[INPUT_MAX_TOUCHES];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement