PlayerGLWidget.h 860 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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. /* 显示RGBA图片 */
  18. void showOneRGBAImage(const QImage& image);
  19. private:
  20. protected:
  21. void initializeGL() override;
  22. void resizeGL(int w, int h) override;
  23. void paintGL() override;
  24. private:
  25. // GLuint m_VAO1 = 0; // 顶点数组对象的ID
  26. ShaderBase* m_shaderCurr = nullptr; /* 当前使用的着色器对象 */
  27. ShaderBase* m_shaderRGBA = nullptr; /* 显示RGBA图片的着色器对象 */
  28. };
  29. #endif /* PLAYEROPENGLWIDGET_H */