Initial D3D8 implementation.
This commit is contained in:
parent
4f10164f07
commit
26258ce06a
|
@ -769,7 +769,7 @@ commdlg: shell32.dll$(DLLEXT) shlwapi.dll$(DLLEXT) comctl32.dll$(DLLEXT) winspo
|
||||||
user32.dll$(DLLEXT) gdi32.dll$(DLLEXT) kernel32.dll$(DLLEXT)
|
user32.dll$(DLLEXT) gdi32.dll$(DLLEXT) kernel32.dll$(DLLEXT)
|
||||||
crtdll: msvcrt.dll$(DLLEXT) kernel32.dll$(DLLEXT)
|
crtdll: msvcrt.dll$(DLLEXT) kernel32.dll$(DLLEXT)
|
||||||
crypt32: advapi32.dll$(DLLEXT) kernel32.dll$(DLLEXT)
|
crypt32: advapi32.dll$(DLLEXT) kernel32.dll$(DLLEXT)
|
||||||
d3d8: kernel32.dll$(DLLEXT)
|
d3d8: user32.dll$(DLLEXT) gdi32.dll$(DLLEXT) kernel32.dll$(DLLEXT)
|
||||||
dciman32: kernel32.dll$(DLLEXT)
|
dciman32: kernel32.dll$(DLLEXT)
|
||||||
ddraw: user32.dll$(DLLEXT) gdi32.dll$(DLLEXT) kernel32.dll$(DLLEXT)
|
ddraw: user32.dll$(DLLEXT) gdi32.dll$(DLLEXT) kernel32.dll$(DLLEXT)
|
||||||
devenum: kernel32.dll$(DLLEXT)
|
devenum: kernel32.dll$(DLLEXT)
|
||||||
|
|
|
@ -3,12 +3,26 @@ TOPOBJDIR = ../..
|
||||||
SRCDIR = @srcdir@
|
SRCDIR = @srcdir@
|
||||||
VPATH = @srcdir@
|
VPATH = @srcdir@
|
||||||
MODULE = d3d8.dll
|
MODULE = d3d8.dll
|
||||||
|
IMPORTS = user32 gdi32 kernel32
|
||||||
|
EXTRALIBS = $(LIBUUID) $(X_LIBS) $(XLIB)
|
||||||
|
|
||||||
LDDLLFLAGS = @LDDLLFLAGS@
|
LDDLLFLAGS = @LDDLLFLAGS@
|
||||||
SYMBOLFILE = $(MODULE).tmp.o
|
SYMBOLFILE = $(MODULE).tmp.o
|
||||||
|
|
||||||
C_SRCS = \
|
C_SRCS = \
|
||||||
d3d8_main.c
|
basetexture.c \
|
||||||
|
cubetexture.c \
|
||||||
|
d3d8_main.c \
|
||||||
|
device.c \
|
||||||
|
directx.c \
|
||||||
|
indexbuffer.c \
|
||||||
|
resource.c \
|
||||||
|
surface.c \
|
||||||
|
swapchain.c \
|
||||||
|
texture.c \
|
||||||
|
vertexbuffer.c \
|
||||||
|
volume.c \
|
||||||
|
volumetexture.c \
|
||||||
|
|
||||||
@MAKE_DLL_RULES@
|
@MAKE_DLL_RULES@
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,130 @@
|
||||||
|
/*
|
||||||
|
* IDirect3DBaseTexture8 implementation
|
||||||
|
*
|
||||||
|
* Copyright 2002 Jason Edmeades
|
||||||
|
*
|
||||||
|
* This library is free software; you can redistribute it and/or
|
||||||
|
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "windef.h"
|
||||||
|
#include "winbase.h"
|
||||||
|
#include "winuser.h"
|
||||||
|
#include "wingdi.h"
|
||||||
|
#include "wine/debug.h"
|
||||||
|
|
||||||
|
#include "d3d8_private.h"
|
||||||
|
|
||||||
|
WINE_DEFAULT_DEBUG_CHANNEL(d3d);
|
||||||
|
|
||||||
|
/* IDirect3DBaseTexture8 IUnknown parts follow: */
|
||||||
|
HRESULT WINAPI IDirect3DBaseTexture8Impl_QueryInterface(LPDIRECT3DBASETEXTURE8 iface,REFIID riid,LPVOID *ppobj)
|
||||||
|
{
|
||||||
|
ICOM_THIS(IDirect3DBaseTexture8Impl,iface);
|
||||||
|
TRACE("(%p) : QueryInterface\n", This);
|
||||||
|
if (IsEqualGUID(riid, &IID_IUnknown)
|
||||||
|
|| IsEqualGUID(riid, &IID_IClassFactory)) {
|
||||||
|
IDirect3DBaseTexture8Impl_AddRef(iface);
|
||||||
|
*ppobj = This;
|
||||||
|
return D3D_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppobj);
|
||||||
|
return E_NOINTERFACE;
|
||||||
|
}
|
||||||
|
|
||||||
|
ULONG WINAPI IDirect3DBaseTexture8Impl_AddRef(LPDIRECT3DBASETEXTURE8 iface) {
|
||||||
|
ICOM_THIS(IDirect3DBaseTexture8Impl,iface);
|
||||||
|
TRACE("(%p) : AddRef from %ld\n", This, This->ref);
|
||||||
|
return ++(This->ref);
|
||||||
|
}
|
||||||
|
|
||||||
|
ULONG WINAPI IDirect3DBaseTexture8Impl_Release(LPDIRECT3DBASETEXTURE8 iface) {
|
||||||
|
ICOM_THIS(IDirect3DBaseTexture8Impl,iface);
|
||||||
|
ULONG ref = --This->ref;
|
||||||
|
TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
|
||||||
|
if (ref == 0)
|
||||||
|
HeapFree(GetProcessHeap(), 0, This);
|
||||||
|
return ref;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* IDirect3DBaseTexture8 IDirect3DResource8 Interface follow: */
|
||||||
|
HRESULT WINAPI IDirect3DBaseTexture8Impl_GetDevice(LPDIRECT3DBASETEXTURE8 iface, IDirect3DDevice8** ppDevice) {
|
||||||
|
ICOM_THIS(IDirect3DBaseTexture8Impl,iface);
|
||||||
|
TRACE("(%p) : returning %p\n", This, This->Device);
|
||||||
|
*ppDevice = (LPDIRECT3DDEVICE8) This->Device;
|
||||||
|
return D3D_OK;
|
||||||
|
}
|
||||||
|
HRESULT WINAPI IDirect3DBaseTexture8Impl_SetPrivateData(LPDIRECT3DBASETEXTURE8 iface, REFGUID refguid, CONST void* pData, DWORD SizeOfData, DWORD Flags) {
|
||||||
|
ICOM_THIS(IDirect3DBaseTexture8Impl,iface);
|
||||||
|
FIXME("(%p) : stub\n", This); return D3D_OK;
|
||||||
|
}
|
||||||
|
HRESULT WINAPI IDirect3DBaseTexture8Impl_GetPrivateData(LPDIRECT3DBASETEXTURE8 iface, REFGUID refguid, void* pData, DWORD* pSizeOfData) {
|
||||||
|
ICOM_THIS(IDirect3DBaseTexture8Impl,iface);
|
||||||
|
FIXME("(%p) : stub\n", This); return D3D_OK;
|
||||||
|
}
|
||||||
|
HRESULT WINAPI IDirect3DBaseTexture8Impl_FreePrivateData(LPDIRECT3DBASETEXTURE8 iface, REFGUID refguid) {
|
||||||
|
ICOM_THIS(IDirect3DBaseTexture8Impl,iface);
|
||||||
|
FIXME("(%p) : stub\n", This); return D3D_OK;
|
||||||
|
}
|
||||||
|
DWORD WINAPI IDirect3DBaseTexture8Impl_SetPriority(LPDIRECT3DBASETEXTURE8 iface, DWORD PriorityNew) {
|
||||||
|
ICOM_THIS(IDirect3DBaseTexture8Impl,iface);
|
||||||
|
FIXME("(%p) : stub\n", This); return D3D_OK;
|
||||||
|
}
|
||||||
|
DWORD WINAPI IDirect3DBaseTexture8Impl_GetPriority(LPDIRECT3DBASETEXTURE8 iface) {
|
||||||
|
ICOM_THIS(IDirect3DBaseTexture8Impl,iface);
|
||||||
|
FIXME("(%p) : stub\n", This); return D3D_OK;
|
||||||
|
}
|
||||||
|
void WINAPI IDirect3DBaseTexture8Impl_PreLoad(LPDIRECT3DBASETEXTURE8 iface) {
|
||||||
|
ICOM_THIS(IDirect3DBaseTexture8Impl,iface);
|
||||||
|
FIXME("(%p) : stub\n", This);
|
||||||
|
}
|
||||||
|
D3DRESOURCETYPE WINAPI IDirect3DBaseTexture8Impl_GetType(LPDIRECT3DBASETEXTURE8 iface) {
|
||||||
|
ICOM_THIS(IDirect3DBaseTexture8Impl,iface);
|
||||||
|
TRACE("(%p) : returning %d\n", This, This->ResourceType);
|
||||||
|
return This->ResourceType;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* IDirect3DBaseTexture8 */
|
||||||
|
DWORD WINAPI IDirect3DBaseTexture8Impl_SetLOD(LPDIRECT3DBASETEXTURE8 iface, DWORD LODNew) {
|
||||||
|
ICOM_THIS(IDirect3DBaseTexture8Impl,iface);
|
||||||
|
FIXME("(%p) : stub\n", This); return D3D_OK;
|
||||||
|
}
|
||||||
|
DWORD WINAPI IDirect3DBaseTexture8Impl_GetLOD(LPDIRECT3DBASETEXTURE8 iface) {
|
||||||
|
ICOM_THIS(IDirect3DBaseTexture8Impl,iface);
|
||||||
|
FIXME("(%p) : stub\n", This); return D3D_OK;
|
||||||
|
}
|
||||||
|
DWORD WINAPI IDirect3DBaseTexture8Impl_GetLevelCount(LPDIRECT3DBASETEXTURE8 iface) {
|
||||||
|
ICOM_THIS(IDirect3DBaseTexture8Impl,iface);
|
||||||
|
FIXME("(%p) : stub\n", This); return D3D_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
ICOM_VTABLE(IDirect3DBaseTexture8) Direct3DBaseTexture8_Vtbl =
|
||||||
|
{
|
||||||
|
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
|
||||||
|
IDirect3DBaseTexture8Impl_QueryInterface,
|
||||||
|
IDirect3DBaseTexture8Impl_AddRef,
|
||||||
|
IDirect3DBaseTexture8Impl_Release,
|
||||||
|
IDirect3DBaseTexture8Impl_GetDevice,
|
||||||
|
IDirect3DBaseTexture8Impl_SetPrivateData,
|
||||||
|
IDirect3DBaseTexture8Impl_GetPrivateData,
|
||||||
|
IDirect3DBaseTexture8Impl_FreePrivateData,
|
||||||
|
IDirect3DBaseTexture8Impl_SetPriority,
|
||||||
|
IDirect3DBaseTexture8Impl_GetPriority,
|
||||||
|
IDirect3DBaseTexture8Impl_PreLoad,
|
||||||
|
IDirect3DBaseTexture8Impl_GetType,
|
||||||
|
IDirect3DBaseTexture8Impl_SetLOD,
|
||||||
|
IDirect3DBaseTexture8Impl_GetLOD,
|
||||||
|
IDirect3DBaseTexture8Impl_GetLevelCount,
|
||||||
|
};
|
|
@ -0,0 +1,182 @@
|
||||||
|
/*
|
||||||
|
* IDirect3DCubeTexture8 implementation
|
||||||
|
*
|
||||||
|
* Copyright 2002 Jason Edmeades
|
||||||
|
*
|
||||||
|
* This library is free software; you can redistribute it and/or
|
||||||
|
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "windef.h"
|
||||||
|
#include "winbase.h"
|
||||||
|
#include "winuser.h"
|
||||||
|
#include "wingdi.h"
|
||||||
|
#include "wine/debug.h"
|
||||||
|
|
||||||
|
#include "d3d8_private.h"
|
||||||
|
|
||||||
|
WINE_DEFAULT_DEBUG_CHANNEL(d3d);
|
||||||
|
|
||||||
|
/* IDirect3DCubeTexture8 IUnknown parts follow: */
|
||||||
|
HRESULT WINAPI IDirect3DCubeTexture8Impl_QueryInterface(LPDIRECT3DCUBETEXTURE8 iface,REFIID riid,LPVOID *ppobj)
|
||||||
|
{
|
||||||
|
ICOM_THIS(IDirect3DCubeTexture8Impl,iface);
|
||||||
|
TRACE("(%p) : QueryInterface\n", This);
|
||||||
|
if (IsEqualGUID(riid, &IID_IUnknown)
|
||||||
|
|| IsEqualGUID(riid, &IID_IClassFactory)) {
|
||||||
|
IDirect3DCubeTexture8Impl_AddRef(iface);
|
||||||
|
*ppobj = This;
|
||||||
|
return D3D_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppobj);
|
||||||
|
return E_NOINTERFACE;
|
||||||
|
}
|
||||||
|
|
||||||
|
ULONG WINAPI IDirect3DCubeTexture8Impl_AddRef(LPDIRECT3DCUBETEXTURE8 iface) {
|
||||||
|
ICOM_THIS(IDirect3DCubeTexture8Impl,iface);
|
||||||
|
TRACE("(%p) : AddRef from %ld\n", This, This->ref);
|
||||||
|
return ++(This->ref);
|
||||||
|
}
|
||||||
|
|
||||||
|
ULONG WINAPI IDirect3DCubeTexture8Impl_Release(LPDIRECT3DCUBETEXTURE8 iface) {
|
||||||
|
ICOM_THIS(IDirect3DCubeTexture8Impl,iface);
|
||||||
|
ULONG ref = --This->ref;
|
||||||
|
int i;
|
||||||
|
|
||||||
|
TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
|
||||||
|
if (ref == 0) {
|
||||||
|
for (i=0; i<This->levels; i++) {
|
||||||
|
if (This->surfaces[i] != NULL) {
|
||||||
|
TRACE("(%p) : Releasing surface %p\n", This, This->surfaces[i]);
|
||||||
|
IDirect3DSurface8Impl_Release((LPDIRECT3DSURFACE8) This->surfaces[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
HeapFree(GetProcessHeap(), 0, This);
|
||||||
|
}
|
||||||
|
return ref;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* IDirect3DCubeTexture8 IDirect3DResource8 Interface follow: */
|
||||||
|
HRESULT WINAPI IDirect3DCubeTexture8Impl_GetDevice(LPDIRECT3DCUBETEXTURE8 iface, IDirect3DDevice8** ppDevice) {
|
||||||
|
ICOM_THIS(IDirect3DCubeTexture8Impl,iface);
|
||||||
|
TRACE("(%p) : returning %p\n", This, This->Device);
|
||||||
|
*ppDevice = (LPDIRECT3DDEVICE8) This->Device;
|
||||||
|
return D3D_OK;
|
||||||
|
}
|
||||||
|
HRESULT WINAPI IDirect3DCubeTexture8Impl_SetPrivateData(LPDIRECT3DCUBETEXTURE8 iface, REFGUID refguid, CONST void* pData, DWORD SizeOfData, DWORD Flags) {
|
||||||
|
ICOM_THIS(IDirect3DCubeTexture8Impl,iface);
|
||||||
|
FIXME("(%p) : stub\n", This); return D3D_OK;
|
||||||
|
}
|
||||||
|
HRESULT WINAPI IDirect3DCubeTexture8Impl_GetPrivateData(LPDIRECT3DCUBETEXTURE8 iface, REFGUID refguid, void* pData, DWORD* pSizeOfData) {
|
||||||
|
ICOM_THIS(IDirect3DCubeTexture8Impl,iface);
|
||||||
|
FIXME("(%p) : stub\n", This); return D3D_OK;
|
||||||
|
}
|
||||||
|
HRESULT WINAPI IDirect3DCubeTexture8Impl_FreePrivateData(LPDIRECT3DCUBETEXTURE8 iface, REFGUID refguid) {
|
||||||
|
ICOM_THIS(IDirect3DCubeTexture8Impl,iface);
|
||||||
|
FIXME("(%p) : stub\n", This); return D3D_OK;
|
||||||
|
}
|
||||||
|
DWORD WINAPI IDirect3DCubeTexture8Impl_SetPriority(LPDIRECT3DCUBETEXTURE8 iface, DWORD PriorityNew) {
|
||||||
|
ICOM_THIS(IDirect3DCubeTexture8Impl,iface);
|
||||||
|
FIXME("(%p) : stub\n", This); return D3D_OK;
|
||||||
|
}
|
||||||
|
DWORD WINAPI IDirect3DCubeTexture8Impl_GetPriority(LPDIRECT3DCUBETEXTURE8 iface) {
|
||||||
|
ICOM_THIS(IDirect3DCubeTexture8Impl,iface);
|
||||||
|
FIXME("(%p) : stub\n", This); return D3D_OK;
|
||||||
|
}
|
||||||
|
void WINAPI IDirect3DCubeTexture8Impl_PreLoad(LPDIRECT3DCUBETEXTURE8 iface) {
|
||||||
|
ICOM_THIS(IDirect3DCubeTexture8Impl,iface);
|
||||||
|
FIXME("(%p) : stub\n", This);
|
||||||
|
}
|
||||||
|
|
||||||
|
D3DRESOURCETYPE WINAPI IDirect3DCubeTexture8Impl_GetType(LPDIRECT3DCUBETEXTURE8 iface) {
|
||||||
|
ICOM_THIS(IDirect3DCubeTexture8Impl,iface);
|
||||||
|
TRACE("(%p) : returning %d\n", This, This->ResourceType);
|
||||||
|
return This->ResourceType;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* IDirect3DCubeTexture8 (Inherited from IDirect3DBaseTexture8) */
|
||||||
|
DWORD WINAPI IDirect3DCubeTexture8Impl_SetLOD(LPDIRECT3DCUBETEXTURE8 iface, DWORD LODNew) {
|
||||||
|
ICOM_THIS(IDirect3DCubeTexture8Impl,iface);
|
||||||
|
FIXME("(%p) : stub\n", This); return D3D_OK;
|
||||||
|
}
|
||||||
|
DWORD WINAPI IDirect3DCubeTexture8Impl_GetLOD(LPDIRECT3DCUBETEXTURE8 iface) {
|
||||||
|
ICOM_THIS(IDirect3DCubeTexture8Impl,iface);
|
||||||
|
FIXME("(%p) : stub\n", This); return D3D_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
DWORD WINAPI IDirect3DCubeTexture8Impl_GetLevelCount(LPDIRECT3DCUBETEXTURE8 iface) {
|
||||||
|
ICOM_THIS(IDirect3DCubeTexture8Impl,iface);
|
||||||
|
TRACE("(%p) : returning %d\n", This, This->levels);
|
||||||
|
return This->levels;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* IDirect3DCubeTexture8 */
|
||||||
|
HRESULT WINAPI IDirect3DCubeTexture8Impl_GetLevelDesc(LPDIRECT3DCUBETEXTURE8 iface,UINT Level,D3DSURFACE_DESC *pDesc) {
|
||||||
|
ICOM_THIS(IDirect3DCubeTexture8Impl,iface);
|
||||||
|
if (Level < This->levels) {
|
||||||
|
TRACE("(%p) Level (%d)\n", This, Level);
|
||||||
|
return IDirect3DSurface8Impl_GetDesc((LPDIRECT3DSURFACE8)This->surfaces[Level], pDesc);
|
||||||
|
} else {
|
||||||
|
FIXME("(%p) Level (%d)\n", This, Level);
|
||||||
|
}
|
||||||
|
return D3D_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
HRESULT WINAPI IDirect3DCubeTexture8Impl_GetCubeMapSurface(LPDIRECT3DCUBETEXTURE8 iface,D3DCUBEMAP_FACES FaceType,UINT Level,IDirect3DSurface8** ppCubeMapSurface) {
|
||||||
|
ICOM_THIS(IDirect3DCubeTexture8Impl,iface);
|
||||||
|
TRACE("(%p) : returning %p\n", This, This->surfaces[FaceType][Level]);
|
||||||
|
*ppCubeMapSurface = (LPDIRECT3DSURFACE8) This->surfaces[FaceType][Level];
|
||||||
|
IDirect3DSurface8Impl_AddRef((LPDIRECT3DSURFACE8)This->surfaces[FaceType][Level]);
|
||||||
|
return D3D_OK;
|
||||||
|
}
|
||||||
|
HRESULT WINAPI IDirect3DCubeTexture8Impl_LockRect(LPDIRECT3DCUBETEXTURE8 iface,D3DCUBEMAP_FACES FaceType,UINT Level,D3DLOCKED_RECT* pLockedRect,CONST RECT* pRect,DWORD Flags) {
|
||||||
|
ICOM_THIS(IDirect3DCubeTexture8Impl,iface);
|
||||||
|
FIXME("(%p) : stub\n", This); return D3D_OK;
|
||||||
|
}
|
||||||
|
HRESULT WINAPI IDirect3DCubeTexture8Impl_UnlockRect(LPDIRECT3DCUBETEXTURE8 iface,D3DCUBEMAP_FACES FaceType,UINT Level) {
|
||||||
|
ICOM_THIS(IDirect3DCubeTexture8Impl,iface);
|
||||||
|
This->Dirty = TRUE;
|
||||||
|
FIXME("(%p) : stub\n", This); return D3D_OK;
|
||||||
|
}
|
||||||
|
HRESULT WINAPI IDirect3DCubeTexture8Impl_AddDirtyRect(LPDIRECT3DCUBETEXTURE8 iface,D3DCUBEMAP_FACES FaceType,CONST RECT* pDirtyRect) {
|
||||||
|
ICOM_THIS(IDirect3DCubeTexture8Impl,iface);
|
||||||
|
This->Dirty = TRUE;
|
||||||
|
FIXME("(%p) : stub\n", This); return D3D_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
ICOM_VTABLE(IDirect3DCubeTexture8) Direct3DCubeTexture8_Vtbl =
|
||||||
|
{
|
||||||
|
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
|
||||||
|
IDirect3DCubeTexture8Impl_QueryInterface,
|
||||||
|
IDirect3DCubeTexture8Impl_AddRef,
|
||||||
|
IDirect3DCubeTexture8Impl_Release,
|
||||||
|
IDirect3DCubeTexture8Impl_GetDevice,
|
||||||
|
IDirect3DCubeTexture8Impl_SetPrivateData,
|
||||||
|
IDirect3DCubeTexture8Impl_GetPrivateData,
|
||||||
|
IDirect3DCubeTexture8Impl_FreePrivateData,
|
||||||
|
IDirect3DCubeTexture8Impl_SetPriority,
|
||||||
|
IDirect3DCubeTexture8Impl_GetPriority,
|
||||||
|
IDirect3DCubeTexture8Impl_PreLoad,
|
||||||
|
IDirect3DCubeTexture8Impl_GetType,
|
||||||
|
IDirect3DCubeTexture8Impl_SetLOD,
|
||||||
|
IDirect3DCubeTexture8Impl_GetLOD,
|
||||||
|
IDirect3DCubeTexture8Impl_GetLevelCount,
|
||||||
|
IDirect3DCubeTexture8Impl_GetLevelDesc,
|
||||||
|
IDirect3DCubeTexture8Impl_GetCubeMapSurface,
|
||||||
|
IDirect3DCubeTexture8Impl_LockRect,
|
||||||
|
IDirect3DCubeTexture8Impl_UnlockRect,
|
||||||
|
IDirect3DCubeTexture8Impl_AddDirtyRect
|
||||||
|
};
|
|
@ -1,3 +1,5 @@
|
||||||
|
init D3D8_DllMain
|
||||||
|
|
||||||
@ stdcall D3D8GetSWInfo() D3D8GetSWInfo
|
@ stdcall D3D8GetSWInfo() D3D8GetSWInfo
|
||||||
@ stdcall DebugSetMute() DebugSetMute
|
@ stdcall DebugSetMute() DebugSetMute
|
||||||
@ stdcall Direct3DCreate8(long) Direct3DCreate8
|
@ stdcall Direct3DCreate8(long) Direct3DCreate8
|
||||||
|
|
|
@ -18,10 +18,17 @@
|
||||||
|
|
||||||
#include "windef.h"
|
#include "windef.h"
|
||||||
#include "winbase.h"
|
#include "winbase.h"
|
||||||
|
#include "wingdi.h"
|
||||||
|
#include "winuser.h"
|
||||||
#include "wine/debug.h"
|
#include "wine/debug.h"
|
||||||
|
|
||||||
|
#include "d3d8_private.h"
|
||||||
|
|
||||||
WINE_DEFAULT_DEBUG_CHANNEL(d3d);
|
WINE_DEFAULT_DEBUG_CHANNEL(d3d);
|
||||||
|
|
||||||
|
void (*wine_tsx11_lock_ptr)(void) = NULL;
|
||||||
|
void (*wine_tsx11_unlock_ptr)(void) = NULL;
|
||||||
|
|
||||||
HRESULT WINAPI ValidatePixelShader(void)
|
HRESULT WINAPI ValidatePixelShader(void)
|
||||||
{
|
{
|
||||||
FIXME("(void): stub\n");
|
FIXME("(void): stub\n");
|
||||||
|
@ -48,7 +55,32 @@ HRESULT WINAPI DebugSetMute(void)
|
||||||
|
|
||||||
LPVOID WINAPI Direct3DCreate8(UINT SDKVersion)
|
LPVOID WINAPI Direct3DCreate8(UINT SDKVersion)
|
||||||
{
|
{
|
||||||
FIXME("(0x%08x): stub\n", SDKVersion);
|
|
||||||
|
|
||||||
return NULL;
|
IDirect3D8Impl *object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirect3D8Impl));
|
||||||
|
|
||||||
|
object->lpVtbl = &Direct3D8_Vtbl;
|
||||||
|
object->ref = 1;
|
||||||
|
|
||||||
|
TRACE("SDKVersion = %x, Created Direct3D object at %p\n", SDKVersion, object);
|
||||||
|
|
||||||
|
/* Dump out the gl supported features
|
||||||
|
TRACE("GL_Extensions reported: %s\n", glGetString(GL_EXTENSIONS)); */
|
||||||
|
|
||||||
|
return object;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* At process attach */
|
||||||
|
BOOL WINAPI D3D8_DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpv)
|
||||||
|
{
|
||||||
|
TRACE("fdwReason=%ld\n", fdwReason);
|
||||||
|
if (fdwReason == DLL_PROCESS_ATTACH)
|
||||||
|
{
|
||||||
|
HMODULE mod = GetModuleHandleA( "x11drv.dll" );
|
||||||
|
if (mod)
|
||||||
|
{
|
||||||
|
wine_tsx11_lock_ptr = (void *)GetProcAddress( mod, "wine_tsx11_lock" );
|
||||||
|
wine_tsx11_unlock_ptr = (void *)GetProcAddress( mod, "wine_tsx11_unlock" );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,824 @@
|
||||||
|
/*
|
||||||
|
* Direct3D 8 private include file
|
||||||
|
*
|
||||||
|
* Copyright 2002 Jason Edmeades
|
||||||
|
*
|
||||||
|
* This library is free software; you can redistribute it and/or
|
||||||
|
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef __WINE_D3DX8_PRIVATE_H
|
||||||
|
#define __WINE_D3DX8_PRIVATE_H
|
||||||
|
|
||||||
|
/* THIS FILE MUST NOT CONTAIN X11 or MESA DEFINES */
|
||||||
|
#include "config.h"
|
||||||
|
#define XMD_H /* This is to prevent the Xmd.h inclusion bug :-/ */
|
||||||
|
#include <GL/gl.h>
|
||||||
|
#include <GL/glx.h>
|
||||||
|
#ifdef HAVE_GL_GLEXT_H
|
||||||
|
# include <GL/glext.h>
|
||||||
|
#endif
|
||||||
|
#undef XMD_H
|
||||||
|
|
||||||
|
#undef APIENTRY
|
||||||
|
#undef CALLBACK
|
||||||
|
#undef WINAPI
|
||||||
|
|
||||||
|
/* Redefines the constants */
|
||||||
|
#define CALLBACK __stdcall
|
||||||
|
#define WINAPI __stdcall
|
||||||
|
#define APIENTRY WINAPI
|
||||||
|
|
||||||
|
/* X11 locking */
|
||||||
|
|
||||||
|
extern void (*wine_tsx11_lock_ptr)(void);
|
||||||
|
extern void (*wine_tsx11_unlock_ptr)(void);
|
||||||
|
|
||||||
|
/* As GLX relies on X, this is needed */
|
||||||
|
#define ENTER_GL() wine_tsx11_lock_ptr()
|
||||||
|
#define LEAVE_GL() wine_tsx11_unlock_ptr()
|
||||||
|
|
||||||
|
#include "d3d8.h"
|
||||||
|
|
||||||
|
/* Device caps */
|
||||||
|
#define MAX_STREAMS 1
|
||||||
|
#define MAX_ACTIVE_LIGHTS 8
|
||||||
|
#define MAX_CLIPPLANES D3DMAXUSERCLIPPLANES
|
||||||
|
#define MAX_LEVELS 256
|
||||||
|
|
||||||
|
/* Other useful values */
|
||||||
|
#define HIGHEST_RENDER_STATE 174
|
||||||
|
#define HIGHEST_TEXTURE_STATE 29
|
||||||
|
#define HIGHEST_TRANSFORMSTATE 512
|
||||||
|
#define D3DSBT_RECORDED 0xfffffffe
|
||||||
|
|
||||||
|
/* Direct38 Interfaces: */
|
||||||
|
typedef struct IDirect3DBaseTexture8Impl IDirect3DBaseTexture8Impl;
|
||||||
|
typedef struct IDirect3DVolumeTexture8Impl IDirect3DVolumeTexture8Impl;
|
||||||
|
typedef struct IDirect3D8Impl IDirect3D8Impl;
|
||||||
|
typedef struct IDirect3DDevice8Impl IDirect3DDevice8Impl;
|
||||||
|
typedef struct IDirect3DTexture8Impl IDirect3DTexture8Impl;
|
||||||
|
typedef struct IDirect3DCubeTexture8Impl IDirect3DCubeTexture8Impl;
|
||||||
|
typedef struct IDirect3DIndexBuffer8Impl IDirect3DIndexBuffer8Impl;
|
||||||
|
typedef struct IDirect3DSurface8Impl IDirect3DSurface8Impl;
|
||||||
|
typedef struct IDirect3DSwapChain8Impl IDirect3DSwapChain8Impl;
|
||||||
|
typedef struct IDirect3DResource8Impl IDirect3DResource8Impl;
|
||||||
|
typedef struct IDirect3DVolume8Impl IDirect3DVolume8Impl;
|
||||||
|
typedef struct IDirect3DVertexBuffer8Impl IDirect3DVertexBuffer8Impl;
|
||||||
|
|
||||||
|
/* State Block for Begin/End/Capture/Create/Apply State Block */
|
||||||
|
/* Note: Very long winded but I do not believe gl Lists will */
|
||||||
|
/* resolve everything we need, so doing it manually for now */
|
||||||
|
typedef struct SAVEDSTATES {
|
||||||
|
BOOL lightEnable[MAX_ACTIVE_LIGHTS];
|
||||||
|
BOOL Indices;
|
||||||
|
BOOL lights[MAX_ACTIVE_LIGHTS];
|
||||||
|
BOOL material;
|
||||||
|
BOOL stream_source[MAX_STREAMS];
|
||||||
|
BOOL textures[8];
|
||||||
|
BOOL transform[HIGHEST_TRANSFORMSTATE];
|
||||||
|
BOOL viewport;
|
||||||
|
BOOL vertexShader;
|
||||||
|
BOOL pixelShader;
|
||||||
|
BOOL renderstate[HIGHEST_RENDER_STATE];
|
||||||
|
BOOL texture_state[8][HIGHEST_TEXTURE_STATE];
|
||||||
|
BOOL clipplane[MAX_CLIPPLANES];
|
||||||
|
} SAVEDSTATES;
|
||||||
|
|
||||||
|
typedef struct STATEBLOCK {
|
||||||
|
|
||||||
|
D3DSTATEBLOCKTYPE blockType;
|
||||||
|
|
||||||
|
SAVEDSTATES Changed;
|
||||||
|
SAVEDSTATES Set;
|
||||||
|
|
||||||
|
/* Light Enable */
|
||||||
|
BOOL lightEnable[MAX_ACTIVE_LIGHTS];
|
||||||
|
|
||||||
|
/* ClipPlane */
|
||||||
|
double clipplane[MAX_CLIPPLANES][4];
|
||||||
|
|
||||||
|
/* Indices */
|
||||||
|
IDirect3DIndexBuffer8* pIndexData;
|
||||||
|
UINT baseVertexIndex;
|
||||||
|
|
||||||
|
/* Lights */
|
||||||
|
D3DLIGHT8 lights[MAX_ACTIVE_LIGHTS];
|
||||||
|
|
||||||
|
/* Material */
|
||||||
|
D3DMATERIAL8 material;
|
||||||
|
|
||||||
|
/* Pixel Shader */
|
||||||
|
DWORD PixelShader;
|
||||||
|
|
||||||
|
/* TODO: Pixel Shader Constant */
|
||||||
|
|
||||||
|
/* RenderState */
|
||||||
|
DWORD renderstate[HIGHEST_RENDER_STATE];
|
||||||
|
|
||||||
|
/* Stream Source */
|
||||||
|
UINT stream_stride[MAX_STREAMS];
|
||||||
|
IDirect3DVertexBuffer8 *stream_source[MAX_STREAMS];
|
||||||
|
|
||||||
|
/* Texture */
|
||||||
|
IDirect3DBaseTexture8 *textures[8];
|
||||||
|
|
||||||
|
/* Texture State Stage */
|
||||||
|
DWORD texture_state[8][HIGHEST_TEXTURE_STATE];
|
||||||
|
|
||||||
|
/* Transform */
|
||||||
|
D3DMATRIX transforms[HIGHEST_TRANSFORMSTATE];
|
||||||
|
|
||||||
|
/* ViewPort */
|
||||||
|
D3DVIEWPORT8 viewport;
|
||||||
|
|
||||||
|
/* Vertex Shader */
|
||||||
|
DWORD VertexShader;
|
||||||
|
|
||||||
|
|
||||||
|
/* TODO: Vertex Shader Constant */
|
||||||
|
|
||||||
|
} STATEBLOCK;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* External prototypes
|
||||||
|
*/
|
||||||
|
/*BOOL D3DRAW_HAL_Init(HINSTANCE, DWORD, LPVOID); */
|
||||||
|
void CreateStateBlock(LPDIRECT3DDEVICE8 iface);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Macros
|
||||||
|
*/
|
||||||
|
#define checkGLcall(A) \
|
||||||
|
{ \
|
||||||
|
GLint err = glGetError(); \
|
||||||
|
if (err != GL_NO_ERROR) { \
|
||||||
|
FIXME(">>>>>>>>>>>>>>>>> %x from %s @ %s / %d\n", err, A, __FILE__, __LINE__); \
|
||||||
|
} else { \
|
||||||
|
TRACE("%s call ok %s / %d\n", A, __FILE__, __LINE__); \
|
||||||
|
} \
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ===========================================================================
|
||||||
|
The interfactes themselves
|
||||||
|
=========================================================================== */
|
||||||
|
|
||||||
|
/* ---------- */
|
||||||
|
/* IDirect3D8 */
|
||||||
|
/* ---------- */
|
||||||
|
|
||||||
|
/*****************************************************************************
|
||||||
|
* Predeclare the interface implementation structures
|
||||||
|
*/
|
||||||
|
extern ICOM_VTABLE(IDirect3D8) Direct3D8_Vtbl;
|
||||||
|
extern ICOM_VTABLE(IDirect3D8) mesa_d3d8vt;
|
||||||
|
|
||||||
|
/*****************************************************************************
|
||||||
|
* IDirect3D implementation structure
|
||||||
|
*/
|
||||||
|
struct IDirect3D8Impl
|
||||||
|
{
|
||||||
|
/* IUnknown fields */
|
||||||
|
ICOM_VFIELD(IDirect3D8);
|
||||||
|
DWORD ref;
|
||||||
|
|
||||||
|
/* IDirect3D8 fields */
|
||||||
|
};
|
||||||
|
|
||||||
|
/* IUnknown: */
|
||||||
|
extern HRESULT WINAPI IDirect3D8Impl_QueryInterface(LPDIRECT3D8 iface,REFIID refiid,LPVOID *obj);
|
||||||
|
extern ULONG WINAPI IDirect3D8Impl_AddRef(LPDIRECT3D8 iface);
|
||||||
|
extern ULONG WINAPI IDirect3D8Impl_Release(LPDIRECT3D8 iface);
|
||||||
|
|
||||||
|
/* IDirect3d8:*/
|
||||||
|
extern HRESULT WINAPI IDirect3D8Impl_RegisterSoftwareDevice(LPDIRECT3D8 iface, void* pInitializeFunction);
|
||||||
|
extern UINT WINAPI IDirect3D8Impl_GetAdapterCount(LPDIRECT3D8 iface);
|
||||||
|
extern HRESULT WINAPI IDirect3D8Impl_GetAdapterIdentifier(LPDIRECT3D8 iface, UINT Adapter, DWORD Flags, D3DADAPTER_IDENTIFIER8* pIdentifier);
|
||||||
|
extern UINT WINAPI IDirect3D8Impl_GetAdapterModeCount(LPDIRECT3D8 iface, UINT Adapter);
|
||||||
|
extern HRESULT WINAPI IDirect3D8Impl_EnumAdapterModes(LPDIRECT3D8 iface, UINT Adapter, UINT Mode, D3DDISPLAYMODE* pMode);
|
||||||
|
extern HRESULT WINAPI IDirect3D8Impl_GetAdapterDisplayMode(LPDIRECT3D8 iface, UINT Adapter, D3DDISPLAYMODE* pMode);
|
||||||
|
extern HRESULT WINAPI IDirect3D8Impl_CheckDeviceType(LPDIRECT3D8 iface, UINT Adapter, D3DDEVTYPE CheckType, D3DFORMAT DisplayFormat,
|
||||||
|
D3DFORMAT BackBufferFormat, BOOL Windowed);
|
||||||
|
extern HRESULT WINAPI IDirect3D8Impl_CheckDeviceFormat(LPDIRECT3D8 iface, UINT Adapter, D3DDEVTYPE DeviceType, D3DFORMAT AdapterFormat,
|
||||||
|
DWORD Usage, D3DRESOURCETYPE RType, D3DFORMAT CheckFormat);
|
||||||
|
extern HRESULT WINAPI IDirect3D8Impl_CheckDeviceMultiSampleType(LPDIRECT3D8 iface, UINT Adapter, D3DDEVTYPE DeviceType, D3DFORMAT SurfaceFormat,
|
||||||
|
BOOL Windowed, D3DMULTISAMPLE_TYPE MultiSampleType);
|
||||||
|
extern HRESULT WINAPI IDirect3D8Impl_CheckDepthStencilMatch(LPDIRECT3D8 iface, UINT Adapter, D3DDEVTYPE DeviceType, D3DFORMAT AdapterFormat,
|
||||||
|
D3DFORMAT RenderTargetFormat, D3DFORMAT DepthStencilFormat);
|
||||||
|
extern HRESULT WINAPI IDirect3D8Impl_GetDeviceCaps(LPDIRECT3D8 iface, UINT Adapter, D3DDEVTYPE DeviceType, D3DCAPS8* pCaps);
|
||||||
|
extern HMONITOR WINAPI IDirect3D8Impl_GetAdapterMonitor(LPDIRECT3D8 iface, UINT Adapter);
|
||||||
|
extern HRESULT WINAPI IDirect3D8Impl_CreateDevice(LPDIRECT3D8 iface, UINT Adapter, D3DDEVTYPE DeviceType, HWND hFocusWindow,
|
||||||
|
DWORD BehaviorFlags, D3DPRESENT_PARAMETERS* pPresentationParameters,
|
||||||
|
IDirect3DDevice8** ppReturnedDeviceInterface);
|
||||||
|
/* --------------------- */
|
||||||
|
/* IDirect3DBaseTexture8 */
|
||||||
|
/* --------------------- */
|
||||||
|
|
||||||
|
/*****************************************************************************
|
||||||
|
* Predeclare the interface implementation structures
|
||||||
|
*/
|
||||||
|
extern ICOM_VTABLE(IDirect3DBaseTexture8) Direct3DBaseTexture8_Vtbl;
|
||||||
|
|
||||||
|
/*****************************************************************************
|
||||||
|
* IDirect3DBaseTexture8 implementation structure
|
||||||
|
*/
|
||||||
|
struct IDirect3DBaseTexture8Impl
|
||||||
|
{
|
||||||
|
/* IUnknown fields */
|
||||||
|
ICOM_VFIELD(IDirect3DBaseTexture8);
|
||||||
|
DWORD ref;
|
||||||
|
|
||||||
|
/* IDirect3DBaseTexture8 fields */
|
||||||
|
IDirect3DDevice8Impl *Device;
|
||||||
|
D3DRESOURCETYPE ResourceType;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* IUnknown: */
|
||||||
|
extern HRESULT WINAPI IDirect3DBaseTexture8Impl_QueryInterface(LPDIRECT3DBASETEXTURE8 iface,REFIID refiid,LPVOID *obj);
|
||||||
|
extern ULONG WINAPI IDirect3DBaseTexture8Impl_AddRef(LPDIRECT3DBASETEXTURE8 iface);
|
||||||
|
extern ULONG WINAPI IDirect3DBaseTexture8Impl_Release(LPDIRECT3DBASETEXTURE8 iface);
|
||||||
|
|
||||||
|
/* IDirect3DBaseTexture8 (Inherited from IDirect3DResource8) */
|
||||||
|
extern HRESULT WINAPI IDirect3DBaseTexture8Impl_GetDevice(LPDIRECT3DBASETEXTURE8 iface, IDirect3DDevice8** ppDevice);
|
||||||
|
extern HRESULT WINAPI IDirect3DBaseTexture8Impl_SetPrivateData(LPDIRECT3DBASETEXTURE8 iface, REFGUID refguid, CONST void* pData, DWORD SizeOfData, DWORD Flags);
|
||||||
|
extern HRESULT WINAPI IDirect3DBaseTexture8Impl_GetPrivateData(LPDIRECT3DBASETEXTURE8 iface, REFGUID refguid, void* pData, DWORD* pSizeOfData);
|
||||||
|
extern HRESULT WINAPI IDirect3DBaseTexture8Impl_FreePrivateData(LPDIRECT3DBASETEXTURE8 iface, REFGUID refguid);
|
||||||
|
extern DWORD WINAPI IDirect3DBaseTexture8Impl_SetPriority(LPDIRECT3DBASETEXTURE8 iface, DWORD PriorityNew);
|
||||||
|
extern DWORD WINAPI IDirect3DBaseTexture8Impl_GetPriority(LPDIRECT3DBASETEXTURE8 iface);
|
||||||
|
extern void WINAPI IDirect3DBaseTexture8Impl_PreLoad(LPDIRECT3DBASETEXTURE8 iface);
|
||||||
|
extern D3DRESOURCETYPE WINAPI IDirect3DBaseTexture8Impl_GetType(LPDIRECT3DBASETEXTURE8 iface);
|
||||||
|
|
||||||
|
/* IDirect3DBaseTexture8 */
|
||||||
|
extern DWORD WINAPI IDirect3DBaseTexture8Impl_SetLOD(LPDIRECT3DBASETEXTURE8 iface, DWORD LODNew);
|
||||||
|
extern DWORD WINAPI IDirect3DBaseTexture8Impl_GetLOD(LPDIRECT3DBASETEXTURE8 iface);
|
||||||
|
extern DWORD WINAPI IDirect3DBaseTexture8Impl_GetLevelCount(LPDIRECT3DBASETEXTURE8 iface);
|
||||||
|
|
||||||
|
/* ---------------- */
|
||||||
|
/* IDirect3DDevice8 */
|
||||||
|
/* ---------------- */
|
||||||
|
|
||||||
|
/*****************************************************************************
|
||||||
|
* Predeclare the interface implementation structures
|
||||||
|
*/
|
||||||
|
extern ICOM_VTABLE(IDirect3DDevice8) Direct3DDevice8_Vtbl;
|
||||||
|
|
||||||
|
|
||||||
|
/*****************************************************************************
|
||||||
|
* IDirect3DDevice8 implementation structure
|
||||||
|
*/
|
||||||
|
struct IDirect3DDevice8Impl
|
||||||
|
{
|
||||||
|
/* IUnknown fields */
|
||||||
|
ICOM_VFIELD(IDirect3DDevice8);
|
||||||
|
DWORD ref;
|
||||||
|
|
||||||
|
/* IDirect3DDevice8 fields */
|
||||||
|
IDirect3D8Impl *direct3d8;
|
||||||
|
IDirect3DSurface8Impl *backBuffer;
|
||||||
|
D3DPRESENT_PARAMETERS PresentParms;
|
||||||
|
|
||||||
|
UINT adapterNo;
|
||||||
|
D3DDEVTYPE devType;
|
||||||
|
|
||||||
|
UINT srcBlend;
|
||||||
|
UINT dstBlend;
|
||||||
|
|
||||||
|
/* State block related */
|
||||||
|
BOOL isRecordingState;
|
||||||
|
STATEBLOCK StateBlock;
|
||||||
|
STATEBLOCK *UpdateStateBlock;
|
||||||
|
|
||||||
|
/* OpenGL related */
|
||||||
|
GLXContext glCtx;
|
||||||
|
XVisualInfo *visInfo;
|
||||||
|
Display *display;
|
||||||
|
Window win;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
/* IUnknown: */
|
||||||
|
extern HRESULT WINAPI IDirect3DDevice8Impl_QueryInterface(LPDIRECT3DDEVICE8 iface,REFIID refiid,LPVOID *obj);
|
||||||
|
extern ULONG WINAPI IDirect3DDevice8Impl_AddRef(LPDIRECT3DDEVICE8 iface);
|
||||||
|
extern ULONG WINAPI IDirect3DDevice8Impl_Release(LPDIRECT3DDEVICE8 iface);
|
||||||
|
|
||||||
|
/* IDirect3DDevice8:*/
|
||||||
|
extern HRESULT WINAPI IDirect3DDevice8Impl_TestCooperativeLevel(LPDIRECT3DDEVICE8 iface);
|
||||||
|
extern UINT WINAPI IDirect3DDevice8Impl_GetAvailableTextureMem(LPDIRECT3DDEVICE8 iface);
|
||||||
|
extern HRESULT WINAPI IDirect3DDevice8Impl_ResourceManagerDiscardBytes(LPDIRECT3DDEVICE8 iface, DWORD Bytes);
|
||||||
|
extern HRESULT WINAPI IDirect3DDevice8Impl_GetDirect3D(LPDIRECT3DDEVICE8 iface, IDirect3D8** ppD3D8);
|
||||||
|
extern HRESULT WINAPI IDirect3DDevice8Impl_GetDeviceCaps(LPDIRECT3DDEVICE8 iface, D3DCAPS8* pCaps);
|
||||||
|
extern HRESULT WINAPI IDirect3DDevice8Impl_GetDisplayMode(LPDIRECT3DDEVICE8 iface, D3DDISPLAYMODE* pMode);
|
||||||
|
extern HRESULT WINAPI IDirect3DDevice8Impl_GetCreationParameters(LPDIRECT3DDEVICE8 iface, D3DDEVICE_CREATION_PARAMETERS* pParameters);
|
||||||
|
extern HRESULT WINAPI IDirect3DDevice8Impl_SetCursorProperties(LPDIRECT3DDEVICE8 iface, UINT XHotSpot, UINT YHotSpot, IDirect3DSurface8* pCursorBitmap);
|
||||||
|
extern void WINAPI IDirect3DDevice8Impl_SetCursorPosition(LPDIRECT3DDEVICE8 iface, UINT XScreenSpace, UINT YScreenSpace,DWORD Flags);
|
||||||
|
extern BOOL WINAPI IDirect3DDevice8Impl_ShowCursor(LPDIRECT3DDEVICE8 iface, BOOL bShow);
|
||||||
|
extern HRESULT WINAPI IDirect3DDevice8Impl_CreateAdditionalSwapChain(LPDIRECT3DDEVICE8 iface, D3DPRESENT_PARAMETERS* pPresentationParameters, IDirect3DSwapChain8** pSwapChain);
|
||||||
|
extern HRESULT WINAPI IDirect3DDevice8Impl_Reset(LPDIRECT3DDEVICE8 iface, D3DPRESENT_PARAMETERS* pPresentationParameters);
|
||||||
|
extern HRESULT WINAPI IDirect3DDevice8Impl_Present(LPDIRECT3DDEVICE8 iface, CONST RECT* pSourceRect,CONST RECT* pDestRect,HWND hDestWindowOverride,CONST RGNDATA* pDirtyRegion);
|
||||||
|
extern HRESULT WINAPI IDirect3DDevice8Impl_GetBackBuffer(LPDIRECT3DDEVICE8 iface, UINT BackBuffer,D3DBACKBUFFER_TYPE Type,IDirect3DSurface8** ppBackBuffer);
|
||||||
|
extern HRESULT WINAPI IDirect3DDevice8Impl_GetRasterStatus(LPDIRECT3DDEVICE8 iface, D3DRASTER_STATUS* pRasterStatus);
|
||||||
|
extern void WINAPI IDirect3DDevice8Impl_SetGammaRamp(LPDIRECT3DDEVICE8 iface, DWORD Flags,CONST D3DGAMMARAMP* pRamp);
|
||||||
|
extern void WINAPI IDirect3DDevice8Impl_GetGammaRamp(LPDIRECT3DDEVICE8 iface, D3DGAMMARAMP* pRamp);
|
||||||
|
extern HRESULT WINAPI IDirect3DDevice8Impl_CreateTexture(LPDIRECT3DDEVICE8 iface, UINT Width,UINT Height,UINT Levels,DWORD Usage,D3DFORMAT Format,D3DPOOL Pool,IDirect3DTexture8** ppTexture);
|
||||||
|
extern HRESULT WINAPI IDirect3DDevice8Impl_CreateVolumeTexture(LPDIRECT3DDEVICE8 iface, UINT Width,UINT Height,UINT Depth,UINT Levels,DWORD Usage,D3DFORMAT Format,D3DPOOL Pool,IDirect3DVolumeTexture8** ppVolumeTexture);
|
||||||
|
extern HRESULT WINAPI IDirect3DDevice8Impl_CreateCubeTexture(LPDIRECT3DDEVICE8 iface, UINT EdgeLength,UINT Levels,DWORD Usage,D3DFORMAT Format,D3DPOOL Pool,IDirect3DCubeTexture8** ppCubeTexture);
|
||||||
|
extern HRESULT WINAPI IDirect3DDevice8Impl_CreateVertexBuffer(LPDIRECT3DDEVICE8 iface, UINT Length,DWORD Usage,DWORD FVF,D3DPOOL Pool,IDirect3DVertexBuffer8** ppVertexBuffer);
|
||||||
|
extern HRESULT WINAPI IDirect3DDevice8Impl_CreateIndexBuffer(LPDIRECT3DDEVICE8 iface, UINT Length,DWORD Usage,D3DFORMAT Format,D3DPOOL Pool,IDirect3DIndexBuffer8** ppIndexBuffer);
|
||||||
|
extern HRESULT WINAPI IDirect3DDevice8Impl_CreateRenderTarget(LPDIRECT3DDEVICE8 iface, UINT Width,UINT Height,D3DFORMAT Format,D3DMULTISAMPLE_TYPE MultiSample,BOOL Lockable,IDirect3DSurface8** ppSurface);
|
||||||
|
extern HRESULT WINAPI IDirect3DDevice8Impl_CreateDepthStencilSurface(LPDIRECT3DDEVICE8 iface, UINT Width,UINT Height,D3DFORMAT Format,D3DMULTISAMPLE_TYPE MultiSample,IDirect3DSurface8** ppSurface);
|
||||||
|
extern HRESULT WINAPI IDirect3DDevice8Impl_CreateImageSurface(LPDIRECT3DDEVICE8 iface, UINT Width,UINT Height,D3DFORMAT Format,IDirect3DSurface8** ppSurface);
|
||||||
|
extern HRESULT WINAPI IDirect3DDevice8Impl_CopyRects(LPDIRECT3DDEVICE8 iface, IDirect3DSurface8* pSourceSurface,CONST RECT* pSourceRectsArray,UINT cRects,IDirect3DSurface8* pDestinationSurface,CONST POINT* pDestPointsArray);
|
||||||
|
extern HRESULT WINAPI IDirect3DDevice8Impl_UpdateTexture(LPDIRECT3DDEVICE8 iface, IDirect3DBaseTexture8* pSourceTexture,IDirect3DBaseTexture8* pDestinationTexture);
|
||||||
|
extern HRESULT WINAPI IDirect3DDevice8Impl_GetFrontBuffer(LPDIRECT3DDEVICE8 iface, IDirect3DSurface8* pDestSurface);
|
||||||
|
extern HRESULT WINAPI IDirect3DDevice8Impl_SetRenderTarget(LPDIRECT3DDEVICE8 iface, IDirect3DSurface8* pRenderTarget,IDirect3DSurface8* pNewZStencil);
|
||||||
|
extern HRESULT WINAPI IDirect3DDevice8Impl_GetRenderTarget(LPDIRECT3DDEVICE8 iface, IDirect3DSurface8** ppRenderTarget);
|
||||||
|
extern HRESULT WINAPI IDirect3DDevice8Impl_GetDepthStencilSurface(LPDIRECT3DDEVICE8 iface, IDirect3DSurface8** ppZStencilSurface);
|
||||||
|
extern HRESULT WINAPI IDirect3DDevice8Impl_BeginScene(LPDIRECT3DDEVICE8 iface);
|
||||||
|
extern HRESULT WINAPI IDirect3DDevice8Impl_EndScene(LPDIRECT3DDEVICE8 iface);
|
||||||
|
extern HRESULT WINAPI IDirect3DDevice8Impl_Clear(LPDIRECT3DDEVICE8 iface, DWORD Count,CONST D3DRECT* pRects,DWORD Flags,D3DCOLOR Color,float Z,DWORD Stencil);
|
||||||
|
extern HRESULT WINAPI IDirect3DDevice8Impl_SetTransform(LPDIRECT3DDEVICE8 iface, D3DTRANSFORMSTATETYPE State,CONST D3DMATRIX* pMatrix);
|
||||||
|
extern HRESULT WINAPI IDirect3DDevice8Impl_GetTransform(LPDIRECT3DDEVICE8 iface, D3DTRANSFORMSTATETYPE State,D3DMATRIX* pMatrix);
|
||||||
|
extern HRESULT WINAPI IDirect3DDevice8Impl_MultiplyTransform(LPDIRECT3DDEVICE8 iface, D3DTRANSFORMSTATETYPE State, CONST D3DMATRIX* pMatrix);
|
||||||
|
extern HRESULT WINAPI IDirect3DDevice8Impl_SetViewport(LPDIRECT3DDEVICE8 iface, CONST D3DVIEWPORT8* pViewport);
|
||||||
|
extern HRESULT WINAPI IDirect3DDevice8Impl_GetViewport(LPDIRECT3DDEVICE8 iface, D3DVIEWPORT8* pViewport);
|
||||||
|
extern HRESULT WINAPI IDirect3DDevice8Impl_SetMaterial(LPDIRECT3DDEVICE8 iface, CONST D3DMATERIAL8* pMaterial);
|
||||||
|
extern HRESULT WINAPI IDirect3DDevice8Impl_GetMaterial(LPDIRECT3DDEVICE8 iface, D3DMATERIAL8* pMaterial);
|
||||||
|
extern HRESULT WINAPI IDirect3DDevice8Impl_SetLight(LPDIRECT3DDEVICE8 iface, DWORD Index,CONST D3DLIGHT8* pLight);
|
||||||
|
extern HRESULT WINAPI IDirect3DDevice8Impl_GetLight(LPDIRECT3DDEVICE8 iface, DWORD Index,D3DLIGHT8* pLight);
|
||||||
|
extern HRESULT WINAPI IDirect3DDevice8Impl_LightEnable(LPDIRECT3DDEVICE8 iface, DWORD Index,BOOL Enable);
|
||||||
|
extern HRESULT WINAPI IDirect3DDevice8Impl_GetLightEnable(LPDIRECT3DDEVICE8 iface, DWORD Index,BOOL* pEnable);
|
||||||
|
extern HRESULT WINAPI IDirect3DDevice8Impl_SetClipPlane(LPDIRECT3DDEVICE8 iface, DWORD Index,CONST float* pPlane);
|
||||||
|
extern HRESULT WINAPI IDirect3DDevice8Impl_GetClipPlane(LPDIRECT3DDEVICE8 iface, DWORD Index,float* pPlane);
|
||||||
|
extern HRESULT WINAPI IDirect3DDevice8Impl_SetRenderState(LPDIRECT3DDEVICE8 iface, D3DRENDERSTATETYPE State,DWORD Value);
|
||||||
|
extern HRESULT WINAPI IDirect3DDevice8Impl_GetRenderState(LPDIRECT3DDEVICE8 iface, D3DRENDERSTATETYPE State,DWORD* pValue);
|
||||||
|
extern HRESULT WINAPI IDirect3DDevice8Impl_BeginStateBlock(LPDIRECT3DDEVICE8 iface);
|
||||||
|
extern HRESULT WINAPI IDirect3DDevice8Impl_EndStateBlock(LPDIRECT3DDEVICE8 iface, DWORD* pToken);
|
||||||
|
extern HRESULT WINAPI IDirect3DDevice8Impl_ApplyStateBlock(LPDIRECT3DDEVICE8 iface, DWORD Token);
|
||||||
|
extern HRESULT WINAPI IDirect3DDevice8Impl_CaptureStateBlock(LPDIRECT3DDEVICE8 iface, DWORD Token);
|
||||||
|
extern HRESULT WINAPI IDirect3DDevice8Impl_DeleteStateBlock(LPDIRECT3DDEVICE8 iface, DWORD Token);
|
||||||
|
extern HRESULT WINAPI IDirect3DDevice8Impl_CreateStateBlock(LPDIRECT3DDEVICE8 iface, D3DSTATEBLOCKTYPE Type,DWORD* pToken);
|
||||||
|
extern HRESULT WINAPI IDirect3DDevice8Impl_SetClipStatus(LPDIRECT3DDEVICE8 iface, CONST D3DCLIPSTATUS8* pClipStatus);
|
||||||
|
extern HRESULT WINAPI IDirect3DDevice8Impl_GetClipStatus(LPDIRECT3DDEVICE8 iface, D3DCLIPSTATUS8* pClipStatus);
|
||||||
|
extern HRESULT WINAPI IDirect3DDevice8Impl_GetTexture(LPDIRECT3DDEVICE8 iface, DWORD Stage,IDirect3DBaseTexture8** ppTexture);
|
||||||
|
extern HRESULT WINAPI IDirect3DDevice8Impl_SetTexture(LPDIRECT3DDEVICE8 iface, DWORD Stage,IDirect3DBaseTexture8* pTexture);
|
||||||
|
extern HRESULT WINAPI IDirect3DDevice8Impl_GetTextureStageState(LPDIRECT3DDEVICE8 iface, DWORD Stage,D3DTEXTURESTAGESTATETYPE Type,DWORD* pValue);
|
||||||
|
extern HRESULT WINAPI IDirect3DDevice8Impl_SetTextureStageState(LPDIRECT3DDEVICE8 iface, DWORD Stage,D3DTEXTURESTAGESTATETYPE Type,DWORD Value);
|
||||||
|
extern HRESULT WINAPI IDirect3DDevice8Impl_ValidateDevice(LPDIRECT3DDEVICE8 iface, DWORD* pNumPasses);
|
||||||
|
extern HRESULT WINAPI IDirect3DDevice8Impl_GetInfo(LPDIRECT3DDEVICE8 iface, DWORD DevInfoID,void* pDevInfoStruct,DWORD DevInfoStructSize);
|
||||||
|
extern HRESULT WINAPI IDirect3DDevice8Impl_SetPaletteEntries(LPDIRECT3DDEVICE8 iface, UINT PaletteNumber,CONST PALETTEENTRY* pEntries);
|
||||||
|
extern HRESULT WINAPI IDirect3DDevice8Impl_GetPaletteEntries(LPDIRECT3DDEVICE8 iface, UINT PaletteNumber,PALETTEENTRY* pEntries);
|
||||||
|
extern HRESULT WINAPI IDirect3DDevice8Impl_SetCurrentTexturePalette(LPDIRECT3DDEVICE8 iface, UINT PaletteNumber);
|
||||||
|
extern HRESULT WINAPI IDirect3DDevice8Impl_GetCurrentTexturePalette(LPDIRECT3DDEVICE8 iface, UINT *PaletteNumber);
|
||||||
|
extern HRESULT WINAPI IDirect3DDevice8Impl_DrawPrimitive(LPDIRECT3DDEVICE8 iface, D3DPRIMITIVETYPE PrimitiveType,UINT StartVertex,UINT PrimitiveCount);
|
||||||
|
extern HRESULT WINAPI IDirect3DDevice8Impl_DrawIndexedPrimitive(LPDIRECT3DDEVICE8 iface, D3DPRIMITIVETYPE PrimitiveType,UINT minIndex,UINT NumVertices,UINT startIndex,UINT primCount);
|
||||||
|
extern HRESULT WINAPI IDirect3DDevice8Impl_DrawPrimitiveUP(LPDIRECT3DDEVICE8 iface, D3DPRIMITIVETYPE PrimitiveType,UINT PrimitiveCount,CONST void* pVertexStreamZeroData,UINT VertexStreamZeroStride);
|
||||||
|
extern HRESULT WINAPI IDirect3DDevice8Impl_DrawIndexedPrimitiveUP(LPDIRECT3DDEVICE8 iface, D3DPRIMITIVETYPE PrimitiveType,UINT MinVertexIndex,UINT NumVertexIndices,UINT PrimitiveCount,CONST void* pIndexData,D3DFORMAT IndexDataFormat,CONST void* pVertexStreamZeroData,UINT VertexStreamZeroStride);
|
||||||
|
extern HRESULT WINAPI IDirect3DDevice8Impl_ProcessVertices(LPDIRECT3DDEVICE8 iface, UINT SrcStartIndex,UINT DestIndex,UINT VertexCount,IDirect3DVertexBuffer8* pDestBuffer,DWORD Flags);
|
||||||
|
extern HRESULT WINAPI IDirect3DDevice8Impl_CreateVertexShader(LPDIRECT3DDEVICE8 iface, CONST DWORD* pDeclaration,CONST DWORD* pFunction,DWORD* pHandle,DWORD Usage);
|
||||||
|
extern HRESULT WINAPI IDirect3DDevice8Impl_SetVertexShader(LPDIRECT3DDEVICE8 iface, DWORD Handle);
|
||||||
|
extern HRESULT WINAPI IDirect3DDevice8Impl_GetVertexShader(LPDIRECT3DDEVICE8 iface, DWORD* pHandle);
|
||||||
|
extern HRESULT WINAPI IDirect3DDevice8Impl_DeleteVertexShader(LPDIRECT3DDEVICE8 iface, DWORD Handle);
|
||||||
|
extern HRESULT WINAPI IDirect3DDevice8Impl_SetVertexShaderConstant(LPDIRECT3DDEVICE8 iface, DWORD Register,CONST void* pConstantData,DWORD ConstantCount);
|
||||||
|
extern HRESULT WINAPI IDirect3DDevice8Impl_GetVertexShaderConstant(LPDIRECT3DDEVICE8 iface, DWORD Register,void* pConstantData,DWORD ConstantCount);
|
||||||
|
extern HRESULT WINAPI IDirect3DDevice8Impl_GetVertexShaderDeclaration(LPDIRECT3DDEVICE8 iface, DWORD Handle,void* pData,DWORD* pSizeOfData);
|
||||||
|
extern HRESULT WINAPI IDirect3DDevice8Impl_GetVertexShaderFunction(LPDIRECT3DDEVICE8 iface, DWORD Handle,void* pData,DWORD* pSizeOfData);
|
||||||
|
extern HRESULT WINAPI IDirect3DDevice8Impl_SetStreamSource(LPDIRECT3DDEVICE8 iface, UINT StreamNumber,IDirect3DVertexBuffer8* pStreamData,UINT Stride);
|
||||||
|
extern HRESULT WINAPI IDirect3DDevice8Impl_GetStreamSource(LPDIRECT3DDEVICE8 iface, UINT StreamNumber,IDirect3DVertexBuffer8** ppStreamData,UINT* pStride);
|
||||||
|
extern HRESULT WINAPI IDirect3DDevice8Impl_SetIndices(LPDIRECT3DDEVICE8 iface, IDirect3DIndexBuffer8* pIndexData,UINT BaseVertexIndex);
|
||||||
|
extern HRESULT WINAPI IDirect3DDevice8Impl_GetIndices(LPDIRECT3DDEVICE8 iface, IDirect3DIndexBuffer8** ppIndexData,UINT* pBaseVertexIndex);
|
||||||
|
extern HRESULT WINAPI IDirect3DDevice8Impl_CreatePixelShader(LPDIRECT3DDEVICE8 iface, CONST DWORD* pFunction,DWORD* pHandle);
|
||||||
|
extern HRESULT WINAPI IDirect3DDevice8Impl_SetPixelShader(LPDIRECT3DDEVICE8 iface, DWORD Handle);
|
||||||
|
extern HRESULT WINAPI IDirect3DDevice8Impl_GetPixelShader(LPDIRECT3DDEVICE8 iface, DWORD* pHandle);
|
||||||
|
extern HRESULT WINAPI IDirect3DDevice8Impl_DeletePixelShader(LPDIRECT3DDEVICE8 iface, DWORD Handle);
|
||||||
|
extern HRESULT WINAPI IDirect3DDevice8Impl_SetPixelShaderConstant(LPDIRECT3DDEVICE8 iface, DWORD Register,CONST void* pConstantData,DWORD ConstantCount);
|
||||||
|
extern HRESULT WINAPI IDirect3DDevice8Impl_GetPixelShaderConstant(LPDIRECT3DDEVICE8 iface, DWORD Register,void* pConstantData,DWORD ConstantCount);
|
||||||
|
extern HRESULT WINAPI IDirect3DDevice8Impl_GetPixelShaderFunction(LPDIRECT3DDEVICE8 iface, DWORD Handle,void* pData,DWORD* pSizeOfData);
|
||||||
|
extern HRESULT WINAPI IDirect3DDevice8Impl_DrawRectPatch(LPDIRECT3DDEVICE8 iface, UINT Handle,CONST float* pNumSegs,CONST D3DRECTPATCH_INFO* pRectPatchInfo);
|
||||||
|
extern HRESULT WINAPI IDirect3DDevice8Impl_DrawTriPatch(LPDIRECT3DDEVICE8 iface, UINT Handle,CONST float* pNumSegs,CONST D3DTRIPATCH_INFO* pTriPatchInfo);
|
||||||
|
extern HRESULT WINAPI IDirect3DDevice8Impl_DeletePatch(LPDIRECT3DDEVICE8 iface, UINT Handle);
|
||||||
|
|
||||||
|
/* ------------------ */
|
||||||
|
/* IDirect3DResource8 */
|
||||||
|
/* ------------------ */
|
||||||
|
|
||||||
|
/*****************************************************************************
|
||||||
|
* Predeclare the interface implementation structures
|
||||||
|
*/
|
||||||
|
extern ICOM_VTABLE(IDirect3DResource8) Direct3DResource8_Vtbl;
|
||||||
|
|
||||||
|
/*****************************************************************************
|
||||||
|
* IDirect3DResource8 implementation structure
|
||||||
|
*/
|
||||||
|
struct IDirect3DResource8Impl
|
||||||
|
{
|
||||||
|
/* IUnknown fields */
|
||||||
|
ICOM_VFIELD(IDirect3DResource8);
|
||||||
|
DWORD ref;
|
||||||
|
|
||||||
|
/* IDirect3DResource8 fields */
|
||||||
|
IDirect3DDevice8Impl *Device;
|
||||||
|
D3DRESOURCETYPE ResourceType;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* IUnknown: */
|
||||||
|
extern HRESULT WINAPI IDirect3DResource8Impl_QueryInterface(LPDIRECT3DRESOURCE8 iface,REFIID refiid,LPVOID *obj);
|
||||||
|
extern ULONG WINAPI IDirect3DResource8Impl_AddRef(LPDIRECT3DRESOURCE8 iface);
|
||||||
|
extern ULONG WINAPI IDirect3DResource8Impl_Release(LPDIRECT3DRESOURCE8 iface);
|
||||||
|
|
||||||
|
/* IDirect3DResource8 */
|
||||||
|
extern HRESULT WINAPI IDirect3DResource8Impl_GetDevice(LPDIRECT3DRESOURCE8 iface, IDirect3DDevice8** ppDevice);
|
||||||
|
extern HRESULT WINAPI IDirect3DResource8Impl_SetPrivateData(LPDIRECT3DRESOURCE8 iface, REFGUID refguid, CONST void* pData, DWORD SizeOfData, DWORD Flags);
|
||||||
|
extern HRESULT WINAPI IDirect3DResource8Impl_GetPrivateData(LPDIRECT3DRESOURCE8 iface, REFGUID refguid, void* pData, DWORD* pSizeOfData);
|
||||||
|
extern HRESULT WINAPI IDirect3DResource8Impl_FreePrivateData(LPDIRECT3DRESOURCE8 iface, REFGUID refguid);
|
||||||
|
extern DWORD WINAPI IDirect3DResource8Impl_SetPriority(LPDIRECT3DRESOURCE8 iface, DWORD PriorityNew);
|
||||||
|
extern DWORD WINAPI IDirect3DResource8Impl_GetPriority(LPDIRECT3DRESOURCE8 iface);
|
||||||
|
extern void WINAPI IDirect3DResource8Impl_PreLoad(LPDIRECT3DRESOURCE8 iface);
|
||||||
|
extern D3DRESOURCETYPE WINAPI IDirect3DResource8Impl_GetType(LPDIRECT3DRESOURCE8 iface);
|
||||||
|
|
||||||
|
/* ---------------------- */
|
||||||
|
/* IDirect3DVertexBuffer8 */
|
||||||
|
/* ---------------------- */
|
||||||
|
|
||||||
|
/*****************************************************************************
|
||||||
|
* Predeclare the interface implementation structures
|
||||||
|
*/
|
||||||
|
extern ICOM_VTABLE(IDirect3DVertexBuffer8) Direct3DVertexBuffer8_Vtbl;
|
||||||
|
|
||||||
|
/*****************************************************************************
|
||||||
|
* IDirect3DVertexBuffer8 implementation structure
|
||||||
|
*/
|
||||||
|
struct IDirect3DVertexBuffer8Impl
|
||||||
|
{
|
||||||
|
/* IUnknown fields */
|
||||||
|
ICOM_VFIELD(IDirect3DVertexBuffer8);
|
||||||
|
DWORD ref;
|
||||||
|
|
||||||
|
/* IDirect3DVertexBuffer8 fields */
|
||||||
|
IDirect3DDevice8Impl *Device;
|
||||||
|
D3DRESOURCETYPE ResourceType;
|
||||||
|
BYTE *allocatedMemory;
|
||||||
|
D3DVERTEXBUFFER_DESC currentDesc;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* IUnknown: */
|
||||||
|
extern HRESULT WINAPI IDirect3DVertexBuffer8Impl_QueryInterface(LPDIRECT3DVERTEXBUFFER8 iface,REFIID refiid,LPVOID *obj);
|
||||||
|
extern ULONG WINAPI IDirect3DVertexBuffer8Impl_AddRef(LPDIRECT3DVERTEXBUFFER8 iface);
|
||||||
|
extern ULONG WINAPI IDirect3DVertexBuffer8Impl_Release(LPDIRECT3DVERTEXBUFFER8 iface);
|
||||||
|
|
||||||
|
/* IDirect3DVertexBuffer8 (Inherited from IDirect3DResource8) */
|
||||||
|
extern HRESULT WINAPI IDirect3DVertexBuffer8Impl_GetDevice(LPDIRECT3DVERTEXBUFFER8 iface, IDirect3DDevice8** ppDevice);
|
||||||
|
extern HRESULT WINAPI IDirect3DVertexBuffer8Impl_SetPrivateData(LPDIRECT3DVERTEXBUFFER8 iface, REFGUID refguid, CONST void* pData, DWORD SizeOfData, DWORD Flags);
|
||||||
|
extern HRESULT WINAPI IDirect3DVertexBuffer8Impl_GetPrivateData(LPDIRECT3DVERTEXBUFFER8 iface, REFGUID refguid, void* pData, DWORD* pSizeOfData);
|
||||||
|
extern HRESULT WINAPI IDirect3DVertexBuffer8Impl_FreePrivateData(LPDIRECT3DVERTEXBUFFER8 iface, REFGUID refguid);
|
||||||
|
extern DWORD WINAPI IDirect3DVertexBuffer8Impl_SetPriority(LPDIRECT3DVERTEXBUFFER8 iface, DWORD PriorityNew);
|
||||||
|
extern DWORD WINAPI IDirect3DVertexBuffer8Impl_GetPriority(LPDIRECT3DVERTEXBUFFER8 iface);
|
||||||
|
extern void WINAPI IDirect3DVertexBuffer8Impl_PreLoad(LPDIRECT3DVERTEXBUFFER8 iface);
|
||||||
|
extern D3DRESOURCETYPE WINAPI IDirect3DVertexBuffer8Impl_GetType(LPDIRECT3DVERTEXBUFFER8 iface);
|
||||||
|
|
||||||
|
/* IDirect3DVertexBuffer8 */
|
||||||
|
extern HRESULT WINAPI IDirect3DVertexBuffer8Impl_Lock(LPDIRECT3DVERTEXBUFFER8 iface, UINT OffsetToLock, UINT SizeToLock, BYTE** ppbData, DWORD Flags);
|
||||||
|
extern HRESULT WINAPI IDirect3DVertexBuffer8Impl_Unlock(LPDIRECT3DVERTEXBUFFER8 iface);
|
||||||
|
extern HRESULT WINAPI IDirect3DVertexBuffer8Impl_GetDesc(LPDIRECT3DVERTEXBUFFER8 iface, D3DVERTEXBUFFER_DESC *pDesc);
|
||||||
|
|
||||||
|
/* IDirect3DVolume8 private include file
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*****************************************************************************
|
||||||
|
* Predeclare the interface implementation structures
|
||||||
|
*/
|
||||||
|
extern ICOM_VTABLE(IDirect3DVolume8) Direct3DVolume8_Vtbl;
|
||||||
|
|
||||||
|
/*****************************************************************************
|
||||||
|
* IDirect3DVolume8 implementation structure
|
||||||
|
*/
|
||||||
|
struct IDirect3DVolume8Impl
|
||||||
|
{
|
||||||
|
/* IUnknown fields */
|
||||||
|
ICOM_VFIELD(IDirect3DVolume8);
|
||||||
|
DWORD ref;
|
||||||
|
|
||||||
|
/* IDirect3DVolume8 fields */
|
||||||
|
IDirect3DDevice8Impl *Device;
|
||||||
|
D3DRESOURCETYPE ResourceType;
|
||||||
|
|
||||||
|
void *Container;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
/* IUnknown: */
|
||||||
|
extern HRESULT WINAPI IDirect3DVolume8Impl_QueryInterface(LPDIRECT3DVOLUME8 iface,REFIID refiid,LPVOID *obj);
|
||||||
|
extern ULONG WINAPI IDirect3DVolume8Impl_AddRef(LPDIRECT3DVOLUME8 iface);
|
||||||
|
extern ULONG WINAPI IDirect3DVolume8Impl_Release(LPDIRECT3DVOLUME8 iface);
|
||||||
|
|
||||||
|
/* IDirect3DVolume8 */
|
||||||
|
extern HRESULT WINAPI IDirect3DVolume8Impl_GetDevice(LPDIRECT3DVOLUME8 iface, IDirect3DDevice8** ppDevice);
|
||||||
|
extern HRESULT WINAPI IDirect3DVolume8Impl_SetPrivateData(LPDIRECT3DVOLUME8 iface, REFGUID refguid, CONST void* pData, DWORD SizeOfData, DWORD Flags);
|
||||||
|
extern HRESULT WINAPI IDirect3DVolume8Impl_GetPrivateData(LPDIRECT3DVOLUME8 iface, REFGUID refguid, void* pData, DWORD* pSizeOfData);
|
||||||
|
extern HRESULT WINAPI IDirect3DVolume8Impl_FreePrivateData(LPDIRECT3DVOLUME8 iface, REFGUID refguid);
|
||||||
|
extern HRESULT WINAPI IDirect3DVolume8Impl_GetContainer(LPDIRECT3DVOLUME8 iface, REFIID riid, void** ppContainer);
|
||||||
|
extern HRESULT WINAPI IDirect3DVolume8Impl_GetDesc(LPDIRECT3DVOLUME8 iface, D3DVOLUME_DESC* pDesc);
|
||||||
|
extern HRESULT WINAPI IDirect3DVolume8Impl_LockBox(LPDIRECT3DVOLUME8 iface, D3DLOCKED_BOX* pLockedVolume,CONST D3DBOX* pBox, DWORD Flags);
|
||||||
|
extern HRESULT WINAPI IDirect3DVolume8Impl_UnlockBox(LPDIRECT3DVOLUME8 iface);
|
||||||
|
|
||||||
|
/* ------------------- */
|
||||||
|
/* IDirect3DSwapChain8 */
|
||||||
|
/* ------------------- */
|
||||||
|
|
||||||
|
/*****************************************************************************
|
||||||
|
* Predeclare the interface implementation structures
|
||||||
|
*/
|
||||||
|
extern ICOM_VTABLE(IDirect3DSwapChain8) Direct3DSwapChain8_Vtbl;
|
||||||
|
|
||||||
|
/*****************************************************************************
|
||||||
|
* IDirect3DSwapChain8 implementation structure
|
||||||
|
*/
|
||||||
|
struct IDirect3DSwapChain8Impl
|
||||||
|
{
|
||||||
|
/* IUnknown fields */
|
||||||
|
ICOM_VFIELD(IDirect3DSwapChain8);
|
||||||
|
DWORD ref;
|
||||||
|
|
||||||
|
/* IDirect3DSwapChain8 fields */
|
||||||
|
};
|
||||||
|
|
||||||
|
/* IUnknown: */
|
||||||
|
extern HRESULT WINAPI IDirect3DSwapChain8Impl_QueryInterface(LPDIRECT3DSWAPCHAIN8 iface,REFIID refiid,LPVOID *obj);
|
||||||
|
extern ULONG WINAPI IDirect3DSwapChain8Impl_AddRef(LPDIRECT3DSWAPCHAIN8 iface);
|
||||||
|
extern ULONG WINAPI IDirect3DSwapChain8Impl_Release(LPDIRECT3DSWAPCHAIN8 iface);
|
||||||
|
|
||||||
|
/* IDirect3DSwapChain8 */
|
||||||
|
extern HRESULT WINAPI IDirect3DSwapChain8Impl_Present(LPDIRECT3DSWAPCHAIN8 iface, CONST RECT* pSourceRect, CONST RECT* pDestRect, HWND hDestWindowOverride,CONST RGNDATA* pDirtyRegion);
|
||||||
|
extern HRESULT WINAPI IDirect3DSwapChain8Impl_GetBackBuffer(LPDIRECT3DSWAPCHAIN8 iface, UINT BackBuffer, D3DBACKBUFFER_TYPE Type,IDirect3DSurface8** ppBackBuffer);
|
||||||
|
|
||||||
|
/* ----------------- */
|
||||||
|
/* IDirect3DSurface8 */
|
||||||
|
/* ----------------- */
|
||||||
|
|
||||||
|
/*****************************************************************************
|
||||||
|
* Predeclare the interface implementation structures
|
||||||
|
*/
|
||||||
|
extern ICOM_VTABLE(IDirect3DSurface8) Direct3DSurface8_Vtbl;
|
||||||
|
|
||||||
|
/*****************************************************************************
|
||||||
|
* IDirect3DSurface8 implementation structure
|
||||||
|
*/
|
||||||
|
struct IDirect3DSurface8Impl
|
||||||
|
{
|
||||||
|
/* IUnknown fields */
|
||||||
|
ICOM_VFIELD(IDirect3DSurface8);
|
||||||
|
DWORD ref;
|
||||||
|
|
||||||
|
/* IDirect3DSurface8 fields */
|
||||||
|
IDirect3DDevice8Impl *Device;
|
||||||
|
D3DRESOURCETYPE ResourceType;
|
||||||
|
|
||||||
|
void *Container;
|
||||||
|
|
||||||
|
D3DSURFACE_DESC myDesc;
|
||||||
|
BYTE *allocatedMemory;
|
||||||
|
UINT textureName;
|
||||||
|
UINT bytesPerPixel;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* IUnknown: */
|
||||||
|
extern HRESULT WINAPI IDirect3DSurface8Impl_QueryInterface(LPDIRECT3DSURFACE8 iface,REFIID refiid,LPVOID *obj);
|
||||||
|
extern ULONG WINAPI IDirect3DSurface8Impl_AddRef(LPDIRECT3DSURFACE8 iface);
|
||||||
|
extern ULONG WINAPI IDirect3DSurface8Impl_Release(LPDIRECT3DSURFACE8 iface);
|
||||||
|
|
||||||
|
/* IDirect3DSurface8 */
|
||||||
|
extern HRESULT WINAPI IDirect3DSurface8Impl_GetDevice(LPDIRECT3DSURFACE8 iface, IDirect3DDevice8** ppDevice);
|
||||||
|
extern HRESULT WINAPI IDirect3DSurface8Impl_SetPrivateData(LPDIRECT3DSURFACE8 iface, REFGUID refguid,CONST void* pData,DWORD SizeOfData,DWORD Flags);
|
||||||
|
extern HRESULT WINAPI IDirect3DSurface8Impl_GetPrivateData(LPDIRECT3DSURFACE8 iface, REFGUID refguid,void* pData,DWORD* pSizeOfData);
|
||||||
|
extern HRESULT WINAPI IDirect3DSurface8Impl_FreePrivateData(LPDIRECT3DSURFACE8 iface, REFGUID refguid);
|
||||||
|
extern HRESULT WINAPI IDirect3DSurface8Impl_GetContainer(LPDIRECT3DSURFACE8 iface, REFIID riid,void** ppContainer);
|
||||||
|
extern HRESULT WINAPI IDirect3DSurface8Impl_GetDesc(LPDIRECT3DSURFACE8 iface, D3DSURFACE_DESC *pDesc);
|
||||||
|
extern HRESULT WINAPI IDirect3DSurface8Impl_LockRect(LPDIRECT3DSURFACE8 iface, D3DLOCKED_RECT* pLockedRect, CONST RECT* pRect,DWORD Flags);
|
||||||
|
extern HRESULT WINAPI IDirect3DSurface8Impl_UnlockRect(LPDIRECT3DSURFACE8 iface);
|
||||||
|
|
||||||
|
/* --------------------- */
|
||||||
|
/* IDirect3DIndexBuffer8 */
|
||||||
|
/* --------------------- */
|
||||||
|
|
||||||
|
/*****************************************************************************
|
||||||
|
* Predeclare the interface implementation structures
|
||||||
|
*/
|
||||||
|
extern ICOM_VTABLE(IDirect3DIndexBuffer8) Direct3DIndexBuffer8_Vtbl;
|
||||||
|
|
||||||
|
/*****************************************************************************
|
||||||
|
* IDirect3DIndexBuffer8 implementation structure
|
||||||
|
*/
|
||||||
|
struct IDirect3DIndexBuffer8Impl
|
||||||
|
{
|
||||||
|
/* IUnknown fields */
|
||||||
|
ICOM_VFIELD(IDirect3DIndexBuffer8);
|
||||||
|
DWORD ref;
|
||||||
|
|
||||||
|
/* IDirect3DIndexBuffer8 fields */
|
||||||
|
IDirect3DDevice8Impl *Device;
|
||||||
|
D3DRESOURCETYPE ResourceType;
|
||||||
|
|
||||||
|
D3DINDEXBUFFER_DESC currentDesc;
|
||||||
|
void *allocatedMemory;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* IUnknown: */
|
||||||
|
extern HRESULT WINAPI IDirect3DIndexBuffer8Impl_QueryInterface(LPDIRECT3DINDEXBUFFER8 iface,REFIID refiid,LPVOID *obj);
|
||||||
|
extern ULONG WINAPI IDirect3DIndexBuffer8Impl_AddRef(LPDIRECT3DINDEXBUFFER8 iface);
|
||||||
|
extern ULONG WINAPI IDirect3DIndexBuffer8Impl_Release(LPDIRECT3DINDEXBUFFER8 iface);
|
||||||
|
|
||||||
|
/* IDirect3DIndexBuffer8 (Inherited from IDirect3DResource8) */
|
||||||
|
extern HRESULT WINAPI IDirect3DIndexBuffer8Impl_GetDevice(LPDIRECT3DINDEXBUFFER8 iface, IDirect3DDevice8** ppDevice);
|
||||||
|
extern HRESULT WINAPI IDirect3DIndexBuffer8Impl_SetPrivateData(LPDIRECT3DINDEXBUFFER8 iface, REFGUID refguid, CONST void* pData, DWORD SizeOfData, DWORD Flags);
|
||||||
|
extern HRESULT WINAPI IDirect3DIndexBuffer8Impl_GetPrivateData(LPDIRECT3DINDEXBUFFER8 iface, REFGUID refguid, void* pData, DWORD* pSizeOfData);
|
||||||
|
extern HRESULT WINAPI IDirect3DIndexBuffer8Impl_FreePrivateData(LPDIRECT3DINDEXBUFFER8 iface, REFGUID refguid);
|
||||||
|
extern DWORD WINAPI IDirect3DIndexBuffer8Impl_SetPriority(LPDIRECT3DINDEXBUFFER8 iface, DWORD PriorityNew);
|
||||||
|
extern DWORD WINAPI IDirect3DIndexBuffer8Impl_GetPriority(LPDIRECT3DINDEXBUFFER8 iface);
|
||||||
|
extern void WINAPI IDirect3DIndexBuffer8Impl_PreLoad(LPDIRECT3DINDEXBUFFER8 iface);
|
||||||
|
extern D3DRESOURCETYPE WINAPI IDirect3DIndexBuffer8Impl_GetType(LPDIRECT3DINDEXBUFFER8 iface);
|
||||||
|
|
||||||
|
/* IDirect3DIndexBuffer8 */
|
||||||
|
extern HRESULT WINAPI IDirect3DIndexBuffer8Impl_Lock(LPDIRECT3DINDEXBUFFER8 iface, UINT OffsetToLock, UINT SizeToLock, BYTE** ppbData, DWORD Flags);
|
||||||
|
extern HRESULT WINAPI IDirect3DIndexBuffer8Impl_Unlock(LPDIRECT3DINDEXBUFFER8 iface);
|
||||||
|
extern HRESULT WINAPI IDirect3DIndexBuffer8Impl_GetDesc(LPDIRECT3DINDEXBUFFER8 iface, D3DINDEXBUFFER_DESC *pDesc);
|
||||||
|
|
||||||
|
/* --------------------- */
|
||||||
|
/* IDirect3DCubeTexture8 */
|
||||||
|
/* --------------------- */
|
||||||
|
|
||||||
|
/*****************************************************************************
|
||||||
|
* Predeclare the interface implementation structures
|
||||||
|
*/
|
||||||
|
extern ICOM_VTABLE(IDirect3DCubeTexture8) Direct3DCubeTexture8_Vtbl;
|
||||||
|
|
||||||
|
/*****************************************************************************
|
||||||
|
* IDirect3DCubeTexture8 implementation structure
|
||||||
|
*/
|
||||||
|
struct IDirect3DCubeTexture8Impl
|
||||||
|
{
|
||||||
|
/* IUnknown fields */
|
||||||
|
ICOM_VFIELD(IDirect3DCubeTexture8);
|
||||||
|
DWORD ref;
|
||||||
|
|
||||||
|
/* IDirect3DCubeTexture8 fields */
|
||||||
|
IDirect3DDevice8Impl *Device;
|
||||||
|
D3DRESOURCETYPE ResourceType;
|
||||||
|
|
||||||
|
UINT edgeLength;
|
||||||
|
DWORD usage;
|
||||||
|
UINT levels;
|
||||||
|
D3DFORMAT format;
|
||||||
|
|
||||||
|
IDirect3DDevice8Impl *device;
|
||||||
|
IDirect3DSurface8Impl *surfaces[6][MAX_LEVELS];
|
||||||
|
BOOL Dirty;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* IUnknown: */
|
||||||
|
extern HRESULT WINAPI IDirect3DCubeTexture8Impl_QueryInterface(LPDIRECT3DCUBETEXTURE8 iface,REFIID refiid,LPVOID *obj);
|
||||||
|
extern ULONG WINAPI IDirect3DCubeTexture8Impl_AddRef(LPDIRECT3DCUBETEXTURE8 iface);
|
||||||
|
extern ULONG WINAPI IDirect3DCubeTexture8Impl_Release(LPDIRECT3DCUBETEXTURE8 iface);
|
||||||
|
|
||||||
|
/* IDirect3DCubeTexture8 (Inherited from IDirect3DResource8) */
|
||||||
|
extern HRESULT WINAPI IDirect3DCubeTexture8Impl_GetDevice(LPDIRECT3DCUBETEXTURE8 iface, IDirect3DDevice8** ppDevice);
|
||||||
|
extern HRESULT WINAPI IDirect3DCubeTexture8Impl_SetPrivateData(LPDIRECT3DCUBETEXTURE8 iface, REFGUID refguid, CONST void* pData, DWORD SizeOfData, DWORD Flags);
|
||||||
|
extern HRESULT WINAPI IDirect3DCubeTexture8Impl_GetPrivateData(LPDIRECT3DCUBETEXTURE8 iface, REFGUID refguid, void* pData, DWORD* pSizeOfData);
|
||||||
|
extern HRESULT WINAPI IDirect3DCubeTexture8Impl_FreePrivateData(LPDIRECT3DCUBETEXTURE8 iface, REFGUID refguid);
|
||||||
|
extern DWORD WINAPI IDirect3DCubeTexture8Impl_SetPriority(LPDIRECT3DCUBETEXTURE8 iface, DWORD PriorityNew);
|
||||||
|
extern DWORD WINAPI IDirect3DCubeTexture8Impl_GetPriority(LPDIRECT3DCUBETEXTURE8 iface);
|
||||||
|
extern void WINAPI IDirect3DCubeTexture8Impl_PreLoad(LPDIRECT3DCUBETEXTURE8 iface);
|
||||||
|
extern D3DRESOURCETYPE WINAPI IDirect3DCubeTexture8Impl_GetType(LPDIRECT3DCUBETEXTURE8 iface);
|
||||||
|
|
||||||
|
/* IDirect3DCubeTexture8 (Inherited from IDirect3DBaseTexture8) */
|
||||||
|
extern DWORD WINAPI IDirect3DCubeTexture8Impl_SetLOD(LPDIRECT3DCUBETEXTURE8 iface, DWORD LODNew);
|
||||||
|
extern DWORD WINAPI IDirect3DCubeTexture8Impl_GetLOD(LPDIRECT3DCUBETEXTURE8 iface);
|
||||||
|
extern DWORD WINAPI IDirect3DCubeTexture8Impl_GetLevelCount(LPDIRECT3DCUBETEXTURE8 iface);
|
||||||
|
|
||||||
|
/* IDirect3DCubeTexture8 */
|
||||||
|
extern HRESULT WINAPI IDirect3DCubeTexture8Impl_GetLevelDesc(LPDIRECT3DCUBETEXTURE8 iface,UINT Level,D3DSURFACE_DESC *pDesc);
|
||||||
|
extern HRESULT WINAPI IDirect3DCubeTexture8Impl_GetCubeMapSurface(LPDIRECT3DCUBETEXTURE8 iface,D3DCUBEMAP_FACES FaceType,UINT Level,IDirect3DSurface8** ppCubeMapSurface);
|
||||||
|
extern HRESULT WINAPI IDirect3DCubeTexture8Impl_LockRect(LPDIRECT3DCUBETEXTURE8 iface,D3DCUBEMAP_FACES FaceType,UINT Level,D3DLOCKED_RECT* pLockedRect,CONST RECT* pRect,DWORD Flags);
|
||||||
|
extern HRESULT WINAPI IDirect3DCubeTexture8Impl_UnlockRect(LPDIRECT3DCUBETEXTURE8 iface,D3DCUBEMAP_FACES FaceType,UINT Level);
|
||||||
|
extern HRESULT WINAPI IDirect3DCubeTexture8Impl_AddDirtyRect(LPDIRECT3DCUBETEXTURE8 iface,D3DCUBEMAP_FACES FaceType,CONST RECT* pDirtyRect);
|
||||||
|
|
||||||
|
/* ----------------- */
|
||||||
|
/* IDirect3DTexture8 */
|
||||||
|
/* ----------------- */
|
||||||
|
|
||||||
|
/*****************************************************************************
|
||||||
|
* Predeclare the interface implementation structures
|
||||||
|
*/
|
||||||
|
extern ICOM_VTABLE(IDirect3DTexture8) Direct3DTexture8_Vtbl;
|
||||||
|
|
||||||
|
/*****************************************************************************
|
||||||
|
* IDirect3DTexture8 implementation structure
|
||||||
|
*/
|
||||||
|
struct IDirect3DTexture8Impl
|
||||||
|
{
|
||||||
|
/* IUnknown fields */
|
||||||
|
ICOM_VFIELD(IDirect3DTexture8);
|
||||||
|
DWORD ref;
|
||||||
|
|
||||||
|
/* IDirect3DTexture8 fields */
|
||||||
|
IDirect3DDevice8Impl *Device;
|
||||||
|
D3DRESOURCETYPE ResourceType;
|
||||||
|
UINT width;
|
||||||
|
UINT height;
|
||||||
|
UINT levels;
|
||||||
|
DWORD usage;
|
||||||
|
D3DFORMAT format;
|
||||||
|
|
||||||
|
IDirect3DDevice8Impl *device;
|
||||||
|
IDirect3DSurface8Impl *surfaces[MAX_LEVELS];
|
||||||
|
BOOL Dirty;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
/* IUnknown: */
|
||||||
|
extern HRESULT WINAPI IDirect3DTexture8Impl_QueryInterface(LPDIRECT3DTEXTURE8 iface,REFIID refiid,LPVOID *obj);
|
||||||
|
extern ULONG WINAPI IDirect3DTexture8Impl_AddRef(LPDIRECT3DTEXTURE8 iface);
|
||||||
|
extern ULONG WINAPI IDirect3DTexture8Impl_Release(LPDIRECT3DTEXTURE8 iface);
|
||||||
|
|
||||||
|
/* IDirect3DTexture8 (Inherited from IDirect3DResource8) */
|
||||||
|
extern HRESULT WINAPI IDirect3DTexture8Impl_GetDevice(LPDIRECT3DTEXTURE8 iface, IDirect3DDevice8** ppDevice);
|
||||||
|
extern HRESULT WINAPI IDirect3DTexture8Impl_SetPrivateData(LPDIRECT3DTEXTURE8 iface, REFGUID refguid, CONST void* pData, DWORD SizeOfData, DWORD Flags);
|
||||||
|
extern HRESULT WINAPI IDirect3DTexture8Impl_GetPrivateData(LPDIRECT3DTEXTURE8 iface, REFGUID refguid, void* pData, DWORD* pSizeOfData);
|
||||||
|
extern HRESULT WINAPI IDirect3DTexture8Impl_FreePrivateData(LPDIRECT3DTEXTURE8 iface, REFGUID refguid);
|
||||||
|
extern DWORD WINAPI IDirect3DTexture8Impl_SetPriority(LPDIRECT3DTEXTURE8 iface, DWORD PriorityNew);
|
||||||
|
extern DWORD WINAPI IDirect3DTexture8Impl_GetPriority(LPDIRECT3DTEXTURE8 iface);
|
||||||
|
extern void WINAPI IDirect3DTexture8Impl_PreLoad(LPDIRECT3DTEXTURE8 iface);
|
||||||
|
extern D3DRESOURCETYPE WINAPI IDirect3DTexture8Impl_GetType(LPDIRECT3DTEXTURE8 iface);
|
||||||
|
|
||||||
|
/* IDirect3DTexture8 (Inherited from IDirect3DBaseTexture8) */
|
||||||
|
extern DWORD WINAPI IDirect3DTexture8Impl_SetLOD(LPDIRECT3DTEXTURE8 iface, DWORD LODNew);
|
||||||
|
extern DWORD WINAPI IDirect3DTexture8Impl_GetLOD(LPDIRECT3DTEXTURE8 iface);
|
||||||
|
extern DWORD WINAPI IDirect3DTexture8Impl_GetLevelCount(LPDIRECT3DTEXTURE8 iface);
|
||||||
|
|
||||||
|
/* IDirect3DTexture8 */
|
||||||
|
extern HRESULT WINAPI IDirect3DTexture8Impl_GetLevelDesc(LPDIRECT3DTEXTURE8 iface, UINT Level,D3DSURFACE_DESC* pDesc);
|
||||||
|
extern HRESULT WINAPI IDirect3DTexture8Impl_GetSurfaceLevel(LPDIRECT3DTEXTURE8 iface, UINT Level,IDirect3DSurface8** ppSurfaceLevel);
|
||||||
|
extern HRESULT WINAPI IDirect3DTexture8Impl_LockRect(LPDIRECT3DTEXTURE8 iface, UINT Level,D3DLOCKED_RECT* pLockedRect,CONST RECT* pRect,DWORD Flags);
|
||||||
|
extern HRESULT WINAPI IDirect3DTexture8Impl_UnlockRect(LPDIRECT3DTEXTURE8 iface, UINT Level);
|
||||||
|
extern HRESULT WINAPI IDirect3DTexture8Impl_AddDirtyRect(LPDIRECT3DTEXTURE8 iface, CONST RECT* pDirtyRect);
|
||||||
|
|
||||||
|
/* ----------------------- */
|
||||||
|
/* IDirect3DVolumeTexture8 */
|
||||||
|
/* ----------------------- */
|
||||||
|
|
||||||
|
/*****************************************************************************
|
||||||
|
* Predeclare the interface implementation structures
|
||||||
|
*/
|
||||||
|
extern ICOM_VTABLE(IDirect3DVolumeTexture8) Direct3DVolumeTexture8_Vtbl;
|
||||||
|
|
||||||
|
/*****************************************************************************
|
||||||
|
* IDirect3DVolumeTexture8 implementation structure
|
||||||
|
*/
|
||||||
|
struct IDirect3DVolumeTexture8Impl
|
||||||
|
{
|
||||||
|
/* IUnknown fields */
|
||||||
|
ICOM_VFIELD(IDirect3DVolumeTexture8);
|
||||||
|
DWORD ref;
|
||||||
|
|
||||||
|
/* IDirect3DVolumeTexture8 fields */
|
||||||
|
IDirect3DDevice8Impl *Device;
|
||||||
|
D3DRESOURCETYPE ResourceType;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* IUnknown: */
|
||||||
|
extern HRESULT WINAPI IDirect3DVolumeTexture8Impl_QueryInterface(LPDIRECT3DVOLUMETEXTURE8 iface,REFIID refiid,LPVOID *obj);
|
||||||
|
extern ULONG WINAPI IDirect3DVolumeTexture8Impl_AddRef(LPDIRECT3DVOLUMETEXTURE8 iface);
|
||||||
|
extern ULONG WINAPI IDirect3DVolumeTexture8Impl_Release(LPDIRECT3DVOLUMETEXTURE8 iface);
|
||||||
|
|
||||||
|
/* IDirect3DVolumeTexture8 (Inherited from IDirect3DResource8) */
|
||||||
|
extern HRESULT WINAPI IDirect3DVolumeTexture8Impl_GetDevice(LPDIRECT3DVOLUMETEXTURE8 iface, IDirect3DDevice8** ppDevice);
|
||||||
|
extern HRESULT WINAPI IDirect3DVolumeTexture8Impl_SetPrivateData(LPDIRECT3DVOLUMETEXTURE8 iface, REFGUID refguid, CONST void* pData, DWORD SizeOfData, DWORD Flags);
|
||||||
|
extern HRESULT WINAPI IDirect3DVolumeTexture8Impl_GetPrivateData(LPDIRECT3DVOLUMETEXTURE8 iface, REFGUID refguid, void* pData, DWORD* pSizeOfData);
|
||||||
|
extern HRESULT WINAPI IDirect3DVolumeTexture8Impl_FreePrivateData(LPDIRECT3DVOLUMETEXTURE8 iface, REFGUID refguid);
|
||||||
|
extern DWORD WINAPI IDirect3DVolumeTexture8Impl_SetPriority(LPDIRECT3DVOLUMETEXTURE8 iface, DWORD PriorityNew);
|
||||||
|
extern DWORD WINAPI IDirect3DVolumeTexture8Impl_GetPriority(LPDIRECT3DVOLUMETEXTURE8 iface);
|
||||||
|
extern void WINAPI IDirect3DVolumeTexture8Impl_PreLoad(LPDIRECT3DVOLUMETEXTURE8 iface);
|
||||||
|
extern D3DRESOURCETYPE WINAPI IDirect3DVolumeTexture8Impl_GetType(LPDIRECT3DVOLUMETEXTURE8 iface);
|
||||||
|
|
||||||
|
/* IDirect3DVolumeTexture8 (Inherited from IDirect3DBaseTexture8) */
|
||||||
|
extern DWORD WINAPI IDirect3DVolumeTexture8Impl_SetLOD(LPDIRECT3DVOLUMETEXTURE8 iface, DWORD LODNew);
|
||||||
|
extern DWORD WINAPI IDirect3DVolumeTexture8Impl_GetLOD(LPDIRECT3DVOLUMETEXTURE8 iface);
|
||||||
|
extern DWORD WINAPI IDirect3DVolumeTexture8Impl_GetLevelCount(LPDIRECT3DVOLUMETEXTURE8 iface);
|
||||||
|
|
||||||
|
/* IDirect3DVolumeTexture8 */
|
||||||
|
extern HRESULT WINAPI IDirect3DVolumeTexture8Impl_GetLevelDesc(LPDIRECT3DVOLUMETEXTURE8 iface, UINT Level,D3DVOLUME_DESC *pDesc);
|
||||||
|
extern HRESULT WINAPI IDirect3DVolumeTexture8Impl_GetVolumeLevel(LPDIRECT3DVOLUMETEXTURE8 iface, UINT Level,IDirect3DVolume8** ppVolumeLevel);
|
||||||
|
extern HRESULT WINAPI IDirect3DVolumeTexture8Impl_LockBox(LPDIRECT3DVOLUMETEXTURE8 iface, UINT Level,D3DLOCKED_BOX* pLockedVolume,CONST D3DBOX* pBox,DWORD Flags);
|
||||||
|
extern HRESULT WINAPI IDirect3DVolumeTexture8Impl_UnlockBox(LPDIRECT3DVOLUMETEXTURE8 iface, UINT Level);
|
||||||
|
extern HRESULT WINAPI IDirect3DVolumeTexture8Impl_AddDirtyBox(LPDIRECT3DVOLUMETEXTURE8 iface, CONST D3DBOX* pDirtyBox);
|
||||||
|
|
||||||
|
#endif /* __WINE_D3DX8_PRIVATE_H */
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,549 @@
|
||||||
|
/*
|
||||||
|
* IDirect3D8 implementation
|
||||||
|
*
|
||||||
|
* Copyright 2002 Jason Edmeades
|
||||||
|
*
|
||||||
|
* This library is free software; you can redistribute it and/or
|
||||||
|
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "windef.h"
|
||||||
|
#include "winbase.h"
|
||||||
|
#include "winuser.h"
|
||||||
|
#include "wingdi.h"
|
||||||
|
#include "wine/debug.h"
|
||||||
|
|
||||||
|
#include "config.h"
|
||||||
|
#include "x11drv.h"
|
||||||
|
|
||||||
|
#include "d3d8_private.h"
|
||||||
|
|
||||||
|
WINE_DEFAULT_DEBUG_CHANNEL(d3d);
|
||||||
|
|
||||||
|
static const float idmatrix[16] = {
|
||||||
|
1.0, 0.0, 0.0, 0.0,
|
||||||
|
0.0, 1.0, 0.0, 0.0,
|
||||||
|
0.0, 0.0, 1.0, 0.0,
|
||||||
|
0.0, 0.0, 0.0, 1.0
|
||||||
|
};
|
||||||
|
|
||||||
|
#define NUM_MODES 10
|
||||||
|
static const int modes[NUM_MODES][3] = {
|
||||||
|
{640, 480, 85},
|
||||||
|
{800, 600, 85},
|
||||||
|
{1024, 768, 85},
|
||||||
|
{1152, 864, 85},
|
||||||
|
{1280, 768, 85},
|
||||||
|
{1280, 960, 85},
|
||||||
|
{1280, 1024, 85},
|
||||||
|
{1600, 900, 85},
|
||||||
|
{1600, 1024, 85},
|
||||||
|
{1600, 1200, 85}
|
||||||
|
};
|
||||||
|
|
||||||
|
/* retrieve the X display to use on a given DC */
|
||||||
|
inline static Display *get_display( HDC hdc )
|
||||||
|
{
|
||||||
|
Display *display;
|
||||||
|
enum x11drv_escape_codes escape = X11DRV_GET_DISPLAY;
|
||||||
|
|
||||||
|
if (!ExtEscape( hdc, X11DRV_ESCAPE, sizeof(escape), (LPCSTR)&escape,
|
||||||
|
sizeof(display), (LPSTR)&display )) display = NULL;
|
||||||
|
return display;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* IDirect3D IUnknown parts follow: */
|
||||||
|
HRESULT WINAPI IDirect3D8Impl_QueryInterface(LPDIRECT3D8 iface,REFIID riid,LPVOID *ppobj)
|
||||||
|
{
|
||||||
|
ICOM_THIS(IDirect3D8Impl,iface);
|
||||||
|
|
||||||
|
if (IsEqualGUID(riid, &IID_IUnknown)
|
||||||
|
|| IsEqualGUID(riid, &IID_IClassFactory)) {
|
||||||
|
IDirect3D8Impl_AddRef(iface);
|
||||||
|
*ppobj = This;
|
||||||
|
return D3D_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppobj);
|
||||||
|
return E_NOINTERFACE;
|
||||||
|
}
|
||||||
|
|
||||||
|
ULONG WINAPI IDirect3D8Impl_AddRef(LPDIRECT3D8 iface) {
|
||||||
|
ICOM_THIS(IDirect3D8Impl,iface);
|
||||||
|
TRACE("(%p) : AddRef from %ld\n", This, This->ref);
|
||||||
|
return ++(This->ref);
|
||||||
|
}
|
||||||
|
|
||||||
|
ULONG WINAPI IDirect3D8Impl_Release(LPDIRECT3D8 iface) {
|
||||||
|
ICOM_THIS(IDirect3D8Impl,iface);
|
||||||
|
ULONG ref = --This->ref;
|
||||||
|
TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
|
||||||
|
if (ref == 0)
|
||||||
|
HeapFree(GetProcessHeap(), 0, This);
|
||||||
|
return ref;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* IDirect3D Interface follow: */
|
||||||
|
HRESULT WINAPI IDirect3D8Impl_RegisterSoftwareDevice (LPDIRECT3D8 iface, void* pInitializeFunction) {
|
||||||
|
ICOM_THIS(IDirect3D8Impl,iface);
|
||||||
|
FIXME("(%p)->(%p): stub\n", This, pInitializeFunction);
|
||||||
|
return D3D_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
UINT WINAPI IDirect3D8Impl_GetAdapterCount (LPDIRECT3D8 iface) {
|
||||||
|
ICOM_THIS(IDirect3D8Impl,iface);
|
||||||
|
/* FIXME: Set to one for now to imply the display */
|
||||||
|
TRACE("(%p): Mostly stub, only returns primary display\n", This);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
HRESULT WINAPI IDirect3D8Impl_GetAdapterIdentifier (LPDIRECT3D8 iface,
|
||||||
|
UINT Adapter, DWORD Flags, D3DADAPTER_IDENTIFIER8* pIdentifier) {
|
||||||
|
ICOM_THIS(IDirect3D8Impl,iface);
|
||||||
|
|
||||||
|
TRACE("(%p}->(Adapter: %d, Flags: %lx, pId=%p)\n", This, Adapter, Flags, pIdentifier);
|
||||||
|
|
||||||
|
if (Adapter >= IDirect3D8Impl_GetAdapterCount(iface)) {
|
||||||
|
return D3DERR_INVALIDCALL;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Adapter == 0) { /* Display */
|
||||||
|
strcpy(pIdentifier->Driver, "Display");
|
||||||
|
strcpy(pIdentifier->Description, "Direct3D Display");
|
||||||
|
pIdentifier->DriverVersion.s.HighPart = 1;
|
||||||
|
pIdentifier->DriverVersion.s.LowPart = 0;
|
||||||
|
pIdentifier->VendorId = 0;
|
||||||
|
pIdentifier->DeviceId = 0;
|
||||||
|
pIdentifier->SubSysId = 0;
|
||||||
|
pIdentifier->Revision = 0;
|
||||||
|
/*FIXME: memcpy(&pIdentifier->DeviceIdentifier, ??, sizeof(??GUID)); */
|
||||||
|
if (Flags & D3DENUM_NO_WHQL_LEVEL ) {
|
||||||
|
pIdentifier->WHQLLevel = 0;
|
||||||
|
} else {
|
||||||
|
pIdentifier->WHQLLevel = 1;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
FIXME("Adapter not primary display\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
return D3D_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
UINT WINAPI IDirect3D8Impl_GetAdapterModeCount (LPDIRECT3D8 iface,
|
||||||
|
UINT Adapter) {
|
||||||
|
ICOM_THIS(IDirect3D8Impl,iface);
|
||||||
|
|
||||||
|
TRACE("(%p}->(Adapter: %d)\n", This, Adapter);
|
||||||
|
|
||||||
|
if (Adapter >= IDirect3D8Impl_GetAdapterCount(iface)) {
|
||||||
|
return D3DERR_INVALIDCALL;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Adapter == 0) { /* Display */
|
||||||
|
int maxWidth = GetSystemMetrics(SM_CXSCREEN);
|
||||||
|
int maxHeight = GetSystemMetrics(SM_CYSCREEN);
|
||||||
|
int i;
|
||||||
|
|
||||||
|
for (i=0; i<NUM_MODES; i++) {
|
||||||
|
if (modes[i][0] > maxWidth || modes[i][1] > maxHeight) {
|
||||||
|
return i+1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return NUM_MODES+1;
|
||||||
|
} else {
|
||||||
|
FIXME("Adapter not primary display\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
return D3D_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
HRESULT WINAPI IDirect3D8Impl_EnumAdapterModes (LPDIRECT3D8 iface,
|
||||||
|
UINT Adapter, UINT Mode, D3DDISPLAYMODE* pMode) {
|
||||||
|
ICOM_THIS(IDirect3D8Impl,iface);
|
||||||
|
|
||||||
|
TRACE("(%p}->(Adapter: %d, mode: %d, pMode=%p)\n", This, Adapter, Mode, pMode);
|
||||||
|
|
||||||
|
if (Adapter >= IDirect3D8Impl_GetAdapterCount(iface)) {
|
||||||
|
return D3DERR_INVALIDCALL;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Adapter == 0) { /* Display */
|
||||||
|
HDC hdc;
|
||||||
|
int bpp = 0;
|
||||||
|
|
||||||
|
if (Mode == 0) {
|
||||||
|
pMode->Width = GetSystemMetrics(SM_CXSCREEN);
|
||||||
|
pMode->Height = GetSystemMetrics(SM_CYSCREEN);
|
||||||
|
pMode->RefreshRate = 85; /*FIXME: How to identify? */
|
||||||
|
} else if (Mode < (NUM_MODES+1)) {
|
||||||
|
pMode->Width = modes[Mode-1][0];
|
||||||
|
pMode->Height = modes[Mode-1][1];
|
||||||
|
pMode->RefreshRate = modes[Mode-1][2];
|
||||||
|
} else {
|
||||||
|
TRACE("Requested mode out of range %d\n", Mode);
|
||||||
|
return D3DERR_INVALIDCALL;
|
||||||
|
}
|
||||||
|
|
||||||
|
hdc = CreateDCA("DISPLAY", NULL, NULL, NULL);
|
||||||
|
bpp = GetDeviceCaps(hdc, BITSPIXEL);
|
||||||
|
DeleteDC(hdc);
|
||||||
|
|
||||||
|
switch (bpp) {
|
||||||
|
case 8: pMode->Format = D3DFMT_R3G3B2; break;
|
||||||
|
case 16: pMode->Format = D3DFMT_A4R4G4B4; break;
|
||||||
|
case 24: pMode->Format = D3DFMT_R8G8B8; break;
|
||||||
|
case 32: pMode->Format = D3DFMT_A8R8G8B8; break;
|
||||||
|
default: pMode->Format = D3DFMT_UNKNOWN;
|
||||||
|
}
|
||||||
|
TRACE("W %d H %d rr %d fmt %x\n", pMode->Width, pMode->Height, pMode->RefreshRate, pMode->Format);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
FIXME("Adapter not primary display\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
return D3D_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
HRESULT WINAPI IDirect3D8Impl_GetAdapterDisplayMode (LPDIRECT3D8 iface,
|
||||||
|
UINT Adapter, D3DDISPLAYMODE* pMode) {
|
||||||
|
ICOM_THIS(IDirect3D8Impl,iface);
|
||||||
|
TRACE("(%p}->(Adapter: %d, pMode: %p)\n", This, Adapter, pMode);
|
||||||
|
|
||||||
|
if (Adapter >= IDirect3D8Impl_GetAdapterCount(iface)) {
|
||||||
|
return D3DERR_INVALIDCALL;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Adapter == 0) { /* Display */
|
||||||
|
HDC hdc;
|
||||||
|
int bpp = 0;
|
||||||
|
|
||||||
|
pMode->Width = GetSystemMetrics(SM_CXSCREEN);
|
||||||
|
pMode->Height = GetSystemMetrics(SM_CYSCREEN);
|
||||||
|
pMode->RefreshRate = 85; /*FIXME: How to identify? */
|
||||||
|
|
||||||
|
hdc = CreateDCA("DISPLAY", NULL, NULL, NULL);
|
||||||
|
bpp = GetDeviceCaps(hdc, BITSPIXEL);
|
||||||
|
DeleteDC(hdc);
|
||||||
|
|
||||||
|
switch (bpp) {
|
||||||
|
case 8: pMode->Format = D3DFMT_R3G3B2; break;
|
||||||
|
case 16: pMode->Format = D3DFMT_A4R4G4B4; break;
|
||||||
|
case 24: pMode->Format = D3DFMT_R8G8B8; break;
|
||||||
|
case 32: pMode->Format = D3DFMT_A8R8G8B8; break;
|
||||||
|
default: pMode->Format = D3DFMT_UNKNOWN;
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
FIXME("Adapter not primary display\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
TRACE("returning w:%d, h:%d, ref:%d, fmt:%d\n", pMode->Width,
|
||||||
|
pMode->Height, pMode->RefreshRate, pMode->Format);
|
||||||
|
return D3D_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
HRESULT WINAPI IDirect3D8Impl_CheckDeviceType (LPDIRECT3D8 iface,
|
||||||
|
UINT Adapter, D3DDEVTYPE CheckType, D3DFORMAT DisplayFormat,
|
||||||
|
D3DFORMAT BackBufferFormat, BOOL Windowed) {
|
||||||
|
ICOM_THIS(IDirect3D8Impl,iface);
|
||||||
|
FIXME("(%p)->(Adptr:%d, CheckType:%x, DispFmt:%x, BackBuf:%x, Win? %d): stub\n", This, Adapter, CheckType,
|
||||||
|
DisplayFormat, BackBufferFormat, Windowed);
|
||||||
|
return D3D_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
HRESULT WINAPI IDirect3D8Impl_CheckDeviceFormat (LPDIRECT3D8 iface,
|
||||||
|
UINT Adapter, D3DDEVTYPE DeviceType, D3DFORMAT AdapterFormat,
|
||||||
|
DWORD Usage, D3DRESOURCETYPE RType, D3DFORMAT CheckFormat) {
|
||||||
|
ICOM_THIS(IDirect3D8Impl,iface);
|
||||||
|
FIXME("(%p)->(Adptr:%d, DevType: %x, AdptFmt: %d, Use: %ld, ResTyp: %x, CheckFmt: %d)\n", This, Adapter, DeviceType,
|
||||||
|
AdapterFormat, Usage, RType, CheckFormat);
|
||||||
|
return D3D_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
HRESULT WINAPI IDirect3D8Impl_CheckDeviceMultiSampleType (LPDIRECT3D8 iface,
|
||||||
|
UINT Adapter, D3DDEVTYPE DeviceType, D3DFORMAT SurfaceFormat,
|
||||||
|
BOOL Windowed, D3DMULTISAMPLE_TYPE MultiSampleType) {
|
||||||
|
ICOM_THIS(IDirect3D8Impl,iface);
|
||||||
|
FIXME("(%p)->(Adptr:%d, DevType: %x, SurfFmt: %x, Win? %d, MultiSamp: %x)\n", This, Adapter, DeviceType,
|
||||||
|
SurfaceFormat, Windowed, MultiSampleType);
|
||||||
|
return D3D_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
HRESULT WINAPI IDirect3D8Impl_CheckDepthStencilMatch (LPDIRECT3D8 iface,
|
||||||
|
UINT Adapter, D3DDEVTYPE DeviceType, D3DFORMAT AdapterFormat,
|
||||||
|
D3DFORMAT RenderTargetFormat, D3DFORMAT DepthStencilFormat) {
|
||||||
|
ICOM_THIS(IDirect3D8Impl,iface);
|
||||||
|
FIXME("(%p)->(Adptr:%d, DevType: %x, AdptFmt: %x, RendrTgtFmt: %x, DepthStencilFmt: %x)\n", This, Adapter, DeviceType,
|
||||||
|
AdapterFormat, RenderTargetFormat, DepthStencilFormat);
|
||||||
|
return D3D_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
HRESULT WINAPI IDirect3D8Impl_GetDeviceCaps (LPDIRECT3D8 iface,
|
||||||
|
UINT Adapter, D3DDEVTYPE DeviceType, D3DCAPS8* pCaps) {
|
||||||
|
ICOM_THIS(IDirect3D8Impl,iface);
|
||||||
|
TRACE("(%p)->(Adptr:%d, DevType: %x, pCaps: %p)\n", This, Adapter, DeviceType, pCaps);
|
||||||
|
|
||||||
|
|
||||||
|
/* NOTE: Most of the values here are complete garbage for now */
|
||||||
|
pCaps->DeviceType = D3DDEVTYPE_HAL; /* Not quite true, but use h/w supported by opengl I suppose */
|
||||||
|
pCaps->AdapterOrdinal = Adapter;
|
||||||
|
|
||||||
|
pCaps->Caps = 0;
|
||||||
|
pCaps->Caps2 = D3DCAPS2_CANRENDERWINDOWED;
|
||||||
|
pCaps->Caps3 = D3DDEVCAPS_HWTRANSFORMANDLIGHT;
|
||||||
|
pCaps->PresentationIntervals = D3DPRESENT_INTERVAL_IMMEDIATE;
|
||||||
|
|
||||||
|
pCaps->CursorCaps = 0;
|
||||||
|
|
||||||
|
pCaps->DevCaps = D3DDEVCAPS_DRAWPRIMTLVERTEX | D3DDEVCAPS_HWTRANSFORMANDLIGHT | D3DDEVCAPS_PUREDEVICE;
|
||||||
|
|
||||||
|
pCaps->PrimitiveMiscCaps = D3DPMISCCAPS_CULLCCW | D3DPMISCCAPS_CULLCW | D3DPMISCCAPS_COLORWRITEENABLE | D3DPMISCCAPS_CLIPTLVERTS |
|
||||||
|
D3DPMISCCAPS_CLIPPLANESCALEDPOINTS | D3DPMISCCAPS_MASKZ; /*NOT: D3DPMISCCAPS_TSSARGTEMP*/
|
||||||
|
pCaps->RasterCaps = D3DPRASTERCAPS_DITHER | D3DPRASTERCAPS_PAT;
|
||||||
|
pCaps->ZCmpCaps = D3DPCMPCAPS_ALWAYS | D3DPCMPCAPS_EQUAL | D3DPCMPCAPS_GREATER | D3DPCMPCAPS_GREATEREQUAL |
|
||||||
|
D3DPCMPCAPS_LESS | D3DPCMPCAPS_LESSEQUAL | D3DPCMPCAPS_NEVER | D3DPCMPCAPS_NOTEQUAL;
|
||||||
|
|
||||||
|
pCaps->SrcBlendCaps = 0;
|
||||||
|
pCaps->DestBlendCaps = 0;
|
||||||
|
pCaps->AlphaCmpCaps = 0;
|
||||||
|
pCaps->ShadeCaps = D3DPSHADECAPS_SPECULARGOURAUDRGB | D3DPSHADECAPS_COLORGOURAUDRGB ;
|
||||||
|
pCaps->TextureCaps = D3DPTEXTURECAPS_ALPHA | D3DPTEXTURECAPS_ALPHAPALETTE | D3DPTEXTURECAPS_CUBEMAP | D3DPTEXTURECAPS_POW2;
|
||||||
|
pCaps->TextureFilterCaps = 0;
|
||||||
|
pCaps->CubeTextureFilterCaps = 0;
|
||||||
|
pCaps->VolumeTextureFilterCaps = 0;
|
||||||
|
pCaps->TextureAddressCaps = D3DPTADDRESSCAPS_BORDER | D3DPTADDRESSCAPS_CLAMP | D3DPTADDRESSCAPS_WRAP;
|
||||||
|
pCaps->VolumeTextureAddressCaps = 0;
|
||||||
|
|
||||||
|
pCaps->LineCaps = D3DLINECAPS_TEXTURE | D3DLINECAPS_ZTEST;
|
||||||
|
|
||||||
|
pCaps->MaxTextureWidth = 16384;
|
||||||
|
pCaps->MaxTextureHeight = 16384;
|
||||||
|
pCaps->MaxVolumeExtent = 0;
|
||||||
|
|
||||||
|
pCaps->MaxTextureRepeat = 32768;
|
||||||
|
pCaps->MaxTextureAspectRatio = 32768;
|
||||||
|
pCaps->MaxAnisotropy = 0;
|
||||||
|
pCaps->MaxVertexW = 1.0;
|
||||||
|
|
||||||
|
pCaps->GuardBandLeft = 0;
|
||||||
|
pCaps->GuardBandTop = 0;
|
||||||
|
pCaps->GuardBandRight = 0;
|
||||||
|
pCaps->GuardBandBottom = 0;
|
||||||
|
|
||||||
|
pCaps->ExtentsAdjust = 0;
|
||||||
|
|
||||||
|
pCaps->StencilCaps = 0;
|
||||||
|
|
||||||
|
pCaps->FVFCaps = D3DFVFCAPS_PSIZE | 0x80000;
|
||||||
|
pCaps->TextureOpCaps = 0xFFFFFFFF;
|
||||||
|
pCaps->MaxTextureBlendStages = 256;
|
||||||
|
pCaps->MaxSimultaneousTextures = 256;
|
||||||
|
|
||||||
|
pCaps->VertexProcessingCaps = D3DVTXPCAPS_DIRECTIONALLIGHTS | D3DVTXPCAPS_MATERIALSOURCE7 | D3DVTXPCAPS_POSITIONALLIGHTS | D3DVTXPCAPS_TEXGEN;
|
||||||
|
|
||||||
|
pCaps->MaxActiveLights = 8;
|
||||||
|
pCaps->MaxUserClipPlanes = 1;
|
||||||
|
pCaps->MaxVertexBlendMatrices = 1;
|
||||||
|
pCaps->MaxVertexBlendMatrixIndex = 1;
|
||||||
|
|
||||||
|
pCaps->MaxPointSize = 128.0;
|
||||||
|
|
||||||
|
pCaps->MaxPrimitiveCount = 0xFFFFFFFF;
|
||||||
|
pCaps->MaxVertexIndex = 0xFFFFFFFF;
|
||||||
|
pCaps->MaxStreams = 1;
|
||||||
|
pCaps->MaxStreamStride = 1024;
|
||||||
|
|
||||||
|
pCaps->VertexShaderVersion = 01;
|
||||||
|
pCaps->MaxVertexShaderConst = 1;
|
||||||
|
|
||||||
|
pCaps->PixelShaderVersion = 01;
|
||||||
|
pCaps->MaxPixelShaderValue = 1.0;
|
||||||
|
|
||||||
|
return D3D_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
HMONITOR WINAPI IDirect3D8Impl_GetAdapterMonitor (LPDIRECT3D8 iface,
|
||||||
|
UINT Adapter) {
|
||||||
|
ICOM_THIS(IDirect3D8Impl,iface);
|
||||||
|
FIXME("(%p)->(Adptr:%d)\n", This, Adapter);
|
||||||
|
return D3D_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
HRESULT WINAPI IDirect3D8Impl_CreateDevice (LPDIRECT3D8 iface,
|
||||||
|
UINT Adapter, D3DDEVTYPE DeviceType, HWND hFocusWindow,
|
||||||
|
DWORD BehaviourFlags, D3DPRESENT_PARAMETERS* pPresentationParameters,
|
||||||
|
IDirect3DDevice8** ppReturnedDeviceInterface) {
|
||||||
|
IDirect3DDevice8Impl *object;
|
||||||
|
HWND whichHWND;
|
||||||
|
|
||||||
|
ICOM_THIS(IDirect3D8Impl,iface);
|
||||||
|
TRACE("(%p)->(Adptr:%d, DevType: %x, FocusHwnd: %x, BehFlags: %lx, PresParms: %p, RetDevInt: %p)\n", This, Adapter, DeviceType,
|
||||||
|
hFocusWindow, BehaviourFlags, pPresentationParameters, ppReturnedDeviceInterface);
|
||||||
|
|
||||||
|
/* Allocate the storage for the device */
|
||||||
|
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirect3DDevice8Impl));
|
||||||
|
object->lpVtbl = &Direct3DDevice8_Vtbl;
|
||||||
|
object->ref = 1;
|
||||||
|
object->direct3d8 = This;
|
||||||
|
object->UpdateStateBlock = &object->StateBlock;
|
||||||
|
CreateStateBlock((LPDIRECT3DDEVICE8) object);
|
||||||
|
|
||||||
|
*ppReturnedDeviceInterface = (LPDIRECT3DDEVICE8)object;
|
||||||
|
|
||||||
|
/* Initialize settings */
|
||||||
|
memcpy(&object->PresentParms, pPresentationParameters, sizeof(D3DPRESENT_PARAMETERS));
|
||||||
|
memcpy(&object->StateBlock.transforms[D3DTS_WORLDMATRIX(0)], &idmatrix, sizeof(idmatrix));
|
||||||
|
memcpy(&object->StateBlock.transforms[D3DTS_PROJECTION], &idmatrix, sizeof(idmatrix));
|
||||||
|
memcpy(&object->StateBlock.transforms[D3DTS_VIEW], &idmatrix, sizeof(idmatrix));
|
||||||
|
|
||||||
|
object->PresentParms.BackBufferCount = 1; /* Opengl only supports one? */
|
||||||
|
pPresentationParameters->BackBufferCount = 1;
|
||||||
|
|
||||||
|
object->adapterNo = Adapter;
|
||||||
|
object->devType = DeviceType;
|
||||||
|
|
||||||
|
/* Initialize openGl */
|
||||||
|
{
|
||||||
|
HDC hDc;
|
||||||
|
int dblBuf[]={GLX_RGBA,GLX_DEPTH_SIZE,16,GLX_DOUBLEBUFFER,None};
|
||||||
|
/*int dblBuf[]={GLX_RGBA,GLX_DEPTH_SIZE,16, None}; // Useful for debugging */
|
||||||
|
|
||||||
|
/* Which hwnd are we using? */
|
||||||
|
/* if (pPresentationParameters->Windowed) { */
|
||||||
|
whichHWND = pPresentationParameters->hDeviceWindow;
|
||||||
|
if (!whichHWND) {
|
||||||
|
whichHWND = hFocusWindow;
|
||||||
|
}
|
||||||
|
object->win = (Window)GetPropA( whichHWND, "__wine_x11_client_window" );
|
||||||
|
/*
|
||||||
|
* } else {
|
||||||
|
* whichHWND = (HWND) GetDesktopWindow();
|
||||||
|
* object->win = (Window)GetPropA(whichHWND, "__wine_x11_whole_window" );
|
||||||
|
* root_window
|
||||||
|
* }
|
||||||
|
*/
|
||||||
|
|
||||||
|
hDc = GetDC(whichHWND);
|
||||||
|
object->display = get_display(hDc);
|
||||||
|
|
||||||
|
ENTER_GL();
|
||||||
|
object->visInfo = glXChooseVisual(object->display, DefaultScreen(object->display), dblBuf);
|
||||||
|
object->glCtx = glXCreateContext(object->display, object->visInfo, NULL, GL_TRUE);
|
||||||
|
LEAVE_GL();
|
||||||
|
ReleaseDC(whichHWND, hDc);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if (object->glCtx == NULL) {
|
||||||
|
ERR("Error in context creation !\n");
|
||||||
|
return D3DERR_INVALIDCALL;
|
||||||
|
} else {
|
||||||
|
TRACE("Context created (HWND=%x, glContext=%p, Window=%ld, VisInfo=%p)\n",
|
||||||
|
whichHWND, object->glCtx, object->win, object->visInfo);
|
||||||
|
}
|
||||||
|
|
||||||
|
TRACE("Creating back buffer\n");
|
||||||
|
/* MSDN: If Windowed is TRUE and either of the BackBufferWidth/Height values is zero,
|
||||||
|
then the corresponding dimension of the client area of the hDeviceWindow
|
||||||
|
(or the focus window, if hDeviceWindow is NULL) is taken. */
|
||||||
|
if (pPresentationParameters->Windowed && ((pPresentationParameters->BackBufferWidth == 0) ||
|
||||||
|
(pPresentationParameters->BackBufferHeight == 0))) {
|
||||||
|
RECT Rect;
|
||||||
|
|
||||||
|
GetClientRect(whichHWND, &Rect);
|
||||||
|
|
||||||
|
if (pPresentationParameters->BackBufferWidth == 0) {
|
||||||
|
pPresentationParameters->BackBufferWidth = Rect.right;
|
||||||
|
TRACE("Updating width to %d\n", pPresentationParameters->BackBufferWidth);
|
||||||
|
}
|
||||||
|
if (pPresentationParameters->BackBufferHeight == 0) {
|
||||||
|
pPresentationParameters->BackBufferHeight = Rect.bottom;
|
||||||
|
TRACE("Updating height to %d\n", pPresentationParameters->BackBufferHeight);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
IDirect3DDevice8Impl_CreateImageSurface((LPDIRECT3DDEVICE8) object,
|
||||||
|
pPresentationParameters->BackBufferWidth,
|
||||||
|
pPresentationParameters->BackBufferHeight,
|
||||||
|
pPresentationParameters->BackBufferFormat,
|
||||||
|
(LPDIRECT3DSURFACE8*) &object->backBuffer);
|
||||||
|
|
||||||
|
/* Now override the surface's Flip method (if in double buffering) ?COPIED from DDRAW!?
|
||||||
|
((x11_ds_private *) surface->private)->opengl_flip = TRUE;
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
struct _surface_chain *chain = surface->s.chain;
|
||||||
|
for (i=0;i<chain->nrofsurfaces;i++)
|
||||||
|
if (chain->surfaces[i]->s.surface_desc.ddsCaps.dwCaps & DDSCAPS_FLIP)
|
||||||
|
((x11_ds_private *) chain->surfaces[i]->private)->opengl_flip = TRUE;
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
ENTER_GL();
|
||||||
|
if (glXMakeCurrent(object->display, object->win, object->glCtx) == False) {
|
||||||
|
ERR("Error in setting current context (context %p drawable %ld)!\n",
|
||||||
|
object->glCtx, object->win);
|
||||||
|
}
|
||||||
|
checkGLcall("glXMakeCurrent");
|
||||||
|
|
||||||
|
/* Clear the screen */
|
||||||
|
glClearColor(1.0, 0.0, 0.0, 0.0);
|
||||||
|
checkGLcall("glClearColor");
|
||||||
|
glColor3f(1.0, 1.0, 1.0);
|
||||||
|
checkGLcall("glColor3f");
|
||||||
|
|
||||||
|
glEnable(GL_LIGHTING);
|
||||||
|
checkGLcall("glEnable");
|
||||||
|
|
||||||
|
glTexEnvf( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE_EXT);
|
||||||
|
checkGLcall("glTexEnvf( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE_EXT);");
|
||||||
|
|
||||||
|
LEAVE_GL();
|
||||||
|
|
||||||
|
{ /* Set a default viewport */
|
||||||
|
D3DVIEWPORT8 vp;
|
||||||
|
vp.X = 0;
|
||||||
|
vp.Y = 0;
|
||||||
|
vp.Width = pPresentationParameters->BackBufferWidth;
|
||||||
|
vp.Height = pPresentationParameters->BackBufferHeight;
|
||||||
|
vp.MinZ = 0.0f;
|
||||||
|
vp.MaxZ = 1.0f;
|
||||||
|
IDirect3DDevice8Impl_SetViewport((LPDIRECT3DDEVICE8) object, &vp);
|
||||||
|
}
|
||||||
|
|
||||||
|
TRACE("(%p,%d) incomplete\n", This, Adapter);
|
||||||
|
return D3D_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
ICOM_VTABLE(IDirect3D8) Direct3D8_Vtbl =
|
||||||
|
{
|
||||||
|
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
|
||||||
|
IDirect3D8Impl_QueryInterface,
|
||||||
|
IDirect3D8Impl_AddRef,
|
||||||
|
IDirect3D8Impl_Release,
|
||||||
|
IDirect3D8Impl_RegisterSoftwareDevice,
|
||||||
|
IDirect3D8Impl_GetAdapterCount,
|
||||||
|
IDirect3D8Impl_GetAdapterIdentifier,
|
||||||
|
IDirect3D8Impl_GetAdapterModeCount,
|
||||||
|
IDirect3D8Impl_EnumAdapterModes,
|
||||||
|
IDirect3D8Impl_GetAdapterDisplayMode,
|
||||||
|
IDirect3D8Impl_CheckDeviceType,
|
||||||
|
IDirect3D8Impl_CheckDeviceFormat,
|
||||||
|
IDirect3D8Impl_CheckDeviceMultiSampleType,
|
||||||
|
IDirect3D8Impl_CheckDepthStencilMatch,
|
||||||
|
IDirect3D8Impl_GetDeviceCaps,
|
||||||
|
IDirect3D8Impl_GetAdapterMonitor,
|
||||||
|
IDirect3D8Impl_CreateDevice
|
||||||
|
};
|
|
@ -0,0 +1,143 @@
|
||||||
|
/*
|
||||||
|
* IDirect3DIndexBuffer8 implementation
|
||||||
|
*
|
||||||
|
* Copyright 2002 Jason Edmeades
|
||||||
|
*
|
||||||
|
* This library is free software; you can redistribute it and/or
|
||||||
|
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "windef.h"
|
||||||
|
#include "winbase.h"
|
||||||
|
#include "winuser.h"
|
||||||
|
#include "wingdi.h"
|
||||||
|
#include "wine/debug.h"
|
||||||
|
|
||||||
|
#include "d3d8_private.h"
|
||||||
|
|
||||||
|
WINE_DEFAULT_DEBUG_CHANNEL(d3d);
|
||||||
|
|
||||||
|
/* IDirect3DIndexBuffer8 IUnknown parts follow: */
|
||||||
|
HRESULT WINAPI IDirect3DIndexBuffer8Impl_QueryInterface(LPDIRECT3DINDEXBUFFER8 iface,REFIID riid,LPVOID *ppobj)
|
||||||
|
{
|
||||||
|
ICOM_THIS(IDirect3DIndexBuffer8Impl,iface);
|
||||||
|
|
||||||
|
if (IsEqualGUID(riid, &IID_IUnknown)
|
||||||
|
|| IsEqualGUID(riid, &IID_IClassFactory)) {
|
||||||
|
IDirect3DIndexBuffer8Impl_AddRef(iface);
|
||||||
|
*ppobj = This;
|
||||||
|
return D3D_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppobj);
|
||||||
|
return E_NOINTERFACE;
|
||||||
|
}
|
||||||
|
|
||||||
|
ULONG WINAPI IDirect3DIndexBuffer8Impl_AddRef(LPDIRECT3DINDEXBUFFER8 iface) {
|
||||||
|
ICOM_THIS(IDirect3DIndexBuffer8Impl,iface);
|
||||||
|
TRACE("(%p) : AddRef from %ld\n", This, This->ref);
|
||||||
|
return ++(This->ref);
|
||||||
|
}
|
||||||
|
|
||||||
|
ULONG WINAPI IDirect3DIndexBuffer8Impl_Release(LPDIRECT3DINDEXBUFFER8 iface) {
|
||||||
|
ICOM_THIS(IDirect3DIndexBuffer8Impl,iface);
|
||||||
|
ULONG ref = --This->ref;
|
||||||
|
TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
|
||||||
|
if (ref == 0) {
|
||||||
|
HeapFree(GetProcessHeap(), 0, This);
|
||||||
|
HeapFree(GetProcessHeap(), 0, This->allocatedMemory);
|
||||||
|
}
|
||||||
|
return ref;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* IDirect3DResource Interface follow: */
|
||||||
|
HRESULT WINAPI IDirect3DIndexBuffer8Impl_GetDevice(LPDIRECT3DINDEXBUFFER8 iface, IDirect3DDevice8** ppDevice) {
|
||||||
|
ICOM_THIS(IDirect3DIndexBuffer8Impl,iface);
|
||||||
|
TRACE("(%p) : returning %p\n", This, This->Device);
|
||||||
|
*ppDevice = (LPDIRECT3DDEVICE8) This->Device;
|
||||||
|
return D3D_OK;
|
||||||
|
}
|
||||||
|
HRESULT WINAPI IDirect3DIndexBuffer8Impl_SetPrivateData(LPDIRECT3DINDEXBUFFER8 iface, REFGUID refguid, CONST void* pData, DWORD SizeOfData, DWORD Flags) {
|
||||||
|
ICOM_THIS(IDirect3DIndexBuffer8Impl,iface);
|
||||||
|
FIXME("(%p) : stub\n", This); return D3D_OK;
|
||||||
|
}
|
||||||
|
HRESULT WINAPI IDirect3DIndexBuffer8Impl_GetPrivateData(LPDIRECT3DINDEXBUFFER8 iface, REFGUID refguid, void* pData, DWORD* pSizeOfData) {
|
||||||
|
ICOM_THIS(IDirect3DIndexBuffer8Impl,iface);
|
||||||
|
FIXME("(%p) : stub\n", This); return D3D_OK;
|
||||||
|
}
|
||||||
|
HRESULT WINAPI IDirect3DIndexBuffer8Impl_FreePrivateData(LPDIRECT3DINDEXBUFFER8 iface, REFGUID refguid) {
|
||||||
|
ICOM_THIS(IDirect3DIndexBuffer8Impl,iface);
|
||||||
|
FIXME("(%p) : stub\n", This); return D3D_OK;
|
||||||
|
}
|
||||||
|
DWORD WINAPI IDirect3DIndexBuffer8Impl_SetPriority(LPDIRECT3DINDEXBUFFER8 iface, DWORD PriorityNew) {
|
||||||
|
ICOM_THIS(IDirect3DIndexBuffer8Impl,iface);
|
||||||
|
FIXME("(%p) : stub\n", This); return D3D_OK;
|
||||||
|
}
|
||||||
|
DWORD WINAPI IDirect3DIndexBuffer8Impl_GetPriority(LPDIRECT3DINDEXBUFFER8 iface) {
|
||||||
|
ICOM_THIS(IDirect3DIndexBuffer8Impl,iface);
|
||||||
|
FIXME("(%p) : stub\n", This); return D3D_OK;
|
||||||
|
}
|
||||||
|
void WINAPI IDirect3DIndexBuffer8Impl_PreLoad(LPDIRECT3DINDEXBUFFER8 iface) {
|
||||||
|
ICOM_THIS(IDirect3DIndexBuffer8Impl,iface);
|
||||||
|
FIXME("(%p) : stub\n", This);
|
||||||
|
}
|
||||||
|
D3DRESOURCETYPE WINAPI IDirect3DIndexBuffer8Impl_GetType(LPDIRECT3DINDEXBUFFER8 iface) {
|
||||||
|
ICOM_THIS(IDirect3DIndexBuffer8Impl,iface);
|
||||||
|
TRACE("(%p) : returning %d\n", This, This->ResourceType);
|
||||||
|
return This->ResourceType;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* IDirect3DIndexBuffer8 */
|
||||||
|
HRESULT WINAPI IDirect3DIndexBuffer8Impl_Lock(LPDIRECT3DINDEXBUFFER8 iface, UINT OffsetToLock, UINT SizeToLock, BYTE** ppbData, DWORD Flags) {
|
||||||
|
ICOM_THIS(IDirect3DIndexBuffer8Impl,iface);
|
||||||
|
if (OffsetToLock==0) {
|
||||||
|
TRACE("(%p) : no locking yet, offset %d, size %d, Flags=%lx\n", This, OffsetToLock, SizeToLock, Flags);
|
||||||
|
} else {
|
||||||
|
FIXME("(%p) : stub, offset %d, size %d, Flags=%lx\n", This, OffsetToLock, SizeToLock, Flags);
|
||||||
|
}
|
||||||
|
*ppbData = This->allocatedMemory;
|
||||||
|
return D3D_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
HRESULT WINAPI IDirect3DIndexBuffer8Impl_Unlock(LPDIRECT3DINDEXBUFFER8 iface) {
|
||||||
|
ICOM_THIS(IDirect3DIndexBuffer8Impl,iface);
|
||||||
|
TRACE("(%p) : stub\n", This);
|
||||||
|
return D3D_OK;
|
||||||
|
}
|
||||||
|
HRESULT WINAPI IDirect3DIndexBuffer8Impl_GetDesc(LPDIRECT3DINDEXBUFFER8 iface, D3DINDEXBUFFER_DESC *pDesc) {
|
||||||
|
ICOM_THIS(IDirect3DIndexBuffer8Impl,iface);
|
||||||
|
|
||||||
|
TRACE("(%p) : copying into %p\n", This, pDesc);
|
||||||
|
memcpy(pDesc, &This->currentDesc, sizeof(D3DINDEXBUFFER_DESC));
|
||||||
|
return D3D_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
ICOM_VTABLE(IDirect3DIndexBuffer8) Direct3DIndexBuffer8_Vtbl =
|
||||||
|
{
|
||||||
|
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
|
||||||
|
IDirect3DIndexBuffer8Impl_QueryInterface,
|
||||||
|
IDirect3DIndexBuffer8Impl_AddRef,
|
||||||
|
IDirect3DIndexBuffer8Impl_Release,
|
||||||
|
IDirect3DIndexBuffer8Impl_GetDevice,
|
||||||
|
IDirect3DIndexBuffer8Impl_SetPrivateData,
|
||||||
|
IDirect3DIndexBuffer8Impl_GetPrivateData,
|
||||||
|
IDirect3DIndexBuffer8Impl_FreePrivateData,
|
||||||
|
IDirect3DIndexBuffer8Impl_SetPriority,
|
||||||
|
IDirect3DIndexBuffer8Impl_GetPriority,
|
||||||
|
IDirect3DIndexBuffer8Impl_PreLoad,
|
||||||
|
IDirect3DIndexBuffer8Impl_GetType,
|
||||||
|
IDirect3DIndexBuffer8Impl_Lock,
|
||||||
|
IDirect3DIndexBuffer8Impl_Unlock,
|
||||||
|
IDirect3DIndexBuffer8Impl_GetDesc
|
||||||
|
};
|
|
@ -0,0 +1,113 @@
|
||||||
|
/*
|
||||||
|
* IDirect3DResource8 implementation
|
||||||
|
*
|
||||||
|
* Copyright 2002 Jason Edmeades
|
||||||
|
*
|
||||||
|
* This library is free software; you can redistribute it and/or
|
||||||
|
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "windef.h"
|
||||||
|
#include "winbase.h"
|
||||||
|
#include "winuser.h"
|
||||||
|
#include "wingdi.h"
|
||||||
|
#include "wine/debug.h"
|
||||||
|
|
||||||
|
#include "d3d8_private.h"
|
||||||
|
|
||||||
|
WINE_DEFAULT_DEBUG_CHANNEL(d3d);
|
||||||
|
|
||||||
|
/* IDirect3DResource IUnknown parts follow: */
|
||||||
|
HRESULT WINAPI IDirect3DResource8Impl_QueryInterface(LPDIRECT3DRESOURCE8 iface,REFIID riid,LPVOID *ppobj)
|
||||||
|
{
|
||||||
|
ICOM_THIS(IDirect3DResource8Impl,iface);
|
||||||
|
|
||||||
|
if (IsEqualGUID(riid, &IID_IUnknown)
|
||||||
|
|| IsEqualGUID(riid, &IID_IClassFactory)) {
|
||||||
|
IDirect3DResource8Impl_AddRef(iface);
|
||||||
|
*ppobj = This;
|
||||||
|
return D3D_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppobj);
|
||||||
|
return E_NOINTERFACE;
|
||||||
|
}
|
||||||
|
|
||||||
|
ULONG WINAPI IDirect3DResource8Impl_AddRef(LPDIRECT3DRESOURCE8 iface) {
|
||||||
|
ICOM_THIS(IDirect3DResource8Impl,iface);
|
||||||
|
TRACE("(%p) : AddRef from %ld\n", This, This->ref);
|
||||||
|
return ++(This->ref);
|
||||||
|
}
|
||||||
|
|
||||||
|
ULONG WINAPI IDirect3DResource8Impl_Release(LPDIRECT3DRESOURCE8 iface) {
|
||||||
|
ICOM_THIS(IDirect3DResource8Impl,iface);
|
||||||
|
ULONG ref = --This->ref;
|
||||||
|
TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
|
||||||
|
if (ref == 0)
|
||||||
|
HeapFree(GetProcessHeap(), 0, This);
|
||||||
|
return ref;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* IDirect3DResource Interface follow: */
|
||||||
|
HRESULT WINAPI IDirect3DResource8Impl_GetDevice(LPDIRECT3DRESOURCE8 iface, IDirect3DDevice8** ppDevice) {
|
||||||
|
ICOM_THIS(IDirect3DResource8Impl,iface);
|
||||||
|
TRACE("(%p) : returning %p\n", This, This->Device);
|
||||||
|
*ppDevice = (LPDIRECT3DDEVICE8) This->Device;
|
||||||
|
return D3D_OK;
|
||||||
|
}
|
||||||
|
HRESULT WINAPI IDirect3DResource8Impl_SetPrivateData(LPDIRECT3DRESOURCE8 iface, REFGUID refguid, CONST void* pData, DWORD SizeOfData, DWORD Flags) {
|
||||||
|
ICOM_THIS(IDirect3DResource8Impl,iface);
|
||||||
|
FIXME("(%p) : stub\n", This); return D3D_OK;
|
||||||
|
}
|
||||||
|
HRESULT WINAPI IDirect3DResource8Impl_GetPrivateData(LPDIRECT3DRESOURCE8 iface, REFGUID refguid, void* pData, DWORD* pSizeOfData) {
|
||||||
|
ICOM_THIS(IDirect3DResource8Impl,iface);
|
||||||
|
FIXME("(%p) : stub\n", This); return D3D_OK;
|
||||||
|
}
|
||||||
|
HRESULT WINAPI IDirect3DResource8Impl_FreePrivateData(LPDIRECT3DRESOURCE8 iface, REFGUID refguid) {
|
||||||
|
ICOM_THIS(IDirect3DResource8Impl,iface);
|
||||||
|
FIXME("(%p) : stub\n", This); return D3D_OK;
|
||||||
|
}
|
||||||
|
DWORD WINAPI IDirect3DResource8Impl_SetPriority(LPDIRECT3DRESOURCE8 iface, DWORD PriorityNew) {
|
||||||
|
ICOM_THIS(IDirect3DResource8Impl,iface);
|
||||||
|
FIXME("(%p) : stub\n", This); return D3D_OK;
|
||||||
|
}
|
||||||
|
DWORD WINAPI IDirect3DResource8Impl_GetPriority(LPDIRECT3DRESOURCE8 iface) {
|
||||||
|
ICOM_THIS(IDirect3DResource8Impl,iface);
|
||||||
|
FIXME("(%p) : stub\n", This); return D3D_OK;
|
||||||
|
}
|
||||||
|
void WINAPI IDirect3DResource8Impl_PreLoad(LPDIRECT3DRESOURCE8 iface) {
|
||||||
|
ICOM_THIS(IDirect3DResource8Impl,iface);
|
||||||
|
FIXME("(%p) : stub\n", This);
|
||||||
|
}
|
||||||
|
D3DRESOURCETYPE WINAPI IDirect3DResource8Impl_GetType(LPDIRECT3DRESOURCE8 iface) {
|
||||||
|
ICOM_THIS(IDirect3DResource8Impl,iface);
|
||||||
|
TRACE("(%p) : returning %d\n", This, This->ResourceType);
|
||||||
|
return This->ResourceType;
|
||||||
|
}
|
||||||
|
|
||||||
|
ICOM_VTABLE(IDirect3DResource8) Direct3DResource8_Vtbl =
|
||||||
|
{
|
||||||
|
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
|
||||||
|
IDirect3DResource8Impl_QueryInterface,
|
||||||
|
IDirect3DResource8Impl_AddRef,
|
||||||
|
IDirect3DResource8Impl_Release,
|
||||||
|
IDirect3DResource8Impl_GetDevice,
|
||||||
|
IDirect3DResource8Impl_SetPrivateData,
|
||||||
|
IDirect3DResource8Impl_GetPrivateData,
|
||||||
|
IDirect3DResource8Impl_FreePrivateData,
|
||||||
|
IDirect3DResource8Impl_SetPriority,
|
||||||
|
IDirect3DResource8Impl_GetPriority,
|
||||||
|
IDirect3DResource8Impl_PreLoad,
|
||||||
|
IDirect3DResource8Impl_GetType
|
||||||
|
};
|
|
@ -0,0 +1,148 @@
|
||||||
|
/*
|
||||||
|
* IDirect3DSurface8 implementation
|
||||||
|
*
|
||||||
|
* Copyright 2002 Jason Edmeades
|
||||||
|
*
|
||||||
|
* This library is free software; you can redistribute it and/or
|
||||||
|
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "windef.h"
|
||||||
|
#include "winbase.h"
|
||||||
|
#include "winuser.h"
|
||||||
|
#include "wingdi.h"
|
||||||
|
#include "wine/debug.h"
|
||||||
|
|
||||||
|
#include "d3d8_private.h"
|
||||||
|
|
||||||
|
WINE_DEFAULT_DEBUG_CHANNEL(d3d);
|
||||||
|
|
||||||
|
/* IDirect3DVolume IUnknown parts follow: */
|
||||||
|
HRESULT WINAPI IDirect3DSurface8Impl_QueryInterface(LPDIRECT3DSURFACE8 iface,REFIID riid,LPVOID *ppobj)
|
||||||
|
{
|
||||||
|
ICOM_THIS(IDirect3DSurface8Impl,iface);
|
||||||
|
|
||||||
|
if (IsEqualGUID(riid, &IID_IUnknown)
|
||||||
|
|| IsEqualGUID(riid, &IID_IClassFactory)) {
|
||||||
|
IDirect3DSurface8Impl_AddRef(iface);
|
||||||
|
*ppobj = This;
|
||||||
|
return D3D_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppobj);
|
||||||
|
return E_NOINTERFACE;
|
||||||
|
}
|
||||||
|
|
||||||
|
ULONG WINAPI IDirect3DSurface8Impl_AddRef(LPDIRECT3DSURFACE8 iface) {
|
||||||
|
ICOM_THIS(IDirect3DSurface8Impl,iface);
|
||||||
|
TRACE("(%p) : AddRef from %ld\n", This, This->ref);
|
||||||
|
return ++(This->ref);
|
||||||
|
}
|
||||||
|
|
||||||
|
ULONG WINAPI IDirect3DSurface8Impl_Release(LPDIRECT3DSURFACE8 iface) {
|
||||||
|
ICOM_THIS(IDirect3DSurface8Impl,iface);
|
||||||
|
ULONG ref = --This->ref;
|
||||||
|
TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
|
||||||
|
if (ref == 0) {
|
||||||
|
HeapFree(GetProcessHeap(), 0, This->allocatedMemory);
|
||||||
|
HeapFree(GetProcessHeap(), 0, This);
|
||||||
|
}
|
||||||
|
return ref;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* IDirect3DSurface8: */
|
||||||
|
HRESULT WINAPI IDirect3DSurface8Impl_GetDevice(LPDIRECT3DSURFACE8 iface, IDirect3DDevice8** ppDevice) {
|
||||||
|
ICOM_THIS(IDirect3DSurface8Impl,iface);
|
||||||
|
TRACE("(%p) : returning %p\n", This, This->Device);
|
||||||
|
*ppDevice = (LPDIRECT3DDEVICE8) This->Device;
|
||||||
|
return D3D_OK;
|
||||||
|
}
|
||||||
|
HRESULT WINAPI IDirect3DSurface8Impl_SetPrivateData(LPDIRECT3DSURFACE8 iface, REFGUID refguid,CONST void* pData,DWORD SizeOfData,DWORD Flags) {
|
||||||
|
ICOM_THIS(IDirect3DSurface8Impl,iface);
|
||||||
|
FIXME("(%p) : stub\n", This); return D3D_OK;
|
||||||
|
}
|
||||||
|
HRESULT WINAPI IDirect3DSurface8Impl_GetPrivateData(LPDIRECT3DSURFACE8 iface, REFGUID refguid,void* pData,DWORD* pSizeOfData) {
|
||||||
|
ICOM_THIS(IDirect3DSurface8Impl,iface);
|
||||||
|
FIXME("(%p) : stub\n", This); return D3D_OK;
|
||||||
|
}
|
||||||
|
HRESULT WINAPI IDirect3DSurface8Impl_FreePrivateData(LPDIRECT3DSURFACE8 iface, REFGUID refguid) {
|
||||||
|
ICOM_THIS(IDirect3DSurface8Impl,iface);
|
||||||
|
FIXME("(%p) : stub\n", This); return D3D_OK;
|
||||||
|
}
|
||||||
|
HRESULT WINAPI IDirect3DSurface8Impl_GetContainer(LPDIRECT3DSURFACE8 iface, REFIID riid,void** ppContainer) {
|
||||||
|
ICOM_THIS(IDirect3DSurface8Impl,iface);
|
||||||
|
TRACE("(%p) : returning %p\n", This, This->Container);
|
||||||
|
*ppContainer = This->Container;
|
||||||
|
return D3D_OK;
|
||||||
|
}
|
||||||
|
HRESULT WINAPI IDirect3DSurface8Impl_GetDesc(LPDIRECT3DSURFACE8 iface, D3DSURFACE_DESC *pDesc) {
|
||||||
|
ICOM_THIS(IDirect3DSurface8Impl,iface);
|
||||||
|
|
||||||
|
TRACE("(%p) : copying into %p\n", This, pDesc);
|
||||||
|
memcpy(pDesc, &This->myDesc, sizeof(D3DSURFACE_DESC));
|
||||||
|
return D3D_OK;
|
||||||
|
}
|
||||||
|
HRESULT WINAPI IDirect3DSurface8Impl_LockRect(LPDIRECT3DSURFACE8 iface, D3DLOCKED_RECT* pLockedRect, CONST RECT* pRect,DWORD Flags) {
|
||||||
|
ICOM_THIS(IDirect3DSurface8Impl,iface);
|
||||||
|
/* fixme: should we really lock as such? */
|
||||||
|
TRACE("(%p) : rect=%p, output prect=%p, allMem=%p\n", This, pRect, pLockedRect, This->allocatedMemory);
|
||||||
|
|
||||||
|
pLockedRect->Pitch = This->bytesPerPixel * This->myDesc.Width; /* Bytes / row */
|
||||||
|
if (!pRect) {
|
||||||
|
pLockedRect->pBits = This->allocatedMemory;
|
||||||
|
} else {
|
||||||
|
TRACE("Lock Rect (%p) = l %d, t %d, r %d, b %d\n", pRect, pRect->left, pRect->top, pRect->right, pRect->bottom);
|
||||||
|
pLockedRect->pBits = This->allocatedMemory + (pLockedRect->Pitch * pRect->top) + (pRect->left * This->bytesPerPixel);
|
||||||
|
}
|
||||||
|
TRACE("returning pBits=%p, pitch=%d\n", pLockedRect->pBits, pLockedRect->Pitch);
|
||||||
|
return D3D_OK;
|
||||||
|
}
|
||||||
|
HRESULT WINAPI IDirect3DSurface8Impl_UnlockRect(LPDIRECT3DSURFACE8 iface) {
|
||||||
|
ICOM_THIS(IDirect3DSurface8Impl,iface);
|
||||||
|
TRACE("(%p) : stub\n", This);
|
||||||
|
if (This->Container) {
|
||||||
|
IDirect3DBaseTexture8 *cont = This->Container;
|
||||||
|
|
||||||
|
/* Now setup the texture appropraitly */
|
||||||
|
int containerType = IDirect3DBaseTexture8Impl_GetType(cont);
|
||||||
|
if (containerType == D3DRTYPE_TEXTURE) {
|
||||||
|
IDirect3DTexture8Impl *pTexture = (IDirect3DTexture8Impl *)cont;
|
||||||
|
pTexture->Dirty = TRUE;
|
||||||
|
} else if (containerType == D3DRTYPE_CUBETEXTURE) {
|
||||||
|
IDirect3DCubeTexture8Impl *pTexture = (IDirect3DCubeTexture8Impl *)cont;
|
||||||
|
pTexture->Dirty = TRUE;
|
||||||
|
|
||||||
|
} else {
|
||||||
|
FIXME("Set dirty on container type %d\n", containerType);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return D3D_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
ICOM_VTABLE(IDirect3DSurface8) Direct3DSurface8_Vtbl =
|
||||||
|
{
|
||||||
|
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
|
||||||
|
IDirect3DSurface8Impl_QueryInterface,
|
||||||
|
IDirect3DSurface8Impl_AddRef,
|
||||||
|
IDirect3DSurface8Impl_Release,
|
||||||
|
IDirect3DSurface8Impl_GetDevice,
|
||||||
|
IDirect3DSurface8Impl_SetPrivateData,
|
||||||
|
IDirect3DSurface8Impl_GetPrivateData,
|
||||||
|
IDirect3DSurface8Impl_FreePrivateData,
|
||||||
|
IDirect3DSurface8Impl_GetContainer,
|
||||||
|
IDirect3DSurface8Impl_GetDesc,
|
||||||
|
IDirect3DSurface8Impl_LockRect,
|
||||||
|
IDirect3DSurface8Impl_UnlockRect,
|
||||||
|
};
|
|
@ -0,0 +1,81 @@
|
||||||
|
/*
|
||||||
|
* IDirect3DSwapChain8 implementation
|
||||||
|
*
|
||||||
|
* Copyright 2002 Jason Edmeades
|
||||||
|
*
|
||||||
|
* This library is free software; you can redistribute it and/or
|
||||||
|
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "windef.h"
|
||||||
|
#include "winbase.h"
|
||||||
|
#include "winuser.h"
|
||||||
|
#include "wingdi.h"
|
||||||
|
#include "wine/debug.h"
|
||||||
|
|
||||||
|
#include "d3d8_private.h"
|
||||||
|
|
||||||
|
WINE_DEFAULT_DEBUG_CHANNEL(d3d);
|
||||||
|
|
||||||
|
/* IDirect3DSwapChain IUnknown parts follow: */
|
||||||
|
HRESULT WINAPI IDirect3DSwapChain8Impl_QueryInterface(LPDIRECT3DSWAPCHAIN8 iface,REFIID riid,LPVOID *ppobj)
|
||||||
|
{
|
||||||
|
ICOM_THIS(IDirect3DSwapChain8Impl,iface);
|
||||||
|
|
||||||
|
if (IsEqualGUID(riid, &IID_IUnknown)
|
||||||
|
|| IsEqualGUID(riid, &IID_IClassFactory)) {
|
||||||
|
IDirect3DSwapChain8Impl_AddRef(iface);
|
||||||
|
*ppobj = This;
|
||||||
|
return D3D_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppobj);
|
||||||
|
return E_NOINTERFACE;
|
||||||
|
}
|
||||||
|
|
||||||
|
ULONG WINAPI IDirect3DSwapChain8Impl_AddRef(LPDIRECT3DSWAPCHAIN8 iface) {
|
||||||
|
ICOM_THIS(IDirect3DSwapChain8Impl,iface);
|
||||||
|
TRACE("(%p) : AddRef from %ld\n", This, This->ref);
|
||||||
|
return ++(This->ref);
|
||||||
|
}
|
||||||
|
|
||||||
|
ULONG WINAPI IDirect3DSwapChain8Impl_Release(LPDIRECT3DSWAPCHAIN8 iface) {
|
||||||
|
ICOM_THIS(IDirect3DSwapChain8Impl,iface);
|
||||||
|
ULONG ref = --This->ref;
|
||||||
|
TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
|
||||||
|
if (ref == 0)
|
||||||
|
HeapFree(GetProcessHeap(), 0, This);
|
||||||
|
return ref;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* IDirect3DSwapChain parts follow: */
|
||||||
|
HRESULT WINAPI IDirect3DSwapChain8Impl_Present(LPDIRECT3DSWAPCHAIN8 iface, CONST RECT* pSourceRect, CONST RECT* pDestRect, HWND hDestWindowOverride,CONST RGNDATA* pDirtyRegion) {
|
||||||
|
ICOM_THIS(IDirect3DSwapChain8Impl,iface);
|
||||||
|
FIXME("(%p) : stub\n", This); return D3D_OK;
|
||||||
|
}
|
||||||
|
HRESULT WINAPI IDirect3DSwapChain8Impl_GetBackBuffer(LPDIRECT3DSWAPCHAIN8 iface, UINT BackBuffer, D3DBACKBUFFER_TYPE Type,IDirect3DSurface8** ppBackBuffer) {
|
||||||
|
ICOM_THIS(IDirect3DSwapChain8Impl,iface);
|
||||||
|
FIXME("(%p) : stub\n", This); return D3D_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
ICOM_VTABLE(IDirect3DSwapChain8) Direct3DSwapChain8_Vtbl =
|
||||||
|
{
|
||||||
|
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
|
||||||
|
IDirect3DSwapChain8Impl_QueryInterface,
|
||||||
|
IDirect3DSwapChain8Impl_AddRef,
|
||||||
|
IDirect3DSwapChain8Impl_Release,
|
||||||
|
IDirect3DSwapChain8Impl_Present,
|
||||||
|
IDirect3DSwapChain8Impl_GetBackBuffer
|
||||||
|
};
|
|
@ -0,0 +1,188 @@
|
||||||
|
/*
|
||||||
|
* IDirect3DTexture8 implementation
|
||||||
|
*
|
||||||
|
* Copyright 2002 Jason Edmeades
|
||||||
|
*
|
||||||
|
* This library is free software; you can redistribute it and/or
|
||||||
|
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "windef.h"
|
||||||
|
#include "winbase.h"
|
||||||
|
#include "winuser.h"
|
||||||
|
#include "wingdi.h"
|
||||||
|
#include "wine/debug.h"
|
||||||
|
|
||||||
|
#include "d3d8_private.h"
|
||||||
|
|
||||||
|
WINE_DEFAULT_DEBUG_CHANNEL(d3d);
|
||||||
|
|
||||||
|
/* IDirect3DTexture8 IUnknown parts follow: */
|
||||||
|
HRESULT WINAPI IDirect3DTexture8Impl_QueryInterface(LPDIRECT3DTEXTURE8 iface,REFIID riid,LPVOID *ppobj)
|
||||||
|
{
|
||||||
|
ICOM_THIS(IDirect3DTexture8Impl,iface);
|
||||||
|
TRACE("(%p) : QueryInterface\n", This);
|
||||||
|
if (IsEqualGUID(riid, &IID_IUnknown)
|
||||||
|
|| IsEqualGUID(riid, &IID_IClassFactory)) {
|
||||||
|
IDirect3DTexture8Impl_AddRef(iface);
|
||||||
|
*ppobj = This;
|
||||||
|
return D3D_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppobj);
|
||||||
|
return E_NOINTERFACE;
|
||||||
|
}
|
||||||
|
|
||||||
|
ULONG WINAPI IDirect3DTexture8Impl_AddRef(LPDIRECT3DTEXTURE8 iface) {
|
||||||
|
ICOM_THIS(IDirect3DTexture8Impl,iface);
|
||||||
|
TRACE("(%p) : AddRef from %ld\n", This, This->ref);
|
||||||
|
return ++(This->ref);
|
||||||
|
}
|
||||||
|
|
||||||
|
ULONG WINAPI IDirect3DTexture8Impl_Release(LPDIRECT3DTEXTURE8 iface) {
|
||||||
|
ICOM_THIS(IDirect3DTexture8Impl,iface);
|
||||||
|
ULONG ref = --This->ref;
|
||||||
|
int i;
|
||||||
|
|
||||||
|
TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
|
||||||
|
if (ref == 0) {
|
||||||
|
for (i=0; i<This->levels; i++) {
|
||||||
|
if (This->surfaces[i] != NULL) {
|
||||||
|
TRACE("(%p) : Releasing surface %p\n", This, This->surfaces[i]);
|
||||||
|
IDirect3DSurface8Impl_Release((LPDIRECT3DSURFACE8) This->surfaces[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
HeapFree(GetProcessHeap(), 0, This);
|
||||||
|
}
|
||||||
|
return ref;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* IDirect3DTexture8 IDirect3DResource8 Interface follow: */
|
||||||
|
HRESULT WINAPI IDirect3DTexture8Impl_GetDevice(LPDIRECT3DTEXTURE8 iface, IDirect3DDevice8** ppDevice) {
|
||||||
|
ICOM_THIS(IDirect3DTexture8Impl,iface);
|
||||||
|
TRACE("(%p) : returning %p\n", This, This->Device);
|
||||||
|
*ppDevice = (LPDIRECT3DDEVICE8) This->Device;
|
||||||
|
return D3D_OK;
|
||||||
|
}
|
||||||
|
HRESULT WINAPI IDirect3DTexture8Impl_SetPrivateData(LPDIRECT3DTEXTURE8 iface, REFGUID refguid, CONST void* pData, DWORD SizeOfData, DWORD Flags) {
|
||||||
|
ICOM_THIS(IDirect3DTexture8Impl,iface);
|
||||||
|
FIXME("(%p) : stub\n", This); return D3D_OK;
|
||||||
|
}
|
||||||
|
HRESULT WINAPI IDirect3DTexture8Impl_GetPrivateData(LPDIRECT3DTEXTURE8 iface, REFGUID refguid, void* pData, DWORD* pSizeOfData) {
|
||||||
|
ICOM_THIS(IDirect3DTexture8Impl,iface);
|
||||||
|
FIXME("(%p) : stub\n", This); return D3D_OK;
|
||||||
|
}
|
||||||
|
HRESULT WINAPI IDirect3DTexture8Impl_FreePrivateData(LPDIRECT3DTEXTURE8 iface, REFGUID refguid) {
|
||||||
|
ICOM_THIS(IDirect3DTexture8Impl,iface);
|
||||||
|
FIXME("(%p) : stub\n", This); return D3D_OK;
|
||||||
|
}
|
||||||
|
DWORD WINAPI IDirect3DTexture8Impl_SetPriority(LPDIRECT3DTEXTURE8 iface, DWORD PriorityNew) {
|
||||||
|
ICOM_THIS(IDirect3DTexture8Impl,iface);
|
||||||
|
FIXME("(%p) : stub\n", This); return D3D_OK;
|
||||||
|
}
|
||||||
|
DWORD WINAPI IDirect3DTexture8Impl_GetPriority(LPDIRECT3DTEXTURE8 iface) {
|
||||||
|
ICOM_THIS(IDirect3DTexture8Impl,iface);
|
||||||
|
FIXME("(%p) : stub\n", This); return D3D_OK;
|
||||||
|
}
|
||||||
|
void WINAPI IDirect3DTexture8Impl_PreLoad(LPDIRECT3DTEXTURE8 iface) {
|
||||||
|
ICOM_THIS(IDirect3DTexture8Impl,iface);
|
||||||
|
FIXME("(%p) : stub\n", This);
|
||||||
|
}
|
||||||
|
D3DRESOURCETYPE WINAPI IDirect3DTexture8Impl_GetType(LPDIRECT3DTEXTURE8 iface) {
|
||||||
|
ICOM_THIS(IDirect3DTexture8Impl,iface);
|
||||||
|
TRACE("(%p) : is %d \n", This, This->ResourceType);
|
||||||
|
return This->ResourceType;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* IDirect3DTexture8 (Inherited from IDirect3DBaseTexture8) */
|
||||||
|
DWORD WINAPI IDirect3DTexture8Impl_SetLOD(LPDIRECT3DTEXTURE8 iface, DWORD LODNew) {
|
||||||
|
ICOM_THIS(IDirect3DTexture8Impl,iface);
|
||||||
|
FIXME("(%p) : stub\n", This); return D3D_OK;
|
||||||
|
}
|
||||||
|
DWORD WINAPI IDirect3DTexture8Impl_GetLOD(LPDIRECT3DTEXTURE8 iface) {
|
||||||
|
ICOM_THIS(IDirect3DTexture8Impl,iface);
|
||||||
|
FIXME("(%p) : stub\n", This); return D3D_OK;
|
||||||
|
}
|
||||||
|
DWORD WINAPI IDirect3DTexture8Impl_GetLevelCount(LPDIRECT3DTEXTURE8 iface) {
|
||||||
|
ICOM_THIS(IDirect3DTexture8Impl,iface);
|
||||||
|
TRACE("(%p) : returning %d\n", This, This->levels);
|
||||||
|
return This->levels;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* IDirect3DTexture8 */
|
||||||
|
HRESULT WINAPI IDirect3DTexture8Impl_GetLevelDesc(LPDIRECT3DTEXTURE8 iface, UINT Level,D3DSURFACE_DESC* pDesc) {
|
||||||
|
ICOM_THIS(IDirect3DTexture8Impl,iface);
|
||||||
|
|
||||||
|
if (Level < This->levels) {
|
||||||
|
TRACE("(%p) Level (%d)\n", This, Level);
|
||||||
|
return IDirect3DSurface8Impl_GetDesc((LPDIRECT3DSURFACE8)This->surfaces[Level], pDesc);
|
||||||
|
} else {
|
||||||
|
FIXME("(%p) Level (%d)\n", This, Level);
|
||||||
|
}
|
||||||
|
return D3D_OK;
|
||||||
|
}
|
||||||
|
HRESULT WINAPI IDirect3DTexture8Impl_GetSurfaceLevel(LPDIRECT3DTEXTURE8 iface, UINT Level,IDirect3DSurface8** ppSurfaceLevel) {
|
||||||
|
ICOM_THIS(IDirect3DTexture8Impl,iface);
|
||||||
|
*ppSurfaceLevel = (LPDIRECT3DSURFACE8)This->surfaces[Level];
|
||||||
|
IDirect3DSurface8Impl_AddRef((LPDIRECT3DSURFACE8)This->surfaces[Level]);
|
||||||
|
TRACE("(%p) : returning %p for level %d\n", This, *ppSurfaceLevel, Level);
|
||||||
|
return D3D_OK;
|
||||||
|
}
|
||||||
|
HRESULT WINAPI IDirect3DTexture8Impl_LockRect(LPDIRECT3DTEXTURE8 iface, UINT Level,D3DLOCKED_RECT* pLockedRect,CONST RECT* pRect,DWORD Flags) {
|
||||||
|
ICOM_THIS(IDirect3DTexture8Impl,iface);
|
||||||
|
TRACE("(%p) Level (%d)\n", This, Level);
|
||||||
|
if (Level < This->levels) {
|
||||||
|
return IDirect3DSurface8Impl_LockRect((LPDIRECT3DSURFACE8)This->surfaces[Level], pLockedRect, pRect, Flags);
|
||||||
|
} else {
|
||||||
|
FIXME("Levels seems too high?!!\n");
|
||||||
|
}
|
||||||
|
return D3D_OK;
|
||||||
|
}
|
||||||
|
HRESULT WINAPI IDirect3DTexture8Impl_UnlockRect(LPDIRECT3DTEXTURE8 iface, UINT Level) {
|
||||||
|
ICOM_THIS(IDirect3DTexture8Impl,iface);
|
||||||
|
This->Dirty = TRUE;
|
||||||
|
TRACE("(%p) : stub\n", This);
|
||||||
|
return D3D_OK;
|
||||||
|
}
|
||||||
|
HRESULT WINAPI IDirect3DTexture8Impl_AddDirtyRect(LPDIRECT3DTEXTURE8 iface, CONST RECT* pDirtyRect) {
|
||||||
|
ICOM_THIS(IDirect3DTexture8Impl,iface);
|
||||||
|
This->Dirty = TRUE;
|
||||||
|
FIXME("(%p) : stub\n", This); return D3D_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
ICOM_VTABLE(IDirect3DTexture8) Direct3DTexture8_Vtbl =
|
||||||
|
{
|
||||||
|
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
|
||||||
|
IDirect3DTexture8Impl_QueryInterface,
|
||||||
|
IDirect3DTexture8Impl_AddRef,
|
||||||
|
IDirect3DTexture8Impl_Release,
|
||||||
|
IDirect3DTexture8Impl_GetDevice,
|
||||||
|
IDirect3DTexture8Impl_SetPrivateData,
|
||||||
|
IDirect3DTexture8Impl_GetPrivateData,
|
||||||
|
IDirect3DTexture8Impl_FreePrivateData,
|
||||||
|
IDirect3DTexture8Impl_SetPriority,
|
||||||
|
IDirect3DTexture8Impl_GetPriority,
|
||||||
|
IDirect3DTexture8Impl_PreLoad,
|
||||||
|
IDirect3DTexture8Impl_GetType,
|
||||||
|
IDirect3DTexture8Impl_SetLOD,
|
||||||
|
IDirect3DTexture8Impl_GetLOD,
|
||||||
|
IDirect3DTexture8Impl_GetLevelCount,
|
||||||
|
IDirect3DTexture8Impl_GetLevelDesc,
|
||||||
|
IDirect3DTexture8Impl_GetSurfaceLevel,
|
||||||
|
IDirect3DTexture8Impl_LockRect,
|
||||||
|
IDirect3DTexture8Impl_UnlockRect,
|
||||||
|
IDirect3DTexture8Impl_AddDirtyRect
|
||||||
|
|
||||||
|
};
|
|
@ -0,0 +1,144 @@
|
||||||
|
/*
|
||||||
|
* IDirect3DResource8 implementation
|
||||||
|
*
|
||||||
|
* Copyright 2002 Jason Edmeades
|
||||||
|
*
|
||||||
|
* This library is free software; you can redistribute it and/or
|
||||||
|
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "windef.h"
|
||||||
|
#include "winbase.h"
|
||||||
|
#include "winuser.h"
|
||||||
|
#include "wingdi.h"
|
||||||
|
#include "wine/debug.h"
|
||||||
|
|
||||||
|
#include "d3d8_private.h"
|
||||||
|
|
||||||
|
WINE_DEFAULT_DEBUG_CHANNEL(d3d);
|
||||||
|
|
||||||
|
/* IDirect3DResource IUnknown parts follow: */
|
||||||
|
HRESULT WINAPI IDirect3DVertexBuffer8Impl_QueryInterface(LPDIRECT3DVERTEXBUFFER8 iface,REFIID riid,LPVOID *ppobj)
|
||||||
|
{
|
||||||
|
ICOM_THIS(IDirect3DVertexBuffer8Impl,iface);
|
||||||
|
|
||||||
|
if (IsEqualGUID(riid, &IID_IUnknown)
|
||||||
|
|| IsEqualGUID(riid, &IID_IClassFactory)) {
|
||||||
|
IDirect3DVertexBuffer8Impl_AddRef(iface);
|
||||||
|
*ppobj = This;
|
||||||
|
return D3D_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppobj);
|
||||||
|
return E_NOINTERFACE;
|
||||||
|
}
|
||||||
|
|
||||||
|
ULONG WINAPI IDirect3DVertexBuffer8Impl_AddRef(LPDIRECT3DVERTEXBUFFER8 iface) {
|
||||||
|
ICOM_THIS(IDirect3DVertexBuffer8Impl,iface);
|
||||||
|
TRACE("(%p) : AddRef from %ld\n", This, This->ref);
|
||||||
|
return ++(This->ref);
|
||||||
|
}
|
||||||
|
|
||||||
|
ULONG WINAPI IDirect3DVertexBuffer8Impl_Release(LPDIRECT3DVERTEXBUFFER8 iface) {
|
||||||
|
ICOM_THIS(IDirect3DVertexBuffer8Impl,iface);
|
||||||
|
ULONG ref = --This->ref;
|
||||||
|
TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
|
||||||
|
if (ref == 0) {
|
||||||
|
HeapFree(GetProcessHeap(), 0, This->allocatedMemory);
|
||||||
|
HeapFree(GetProcessHeap(), 0, This);
|
||||||
|
}
|
||||||
|
return ref;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* IDirect3DResource Interface follow: */
|
||||||
|
HRESULT WINAPI IDirect3DVertexBuffer8Impl_GetDevice(LPDIRECT3DVERTEXBUFFER8 iface, IDirect3DDevice8** ppDevice) {
|
||||||
|
ICOM_THIS(IDirect3DVertexBuffer8Impl,iface);
|
||||||
|
TRACE("(%p) : returning %p\n", This, This->Device);
|
||||||
|
*ppDevice = (LPDIRECT3DDEVICE8) This->Device;
|
||||||
|
return D3D_OK;
|
||||||
|
}
|
||||||
|
HRESULT WINAPI IDirect3DVertexBuffer8Impl_SetPrivateData(LPDIRECT3DVERTEXBUFFER8 iface, REFGUID refguid, CONST void* pData, DWORD SizeOfData, DWORD Flags) {
|
||||||
|
ICOM_THIS(IDirect3DVertexBuffer8Impl,iface);
|
||||||
|
FIXME("(%p) : stub\n", This); return D3D_OK;
|
||||||
|
}
|
||||||
|
HRESULT WINAPI IDirect3DVertexBuffer8Impl_GetPrivateData(LPDIRECT3DVERTEXBUFFER8 iface, REFGUID refguid, void* pData, DWORD* pSizeOfData) {
|
||||||
|
ICOM_THIS(IDirect3DVertexBuffer8Impl,iface);
|
||||||
|
FIXME("(%p) : stub\n", This); return D3D_OK;
|
||||||
|
}
|
||||||
|
HRESULT WINAPI IDirect3DVertexBuffer8Impl_FreePrivateData(LPDIRECT3DVERTEXBUFFER8 iface, REFGUID refguid) {
|
||||||
|
ICOM_THIS(IDirect3DVertexBuffer8Impl,iface);
|
||||||
|
FIXME("(%p) : stub\n", This); return D3D_OK;
|
||||||
|
}
|
||||||
|
DWORD WINAPI IDirect3DVertexBuffer8Impl_SetPriority(LPDIRECT3DVERTEXBUFFER8 iface, DWORD PriorityNew) {
|
||||||
|
ICOM_THIS(IDirect3DVertexBuffer8Impl,iface);
|
||||||
|
FIXME("(%p) : stub\n", This); return D3D_OK;
|
||||||
|
}
|
||||||
|
DWORD WINAPI IDirect3DVertexBuffer8Impl_GetPriority(LPDIRECT3DVERTEXBUFFER8 iface) {
|
||||||
|
ICOM_THIS(IDirect3DVertexBuffer8Impl,iface);
|
||||||
|
FIXME("(%p) : stub\n", This); return D3D_OK;
|
||||||
|
}
|
||||||
|
void WINAPI IDirect3DVertexBuffer8Impl_PreLoad(LPDIRECT3DVERTEXBUFFER8 iface) {
|
||||||
|
ICOM_THIS(IDirect3DVertexBuffer8Impl,iface);
|
||||||
|
FIXME("(%p) : stub\n", This);
|
||||||
|
}
|
||||||
|
D3DRESOURCETYPE WINAPI IDirect3DVertexBuffer8Impl_GetType(LPDIRECT3DVERTEXBUFFER8 iface) {
|
||||||
|
ICOM_THIS(IDirect3DVertexBuffer8Impl,iface);
|
||||||
|
TRACE("(%p) : returning %d\n", This, This->ResourceType);
|
||||||
|
return This->ResourceType;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* IDirect3DVertexBuffer8 */
|
||||||
|
HRESULT WINAPI IDirect3DVertexBuffer8Impl_Lock(LPDIRECT3DVERTEXBUFFER8 iface, UINT OffsetToLock, UINT SizeToLock, BYTE** ppbData, DWORD Flags) {
|
||||||
|
ICOM_THIS(IDirect3DVertexBuffer8Impl,iface);
|
||||||
|
if (OffsetToLock) FIXME("(%p) : with non-zero offset!!\n", This);
|
||||||
|
TRACE("(%p) : returning memory of %p\n", This, This->allocatedMemory);
|
||||||
|
*ppbData = This->allocatedMemory;
|
||||||
|
return D3D_OK;
|
||||||
|
}
|
||||||
|
HRESULT WINAPI IDirect3DVertexBuffer8Impl_Unlock(LPDIRECT3DVERTEXBUFFER8 iface) {
|
||||||
|
ICOM_THIS(IDirect3DVertexBuffer8Impl,iface);
|
||||||
|
TRACE("(%p) : stub\n", This);
|
||||||
|
return D3D_OK;
|
||||||
|
}
|
||||||
|
HRESULT WINAPI IDirect3DVertexBuffer8Impl_GetDesc(LPDIRECT3DVERTEXBUFFER8 iface, D3DVERTEXBUFFER_DESC *pDesc) {
|
||||||
|
ICOM_THIS(IDirect3DVertexBuffer8Impl,iface);
|
||||||
|
|
||||||
|
TRACE("(%p)\n", This);
|
||||||
|
pDesc->Format= This->currentDesc.Format;
|
||||||
|
pDesc->Type= This->currentDesc.Type;
|
||||||
|
pDesc->Usage= This->currentDesc.Usage;
|
||||||
|
pDesc->Pool= This->currentDesc.Pool;
|
||||||
|
pDesc->Size= This->currentDesc.Size;
|
||||||
|
pDesc->FVF= This->currentDesc.FVF;
|
||||||
|
return D3D_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
ICOM_VTABLE(IDirect3DVertexBuffer8) Direct3DVertexBuffer8_Vtbl =
|
||||||
|
{
|
||||||
|
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
|
||||||
|
IDirect3DVertexBuffer8Impl_QueryInterface,
|
||||||
|
IDirect3DVertexBuffer8Impl_AddRef,
|
||||||
|
IDirect3DVertexBuffer8Impl_Release,
|
||||||
|
IDirect3DVertexBuffer8Impl_GetDevice,
|
||||||
|
IDirect3DVertexBuffer8Impl_SetPrivateData,
|
||||||
|
IDirect3DVertexBuffer8Impl_GetPrivateData,
|
||||||
|
IDirect3DVertexBuffer8Impl_FreePrivateData,
|
||||||
|
IDirect3DVertexBuffer8Impl_SetPriority,
|
||||||
|
IDirect3DVertexBuffer8Impl_GetPriority,
|
||||||
|
IDirect3DVertexBuffer8Impl_PreLoad,
|
||||||
|
IDirect3DVertexBuffer8Impl_GetType,
|
||||||
|
IDirect3DVertexBuffer8Impl_Lock,
|
||||||
|
IDirect3DVertexBuffer8Impl_Unlock,
|
||||||
|
IDirect3DVertexBuffer8Impl_GetDesc
|
||||||
|
};
|
|
@ -0,0 +1,115 @@
|
||||||
|
/*
|
||||||
|
* IDirect3DVolume8 implementation
|
||||||
|
*
|
||||||
|
* Copyright 2002 Jason Edmeades
|
||||||
|
*
|
||||||
|
* This library is free software; you can redistribute it and/or
|
||||||
|
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "windef.h"
|
||||||
|
#include "winbase.h"
|
||||||
|
#include "winuser.h"
|
||||||
|
#include "wingdi.h"
|
||||||
|
#include "wine/debug.h"
|
||||||
|
|
||||||
|
#include "d3d8_private.h"
|
||||||
|
|
||||||
|
WINE_DEFAULT_DEBUG_CHANNEL(d3d);
|
||||||
|
|
||||||
|
/* IDirect3DVolume IUnknown parts follow: */
|
||||||
|
HRESULT WINAPI IDirect3DVolume8Impl_QueryInterface(LPDIRECT3DVOLUME8 iface,REFIID riid,LPVOID *ppobj)
|
||||||
|
{
|
||||||
|
ICOM_THIS(IDirect3DVolume8Impl,iface);
|
||||||
|
|
||||||
|
if (IsEqualGUID(riid, &IID_IUnknown)
|
||||||
|
|| IsEqualGUID(riid, &IID_IClassFactory)) {
|
||||||
|
IDirect3DVolume8Impl_AddRef(iface);
|
||||||
|
*ppobj = This;
|
||||||
|
return D3D_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppobj);
|
||||||
|
return E_NOINTERFACE;
|
||||||
|
}
|
||||||
|
|
||||||
|
ULONG WINAPI IDirect3DVolume8Impl_AddRef(LPDIRECT3DVOLUME8 iface) {
|
||||||
|
ICOM_THIS(IDirect3DVolume8Impl,iface);
|
||||||
|
TRACE("(%p) : AddRef from %ld\n", This, This->ref);
|
||||||
|
return ++(This->ref);
|
||||||
|
}
|
||||||
|
|
||||||
|
ULONG WINAPI IDirect3DVolume8Impl_Release(LPDIRECT3DVOLUME8 iface) {
|
||||||
|
ICOM_THIS(IDirect3DVolume8Impl,iface);
|
||||||
|
ULONG ref = --This->ref;
|
||||||
|
TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
|
||||||
|
if (ref == 0)
|
||||||
|
HeapFree(GetProcessHeap(), 0, This);
|
||||||
|
return ref;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* IDirect3DVolume8: */
|
||||||
|
HRESULT WINAPI IDirect3DVolume8Impl_GetDevice(LPDIRECT3DVOLUME8 iface, IDirect3DDevice8** ppDevice) {
|
||||||
|
ICOM_THIS(IDirect3DVolume8Impl,iface);
|
||||||
|
TRACE("(%p) : returning %p\n", This, This->Device);
|
||||||
|
*ppDevice = (LPDIRECT3DDEVICE8) This->Device;
|
||||||
|
return D3D_OK;
|
||||||
|
}
|
||||||
|
HRESULT WINAPI IDirect3DVolume8Impl_SetPrivateData(LPDIRECT3DVOLUME8 iface, REFGUID refguid, CONST void* pData, DWORD SizeOfData, DWORD Flags) {
|
||||||
|
ICOM_THIS(IDirect3DVolume8Impl,iface);
|
||||||
|
FIXME("(%p) : stub\n", This); return D3D_OK;
|
||||||
|
}
|
||||||
|
HRESULT WINAPI IDirect3DVolume8Impl_GetPrivateData(LPDIRECT3DVOLUME8 iface, REFGUID refguid, void* pData, DWORD* pSizeOfData) {
|
||||||
|
ICOM_THIS(IDirect3DVolume8Impl,iface);
|
||||||
|
FIXME("(%p) : stub\n", This); return D3D_OK;
|
||||||
|
}
|
||||||
|
HRESULT WINAPI IDirect3DVolume8Impl_FreePrivateData(LPDIRECT3DVOLUME8 iface, REFGUID refguid) {
|
||||||
|
ICOM_THIS(IDirect3DVolume8Impl,iface);
|
||||||
|
FIXME("(%p) : stub\n", This); return D3D_OK;
|
||||||
|
}
|
||||||
|
HRESULT WINAPI IDirect3DVolume8Impl_GetContainer(LPDIRECT3DVOLUME8 iface, REFIID riid, void** ppContainer) {
|
||||||
|
ICOM_THIS(IDirect3DVolume8Impl,iface);
|
||||||
|
TRACE("(%p) : returning %p\n", This, This->Container);
|
||||||
|
*ppContainer = This->Container;
|
||||||
|
return D3D_OK;
|
||||||
|
}
|
||||||
|
HRESULT WINAPI IDirect3DVolume8Impl_GetDesc(LPDIRECT3DVOLUME8 iface, D3DVOLUME_DESC* pDesc) {
|
||||||
|
ICOM_THIS(IDirect3DVolume8Impl,iface);
|
||||||
|
FIXME("(%p) : stub\n", This); return D3D_OK;
|
||||||
|
}
|
||||||
|
HRESULT WINAPI IDirect3DVolume8Impl_LockBox(LPDIRECT3DVOLUME8 iface, D3DLOCKED_BOX* pLockedVolume,CONST D3DBOX* pBox, DWORD Flags) {
|
||||||
|
ICOM_THIS(IDirect3DVolume8Impl,iface);
|
||||||
|
FIXME("(%p) : stub\n", This); return D3D_OK;
|
||||||
|
}
|
||||||
|
HRESULT WINAPI IDirect3DVolume8Impl_UnlockBox(LPDIRECT3DVOLUME8 iface) {
|
||||||
|
ICOM_THIS(IDirect3DVolume8Impl,iface);
|
||||||
|
FIXME("(%p) : stub\n", This); return D3D_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
ICOM_VTABLE(IDirect3DVolume8) Direct3DVolume8_Vtbl =
|
||||||
|
{
|
||||||
|
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
|
||||||
|
IDirect3DVolume8Impl_QueryInterface,
|
||||||
|
IDirect3DVolume8Impl_AddRef,
|
||||||
|
IDirect3DVolume8Impl_Release,
|
||||||
|
IDirect3DVolume8Impl_GetDevice,
|
||||||
|
IDirect3DVolume8Impl_SetPrivateData,
|
||||||
|
IDirect3DVolume8Impl_GetPrivateData,
|
||||||
|
IDirect3DVolume8Impl_FreePrivateData,
|
||||||
|
IDirect3DVolume8Impl_GetContainer,
|
||||||
|
IDirect3DVolume8Impl_GetDesc,
|
||||||
|
IDirect3DVolume8Impl_LockBox,
|
||||||
|
IDirect3DVolume8Impl_UnlockBox
|
||||||
|
};
|
|
@ -0,0 +1,160 @@
|
||||||
|
/*
|
||||||
|
* IDirect3DVolumeTexture8 implementation
|
||||||
|
*
|
||||||
|
* Copyright 2002 Jason Edmeades
|
||||||
|
*
|
||||||
|
* This library is free software; you can redistribute it and/or
|
||||||
|
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#include "windef.h"
|
||||||
|
#include "winbase.h"
|
||||||
|
#include "winuser.h"
|
||||||
|
#include "wingdi.h"
|
||||||
|
#include "wine/debug.h"
|
||||||
|
|
||||||
|
#include "d3d8_private.h"
|
||||||
|
|
||||||
|
WINE_DEFAULT_DEBUG_CHANNEL(d3d);
|
||||||
|
|
||||||
|
/* IDirect3DVolumeTexture8 IUnknown parts follow: */
|
||||||
|
HRESULT WINAPI IDirect3DVolumeTexture8Impl_QueryInterface(LPDIRECT3DVOLUMETEXTURE8 iface,REFIID riid,LPVOID *ppobj)
|
||||||
|
{
|
||||||
|
ICOM_THIS(IDirect3DVolumeTexture8Impl,iface);
|
||||||
|
|
||||||
|
TRACE("(%p) : QueryInterface\n", This);
|
||||||
|
if (IsEqualGUID(riid, &IID_IUnknown)
|
||||||
|
|| IsEqualGUID(riid, &IID_IClassFactory)) {
|
||||||
|
IDirect3DVolumeTexture8Impl_AddRef(iface);
|
||||||
|
*ppobj = This;
|
||||||
|
return D3D_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppobj);
|
||||||
|
return E_NOINTERFACE;
|
||||||
|
}
|
||||||
|
|
||||||
|
ULONG WINAPI IDirect3DVolumeTexture8Impl_AddRef(LPDIRECT3DVOLUMETEXTURE8 iface) {
|
||||||
|
ICOM_THIS(IDirect3DVolumeTexture8Impl,iface);
|
||||||
|
TRACE("(%p) : AddRef from %ld\n", This, This->ref);
|
||||||
|
return ++(This->ref);
|
||||||
|
}
|
||||||
|
|
||||||
|
ULONG WINAPI IDirect3DVolumeTexture8Impl_Release(LPDIRECT3DVOLUMETEXTURE8 iface) {
|
||||||
|
ICOM_THIS(IDirect3DVolumeTexture8Impl,iface);
|
||||||
|
ULONG ref = --This->ref;
|
||||||
|
TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
|
||||||
|
if (ref == 0)
|
||||||
|
HeapFree(GetProcessHeap(), 0, This);
|
||||||
|
return ref;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* IDirect3DVolumeTexture8 IDirect3DResource8 Interface follow: */
|
||||||
|
HRESULT WINAPI IDirect3DVolumeTexture8Impl_GetDevice(LPDIRECT3DVOLUMETEXTURE8 iface, IDirect3DDevice8** ppDevice) {
|
||||||
|
ICOM_THIS(IDirect3DVolumeTexture8Impl,iface);
|
||||||
|
TRACE("(%p) : returning %p\n", This, This->Device);
|
||||||
|
*ppDevice = (LPDIRECT3DDEVICE8) This->Device;
|
||||||
|
return D3D_OK;
|
||||||
|
}
|
||||||
|
HRESULT WINAPI IDirect3DVolumeTexture8Impl_SetPrivateData(LPDIRECT3DVOLUMETEXTURE8 iface, REFGUID refguid, CONST void* pData, DWORD SizeOfData, DWORD Flags) {
|
||||||
|
ICOM_THIS(IDirect3DVolumeTexture8Impl,iface);
|
||||||
|
FIXME("(%p) : stub\n", This); return D3D_OK;
|
||||||
|
}
|
||||||
|
HRESULT WINAPI IDirect3DVolumeTexture8Impl_GetPrivateData(LPDIRECT3DVOLUMETEXTURE8 iface, REFGUID refguid, void* pData, DWORD* pSizeOfData) {
|
||||||
|
ICOM_THIS(IDirect3DVolumeTexture8Impl,iface);
|
||||||
|
FIXME("(%p) : stub\n", This); return D3D_OK;
|
||||||
|
}
|
||||||
|
HRESULT WINAPI IDirect3DVolumeTexture8Impl_FreePrivateData(LPDIRECT3DVOLUMETEXTURE8 iface, REFGUID refguid) {
|
||||||
|
ICOM_THIS(IDirect3DVolumeTexture8Impl,iface);
|
||||||
|
FIXME("(%p) : stub\n", This); return D3D_OK;
|
||||||
|
}
|
||||||
|
DWORD WINAPI IDirect3DVolumeTexture8Impl_SetPriority(LPDIRECT3DVOLUMETEXTURE8 iface, DWORD PriorityNew) {
|
||||||
|
ICOM_THIS(IDirect3DVolumeTexture8Impl,iface);
|
||||||
|
FIXME("(%p) : stub\n", This); return D3D_OK;
|
||||||
|
}
|
||||||
|
DWORD WINAPI IDirect3DVolumeTexture8Impl_GetPriority(LPDIRECT3DVOLUMETEXTURE8 iface) {
|
||||||
|
ICOM_THIS(IDirect3DVolumeTexture8Impl,iface);
|
||||||
|
FIXME("(%p) : stub\n", This); return D3D_OK;
|
||||||
|
}
|
||||||
|
void WINAPI IDirect3DVolumeTexture8Impl_PreLoad(LPDIRECT3DVOLUMETEXTURE8 iface) {
|
||||||
|
ICOM_THIS(IDirect3DVolumeTexture8Impl,iface);
|
||||||
|
FIXME("(%p) : stub\n", This);
|
||||||
|
}
|
||||||
|
D3DRESOURCETYPE WINAPI IDirect3DVolumeTexture8Impl_GetType(LPDIRECT3DVOLUMETEXTURE8 iface) {
|
||||||
|
ICOM_THIS(IDirect3DVolumeTexture8Impl,iface);
|
||||||
|
TRACE("(%p) : returning %d\n", This, This->ResourceType);
|
||||||
|
return This->ResourceType;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* IDirect3DVolumeTexture8 (Inherited from IDirect3DBaseTexture8) */
|
||||||
|
DWORD WINAPI IDirect3DVolumeTexture8Impl_SetLOD(LPDIRECT3DVOLUMETEXTURE8 iface, DWORD LODNew) {
|
||||||
|
ICOM_THIS(IDirect3DVolumeTexture8Impl,iface);
|
||||||
|
FIXME("(%p) : stub\n", This); return D3D_OK;
|
||||||
|
}
|
||||||
|
DWORD WINAPI IDirect3DVolumeTexture8Impl_GetLOD(LPDIRECT3DVOLUMETEXTURE8 iface) {
|
||||||
|
ICOM_THIS(IDirect3DVolumeTexture8Impl,iface);
|
||||||
|
FIXME("(%p) : stub\n", This); return D3D_OK;
|
||||||
|
}
|
||||||
|
DWORD WINAPI IDirect3DVolumeTexture8Impl_GetLevelCount(LPDIRECT3DVOLUMETEXTURE8 iface) {
|
||||||
|
ICOM_THIS(IDirect3DVolumeTexture8Impl,iface);
|
||||||
|
FIXME("(%p) : stub\n", This); return D3D_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* IDirect3DVolumeTexture8 */
|
||||||
|
HRESULT WINAPI IDirect3DVolumeTexture8Impl_GetLevelDesc(LPDIRECT3DVOLUMETEXTURE8 iface, UINT Level,D3DVOLUME_DESC *pDesc) {
|
||||||
|
ICOM_THIS(IDirect3DVolumeTexture8Impl,iface);
|
||||||
|
FIXME("(%p) : stub\n", This); return D3D_OK;
|
||||||
|
}
|
||||||
|
HRESULT WINAPI IDirect3DVolumeTexture8Impl_GetVolumeLevel(LPDIRECT3DVOLUMETEXTURE8 iface, UINT Level,IDirect3DVolume8** ppVolumeLevel) {
|
||||||
|
ICOM_THIS(IDirect3DVolumeTexture8Impl,iface);
|
||||||
|
FIXME("(%p) : stub\n", This); return D3D_OK;
|
||||||
|
}
|
||||||
|
HRESULT WINAPI IDirect3DVolumeTexture8Impl_LockBox(LPDIRECT3DVOLUMETEXTURE8 iface, UINT Level,D3DLOCKED_BOX* pLockedVolume,CONST D3DBOX* pBox,DWORD Flags) {
|
||||||
|
ICOM_THIS(IDirect3DVolumeTexture8Impl,iface);
|
||||||
|
FIXME("(%p) : stub\n", This); return D3D_OK;
|
||||||
|
}
|
||||||
|
HRESULT WINAPI IDirect3DVolumeTexture8Impl_UnlockBox(LPDIRECT3DVOLUMETEXTURE8 iface, UINT Level) {
|
||||||
|
ICOM_THIS(IDirect3DVolumeTexture8Impl,iface);
|
||||||
|
FIXME("(%p) : stub\n", This); return D3D_OK;
|
||||||
|
}
|
||||||
|
HRESULT WINAPI IDirect3DVolumeTexture8Impl_AddDirtyBox(LPDIRECT3DVOLUMETEXTURE8 iface, CONST D3DBOX* pDirtyBox) {
|
||||||
|
ICOM_THIS(IDirect3DVolumeTexture8Impl,iface);
|
||||||
|
FIXME("(%p) : stub\n", This); return D3D_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
ICOM_VTABLE(IDirect3DVolumeTexture8) Direct3DVolumeTexture8_Vtbl =
|
||||||
|
{
|
||||||
|
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
|
||||||
|
IDirect3DVolumeTexture8Impl_QueryInterface,
|
||||||
|
IDirect3DVolumeTexture8Impl_AddRef,
|
||||||
|
IDirect3DVolumeTexture8Impl_Release,
|
||||||
|
IDirect3DVolumeTexture8Impl_GetDevice,
|
||||||
|
IDirect3DVolumeTexture8Impl_SetPrivateData,
|
||||||
|
IDirect3DVolumeTexture8Impl_GetPrivateData,
|
||||||
|
IDirect3DVolumeTexture8Impl_FreePrivateData,
|
||||||
|
IDirect3DVolumeTexture8Impl_SetPriority,
|
||||||
|
IDirect3DVolumeTexture8Impl_GetPriority,
|
||||||
|
IDirect3DVolumeTexture8Impl_PreLoad,
|
||||||
|
IDirect3DVolumeTexture8Impl_GetType,
|
||||||
|
IDirect3DVolumeTexture8Impl_SetLOD,
|
||||||
|
IDirect3DVolumeTexture8Impl_GetLOD,
|
||||||
|
IDirect3DVolumeTexture8Impl_GetLevelCount,
|
||||||
|
IDirect3DVolumeTexture8Impl_GetLevelDesc,
|
||||||
|
IDirect3DVolumeTexture8Impl_GetVolumeLevel,
|
||||||
|
IDirect3DVolumeTexture8Impl_LockBox,
|
||||||
|
IDirect3DVolumeTexture8Impl_UnlockBox,
|
||||||
|
IDirect3DVolumeTexture8Impl_AddDirtyBox
|
||||||
|
};
|
Loading…
Reference in New Issue