本文整理汇总了C++中shader::IProgramObject::IsValid方法的典型用法代码示例。如果您正苦于以下问题:C++ IProgramObject::IsValid方法的具体用法?C++ IProgramObject::IsValid怎么用?C++ IProgramObject::IsValid使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类shader::IProgramObject
的用法示例。
在下文中一共展示了IProgramObject::IsValid方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CreateProgramObject
Shader::IProgramObject* CShaderHandler::CreateProgramObject(
const std::string& poClass,
const std::string& poName,
const std::string& vsStr,
const std::string& vsDefs,
const std::string& fsStr,
const std::string& fsDefs,
bool arbProgram
) {
Shader::IProgramObject* po = CreateProgramObject(poClass, poName, arbProgram);
if (po->IsValid()) {
return po;
}
Shader::IShaderObject* vso = CreateShaderObject(vsStr, vsDefs, (arbProgram? GL_VERTEX_PROGRAM_ARB: GL_VERTEX_SHADER));
Shader::IShaderObject* fso = CreateShaderObject(fsStr, fsDefs, (arbProgram? GL_FRAGMENT_PROGRAM_ARB: GL_FRAGMENT_SHADER));
po->AttachShaderObject(vso);
po->AttachShaderObject(fso);
po->Link();
if (!po->IsValid()) {
logOutput.Print("[CShaderHandler::CreateProgramObject]\n");
logOutput.Print("\tprogram-object name: %s, link-log:\n%s\n", poName.c_str(), po->GetLog().c_str());
}
return po;
}
示例2: CreateProgramObject
Shader::IProgramObject* CShaderHandler::CreateProgramObject(
const std::string& poClass,
const std::string& poName,
const std::string& vsStr,
const std::string& vsDefs,
const std::string& fsStr,
const std::string& fsDefs,
bool arbProgram
) {
Shader::IProgramObject* po = CreateProgramObject(poClass, poName, arbProgram);
if (po->IsValid()) {
return po;
}
Shader::IShaderObject* vso = CreateShaderObject(vsStr, vsDefs, (arbProgram? GL_VERTEX_PROGRAM_ARB: GL_VERTEX_SHADER));
Shader::IShaderObject* fso = CreateShaderObject(fsStr, fsDefs, (arbProgram? GL_FRAGMENT_PROGRAM_ARB: GL_FRAGMENT_SHADER));
po->AttachShaderObject(vso);
po->AttachShaderObject(fso);
po->Link();
po->Validate();
if (!po->IsValid()) {
const char* fmt = "[%s]\n\tprogram-object name: %s, link-log:\n%s";
const char* log = po->GetLog().c_str();
LOG_L(L_WARNING, fmt, __FUNCTION__, poName.c_str(), log);
}
return po;
}
示例3: HasValidShader
bool SMFRenderStateGLSL::HasValidShader(const DrawPass::e& drawPass) const {
Shader::IProgramObject* shader = nullptr;
switch (drawPass) {
case DrawPass::TerrainDeferred: { shader = glslShaders[GLSL_SHADER_DEFERRED]; } break;
default: { shader = glslShaders[GLSL_SHADER_CURRENT ]; } break;
}
return (shader != nullptr && shader->IsValid());
}
示例4: HasValidShader
bool SMFRenderStateARB::HasValidShader(const DrawPass::e& drawPass) const {
Shader::IProgramObject* shader = nullptr;
switch (drawPass) {
case DrawPass::Normal: { shader = arbShaders[ARB_SHADER_CURRENT]; } break;
case DrawPass::WaterReflection: { shader = arbShaders[ARB_SHADER_REFLECT]; } break;
case DrawPass::WaterRefraction: { shader = arbShaders[ARB_SHADER_REFRACT]; } break;
default: {} break;
}
return (shader != nullptr && shader->IsValid());
}