12345678910111213141516171819202122232425262728293031323334 |
- #ifndef SHADERRECT_H
- #define SHADERRECT_H
- #include "ShaderBase.h"
- /**
- * @brief 显示矩形RGBA图片
- *
- */
- class ShaderRect : public ShaderBase
- {
- public:
- ShaderRect();
- ~ShaderRect();
- /* 初始化形状 */
- GLuint initShape() override;
- /* 绘制图形 */
- void drawShape() override;
- /* 刷新一帧 */
- bool refreshFrameRGBA(const QImage& image, int textureUnit = 0);
- private:
- GLuint m_VAO = 0; // 顶点数组对象的ID
- GLuint m_VBO = 0; // 顶点缓冲对象的ID
- GLuint m_EBO = 0; // 索引缓冲对象的ID
- QSize m_lastSize; /* 上一张图片的大小 */
- };
- #endif // SHADERRECT_H
|