surface.c revision 1e8407a779e6ce2d2326f9b62c7cb82e3ab7b49a
/*
* IDirect3DSurface9 implementation
*
* Copyright 2002-2005 Jason Edmeades
* Raphael Junqueira
*
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "config.h"
#include "d3d9_private.h"
{
}
static HRESULT WINAPI d3d9_surface_QueryInterface(IDirect3DSurface9 *iface, REFIID riid, void **out)
{
{
return S_OK;
}
return E_NOINTERFACE;
}
{
if (surface->forwardReference)
{
}
if (refcount == 1)
{
if (surface->parent_device)
}
return refcount;
}
{
if (surface->forwardReference)
{
}
if (!refcount)
{
/* Release the device last, as it may cause the device to be destroyed. */
if (parent_device)
}
return refcount;
}
{
if (surface->forwardReference)
{
hr = IUnknown_QueryInterface(surface->forwardReference, &IID_IDirect3DResource9, (void **)&resource);
{
}
return hr;
}
return D3D_OK;
}
{
struct wined3d_resource *resource;
TRACE("iface %p, guid %s, data %p, data_size %u, flags %#x.\n",
return hr;
}
{
struct wined3d_resource *resource;
TRACE("iface %p, guid %s, data %p, data_size %p.\n",
return hr;
}
{
struct wined3d_resource *resource;
return hr;
}
{
return ret;
}
{
return ret;
}
{
}
{
return D3DRTYPE_SURFACE;
}
static HRESULT WINAPI d3d9_surface_GetContainer(IDirect3DSurface9 *iface, REFIID riid, void **container)
{
return E_NOINTERFACE;
return hr;
}
{
struct wined3d_resource_desc wined3d_desc;
struct wined3d_resource *wined3d_resource;
return D3D_OK;
}
{
struct wined3d_map_desc map_desc;
TRACE("iface %p, locked_rect %p, rect %s, flags %#x.\n",
return hr;
}
{
switch(hr)
{
case WINEDDERR_NOTLOCKED: return D3DERR_INVALIDCALL;
default: return hr;
}
}
{
if (!surface->getdc_supported)
{
WARN("Surface does not support GetDC, returning D3DERR_INVALIDCALL\n");
/* Don't touch the DC */
return D3DERR_INVALIDCALL;
}
return hr;
}
{
switch (hr)
{
case WINEDDERR_NODC: return D3DERR_INVALIDCALL;
default: return hr;
}
}
static const struct IDirect3DSurface9Vtbl d3d9_surface_vtbl =
{
/* IUnknown */
/* IDirect3DResource9 */
/* IDirect3DSurface9 */
};
{
}
static const struct wined3d_parent_ops d3d9_surface_wined3d_parent_ops =
{
};
HRESULT surface_init(struct d3d9_surface *surface, struct d3d9_device *device, UINT width, UINT height,
#ifdef VBOX_WITH_WDDM
, void *pvClientMem
#endif
)
{
switch (format)
{
case D3DFMT_A8R8G8B8:
case D3DFMT_X8R8G8B8:
case D3DFMT_R5G6B5:
case D3DFMT_X1R5G5B5:
case D3DFMT_A1R5G5B5:
case D3DFMT_R8G8B8:
break;
default:
break;
}
/* FIXME: Check MAX bounds of MultisampleQuality. */
if (multisample_quality > 0)
{
multisample_quality = 0;
}
hr = wined3d_surface_create(device->wined3d_device, width, height, wined3dformat_from_d3dformat(format),
#ifdef VBOX_WITH_WDDM
#endif
);
{
return hr;
}
return D3D_OK;
}
{
if (!iface)
return NULL;
return impl_from_IDirect3DSurface9(iface);
}
#ifdef VBOX_WITH_WDDM
{
return hr;
}
#endif