H. Verbeet : wined3d: Add a function to determine if a surface is the front or the backbuffer for a swapchain , and return the corresponding GLenum.

Alexandre Julliard julliard at wine.codeweavers.com
Tue Apr 17 08:12:12 CDT 2007


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

Author: H. Verbeet <hverbeet at gmail.com>
Date:   Mon Apr 16 21:20:25 2007 +0200

wined3d: Add a function to determine if a surface is the front or the backbuffer for a swapchain, and return the corresponding GLenum.

---

 dlls/wined3d/surface.c         |   17 +++++++++++++++++
 dlls/wined3d/wined3d_private.h |    1 +
 2 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index 117c457..049b827 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -287,6 +287,23 @@ void surface_set_compatible_renderbuffer(IWineD3DSurface *iface, unsigned int wi
     checkGLcall("set_compatible_renderbuffer");
 }
 
+GLenum surface_get_gl_buffer(IWineD3DSurface *iface, IWineD3DSwapChain *swapchain) {
+    IWineD3DSurfaceImpl *This = (IWineD3DSurfaceImpl *)iface;
+    IWineD3DSwapChainImpl *swapchain_impl = (IWineD3DSwapChainImpl *)swapchain;
+
+    TRACE("(%p) : swapchain %p\n", This, swapchain);
+
+    if (swapchain_impl->backBuffer && swapchain_impl->backBuffer[0] == iface) {
+        TRACE("Returning GL_BACK\n");
+        return GL_BACK;
+    } else if (swapchain_impl->frontBuffer == iface) {
+        TRACE("Returning GL_FRONT\n");
+        return GL_FRONT;
+    }
+
+    FIXME("Higher back buffer, returning GL_BACK\n");
+    return GL_BACK;
+}
 
 /* *******************************************
    IWineD3DSurface IUnknown parts follow
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 9fb4343..3de938a 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -1412,6 +1412,7 @@ void   set_tex_op_nvrc(IWineD3DDevice *iface, BOOL is_alpha, int stage, WINED3DT
 void   set_texture_matrix(const float *smat, DWORD flags, BOOL calculatedCoords);
 
 void surface_set_compatible_renderbuffer(IWineD3DSurface *iface, unsigned int width, unsigned int height);
+GLenum surface_get_gl_buffer(IWineD3DSurface *iface, IWineD3DSwapChain *swapchain);
 
 int D3DFmtMakeGlCfg(WINED3DFORMAT BackBufferFormat, WINED3DFORMAT StencilBufferFormat, int *attribs, int* nAttribs, BOOL alternate);
 




More information about the wine-cvs mailing list