本文整理汇总了C++中CTexture::Build方法的典型用法代码示例。如果您正苦于以下问题:C++ CTexture::Build方法的具体用法?C++ CTexture::Build怎么用?C++ CTexture::Build使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CTexture
的用法示例。
在下文中一共展示了CTexture::Build方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CreateDepthTexture
axelynx::Texture* CRenderTarget::CreateDepthTexture()
{
OPENGL_CHECK_FOR_ERRORS();
axelynx::Texture::Desc desc;
desc.TT = axelynx::Texture::TT_DEPTH;
desc.width = width_;
desc.height = height_;
desc.cpp = 1;
desc.bpc = 4;
desc.use_mipmaps = false;
CTexture *tex = new CTexture(desc);
//tex->Bind();
//glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_COMPARE_MODE, GL_COMPARE_REF_TO_TEXTURE);
//tex->UnBind();
tex->Build(0,GL_DEPTH_COMPONENT,GL_DEPTH_COMPONENT32F);
OPENGL_CHECK_FOR_ERRORS();
BindDepthTexture(tex);
OPENGL_CHECK_FOR_ERRORS();
return tex;
}
示例2: CreateColorTexture
axelynx::Texture* CRenderTarget::CreateColorTexture(int channels, int channel_size, int layer,bool use_mipmaps)
{
OPENGL_CHECK_FOR_ERRORS();
axelynx::Texture::Desc desc;
desc.TT = axelynx::Texture::TT_2D;
desc.width = width_;
desc.height = height_;
desc.cpp = channels;
desc.bpc = channel_size;
desc.use_mipmaps = use_mipmaps;
CTexture *tex = new CTexture(desc);
GLenum format;
GLenum internalformat;
GetGLTextures(format,internalformat,channels,channel_size);
tex->Build(0,format,internalformat);
OPENGL_CHECK_FOR_ERRORS();
BindColorTexture(tex,layer);
OPENGL_CHECK_FOR_ERRORS();
return tex;
}