Commit 1b9a5ba6 authored by H. Verbeet's avatar H. Verbeet Committed by Alexandre Julliard

wined3d: Add a function to determine if a surface is the front or the backbuffer…

wined3d: Add a function to determine if a surface is the front or the backbuffer for a swapchain, and return the corresponding GLenum.
parent 74b5c87e
......@@ -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
......
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment