本文整理汇总了C++中VertexShader::GetShaderHandle方法的典型用法代码示例。如果您正苦于以下问题:C++ VertexShader::GetShaderHandle方法的具体用法?C++ VertexShader::GetShaderHandle怎么用?C++ VertexShader::GetShaderHandle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类VertexShader
的用法示例。
在下文中一共展示了VertexShader::GetShaderHandle方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: __CreateProgram
//----------------------------------------------------------------------------
ShaderProgramHandle* OpenGLDevice::__CreateProgram(ShaderProgram* program)
{
GLuint __program = glCreateProgram();
std::string linkingString("Linking program");
VertexShader* vShader = program->GetVertexShader();
if( vShader )
{
vShader->CreateDeviceResource(this);
OpenGLShaderHandle* vsHandle =
(OpenGLShaderHandle*)vShader->GetShaderHandle();
glAttachShader(__program, vsHandle->mShader);
linkingString += " ";
linkingString += vShader->GetShaderFileName();
}
FragmentShader* fShader = program->GetFragmentShader();
if( fShader )
{
fShader->CreateDeviceResource(this);
OpenGLShaderHandle* fsHandle =
(OpenGLShaderHandle*)fShader->GetShaderHandle();
glAttachShader(__program, fsHandle->mShader);
linkingString += " ";
linkingString += fShader->GetShaderFileName();
}
GeometryShader* gShader = program->GetGeometryShader();
if( gShader )
{
gShader->CreateDeviceResource(this);
OpenGLShaderHandle* gsHandle =
(OpenGLShaderHandle*)gShader->GetShaderHandle();
glAttachShader(__program, gsHandle->mShader);
linkingString += " ";
linkingString += gShader->GetShaderFileName();
}
ComputeShader* cShader = program->GetComputeShader();
if( cShader )
{
cShader->CreateDeviceResource(this);
OpenGLShaderHandle* csHandle =
(OpenGLShaderHandle*)cShader->GetShaderHandle();
glAttachShader(__program, csHandle->mShader);
linkingString += " ";
linkingString += cShader->GetShaderFileName();
}
TessellationControlShader* tcShader = program->GetTessellationControlShader();
if( tcShader )
{
tcShader->CreateDeviceResource(this);
OpenGLShaderHandle* tcsHandle =
(OpenGLShaderHandle*)tcShader->GetShaderHandle();
glAttachShader(__program, tcsHandle->mShader);
linkingString += " ";
linkingString += tcShader->GetShaderFileName();
}
TessellationEvaluationShader* teShader = program->GetTessellationEvaluationShader();
if( teShader )
{
teShader->CreateDeviceResource(this);
OpenGLShaderHandle* tesHandle =
(OpenGLShaderHandle*)teShader->GetShaderHandle();
glAttachShader(__program, tesHandle->mShader);
linkingString += " ";
linkingString += teShader->GetShaderFileName();
}
glLinkProgram(__program);
GLint linked;
glGetProgramiv(__program, GL_LINK_STATUS, &linked);
if( !linked )
{
GLint iInfoLen = 0;
glGetProgramiv(__program, GL_INFO_LOG_LENGTH, &iInfoLen);
if( iInfoLen > 1 )
{
char* acInfoLog = new char[iInfoLen];
glGetProgramInfoLog(__program, iInfoLen, 0, acInfoLog);
linkingString += " failed";
Terminal::Output(Terminal::OC_Error, "%s\n%s\n",
linkingString.c_str(), acInfoLog);
delete[] acInfoLog;
}
RTGI_ASSERT(false);
return 0;
}
#ifdef RTGI_OUTPUT_SHADER_RESOURCE_LOADING
linkingString += " finished";
Terminal::Output(Terminal::OC_Success, "%s\n", linkingString.c_str());
#endif
OPENGL_DEVICE_CHECK_ERROR;
//.........这里部分代码省略.........