H. Verbeet : wined3d: Make bind_fbo a bit more generic.

Alexandre Julliard julliard at wine.codeweavers.com
Mon Apr 9 07:36:06 CDT 2007


Module: wine
Branch: master
Commit: 2e1e3d48f21e261376280cee2695393711308e6c
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=2e1e3d48f21e261376280cee2695393711308e6c

Author: H. Verbeet <hverbeet at gmail.com>
Date:   Mon Apr  9 01:53:47 2007 +0200

wined3d: Make bind_fbo a bit more generic.

---

 dlls/wined3d/device.c |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 2b5a168..99f0690 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -5093,14 +5093,14 @@ static HRESULT  WINAPI  IWineD3DDeviceImpl_GetDepthStencilSurface(IWineD3DDevice
     return WINED3D_OK;
 }
 
-static void bind_fbo(IWineD3DDevice *iface) {
+static void bind_fbo(IWineD3DDevice *iface, GLenum target, GLuint *fbo) {
     IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
 
-    if (!This->fbo) {
-        GL_EXTCALL(glGenFramebuffersEXT(1, &This->fbo));
+    if (!*fbo) {
+        GL_EXTCALL(glGenFramebuffersEXT(1, fbo));
         checkGLcall("glGenFramebuffersEXT()");
     }
-    GL_EXTCALL(glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, This->fbo));
+    GL_EXTCALL(glBindFramebufferEXT(target, *fbo));
     checkGLcall("glBindFramebuffer()");
 }
 
@@ -5203,7 +5203,7 @@ void apply_fbo_state(IWineD3DDevice *iface) {
     unsigned int i;
 
     if (This->render_offscreen) {
-        bind_fbo(iface);
+        bind_fbo(iface, GL_FRAMEBUFFER_EXT, &This->fbo);
 
         /* Apply render targets */
         for (i = 0; i < GL_LIMITS(buffers); ++i) {
@@ -5787,13 +5787,13 @@ static void WINAPI IWineD3DDeviceImpl_ResourceReleased(IWineD3DDevice *iface, IW
             /* Cleanup any FBO attachments */
             for (i = 0; i < GL_LIMITS(buffers); ++i) {
                 if (This->fbo_color_attachments[i] == (IWineD3DSurface *)resource) {
-                    bind_fbo(iface);
+                    bind_fbo(iface, GL_FRAMEBUFFER_EXT, &This->fbo);
                     set_render_target_fbo(iface, i, NULL);
                     This->fbo_color_attachments[i] = NULL;
                 }
             }
             if (This->fbo_depth_attachment == (IWineD3DSurface *)resource) {
-                bind_fbo(iface);
+                bind_fbo(iface, GL_FRAMEBUFFER_EXT, &This->fbo);
                 set_depth_stencil_fbo(iface, NULL);
                 This->fbo_depth_attachment = NULL;
             }




More information about the wine-cvs mailing list