本文整理汇总了C++中CTexture::GetHandle方法的典型用法代码示例。如果您正苦于以下问题:C++ CTexture::GetHandle方法的具体用法?C++ CTexture::GetHandle怎么用?C++ CTexture::GetHandle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CTexture
的用法示例。
在下文中一共展示了CTexture::GetHandle方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: BindColorTexture
bool CRenderTarget::BindColorTexture(axelynx::Texture* tex, int layer)
{
OPENGL_CHECK_FOR_ERRORS();
// указываем для текущего FBO текстуру, куда следует производить рендер глубины
glBindFramebuffer(GL_FRAMEBUFFER, fbo_);
if(tex)
{
CTexture *ctex = dynamic_cast<CTexture*>(tex);
glFramebufferTexture(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0 + layer, ctex->GetHandle(), 0);
used_layer_[layer] = true;
}
else
{
glFramebufferTexture(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0 + layer, 0, 0);
used_layer_[layer] = false;
}
if(current_)
current_->Bind();
else
glBindFramebuffer(GL_FRAMEBUFFER, 0);
OPENGL_CHECK_FOR_ERRORS();
return true;
}
示例2:
bool CRenderTarget::Bind3DTexture(axelynx::Texture* tex, int texlayer, int rendertargetlayer)
{
OPENGL_CHECK_FOR_ERRORS();
glBindFramebuffer(GL_FRAMEBUFFER, fbo_);
OPENGL_CHECK_FOR_ERRORS();
if(tex)
{
CTexture *ctex = dynamic_cast<CTexture*>(tex);
glFramebufferTexture3D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0 + rendertargetlayer, GL_TEXTURE_3D, ctex->GetHandle(), 0, texlayer);
used_layer_[rendertargetlayer] = true;
}
else
{
glFramebufferTexture3D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0 + rendertargetlayer, GL_TEXTURE_3D, 0, 0, texlayer);
used_layer_[rendertargetlayer] = false;
}
OPENGL_CHECK_FOR_ERRORS();
if(current_)
current_->Bind();
else
glBindFramebuffer(GL_FRAMEBUFFER, 0);
OPENGL_CHECK_FOR_ERRORS();
return true;
}