/*@{*/
struct gl_framebuffer * (*NewFramebuffer)(GLcontext *ctx, GLuint name);
struct gl_renderbuffer * (*NewRenderbuffer)(GLcontext *ctx, GLuint name);
+ void (*BindFramebuffer)(GLcontext *ctx, GLenum target,
+ struct gl_framebuffer *fb);
void (*FramebufferRenderbuffer)(GLcontext *ctx,
struct gl_framebuffer *fb,
GLenum attachment,
/**
* Given an internal format token for a render buffer, return the
* corresponding base format.
+ * This is very similar to _mesa_base_tex_format() but the set of valid
+ * internal formats is somewhat different.
+ *
* \return one of GL_RGB, GL_RGBA, GL_STENCIL_INDEX, GL_DEPTH_COMPONENT
* GL_DEPTH_STENCIL_EXT or zero if error.
*/
-static GLenum
-base_internal_format(GLcontext *ctx, GLenum internalFormat)
+GLenum
+_mesa_base_fbo_format(GLcontext *ctx, GLenum internalFormat)
{
switch (internalFormat) {
case GL_RGB:
return;
}
- baseFormat = base_internal_format(ctx, internalFormat);
+ baseFormat = _mesa_base_fbo_format(ctx, internalFormat);
if (baseFormat == 0) {
_mesa_error(ctx, GL_INVALID_ENUM,
"glRenderbufferStorageEXT(internalFormat)");
}
ctx->DrawBuffer = newFb;
}
+
+ if (ctx->Driver.BindFramebuffer) {
+ ctx->Driver.BindFramebuffer(ctx, target, newFb);
+ }
}
extern void
_mesa_test_framebuffer_completeness(GLcontext *ctx, struct gl_framebuffer *fb);
+extern GLenum
+_mesa_base_fbo_format(GLcontext *ctx, GLenum internalFormat);
+
extern GLboolean GLAPIENTRY
_mesa_IsRenderbufferEXT(GLuint renderbuffer);