您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

renderwidget.h 1.0KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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. #include "cameras/abstractcamera.h"
  10. class RenderWidget : public QGLWidget
  11. {
  12. Q_OBJECT
  13. public:
  14. explicit RenderWidget(QWidget *parent = 0);
  15. protected:
  16. void initializeGL();
  17. void paintGL();
  18. void resizeGL(int width, int height);
  19. void mousePressEvent(QMouseEvent* event);
  20. void mouseReleaseEvent(QMouseEvent *event);
  21. void mouseMoveEvent(QMouseEvent* event);
  22. void mouseDoubleClickEvent(QMouseEvent* event);
  23. void wheelEvent(QWheelEvent* event);
  24. void keyPressEvent(QKeyEvent* event);
  25. void keyReleaseEvent(QKeyEvent* event);
  26. void paintEvent(QPaintEvent* event);
  27. signals:
  28. public slots:
  29. void animate();
  30. private:
  31. UGameEngine* _engine;
  32. Vector3D pos;
  33. QList<UGEEntity*> _entities;
  34. AbstractCamera* _camera;
  35. QString _assetsPath;
  36. QStringList _textures;
  37. };
  38. #endif // RENDERWIDGET_H