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.

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. void animate();
  27. private:
  28. AbstractRenderDevice* _device;
  29. UGameEngine* _engine;
  30. QPoint _lastPoint;
  31. double _radius;
  32. double _phi;
  33. double _theta;
  34. Vector3D pos;
  35. UGEEntity* _entity;
  36. };
  37. #endif // RENDERWIDGET_H