Commit daa6a3d7 authored by Stefan Dösinger's avatar Stefan Dösinger Committed by Alexandre Julliard

wined3d: Support for single buffering.

parent 2f724834
...@@ -1152,9 +1152,6 @@ HRESULT WINAPI IWineD3DDeviceImpl_CreateAdditionalSwapChain(IWineD3DDevice* ifac ...@@ -1152,9 +1152,6 @@ HRESULT WINAPI IWineD3DDeviceImpl_CreateAdditionalSwapChain(IWineD3DDevice* ifac
D3DCREATEOBJECTINSTANCE(object, SwapChain) D3DCREATEOBJECTINSTANCE(object, SwapChain)
/* Initialize other useful values */
object->presentParms.BackBufferCount = 1; /* TODO:? support for gl_aux buffers */
/********************* /*********************
* Lookup the window Handle and the relating X window handle * Lookup the window Handle and the relating X window handle
********************/ ********************/
...@@ -1382,18 +1379,34 @@ HRESULT WINAPI IWineD3DDeviceImpl_CreateAdditionalSwapChain(IWineD3DDevice* ifac ...@@ -1382,18 +1379,34 @@ HRESULT WINAPI IWineD3DDeviceImpl_CreateAdditionalSwapChain(IWineD3DDevice* ifac
NULL /* pShared (always null)*/); NULL /* pShared (always null)*/);
if (object->frontBuffer != NULL) if (object->frontBuffer != NULL)
IWineD3DSurface_SetContainer(object->frontBuffer, (IWineD3DBase *)object); IWineD3DSurface_SetContainer(object->frontBuffer, (IWineD3DBase *)object);
TRACE("calling rendertarget CB\n"); if(object->presentParms.BackBufferCount > 0) {
hr = D3DCB_CreateRenderTarget((IUnknown *) This->parent, TRACE("calling rendertarget CB\n");
object->presentParms.BackBufferWidth, hr = D3DCB_CreateRenderTarget((IUnknown *) This->parent,
object->presentParms.BackBufferHeight, object->presentParms.BackBufferWidth,
object->presentParms.BackBufferFormat, object->presentParms.BackBufferHeight,
object->presentParms.MultiSampleType, object->presentParms.BackBufferFormat,
object->presentParms.MultiSampleQuality, object->presentParms.MultiSampleType,
TRUE /* Lockable */, object->presentParms.MultiSampleQuality,
&object->backBuffer, TRUE /* Lockable */,
NULL /* pShared (always null)*/); &object->backBuffer,
if (object->backBuffer != NULL) NULL /* pShared (always null)*/);
} else {
object->backBuffer = NULL;
}
if (object->backBuffer != NULL) {
IWineD3DSurface_SetContainer(object->backBuffer, (IWineD3DBase *)object); IWineD3DSurface_SetContainer(object->backBuffer, (IWineD3DBase *)object);
ENTER_GL();
glDrawBuffer(GL_BACK);
checkGLcall("glDrawBuffer(GL_BACK)");
LEAVE_GL();
} else {
/* Single buffering - draw to front buffer */
ENTER_GL();
glDrawBuffer(GL_FRONT);
checkGLcall("glDrawBuffer(GL_FRONT)");
LEAVE_GL();
}
/* Under directX swapchains share the depth stencil, so only create one depth-stencil */ /* Under directX swapchains share the depth stencil, so only create one depth-stencil */
if (pPresentationParameters->EnableAutoDepthStencil) { if (pPresentationParameters->EnableAutoDepthStencil) {
......
...@@ -94,19 +94,24 @@ ULONG WINAPI IWineD3DSwapChainImpl_Release(IWineD3DSwapChain *iface) { ...@@ -94,19 +94,24 @@ ULONG WINAPI IWineD3DSwapChainImpl_Release(IWineD3DSwapChain *iface) {
IWineD3DDevice_SwapChainReleased((IWineD3DDevice *)This->wineD3DDevice, iface); IWineD3DDevice_SwapChainReleased((IWineD3DDevice *)This->wineD3DDevice, iface);
/* release the ref to the front and back buffer parents */ /* release the ref to the front and back buffer parents */
IWineD3DSurface_SetContainer(This->frontBuffer, 0); if(This->frontBuffer) {
IWineD3DSurface_GetParent(This->frontBuffer, &bufferParent); IWineD3DSurface_SetContainer(This->frontBuffer, 0);
IUnknown_Release(bufferParent); /* once for the get parent */ IWineD3DSurface_GetParent(This->frontBuffer, &bufferParent);
if(IUnknown_Release(bufferParent) > 0){ IUnknown_Release(bufferParent); /* once for the get parent */
FIXME("(%p) Something's still holding the front buffer\n",This); if(IUnknown_Release(bufferParent) > 0){
FIXME("(%p) Something's still holding the front buffer\n",This);
}
} }
IWineD3DSurface_SetContainer(This->backBuffer, 0); if(This->backBuffer) {
IWineD3DSurface_GetParent(This->backBuffer, &bufferParent); IWineD3DSurface_SetContainer(This->backBuffer, 0);
IUnknown_Release(bufferParent); /* once for the get parent */ IWineD3DSurface_GetParent(This->backBuffer, &bufferParent);
if(IUnknown_Release(bufferParent) > 0){ IUnknown_Release(bufferParent); /* once for the get parent */
FIXME("(%p) Something's still holding the back buffer\n",This); if(IUnknown_Release(bufferParent) > 0){
FIXME("(%p) Something's still holding the back buffer\n",This);
}
} }
/* Clean up the context */ /* Clean up the context */
/* check that we are the current context first */ /* check that we are the current context first */
if(glXGetCurrentContext() == This->glCtx){ if(glXGetCurrentContext() == This->glCtx){
......
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