From 2f56ef09e60943dddc74b0e117def4347f8c2a21 Mon Sep 17 00:00:00 2001 From: Henri Verbeet Date: Mon, 14 Dec 2009 20:49:56 +0100 Subject: [PATCH] wined3d: Use surface_is_offscreen() in context_apply_draw_buffer(). --- dlls/wined3d/context.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c index 0debd2e78d7..62eb0ac84ce 100644 --- a/dlls/wined3d/context.c +++ b/dlls/wined3d/context.c @@ -2054,15 +2054,13 @@ static void context_apply_draw_buffer(struct wined3d_context *context, BOOL blit { const struct wined3d_gl_info *gl_info = context->gl_info; IWineD3DSurface *rt = context->current_rt; - IWineD3DSwapChain *swapchain; IWineD3DDeviceImpl *device; device = ((IWineD3DSurfaceImpl *)rt)->resource.device; - if (SUCCEEDED(IWineD3DSurface_GetContainer(rt, &IID_IWineD3DSwapChain, (void **)&swapchain))) + if (!surface_is_offscreen(rt)) { - IWineD3DSwapChain_Release((IUnknown *)swapchain); ENTER_GL(); - glDrawBuffer(surface_get_gl_buffer(rt, swapchain)); + glDrawBuffer(surface_get_gl_buffer(rt, (IWineD3DSwapChain *)((IWineD3DSurfaceImpl *)rt)->container)); checkGLcall("glDrawBuffers()"); LEAVE_GL(); }