- Output a FIXME when a surface with dimensions not being a power of

two is requested.
- Fail gracefully when IWineD3DImpl_CreateDevice fails to create the
  front- or backbuffer.
This commit is contained in:
Felix Nawothnig 2005-06-08 18:34:52 +00:00 committed by Alexandre Julliard
parent fe42f46c8a
commit 2767543be9
2 changed files with 24 additions and 21 deletions

View File

@ -412,9 +412,8 @@ HRESULT WINAPI IWineD3DDeviceImpl_CreateSurface(IWineD3DDevice *iface, UINT Wid
while (pow2Width < Width) pow2Width <<= 1; while (pow2Width < Width) pow2Width <<= 1;
while (pow2Height < Height) pow2Height <<= 1; while (pow2Height < Height) pow2Height <<= 1;
/* TODO: support for non-power 2 textures */
if(pow2Width > Width || pow2Height > Height){ if(pow2Width > Width || pow2Height > Height){
/** TODO: add support for non power two compressed textures (OpenGL provices support for * non-power-two textures gratis) **/ FIXME("non-power-two textures unsupported\n"); /* OpenGL provides support for these gratis */
return D3DERR_NOTAVAILABLE; return D3DERR_NOTAVAILABLE;
} }

View File

@ -1496,6 +1496,7 @@ HRESULT WINAPI IWineD3DImpl_CreateDevice(IWineD3D *iface, UINT Adapter, D3DDEV
IWineD3DImpl *This = (IWineD3DImpl *)iface; IWineD3DImpl *This = (IWineD3DImpl *)iface;
int num; int num;
XVisualInfo template; XVisualInfo template;
HRESULT res;
/* Validate the adapter number */ /* Validate the adapter number */
if (Adapter >= IWineD3D_GetAdapterCount(iface)) { if (Adapter >= IWineD3D_GetAdapterCount(iface)) {
@ -1659,25 +1660,28 @@ HRESULT WINAPI IWineD3DImpl_CreateDevice(IWineD3D *iface, UINT Adapter, D3DDEV
parms. Fix this by passing in a function to call which takes identical parms parms. Fix this by passing in a function to call which takes identical parms
and handles the differences at the d3dx layer, and returns the IWineD3DSurface and handles the differences at the d3dx layer, and returns the IWineD3DSurface
pointer rather than the created D3D8/9 one */ pointer rather than the created D3D8/9 one */
D3DCB_CreateRenderTarget((IUnknown *) parent, if ((res = D3DCB_CreateRenderTarget((IUnknown *) parent,
*(pPresentationParameters->BackBufferWidth), *(pPresentationParameters->BackBufferWidth),
*(pPresentationParameters->BackBufferHeight), *(pPresentationParameters->BackBufferHeight),
*(pPresentationParameters->BackBufferFormat), *(pPresentationParameters->BackBufferFormat),
*(pPresentationParameters->MultiSampleType), *(pPresentationParameters->MultiSampleType),
*(pPresentationParameters->MultiSampleQuality), *(pPresentationParameters->MultiSampleQuality),
TRUE, TRUE,
(IWineD3DSurface **) &object->frontBuffer, (IWineD3DSurface **) &object->frontBuffer,
NULL); NULL) != D3D_OK) ||
(res = D3DCB_CreateRenderTarget((IUnknown *) parent,
D3DCB_CreateRenderTarget((IUnknown *) parent, *(pPresentationParameters->BackBufferWidth),
*(pPresentationParameters->BackBufferWidth), *(pPresentationParameters->BackBufferHeight),
*(pPresentationParameters->BackBufferHeight), *(pPresentationParameters->BackBufferFormat),
*(pPresentationParameters->BackBufferFormat), *(pPresentationParameters->MultiSampleType),
*(pPresentationParameters->MultiSampleType), *(pPresentationParameters->MultiSampleQuality),
*(pPresentationParameters->MultiSampleQuality), TRUE,
TRUE, (IWineD3DSurface **) &object->backBuffer,
(IWineD3DSurface **) &object->backBuffer, NULL) != D3D_OK))
NULL); {
ERR("D3DCB_CreateRenderTarget() failed\n");
return res;
}
/* TODO: /* TODO:
if (*(pPresentationParameters->EnableAutoDepthStencil)) { if (*(pPresentationParameters->EnableAutoDepthStencil)) {