surface.c revision 4237d5a79f48789aacc67dc43378d2d7813a39f4
/*
* IDirect3DSurface8 implementation
*
* Copyright 2005 Oliver Stieber
*
* 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
*/
/*
* Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
* other than GPL or LGPL is available it will apply instead, Oracle elects to use only
* the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
* a choice of LGPL license versions is made available with the language indicating
* that LGPLv2 or any later version may be used, or where a choice of which version
* of the LGPL is applied is otherwise unspecified.
*/
#include "config.h"
#include "d3d8_private.h"
{
}
static HRESULT WINAPI d3d8_surface_QueryInterface(IDirect3DSurface8 *iface, REFIID riid, void **out)
{
{
return S_OK;
}
return E_NOINTERFACE;
}
{
if (surface->forwardReference)
{
/* Forward refcounting */
}
else
{
/* No container, handle our own refcounting */
if (ref == 1)
{
if (surface->parent_device)
}
return ref;
}
}
{
if (surface->forwardReference)
{
/* Forward refcounting */
}
else
{
/* No container, handle our own refcounting */
if (!ref)
{
/* Implicit surfaces are destroyed with the device, not if refcount reaches 0. */
if (parent_device)
}
return ref;
}
}
{
if (surface->forwardReference)
{
hr = IUnknown_QueryInterface(surface->forwardReference, &IID_IDirect3DResource8, (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;
}
static HRESULT WINAPI d3d8_surface_GetContainer(IDirect3DSurface8 *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",
if (rect)
{
{
WARN("Trying to lock an invalid rectangle, returning D3DERR_INVALIDCALL\n");
return D3DERR_INVALIDCALL;
}
}
return hr;
}
{
switch(hr)
{
case WINEDDERR_NOTLOCKED: return D3DERR_INVALIDCALL;
default: return hr;
}
}
static const IDirect3DSurface8Vtbl d3d8_surface_vtbl =
{
/* IUnknown */
/* IDirect3DResource8 */
/* IDirect3DSurface8 */
};
{
}
static const struct wined3d_parent_ops d3d8_surface_wined3d_parent_ops =
{
};
HRESULT surface_init(struct d3d8_surface *surface, struct d3d8_device *device, UINT width, UINT height,
{
/* 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),
{
return hr;
}
return D3D_OK;
}
{
if (!iface)
return NULL;
return impl_from_IDirect3DSurface8(iface);
}