surface.c revision 5112e32d7072e280613921c982a6672f2c859cf3
/*
* 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
*/
/*
* Sun LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
* other than GPL or LGPL is available it will apply instead, Sun 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"
/* IDirect3DSurface8 IUnknown parts follow: */
static HRESULT WINAPI IDirect3DSurface8Impl_QueryInterface(LPDIRECT3DSURFACE8 iface, REFIID riid, LPVOID *ppobj) {
return S_OK;
}
return E_NOINTERFACE;
}
if (This->forwardReference) {
/* Forward refcounting */
} else {
/* No container, handle our own refcounting */
if (ref == 1)
{
}
return ref;
}
}
if (This->forwardReference) {
/* Forward refcounting */
} else {
/* No container, handle our own refcounting */
if (ref == 0) {
/* Implicit surfaces are destroyed with the device, not if refcount reaches 0. */
}
return ref;
}
}
/* IDirect3DSurface8 IDirect3DResource8 Interface follow: */
static HRESULT WINAPI IDirect3DSurface8Impl_GetDevice(IDirect3DSurface8 *iface, IDirect3DDevice8 **device)
{
if (This->forwardReference)
{
{
}
return hr;
}
return D3D_OK;
}
static HRESULT WINAPI IDirect3DSurface8Impl_SetPrivateData(LPDIRECT3DSURFACE8 iface, REFGUID refguid, CONST void *pData, DWORD SizeOfData, DWORD Flags) {
TRACE("iface %p, guid %s, data %p, data_size %u, flags %#x.\n",
return hr;
}
static HRESULT WINAPI IDirect3DSurface8Impl_GetPrivateData(LPDIRECT3DSURFACE8 iface, REFGUID refguid, void *pData, DWORD *pSizeOfData) {
TRACE("iface %p, guid %s, data %p, data_size %p.\n",
return hr;
}
static HRESULT WINAPI IDirect3DSurface8Impl_FreePrivateData(LPDIRECT3DSURFACE8 iface, REFGUID refguid) {
return hr;
}
/* IDirect3DSurface8 Interface follow: */
static HRESULT WINAPI IDirect3DSurface8Impl_GetContainer(LPDIRECT3DSURFACE8 iface, REFIID riid, void **ppContainer) {
return res;
}
static HRESULT WINAPI IDirect3DSurface8Impl_GetDesc(LPDIRECT3DSURFACE8 iface, D3DSURFACE_DESC *pDesc) {
{
}
return hr;
}
static HRESULT WINAPI IDirect3DSurface8Impl_LockRect(LPDIRECT3DSURFACE8 iface, D3DLOCKED_RECT *pLockedRect, CONST RECT *pRect, DWORD Flags) {
if (pRect) {
WARN("Trying to lock an invalid rectangle, returning D3DERR_INVALIDCALL\n");
return D3DERR_INVALIDCALL;
}
}
hr = IWineD3DSurface_LockRect(This->wineD3DSurface, (WINED3DLOCKED_RECT *) pLockedRect, pRect, Flags);
return hr;
}
switch(hr)
{
case WINEDDERR_NOTLOCKED: return D3DERR_INVALIDCALL;
default: return hr;
}
}
static const IDirect3DSurface8Vtbl Direct3DSurface8_Vtbl =
{
/* IUnknown */
/* IDirect3DResource8 */
/* IDirect3DSurface8 */
};
{
}
static const struct wined3d_parent_ops d3d8_surface_wined3d_parent_ops =
{
};
{
/* FIXME: Check MAX bounds of MultisampleQuality. */
if (multisample_quality > 0)
{
multisample_quality = 0;
}
hr = IWineD3DDevice_CreateSurface(device->WineD3DDevice, width, height, wined3dformat_from_d3dformat(format),
{
return hr;
}
return D3D_OK;
}