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.

renderwidget.h 906B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. #ifndef RENDERWIDGET_H
  2. #define RENDERWIDGET_H
  3. #include <QGLWidget>
  4. #include <QMouseEvent>
  5. #include <QWheelEvent>
  6. #include <QKeyEvent>
  7. #include "engine/ugameengine.h"
  8. #include "openglrenderdevice.h"
  9. class RenderWidget : public QGLWidget
  10. {
  11. Q_OBJECT
  12. public:
  13. explicit RenderWidget(QWidget *parent = 0);
  14. protected:
  15. void initializeGL();
  16. void paintGL();
  17. void resizeGL(int width, int height);
  18. float normalizeAngle(float angle);
  19. void mousePressEvent(QMouseEvent* event);
  20. void mouseMoveEvent(QMouseEvent* event);
  21. void wheelEvent(QWheelEvent* event);
  22. void keyPressEvent(QKeyEvent* event);
  23. void rotate(float phi, float theta);
  24. signals:
  25. public slots:
  26. private:
  27. OpenGLRenderDevice* _device;
  28. int angle;
  29. UGameEngine* _engine;
  30. QPoint _lastPoint;
  31. float _radius;
  32. float _phi;
  33. float _theta;
  34. bool _reverse;
  35. };
  36. #endif // RENDERWIDGET_H