PlayerGLWidget.h 669 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #ifndef PLAYEROPENGLWIDGET_H
  2. #define PLAYEROPENGLWIDGET_H
  3. #include <QOpenGLWidget>
  4. #include <QOpenGLFunctions_3_3_Core>
  5. #include <GL/gl.h>
  6. #include "ShaderRect.h"
  7. /**
  8. * @brief
  9. *
  10. */
  11. class PlayerGLWidget : public QOpenGLWidget, protected QOpenGLFunctions_3_3_Core
  12. {
  13. Q_OBJECT
  14. public:
  15. explicit PlayerGLWidget(QWidget *parent = nullptr);
  16. ~PlayerGLWidget();
  17. private:
  18. protected:
  19. void initializeGL() override;
  20. void resizeGL(int w, int h) override;
  21. void paintGL() override;
  22. private:
  23. GLuint m_VAO1 = 0; // 顶点数组对象的ID
  24. ShaderBase* m_shaderObj = nullptr; // 着色器对象
  25. };
  26. #endif /* PLAYEROPENGLWIDGET_H */