From a563bc5d020f19874c3e1ac285ec0111177804de Mon Sep 17 00:00:00 2001 From: Allan Tong Date: Sat, 24 Nov 2007 16:41:05 -0500 Subject: wined3d: Bind device framebuffer in ActivateContext. --- dlls/wined3d/context.c | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c index 32d75b6..263b9af 100644 --- a/dlls/wined3d/context.c +++ b/dlls/wined3d/context.c @@ -879,6 +879,13 @@ void ActivateContext(IWineD3DDeviceImpl *This, IWineD3DSurface *target, ContextU ENTER_GL(); /* Select the right draw buffer. It is selected in FindContext. */ if(drawBuffer && context->last_draw_buffer != drawBuffer) { + if(wined3d_settings.offscreen_rendering_mode == ORM_FBO) { + /* Make sure we're bound to the device framebuffer, otherwise the call to glDrawBuffer + * below may fail. */ + GL_EXTCALL(glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0)); + checkGLcall("glBindFramebuffer()"); + } + TRACE("Drawing to buffer: %#x\n", drawBuffer); context->last_draw_buffer = drawBuffer; -- 1.5.2.5