本文整理汇总了C++中QOpenGLShaderProgram::setProperty方法的典型用法代码示例。如果您正苦于以下问题:C++ QOpenGLShaderProgram::setProperty方法的具体用法?C++ QOpenGLShaderProgram::setProperty怎么用?C++ QOpenGLShaderProgram::setProperty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QOpenGLShaderProgram
的用法示例。
在下文中一共展示了QOpenGLShaderProgram::setProperty方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getShaderProgram
QOpenGLShaderProgram* Viewer::getShaderProgram(int name) const
{
switch(name)
{
case PROGRAM_C3T3:
{
QOpenGLShaderProgram* program = isOpenGL_4_3()
? declare_program(name, ":/cgal/Polyhedron_3/resources/shader_c3t3.v" , ":/cgal/Polyhedron_3/resources/shader_c3t3.f")
: declare_program(name, ":/cgal/Polyhedron_3/resources/compatibility_shaders/shader_c3t3.v" ,
":/cgal/Polyhedron_3/resources/compatibility_shaders/shader_c3t3.f");
program->setProperty("hasLight", true);
program->setProperty("hasNormals", true);
program->setProperty("hasCutPlane", true);
program->setProperty("hasTransparency", true);
return program;
}
case PROGRAM_C3T3_EDGES:
{
QOpenGLShaderProgram* program = isOpenGL_4_3()
? declare_program(name, ":/cgal/Polyhedron_3/resources/shader_c3t3_edges.v" , ":/cgal/Polyhedron_3/resources/shader_c3t3_edges.f")
: declare_program(name, ":/cgal/Polyhedron_3/resources/compatibility_shaders/shader_c3t3_edges.v" ,
":/cgal/Polyhedron_3/resources/compatibility_shaders/shader_c3t3_edges.f");
program->setProperty("hasCutPlane", true);
return program;
}
case PROGRAM_WITH_LIGHT:
{
QOpenGLShaderProgram* program = isOpenGL_4_3()
? declare_program(name, ":/cgal/Polyhedron_3/resources/shader_with_light.v" , ":/cgal/Polyhedron_3/resources/shader_with_light.f")
: declare_program(name, ":/cgal/Polyhedron_3/resources/compatibility_shaders/shader_with_light.v" ,
":/cgal/Polyhedron_3/resources/compatibility_shaders/shader_with_light.f");
program->setProperty("hasLight", true);
program->setProperty("hasNormals", true);
program->setProperty("hasTransparency", true);
return program;
}
case PROGRAM_WITHOUT_LIGHT:
{
QOpenGLShaderProgram* program = isOpenGL_4_3()
? declare_program(name, ":/cgal/Polyhedron_3/resources/shader_without_light.v" , ":/cgal/Polyhedron_3/resources/shader_without_light.f")
: declare_program(name, ":/cgal/Polyhedron_3/resources/compatibility_shaders/shader_without_light.v" ,
":/cgal/Polyhedron_3/resources/compatibility_shaders/shader_without_light.f");
program->setProperty("hasFMatrix", true);
return program;
}
case PROGRAM_NO_SELECTION:
{
QOpenGLShaderProgram* program = isOpenGL_4_3()
? declare_program(name, ":/cgal/Polyhedron_3/resources/shader_without_light.v" , ":/cgal/Polyhedron_3/resources/shader_no_light_no_selection.f")
: declare_program(name, ":/cgal/Polyhedron_3/resources/compatibility_shaders/shader_without_light.v" ,
":/cgal/Polyhedron_3/resources/compatibility_shaders/shader_no_light_no_selection.f");
program->setProperty("hasFMatrix", true);
return program;
}
case PROGRAM_WITH_TEXTURE:
{
QOpenGLShaderProgram* program = isOpenGL_4_3()
? declare_program(name, ":/cgal/Polyhedron_3/resources/shader_with_texture.v" , ":/cgal/Polyhedron_3/resources/shader_with_texture.f")
: declare_program(name, ":/cgal/Polyhedron_3/resources/compatibility_shaders/shader_with_texture.v" ,
":/cgal/Polyhedron_3/resources/compatibility_shaders/shader_with_texture.f");
program->setProperty("hasLight", true);
program->setProperty("hasNormals", true);
program->setProperty("hasFMatrix", true);
program->setProperty("hasTexture", true);
return program;
}
case PROGRAM_PLANE_TWO_FACES:
{
QOpenGLShaderProgram* program = isOpenGL_4_3()
?declare_program(name, ":/cgal/Polyhedron_3/resources/shader_without_light.v" , ":/cgal/Polyhedron_3/resources/shader_plane_two_faces.f")
: declare_program(name, ":/cgal/Polyhedron_3/resources/compatibility_shaders/shader_without_light.v" ,
":/cgal/Polyhedron_3/resources/compatibility_shaders/shader_plane_two_faces.f");
program->setProperty("hasLight", true);
program->setProperty("hasNormals", true);
return program;
}
case PROGRAM_WITH_TEXTURED_EDGES:
{
QOpenGLShaderProgram* program = isOpenGL_4_3()
? declare_program(name, ":/cgal/Polyhedron_3/resources/shader_with_textured_edges.v" , ":/cgal/Polyhedron_3/resources/shader_with_textured_edges.f")
: declare_program(name, ":/cgal/Polyhedron_3/resources/compatibility_shaders/shader_with_textured_edges.v" ,
":/cgal/Polyhedron_3/resources/compatibility_shaders/shader_with_textured_edges.f");
program->setProperty("hasFMatrix", true);
program->setProperty("hasTexture", true);
return program;
}
case PROGRAM_INSTANCED:
{
QOpenGLShaderProgram* program = isOpenGL_4_3()
? declare_program(name, ":/cgal/Polyhedron_3/resources/shader_instanced.v" , ":/cgal/Polyhedron_3/resources/shader_with_light.f")
: declare_program(name, ":/cgal/Polyhedron_3/resources/compatibility_shaders/shader_instanced.v" ,
":/cgal/Polyhedron_3/resources/compatibility_shaders/shader_with_light.f");
program->setProperty("hasLight", true);
program->setProperty("hasNormals", true);
program->setProperty("isInstanced", true);
return program;
}
case PROGRAM_INSTANCED_WIRE:
{
//.........这里部分代码省略.........