本文整理汇总了C++中GLContext::fFramebufferTexture2D方法的典型用法代码示例。如果您正苦于以下问题:C++ GLContext::fFramebufferTexture2D方法的具体用法?C++ GLContext::fFramebufferTexture2D怎么用?C++ GLContext::fFramebufferTexture2D使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GLContext
的用法示例。
在下文中一共展示了GLContext::fFramebufferTexture2D方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
void
GLBlitTextureImageHelper::SetBlitFramebufferForDestTexture(GLuint aTexture)
{
GLContext *gl = mCompositor->gl();
if (!mBlitFramebuffer) {
gl->fGenFramebuffers(1, &mBlitFramebuffer);
}
gl->fBindFramebuffer(LOCAL_GL_FRAMEBUFFER, mBlitFramebuffer);
gl->fFramebufferTexture2D(LOCAL_GL_FRAMEBUFFER,
LOCAL_GL_COLOR_ATTACHMENT0,
LOCAL_GL_TEXTURE_2D,
aTexture,
0);
GLenum result = gl->fCheckFramebufferStatus(LOCAL_GL_FRAMEBUFFER);
if (aTexture && (result != LOCAL_GL_FRAMEBUFFER_COMPLETE)) {
nsAutoCString msg;
msg.AppendLiteral("Framebuffer not complete -- error 0x");
msg.AppendInt(result, 16);
// Note: if you are hitting this, it is likely that
// your texture is not texture complete -- that is, you
// allocated a texture name, but didn't actually define its
// size via a call to TexImage2D.
NS_RUNTIMEABORT(msg.get());
}
}
示例2: Texture
void
WebGLFramebuffer::Attachment::FinalizeAttachment(GLenum attachmentLoc) const {
if (Texture()) {
GLContext* gl = Texture()->Context()->gl;
if (attachmentLoc == LOCAL_GL_DEPTH_STENCIL_ATTACHMENT) {
gl->fFramebufferTexture2D(LOCAL_GL_FRAMEBUFFER, LOCAL_GL_DEPTH_ATTACHMENT,
TexImageTarget(), Texture()->GLName(), TexImageLevel());
gl->fFramebufferTexture2D(LOCAL_GL_FRAMEBUFFER, LOCAL_GL_STENCIL_ATTACHMENT,
TexImageTarget(), Texture()->GLName(), TexImageLevel());
} else {
gl->fFramebufferTexture2D(LOCAL_GL_FRAMEBUFFER, attachmentLoc,
TexImageTarget(), Texture()->GLName(), TexImageLevel());
}
return;
}
if (Renderbuffer()) {
Renderbuffer()->FramebufferRenderbuffer(attachmentLoc);
return;
}
// Neither?
MOZ_ASSERT(false, "FB attachment without a tex or RB.");
}