PlayerGLWidget.h 759 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 <qopenglext.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 VAO1 = 0; // 顶点数组对象的ID
  24. GLuint VBO1 = 0; // 顶点缓冲对象的ID
  25. GLuint EBO1 = 0; // 索引缓冲对象的ID
  26. GLuint shaderProgram = 0; // 着色器程序对象的ID
  27. };
  28. #endif /* PLAYEROPENGLWIDGET_H */