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.

object.h 645B

1234567891011121314151617181920212223242526272829
  1. #ifndef __GLGUIOBJECT_H
  2. #define __GLGUIOBJECT_H
  3. #include <iostream>
  4. #include <string>
  5. #include <SDL.h>
  6. #include <SDL_opengl.h>
  7. class GLGuiObject {
  8. protected:
  9. SDL_Rect pos;
  10. bool highlightable, clickable, keyboardable;
  11. public:
  12. GLGuiObject();
  13. virtual ~GLGuiObject() { };
  14. virtual void render()=0;
  15. // Optionen
  16. bool isHighlightable() { return highlightable; };
  17. bool isClickable() { return clickable; };
  18. bool isKeyboardable() { return keyboardable; };
  19. virtual void onMouseOver(int m_x, int m_y) { };
  20. virtual void onMouseClick(int m_x, int m_y, int m_button) { };
  21. virtual void onKeyboardInput(char c) { };
  22. };
  23. #endif