本文整理汇总了C++中GLES_RenderData::glCheckFramebufferStatusOES方法的典型用法代码示例。如果您正苦于以下问题:C++ GLES_RenderData::glCheckFramebufferStatusOES方法的具体用法?C++ GLES_RenderData::glCheckFramebufferStatusOES怎么用?C++ GLES_RenderData::glCheckFramebufferStatusOES使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GLES_RenderData
的用法示例。
在下文中一共展示了GLES_RenderData::glCheckFramebufferStatusOES方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SDL_SetError
static int
GLES_SetRenderTarget(SDL_Renderer * renderer, SDL_Texture * texture)
{
GLES_RenderData *data = (GLES_RenderData *) renderer->driverdata;
GLES_TextureData *texturedata = NULL;
GLenum status;
if (!data->GL_OES_framebuffer_object_supported) {
return SDL_SetError("Can't enable render target support in this renderer");
}
if (texture == NULL) {
data->glBindFramebufferOES(GL_FRAMEBUFFER_OES, data->window_framebuffer);
return 0;
}
texturedata = (GLES_TextureData *) texture->driverdata;
data->glBindFramebufferOES(GL_FRAMEBUFFER_OES, texturedata->fbo->FBO);
/* TODO: check if texture pixel format allows this operation */
data->glFramebufferTexture2DOES(GL_FRAMEBUFFER_OES, GL_COLOR_ATTACHMENT0_OES, texturedata->type, texturedata->texture, 0);
/* Check FBO status */
status = data->glCheckFramebufferStatusOES(GL_FRAMEBUFFER_OES);
if (status != GL_FRAMEBUFFER_COMPLETE_OES) {
return SDL_SetError("glFramebufferTexture2DOES() failed");
}
return 0;
}
示例2:
static int
GLES_SetRenderTarget(SDL_Renderer * renderer, SDL_Texture * texture)
{
GLES_RenderData *data = (GLES_RenderData *) renderer->driverdata;
GLES_TextureData *texturedata = NULL;
GLenum status;
GLES_ActivateRenderer(renderer);
if (texture == NULL) {
data->glBindFramebufferOES(GL_FRAMEBUFFER_OES, 0);
return 0;
}
texturedata = (GLES_TextureData *) texture->driverdata;
data->glBindFramebufferOES(GL_FRAMEBUFFER_OES, texturedata->fbo->FBO);
/* TODO: check if texture pixel format allows this operation */
data->glFramebufferTexture2DOES(GL_FRAMEBUFFER_OES, GL_COLOR_ATTACHMENT0_OES, texturedata->type, texturedata->texture, 0);
/* Check FBO status */
status = data->glCheckFramebufferStatusOES(GL_FRAMEBUFFER_OES);
if (status != GL_FRAMEBUFFER_COMPLETE_OES) {
SDL_SetError("glFramebufferTexture2DOES() failed");
return -1;
}
return 0;
}