slop.hpp 995B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. #ifndef N_SLOP_H_
  2. #define N_SLOP_H_
  3. #include <string>
  4. #include "window.hpp"
  5. #include "shader.hpp"
  6. #include "framebuffer.hpp"
  7. #include "rectangle.hpp"
  8. #include "slopstates.hpp"
  9. #include "keyboard.hpp"
  10. #include "mouse.hpp"
  11. #include "resource.hpp"
  12. class SlopState;
  13. class SlopOptions {
  14. public:
  15. SlopOptions();
  16. float borderSize;
  17. float padding;
  18. bool highlight;
  19. std::string shader;
  20. float r;
  21. float g;
  22. float b;
  23. float a;
  24. };
  25. class SlopSelection {
  26. public:
  27. SlopSelection( float x, float y, float w, float h );
  28. float x;
  29. float y;
  30. float w;
  31. float h;
  32. };
  33. class SlopMemory {
  34. private:
  35. SlopState* state;
  36. SlopState* nextState;
  37. public:
  38. SlopMemory( SlopOptions* options );
  39. ~SlopMemory();
  40. bool running;
  41. Rectangle* rectangle;
  42. void setState( SlopState* state );
  43. void update( double dt );
  44. void draw( glm::mat4& matrix );
  45. };
  46. SlopSelection SlopSelect( SlopOptions* options = NULL, bool* cancelled = NULL );
  47. #endif // N_SLOP_H_