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

This commit is contained in:
H. Verbeet 2007-04-16 21:20:25 +02:00 committed by Alexandre Julliard
parent 74b5c87ebd
commit 1b9a5ba682
2 changed files with 18 additions and 0 deletions

View File

@ -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

View File

@ -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);