当前位置: 首页>>代码示例>>C++>>正文


C++ GLES_RenderData::glCheckFramebufferStatusOES方法代码示例

本文整理汇总了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;
}
开发者ID:1vanK,项目名称:Urho3D,代码行数:27,代码来源:SDL_render_gles.c

示例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;
}
开发者ID:leffuy,项目名称:andsdl-test,代码行数:26,代码来源:SDL_render_gles.c


注:本文中的GLES_RenderData::glCheckFramebufferStatusOES方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。