1999-01-03 18:00:19 +01:00
|
|
|
/* Direct3D Viewport
|
|
|
|
(c) 1998 Lionel ULMER
|
|
|
|
|
|
|
|
This files contains the implementation of Direct3DViewport2. */
|
|
|
|
|
|
|
|
#include "config.h"
|
1999-03-14 17:35:05 +01:00
|
|
|
#include "windef.h"
|
1999-01-03 18:00:19 +01:00
|
|
|
#include "winerror.h"
|
1999-02-02 17:14:23 +01:00
|
|
|
#include "wine/obj_base.h"
|
1999-01-03 18:00:19 +01:00
|
|
|
#include "heap.h"
|
|
|
|
#include "ddraw.h"
|
|
|
|
#include "d3d.h"
|
1999-06-26 21:09:08 +02:00
|
|
|
#include "debugtools.h"
|
1999-05-13 20:53:05 +02:00
|
|
|
#include "x11drv.h"
|
1999-01-03 18:00:19 +01:00
|
|
|
|
|
|
|
#include "d3d_private.h"
|
2000-05-12 22:18:14 +02:00
|
|
|
#include "mesa_private.h"
|
1999-01-03 18:00:19 +01:00
|
|
|
|
2000-11-28 00:54:25 +01:00
|
|
|
DEFAULT_DEBUG_CHANNEL(ddraw);
|
1999-04-19 16:56:29 +02:00
|
|
|
|
2000-05-12 22:18:14 +02:00
|
|
|
#ifdef HAVE_OPENGL
|
|
|
|
|
|
|
|
#define D3DVPRIVATE(x) mesa_d3dv_private*dvpriv=((mesa_d3dv_private*)x->private)
|
|
|
|
#define D3DLPRIVATE(x) mesa_d3dl_private*dlpriv=((mesa_d3dl_private*)x->private)
|
1999-01-03 18:00:19 +01:00
|
|
|
|
1999-03-27 17:56:13 +01:00
|
|
|
static ICOM_VTABLE(IDirect3DViewport2) viewport2_vtable;
|
1999-01-03 18:00:19 +01:00
|
|
|
|
|
|
|
/*******************************************************************************
|
|
|
|
* Viewport1/2 static functions
|
|
|
|
*/
|
1999-03-27 17:56:13 +01:00
|
|
|
static void activate(IDirect3DViewport2Impl* This) {
|
|
|
|
IDirect3DLightImpl* l;
|
1999-01-03 18:00:19 +01:00
|
|
|
|
|
|
|
/* Activate all the lights associated with this context */
|
1999-03-27 17:56:13 +01:00
|
|
|
l = This->lights;
|
1999-01-03 18:00:19 +01:00
|
|
|
|
|
|
|
while (l != NULL) {
|
|
|
|
l->activate(l);
|
|
|
|
l = l->next;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/*******************************************************************************
|
|
|
|
* Viewport1/2 Creation functions
|
|
|
|
*/
|
1999-03-27 17:56:13 +01:00
|
|
|
LPDIRECT3DVIEWPORT2 d3dviewport2_create(IDirect3D2Impl* d3d2)
|
1999-01-03 18:00:19 +01:00
|
|
|
{
|
1999-03-27 17:56:13 +01:00
|
|
|
IDirect3DViewport2Impl* vp;
|
1999-01-03 18:00:19 +01:00
|
|
|
|
1999-03-27 17:56:13 +01:00
|
|
|
vp = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(IDirect3DViewport2Impl));
|
2000-05-12 22:18:14 +02:00
|
|
|
vp->private = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(mesa_d3dv_private));
|
1999-01-03 18:00:19 +01:00
|
|
|
vp->ref = 1;
|
1999-10-31 02:59:23 +01:00
|
|
|
ICOM_VTBL(vp) = &viewport2_vtable;
|
1999-03-27 17:56:13 +01:00
|
|
|
vp->d3d.d3d2 = d3d2;
|
1999-01-03 18:00:19 +01:00
|
|
|
vp->use_d3d2 = 1;
|
|
|
|
|
|
|
|
vp->device.active_device2 = NULL;
|
|
|
|
vp->activate = activate;
|
|
|
|
|
|
|
|
vp->lights = NULL;
|
|
|
|
|
2000-05-12 22:18:14 +02:00
|
|
|
((mesa_d3dv_private *) vp->private)->nextlight = GL_LIGHT0;
|
1999-01-03 18:00:19 +01:00
|
|
|
|
1999-03-27 17:56:13 +01:00
|
|
|
return (LPDIRECT3DVIEWPORT2)vp;
|
1999-01-03 18:00:19 +01:00
|
|
|
}
|
|
|
|
|
1999-03-27 17:56:13 +01:00
|
|
|
LPDIRECT3DVIEWPORT d3dviewport_create(IDirect3DImpl* d3d1)
|
1999-01-03 18:00:19 +01:00
|
|
|
{
|
1999-03-27 17:56:13 +01:00
|
|
|
IDirect3DViewport2Impl* vp;
|
1999-01-03 18:00:19 +01:00
|
|
|
|
1999-03-27 17:56:13 +01:00
|
|
|
vp = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(IDirect3DViewport2Impl));
|
2000-05-12 22:18:14 +02:00
|
|
|
vp->private = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(mesa_d3dv_private));
|
1999-01-03 18:00:19 +01:00
|
|
|
vp->ref = 1;
|
1999-10-31 02:59:23 +01:00
|
|
|
ICOM_VTBL(vp) = &viewport2_vtable;
|
1999-03-27 17:56:13 +01:00
|
|
|
vp->d3d.d3d1 = d3d1;
|
1999-01-03 18:00:19 +01:00
|
|
|
vp->use_d3d2 = 0;
|
|
|
|
|
|
|
|
vp->device.active_device1 = NULL;
|
|
|
|
vp->activate = activate;
|
|
|
|
|
|
|
|
vp->lights = NULL;
|
|
|
|
|
2000-05-12 22:18:14 +02:00
|
|
|
((mesa_d3dv_private *) vp->private)->nextlight = GL_LIGHT0;
|
1999-01-03 18:00:19 +01:00
|
|
|
|
|
|
|
return (LPDIRECT3DVIEWPORT) vp;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*******************************************************************************
|
|
|
|
* IDirect3DViewport2 methods
|
|
|
|
*/
|
|
|
|
|
2000-05-12 22:18:14 +02:00
|
|
|
HRESULT WINAPI IDirect3DViewport2Impl_QueryInterface(LPDIRECT3DVIEWPORT2 iface,
|
1999-01-03 18:00:19 +01:00
|
|
|
REFIID riid,
|
|
|
|
LPVOID* ppvObj)
|
|
|
|
{
|
1999-03-27 17:56:13 +01:00
|
|
|
ICOM_THIS(IDirect3DViewport2Impl,iface);
|
1999-01-03 18:00:19 +01:00
|
|
|
|
2000-01-18 06:09:49 +01:00
|
|
|
FIXME("(%p)->(%s,%p): stub\n", This, debugstr_guid(riid),ppvObj);
|
1999-01-03 18:00:19 +01:00
|
|
|
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2000-05-12 22:18:14 +02:00
|
|
|
ULONG WINAPI IDirect3DViewport2Impl_AddRef(LPDIRECT3DVIEWPORT2 iface)
|
1999-01-03 18:00:19 +01:00
|
|
|
{
|
1999-03-27 17:56:13 +01:00
|
|
|
ICOM_THIS(IDirect3DViewport2Impl,iface);
|
1999-06-26 21:09:08 +02:00
|
|
|
TRACE("(%p)->()incrementing from %lu.\n", This, This->ref );
|
1999-01-03 18:00:19 +01:00
|
|
|
|
1999-03-27 17:56:13 +01:00
|
|
|
return ++(This->ref);
|
1999-01-03 18:00:19 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2000-05-12 22:18:14 +02:00
|
|
|
ULONG WINAPI IDirect3DViewport2Impl_Release(LPDIRECT3DVIEWPORT2 iface)
|
1999-01-03 18:00:19 +01:00
|
|
|
{
|
1999-03-27 17:56:13 +01:00
|
|
|
ICOM_THIS(IDirect3DViewport2Impl,iface);
|
1999-06-26 21:09:08 +02:00
|
|
|
FIXME("(%p)->() decrementing from %lu.\n", This, This->ref );
|
1999-01-03 18:00:19 +01:00
|
|
|
|
1999-03-27 17:56:13 +01:00
|
|
|
if (!--(This->ref)) {
|
|
|
|
HeapFree(GetProcessHeap(),0,This);
|
1999-01-03 18:00:19 +01:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
1999-03-27 17:56:13 +01:00
|
|
|
return This->ref;
|
1999-01-03 18:00:19 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/*** IDirect3DViewport methods ***/
|
2000-05-12 22:18:14 +02:00
|
|
|
HRESULT WINAPI IDirect3DViewport2Impl_Initialize(LPDIRECT3DVIEWPORT2 iface,
|
1999-01-03 18:00:19 +01:00
|
|
|
LPDIRECT3D d3d)
|
|
|
|
{
|
1999-03-27 17:56:13 +01:00
|
|
|
ICOM_THIS(IDirect3DViewport2Impl,iface);
|
1999-06-26 21:09:08 +02:00
|
|
|
FIXME("(%p)->(%p): stub\n", This, d3d);
|
1999-01-03 18:00:19 +01:00
|
|
|
|
|
|
|
return DD_OK;
|
|
|
|
}
|
|
|
|
|
2000-05-12 22:18:14 +02:00
|
|
|
HRESULT WINAPI IDirect3DViewport2Impl_GetViewport(LPDIRECT3DVIEWPORT2 iface,
|
1999-01-03 18:00:19 +01:00
|
|
|
LPD3DVIEWPORT lpvp)
|
|
|
|
{
|
1999-03-27 17:56:13 +01:00
|
|
|
ICOM_THIS(IDirect3DViewport2Impl,iface);
|
1999-06-26 21:09:08 +02:00
|
|
|
FIXME("(%p)->(%p): stub\n", This, lpvp);
|
1999-01-03 18:00:19 +01:00
|
|
|
|
1999-03-27 17:56:13 +01:00
|
|
|
if (This->use_vp2 != 0)
|
1999-01-03 18:00:19 +01:00
|
|
|
return DDERR_INVALIDPARAMS;
|
|
|
|
|
1999-03-27 17:56:13 +01:00
|
|
|
*lpvp = This->viewport.vp1;
|
1999-01-03 18:00:19 +01:00
|
|
|
|
|
|
|
return DD_OK;
|
|
|
|
}
|
|
|
|
|
2000-05-12 22:18:14 +02:00
|
|
|
HRESULT WINAPI IDirect3DViewport2Impl_SetViewport(LPDIRECT3DVIEWPORT2 iface,
|
1999-01-03 18:00:19 +01:00
|
|
|
LPD3DVIEWPORT lpvp)
|
|
|
|
{
|
1999-03-27 17:56:13 +01:00
|
|
|
ICOM_THIS(IDirect3DViewport2Impl,iface);
|
1999-06-26 21:09:08 +02:00
|
|
|
FIXME("(%p)->(%p): stub\n", This, lpvp);
|
1999-01-03 18:00:19 +01:00
|
|
|
|
1999-03-27 17:56:13 +01:00
|
|
|
This->use_vp2 = 0;
|
|
|
|
This->viewport.vp1 = *lpvp;
|
1999-01-03 18:00:19 +01:00
|
|
|
|
1999-06-26 21:09:08 +02:00
|
|
|
TRACE("dwSize = %ld dwX = %ld dwY = %ld\n",
|
1999-01-23 13:33:16 +01:00
|
|
|
lpvp->dwSize, lpvp->dwX, lpvp->dwY);
|
1999-06-26 21:09:08 +02:00
|
|
|
TRACE("dwWidth = %ld dwHeight = %ld\n",
|
1999-01-23 13:33:16 +01:00
|
|
|
lpvp->dwWidth, lpvp->dwHeight);
|
1999-06-26 21:09:08 +02:00
|
|
|
TRACE("dvScaleX = %f dvScaleY = %f\n",
|
1999-01-23 13:33:16 +01:00
|
|
|
lpvp->dvScaleX, lpvp->dvScaleY);
|
1999-06-26 21:09:08 +02:00
|
|
|
TRACE("dvMaxX = %f dvMaxY = %f\n",
|
1999-01-23 13:33:16 +01:00
|
|
|
lpvp->dvMaxX, lpvp->dvMaxY);
|
1999-06-26 21:09:08 +02:00
|
|
|
TRACE("dvMinZ = %f dvMaxZ = %f\n",
|
1999-01-23 13:33:16 +01:00
|
|
|
lpvp->dvMinZ, lpvp->dvMaxZ);
|
|
|
|
|
|
|
|
|
1999-01-03 18:00:19 +01:00
|
|
|
return DD_OK;
|
|
|
|
}
|
|
|
|
|
2000-05-12 22:18:14 +02:00
|
|
|
HRESULT WINAPI IDirect3DViewport2Impl_TransformVertices(LPDIRECT3DVIEWPORT2 iface,
|
1999-01-03 18:00:19 +01:00
|
|
|
DWORD dwVertexCount,
|
|
|
|
LPD3DTRANSFORMDATA lpData,
|
|
|
|
DWORD dwFlags,
|
|
|
|
LPDWORD lpOffScreen)
|
|
|
|
{
|
1999-03-27 17:56:13 +01:00
|
|
|
ICOM_THIS(IDirect3DViewport2Impl,iface);
|
1999-06-26 21:09:08 +02:00
|
|
|
FIXME("(%p)->(%8ld,%p,%08lx,%p): stub\n",
|
1999-03-27 17:56:13 +01:00
|
|
|
This, dwVertexCount, lpData, dwFlags, lpOffScreen);
|
1999-01-03 18:00:19 +01:00
|
|
|
|
|
|
|
return DD_OK;
|
|
|
|
}
|
|
|
|
|
2000-05-12 22:18:14 +02:00
|
|
|
HRESULT WINAPI IDirect3DViewport2Impl_LightElements(LPDIRECT3DVIEWPORT2 iface,
|
1999-01-03 18:00:19 +01:00
|
|
|
DWORD dwElementCount,
|
|
|
|
LPD3DLIGHTDATA lpData)
|
|
|
|
{
|
1999-03-27 17:56:13 +01:00
|
|
|
ICOM_THIS(IDirect3DViewport2Impl,iface);
|
1999-06-26 21:09:08 +02:00
|
|
|
FIXME("(%p)->(%8ld,%p): stub\n", This, dwElementCount, lpData);
|
1999-01-03 18:00:19 +01:00
|
|
|
|
|
|
|
return DD_OK;
|
|
|
|
}
|
|
|
|
|
2000-05-12 22:18:14 +02:00
|
|
|
HRESULT WINAPI IDirect3DViewport2Impl_SetBackground(LPDIRECT3DVIEWPORT2 iface,
|
1999-01-03 18:00:19 +01:00
|
|
|
D3DMATERIALHANDLE hMat)
|
|
|
|
{
|
1999-03-27 17:56:13 +01:00
|
|
|
ICOM_THIS(IDirect3DViewport2Impl,iface);
|
1999-06-26 21:09:08 +02:00
|
|
|
FIXME("(%p)->(%08lx): stub\n", This, (DWORD) hMat);
|
1999-01-03 18:00:19 +01:00
|
|
|
|
|
|
|
return DD_OK;
|
|
|
|
}
|
|
|
|
|
2000-05-12 22:18:14 +02:00
|
|
|
HRESULT WINAPI IDirect3DViewport2Impl_GetBackground(LPDIRECT3DVIEWPORT2 iface,
|
1999-01-03 18:00:19 +01:00
|
|
|
LPD3DMATERIALHANDLE lphMat,
|
1999-02-26 12:11:13 +01:00
|
|
|
LPBOOL lpValid)
|
1999-01-03 18:00:19 +01:00
|
|
|
{
|
1999-03-27 17:56:13 +01:00
|
|
|
ICOM_THIS(IDirect3DViewport2Impl,iface);
|
1999-06-26 21:09:08 +02:00
|
|
|
FIXME("(%p)->(%p,%p): stub\n", This, lphMat, lpValid);
|
1999-01-03 18:00:19 +01:00
|
|
|
|
|
|
|
return DD_OK;
|
|
|
|
}
|
|
|
|
|
2000-05-12 22:18:14 +02:00
|
|
|
HRESULT WINAPI IDirect3DViewport2Impl_SetBackgroundDepth(LPDIRECT3DVIEWPORT2 iface,
|
1999-01-03 18:00:19 +01:00
|
|
|
LPDIRECTDRAWSURFACE lpDDSurface)
|
|
|
|
{
|
1999-03-27 17:56:13 +01:00
|
|
|
ICOM_THIS(IDirect3DViewport2Impl,iface);
|
1999-06-26 21:09:08 +02:00
|
|
|
FIXME("(%p)->(%p): stub\n", This, lpDDSurface);
|
1999-01-03 18:00:19 +01:00
|
|
|
|
|
|
|
return DD_OK;
|
|
|
|
}
|
|
|
|
|
2000-05-12 22:18:14 +02:00
|
|
|
HRESULT WINAPI IDirect3DViewport2Impl_GetBackgroundDepth(LPDIRECT3DVIEWPORT2 iface,
|
1999-01-03 18:00:19 +01:00
|
|
|
LPDIRECTDRAWSURFACE* lplpDDSurface,
|
1999-02-26 12:11:13 +01:00
|
|
|
LPBOOL lpValid)
|
1999-01-03 18:00:19 +01:00
|
|
|
{
|
1999-03-27 17:56:13 +01:00
|
|
|
ICOM_THIS(IDirect3DViewport2Impl,iface);
|
1999-06-26 21:09:08 +02:00
|
|
|
FIXME("(%p)->(%p,%p): stub\n", This, lplpDDSurface, lpValid);
|
1999-01-03 18:00:19 +01:00
|
|
|
|
|
|
|
return DD_OK;
|
|
|
|
}
|
|
|
|
|
2000-05-12 22:18:14 +02:00
|
|
|
HRESULT WINAPI IDirect3DViewport2Impl_Clear(LPDIRECT3DVIEWPORT2 iface,
|
1999-01-03 18:00:19 +01:00
|
|
|
DWORD dwCount,
|
|
|
|
LPD3DRECT lpRects,
|
|
|
|
DWORD dwFlags)
|
|
|
|
{
|
1999-03-27 17:56:13 +01:00
|
|
|
ICOM_THIS(IDirect3DViewport2Impl,iface);
|
1999-01-17 17:55:11 +01:00
|
|
|
GLboolean ztest;
|
1999-06-26 21:09:08 +02:00
|
|
|
FIXME("(%p)->(%8ld,%p,%08lx): stub\n", This, dwCount, lpRects, dwFlags);
|
1999-01-03 18:00:19 +01:00
|
|
|
|
|
|
|
/* For the moment, ignore the rectangles */
|
1999-03-27 17:56:13 +01:00
|
|
|
if (This->device.active_device1 != NULL) {
|
1999-01-03 18:00:19 +01:00
|
|
|
/* Get the rendering context */
|
1999-03-27 17:56:13 +01:00
|
|
|
if (This->use_d3d2)
|
|
|
|
This->device.active_device2->set_context(This->device.active_device2);
|
1999-01-03 18:00:19 +01:00
|
|
|
else
|
1999-03-27 17:56:13 +01:00
|
|
|
This->device.active_device1->set_context(This->device.active_device1);
|
1999-01-23 13:33:16 +01:00
|
|
|
}
|
1999-01-03 18:00:19 +01:00
|
|
|
|
|
|
|
/* Clears the screen */
|
1999-05-13 20:53:05 +02:00
|
|
|
ENTER_GL();
|
1999-01-17 17:55:11 +01:00
|
|
|
glGetBooleanv(GL_DEPTH_TEST, &ztest);
|
1999-01-03 18:00:19 +01:00
|
|
|
glDepthMask(GL_TRUE); /* Enables Z writing to be sure to delete also the Z buffer */
|
|
|
|
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
1999-01-17 17:55:11 +01:00
|
|
|
glDepthMask(ztest);
|
1999-05-13 20:53:05 +02:00
|
|
|
LEAVE_GL();
|
1999-01-03 18:00:19 +01:00
|
|
|
|
|
|
|
return DD_OK;
|
|
|
|
}
|
|
|
|
|
2000-05-12 22:18:14 +02:00
|
|
|
HRESULT WINAPI IDirect3DViewport2Impl_AddLight(LPDIRECT3DVIEWPORT2 iface,
|
1999-01-03 18:00:19 +01:00
|
|
|
LPDIRECT3DLIGHT lpLight)
|
|
|
|
{
|
1999-03-27 17:56:13 +01:00
|
|
|
ICOM_THIS(IDirect3DViewport2Impl,iface);
|
|
|
|
IDirect3DLightImpl* ilpLight=(IDirect3DLightImpl*)lpLight;
|
1999-06-26 21:09:08 +02:00
|
|
|
FIXME("(%p)->(%p): stub\n", This, ilpLight);
|
1999-01-03 18:00:19 +01:00
|
|
|
|
|
|
|
/* Add the light in the 'linked' chain */
|
1999-03-27 17:56:13 +01:00
|
|
|
ilpLight->next = This->lights;
|
|
|
|
This->lights = ilpLight;
|
1999-01-03 18:00:19 +01:00
|
|
|
|
|
|
|
/* If active, activate the light */
|
1999-03-27 17:56:13 +01:00
|
|
|
if (This->device.active_device1 != NULL) {
|
2000-05-12 22:18:14 +02:00
|
|
|
D3DVPRIVATE(This);
|
|
|
|
D3DLPRIVATE(ilpLight);
|
|
|
|
|
1999-01-03 18:00:19 +01:00
|
|
|
/* Get the rendering context */
|
1999-03-27 17:56:13 +01:00
|
|
|
if (This->use_d3d2)
|
|
|
|
This->device.active_device2->set_context(This->device.active_device2);
|
1999-01-03 18:00:19 +01:00
|
|
|
else
|
1999-03-27 17:56:13 +01:00
|
|
|
This->device.active_device1->set_context(This->device.active_device1);
|
1999-01-03 18:00:19 +01:00
|
|
|
|
|
|
|
/* Activate the light */
|
2000-05-12 22:18:14 +02:00
|
|
|
dlpriv->light_num = dvpriv->nextlight++;
|
1999-03-27 17:56:13 +01:00
|
|
|
ilpLight->activate(ilpLight);
|
1999-01-03 18:00:19 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
return DD_OK;
|
|
|
|
}
|
|
|
|
|
2000-05-12 22:18:14 +02:00
|
|
|
HRESULT WINAPI IDirect3DViewport2Impl_DeleteLight(LPDIRECT3DVIEWPORT2 iface,
|
1999-01-03 18:00:19 +01:00
|
|
|
LPDIRECT3DLIGHT lpLight)
|
|
|
|
{
|
1999-03-27 17:56:13 +01:00
|
|
|
ICOM_THIS(IDirect3DViewport2Impl,iface);
|
1999-06-26 21:09:08 +02:00
|
|
|
FIXME("(%p)->(%p): stub\n", This, lpLight);
|
1999-01-03 18:00:19 +01:00
|
|
|
|
|
|
|
return DD_OK;
|
|
|
|
}
|
|
|
|
|
2000-05-12 22:18:14 +02:00
|
|
|
HRESULT WINAPI IDirect3DViewport2Impl_NextLight(LPDIRECT3DVIEWPORT2 iface,
|
1999-01-03 18:00:19 +01:00
|
|
|
LPDIRECT3DLIGHT lpLight,
|
|
|
|
LPDIRECT3DLIGHT* lplpLight,
|
|
|
|
DWORD dwFlags)
|
|
|
|
{
|
1999-03-27 17:56:13 +01:00
|
|
|
ICOM_THIS(IDirect3DViewport2Impl,iface);
|
1999-06-26 21:09:08 +02:00
|
|
|
FIXME("(%p)->(%p,%p,%08lx): stub\n", This, lpLight, lplpLight, dwFlags);
|
1999-01-03 18:00:19 +01:00
|
|
|
|
|
|
|
return DD_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*** IDirect3DViewport2 methods ***/
|
2000-05-12 22:18:14 +02:00
|
|
|
HRESULT WINAPI IDirect3DViewport2Impl_GetViewport2(LPDIRECT3DVIEWPORT2 iface,
|
1999-01-03 18:00:19 +01:00
|
|
|
LPD3DVIEWPORT2 lpViewport2)
|
|
|
|
{
|
1999-03-27 17:56:13 +01:00
|
|
|
ICOM_THIS(IDirect3DViewport2Impl,iface);
|
1999-06-26 21:09:08 +02:00
|
|
|
TRACE("(%p)->(%p)\n", This, lpViewport2);
|
1999-01-03 18:00:19 +01:00
|
|
|
|
1999-03-27 17:56:13 +01:00
|
|
|
if (This->use_vp2 != 1)
|
1999-01-03 18:00:19 +01:00
|
|
|
return DDERR_INVALIDPARAMS;
|
|
|
|
|
1999-03-27 17:56:13 +01:00
|
|
|
*lpViewport2 = This->viewport.vp2;
|
1999-01-03 18:00:19 +01:00
|
|
|
|
|
|
|
return DD_OK;
|
|
|
|
}
|
|
|
|
|
2000-05-12 22:18:14 +02:00
|
|
|
HRESULT WINAPI IDirect3DViewport2Impl_SetViewport2(LPDIRECT3DVIEWPORT2 iface,
|
1999-01-03 18:00:19 +01:00
|
|
|
LPD3DVIEWPORT2 lpViewport2)
|
|
|
|
{
|
1999-03-27 17:56:13 +01:00
|
|
|
ICOM_THIS(IDirect3DViewport2Impl,iface);
|
1999-06-26 21:09:08 +02:00
|
|
|
TRACE("(%p)->(%p)\n", This, lpViewport2);
|
1999-01-03 18:00:19 +01:00
|
|
|
|
1999-06-26 21:09:08 +02:00
|
|
|
TRACE("dwSize = %ld dwX = %ld dwY = %ld\n",
|
1999-01-03 18:00:19 +01:00
|
|
|
lpViewport2->dwSize, lpViewport2->dwX, lpViewport2->dwY);
|
1999-06-26 21:09:08 +02:00
|
|
|
TRACE("dwWidth = %ld dwHeight = %ld\n",
|
1999-01-03 18:00:19 +01:00
|
|
|
lpViewport2->dwWidth, lpViewport2->dwHeight);
|
1999-06-26 21:09:08 +02:00
|
|
|
TRACE("dvClipX = %f dvClipY = %f\n",
|
1999-01-03 18:00:19 +01:00
|
|
|
lpViewport2->dvClipX, lpViewport2->dvClipY);
|
1999-06-26 21:09:08 +02:00
|
|
|
TRACE("dvClipWidth = %f dvClipHeight = %f\n",
|
1999-01-03 18:00:19 +01:00
|
|
|
lpViewport2->dvClipWidth, lpViewport2->dvClipHeight);
|
1999-06-26 21:09:08 +02:00
|
|
|
TRACE("dvMinZ = %f dvMaxZ = %f\n",
|
1999-01-03 18:00:19 +01:00
|
|
|
lpViewport2->dvMinZ, lpViewport2->dvMaxZ);
|
|
|
|
|
1999-03-27 17:56:13 +01:00
|
|
|
This->viewport.vp2 = *lpViewport2;
|
|
|
|
This->use_vp2 = 1;
|
1999-01-03 18:00:19 +01:00
|
|
|
|
|
|
|
return DD_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*******************************************************************************
|
|
|
|
* IDirect3DViewport1/2 VTable
|
|
|
|
*/
|
1999-05-22 13:41:38 +02:00
|
|
|
static ICOM_VTABLE(IDirect3DViewport2) viewport2_vtable =
|
|
|
|
{
|
|
|
|
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
|
1999-01-03 18:00:19 +01:00
|
|
|
/*** IUnknown methods ***/
|
1999-03-27 17:56:13 +01:00
|
|
|
IDirect3DViewport2Impl_QueryInterface,
|
|
|
|
IDirect3DViewport2Impl_AddRef,
|
|
|
|
IDirect3DViewport2Impl_Release,
|
1999-01-03 18:00:19 +01:00
|
|
|
/*** IDirect3DViewport methods ***/
|
1999-03-27 17:56:13 +01:00
|
|
|
IDirect3DViewport2Impl_Initialize,
|
|
|
|
IDirect3DViewport2Impl_GetViewport,
|
|
|
|
IDirect3DViewport2Impl_SetViewport,
|
|
|
|
IDirect3DViewport2Impl_TransformVertices,
|
|
|
|
IDirect3DViewport2Impl_LightElements,
|
|
|
|
IDirect3DViewport2Impl_SetBackground,
|
|
|
|
IDirect3DViewport2Impl_GetBackground,
|
|
|
|
IDirect3DViewport2Impl_SetBackgroundDepth,
|
|
|
|
IDirect3DViewport2Impl_GetBackgroundDepth,
|
|
|
|
IDirect3DViewport2Impl_Clear,
|
|
|
|
IDirect3DViewport2Impl_AddLight,
|
|
|
|
IDirect3DViewport2Impl_DeleteLight,
|
|
|
|
IDirect3DViewport2Impl_NextLight,
|
1999-01-03 18:00:19 +01:00
|
|
|
/*** IDirect3DViewport2 methods ***/
|
1999-03-27 17:56:13 +01:00
|
|
|
IDirect3DViewport2Impl_GetViewport2,
|
|
|
|
IDirect3DViewport2Impl_SetViewport2
|
1999-01-03 18:00:19 +01:00
|
|
|
};
|
|
|
|
|
2000-05-12 22:18:14 +02:00
|
|
|
#else /* HAVE_OPENGL */
|
1999-01-03 18:00:19 +01:00
|
|
|
|
1999-03-27 17:56:13 +01:00
|
|
|
LPDIRECT3DVIEWPORT d3dviewport_create(IDirect3DImpl* d3d1) {
|
1999-06-26 21:09:08 +02:00
|
|
|
ERR("Should not be called...\n");
|
1999-01-03 18:00:19 +01:00
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
1999-03-27 17:56:13 +01:00
|
|
|
LPDIRECT3DVIEWPORT2 d3dviewport2_create(IDirect3D2Impl* d3d2) {
|
1999-06-26 21:09:08 +02:00
|
|
|
ERR("Should not be called...\n");
|
1999-01-03 18:00:19 +01:00
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2000-05-12 22:18:14 +02:00
|
|
|
#endif /* HAVE_OPENGL */
|