diff --git a/src/render/opengl/SDL_render_gl.c b/src/render/opengl/SDL_render_gl.c index 6a4fa3ecf..ab831e7b3 100644 --- a/src/render/opengl/SDL_render_gl.c +++ b/src/render/opengl/SDL_render_gl.c @@ -450,7 +450,7 @@ GL_CreateRenderer(SDL_Window * window, Uint32 flags) renderer->GL_BindTexture = GL_BindTexture; renderer->GL_UnbindTexture = GL_UnbindTexture; renderer->info = GL_RenderDriver.info; - renderer->info.flags = (SDL_RENDERER_ACCELERATED | SDL_RENDERER_TARGETTEXTURE); + renderer->info.flags = SDL_RENDERER_ACCELERATED; renderer->driverdata = data; renderer->window = window; @@ -664,6 +664,11 @@ GL_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture) GL_ActivateRenderer(renderer); + if (texture->access == SDL_TEXTUREACCESS_TARGET && + !renderdata->GL_EXT_framebuffer_object_supported) { + return SDL_SetError("Render targets not supported by OpenGL"); + } + if (!convert_format(renderdata, texture->format, &internalFormat, &format, &type)) { return SDL_SetError("Texture format %s not supported by OpenGL", @@ -980,6 +985,10 @@ GL_SetRenderTarget(SDL_Renderer * renderer, SDL_Texture * texture) GL_ActivateRenderer(renderer); + if (!data->GL_EXT_framebuffer_object_supported) { + return SDL_SetError("Render targets not supported by OpenGL"); + } + if (texture == NULL) { data->glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0); return 0;