首页 > 其他分享 >QOpenGLShader Class

QOpenGLShader Class

时间:2023-03-15 21:13:50浏览次数:30  
标签:GLSL QOpenGLShader OpenGL Class 着色 着色器 ES

Detailed Description

此类支持使用 OpenGL 着色语言 (GLSL) 和 OpenGL/ES 着色语言 (GLSL/ES) 编写的着色器。
QOpenGLShader 和 QOpenGLShaderProgram 使程序员免于编译和链接顶点和片段着色器的细节。
另见 QOpenGLShaderProgram。

 

Member Type Documentation

enum QOpenGLShader::ShaderTypeBit
flags QOpenGLShader::ShaderType
此枚举指定正在创建的 QOpenGLShader 的类型。
Constant Value Description
QOpenGLShader::Vertex 0x0001 用 OpenGL 着色语言 (GLSL) 编写的顶点着色器。
QOpenGLShader::Fragment 0x0002 用 OpenGL 着色语言 (GLSL) 编写的片段着色器。
QOpenGLShader::Geometry 0x0004 用 OpenGL 着色语言 (GLSL) 编写的几何着色器(需要 OpenGL >= 3.2 或 OpenGL ES >= 3.2)。
QOpenGLShader::TessellationControl 0x0008 以 OpenGL 着色语言 (GLSL) 编写的曲面细分控制着色器(需要 OpenGL >= 4.0 或 OpenGL ES >= 3.2)。
QOpenGLShader::TessellationEvaluation 0x0010 以 OpenGL 着色语言 (GLSL) 编写的细分评估着色器(需要 OpenGL >= 4.0 或 OpenGL ES >= 3.2)。
QOpenGLShader::Compute 0x0020 计算以 OpenGL 着色语言 (GLSL) 编写的着色器(需要 OpenGL >= 4.3 或 OpenGL ES >= 3.1)。

 

Member Function Documentation

QOpenGLShader::QOpenGLShader(QOpenGLShader::ShaderType type, QObject *parent = nullptr)

构造一个指定type的新QOpenGLShader对象,并将其附加到父对象parent上。如果不支持着色器程序,则QOpenGLShaderProgram::hasOpenGLShaderPrograms()将返回false。

通常会在此构造函数后调用compileSourceCode()或compileSourceFile()。 该着色器将与当前的QOpenGLContext相关联。

另请参见compileSourceCode()和compileSourceFile()。

标签:GLSL,QOpenGLShader,OpenGL,Class,着色,着色器,ES
From: https://www.cnblogs.com/errorman/p/17220022.html

相关文章