Small OpenGL based c++ rendering library
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

button.h 648B

1234567891011121314151617181920212223242526272829303132
  1. #ifndef __GLGUIBUTTON_H
  2. #define __GLGUIBUTTON_H
  3. #include <iostream>
  4. #include <string>
  5. #include <SDL.h>
  6. #include <SDL_opengl.h>
  7. #include "textlabel.h"
  8. #define GLGUI_BUTTONDOWN SDL_USEREVENT+10
  9. namespace segl {
  10. class GLGuiButton : public GLGuiTextLabel {
  11. protected:
  12. int eventid;
  13. Color highlightcol;
  14. public:
  15. GLGuiButton(int _eventid, int _x, int _y, bool _center=false, int _wrap=0);
  16. GLGuiButton(int _eventid, std::string str, int _x, int _y, bool _center=false, int _wrap=0);
  17. void setHighlightColor();
  18. void onMouseOver(int m_x, int m_y);
  19. void onMouseClick(int m_x, int m_y, int m_button);
  20. };
  21. } // namespace {
  22. #endif