Added a stubbed out version of query to d3d9 and wined3d.

Update the d3d9 headers and creates wined3d types where d3d9 and d3d8
are incompatible.
This commit is contained in:
Oliver Stieber 2005-03-03 13:57:15 +00:00 committed by Alexandre Julliard
parent 5be005b0d5
commit 7b261656fd
13 changed files with 1590 additions and 704 deletions

View File

@ -2,7 +2,8 @@
* Direct3D 9 private include file * Direct3D 9 private include file
* *
* Copyright 2002-2003 Jason Edmeades * Copyright 2002-2003 Jason Edmeades
* Raphael Junqueira * Copyright 2002-2003 Raphael Junqueira
* Copyright 2005 Oliver Stieber
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
@ -83,7 +84,7 @@ extern void (*wine_tsx11_unlock_ptr)(void);
#define MAX_LEVELS 256 #define MAX_LEVELS 256
/* Other useful values */ /* Other useful values */
#define HIGHEST_RENDER_STATE 174 #define HIGHEST_RENDER_STATE D3DRS_BLENDOPALPHA
#define HIGHEST_TEXTURE_STATE 29 #define HIGHEST_TEXTURE_STATE 29
#define HIGHEST_TRANSFORMSTATE 512 #define HIGHEST_TRANSFORMSTATE 512
#define D3DSBT_RECORDED 0xfffffffe #define D3DSBT_RECORDED 0xfffffffe
@ -108,7 +109,6 @@ typedef struct IDirect3DStateBlock9Impl IDirect3DStateBlock9Impl;
typedef struct IDirect3DVertexShader9Impl IDirect3DVertexShader9Impl; typedef struct IDirect3DVertexShader9Impl IDirect3DVertexShader9Impl;
typedef struct IDirect3DPixelShader9Impl IDirect3DPixelShader9Impl; typedef struct IDirect3DPixelShader9Impl IDirect3DPixelShader9Impl;
typedef struct IDirect3DVertexDeclaration9Impl IDirect3DVertexDeclaration9Impl; typedef struct IDirect3DVertexDeclaration9Impl IDirect3DVertexDeclaration9Impl;
typedef struct IDirect3DQuery9Impl IDirect3DQuery9Impl;
#define D3DCOLOR_R(dw) (((float) (((dw) >> 16) & 0xFF)) / 255.0f) #define D3DCOLOR_R(dw) (((float) (((dw) >> 16) & 0xFF)) / 255.0f)
@ -1108,26 +1108,15 @@ extern IDirect3DQuery9Vtbl Direct3DQuery9_Vtbl;
/***************************************************************************** /*****************************************************************************
* IDirect3DPixelShader implementation structure * IDirect3DPixelShader implementation structure
*/ */
struct IDirect3DQuery9Impl { typedef struct IDirect3DQuery9Impl {
/* IUnknown fields */ /* IUnknown fields */
IDirect3DQuery9Vtbl *lpVtbl; IDirect3DQuery9Vtbl *lpVtbl;
DWORD ref; DWORD ref;
/* IDirect3DQuery9 fields */ /* IDirect3DQuery9 fields */
IDirect3DDevice9Impl* Device; IWineD3DQuery *wineD3DQuery;
}; } IDirect3DQuery9Impl;
/* IUnknown: */
extern HRESULT WINAPI IDirect3DQuery9Impl_QueryInterface(LPDIRECT3DQUERY9 iface, REFIID riid, LPVOID* ppobj);
extern ULONG WINAPI IDirect3DQuery9Impl_AddRef(LPDIRECT3DQUERY9 iface);
extern ULONG WINAPI IDirect3DQuery9Impl_Release(LPDIRECT3DQUERY9 iface);
/* IDirect3DQuery9: */
extern HRESULT WINAPI IDirect3DQuery9Impl_GetDevice(LPDIRECT3DQUERY9 iface, IDirect3DDevice9** ppDevice);
extern D3DQUERYTYPE WINAPI IDirect3DQuery9Impl_GetType(LPDIRECT3DQUERY9 iface);
extern DWORD WINAPI IDirect3DQuery9Impl_GetDataSize(LPDIRECT3DQUERY9 iface);
extern HRESULT WINAPI IDirect3DQuery9Impl_Issue(LPDIRECT3DQUERY9 iface, DWORD dwIssueFlags);
extern HRESULT WINAPI IDirect3DQuery9Impl_GetData(LPDIRECT3DQUERY9 iface, void* pData, DWORD dwSize, DWORD dwGetDataFlags);
/* Callbacks */ /* Callbacks */
extern HRESULT WINAPI D3D9CB_CreateSurface(IUnknown *device, UINT Width, UINT Height, extern HRESULT WINAPI D3D9CB_CreateSurface(IUnknown *device, UINT Width, UINT Height,

View File

@ -2,7 +2,8 @@
* IDirect3DQuery9 implementation * IDirect3DQuery9 implementation
* *
* Copyright 2002-2003 Raphael Junqueira * Copyright 2002-2003 Raphael Junqueira
* Jason Edmeades * Copyright 2002-2003 Jason Edmeades
* Copyright 2005 Oliver Stieber
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
@ -22,15 +23,16 @@
#include "config.h" #include "config.h"
#include "d3d9_private.h" #include "d3d9_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(d3d); WINE_DEFAULT_DEBUG_CHANNEL(d3d9);
/* IDirect3DQuery9 IUnknown parts follow: */ /* IDirect3DQuery9 IUnknown parts follow: */
HRESULT WINAPI IDirect3DQuery9Impl_QueryInterface(LPDIRECT3DQUERY9 iface, REFIID riid, LPVOID* ppobj) { HRESULT WINAPI IDirect3DQuery9Impl_QueryInterface(LPDIRECT3DQUERY9 iface, REFIID riid, LPVOID* ppobj) {
IDirect3DQuery9Impl *This = (IDirect3DQuery9Impl *)iface; IDirect3DQuery9Impl *This = (IDirect3DQuery9Impl *)iface;
TRACE("(%p) Relay\n", This);
if (IsEqualGUID(riid, &IID_IUnknown) if (IsEqualGUID(riid, &IID_IUnknown)
|| IsEqualGUID(riid, &IID_IDirect3DQuery9)) { || IsEqualGUID(riid, &IID_IDirect3DQuery9)) {
IDirect3DQuery9Impl_AddRef(iface); IUnknown_AddRef(iface);
*ppobj = This; *ppobj = This;
return D3D_OK; return D3D_OK;
} }
@ -44,7 +46,6 @@ ULONG WINAPI IDirect3DQuery9Impl_AddRef(LPDIRECT3DQUERY9 iface) {
ULONG ref = InterlockedIncrement(&This->ref); ULONG ref = InterlockedIncrement(&This->ref);
TRACE("(%p) : AddRef from %ld\n", This, ref - 1); TRACE("(%p) : AddRef from %ld\n", This, ref - 1);
return ref; return ref;
} }
@ -63,34 +64,43 @@ ULONG WINAPI IDirect3DQuery9Impl_Release(LPDIRECT3DQUERY9 iface) {
/* IDirect3DQuery9 Interface follow: */ /* IDirect3DQuery9 Interface follow: */
HRESULT WINAPI IDirect3DQuery9Impl_GetDevice(LPDIRECT3DQUERY9 iface, IDirect3DDevice9** ppDevice) { HRESULT WINAPI IDirect3DQuery9Impl_GetDevice(LPDIRECT3DQUERY9 iface, IDirect3DDevice9** ppDevice) {
IDirect3DQuery9Impl *This = (IDirect3DQuery9Impl *)iface; IDirect3DQuery9Impl *This = (IDirect3DQuery9Impl *)iface;
TRACE("(%p) : returning %p\n", This, This->Device); IWineD3DDevice* pDevice;
*ppDevice = (LPDIRECT3DDEVICE9) This->Device; HRESULT hr;
IDirect3DDevice9Impl_AddRef(*ppDevice);
return D3D_OK; TRACE("(%p) Relay\n", This);
hr = IWineD3DQuery_GetDevice(This->wineD3DQuery, &pDevice);
if(hr != D3D_OK){
*ppDevice = NULL;
}else{
hr = IWineD3DDevice_GetParent(pDevice, (IUnknown **)ppDevice);
IWineD3DDevice_Release(pDevice);
}
return hr;
} }
D3DQUERYTYPE WINAPI IDirect3DQuery9Impl_GetType(LPDIRECT3DQUERY9 iface) { D3DQUERYTYPE WINAPI IDirect3DQuery9Impl_GetType(LPDIRECT3DQUERY9 iface) {
IDirect3DQuery9Impl *This = (IDirect3DQuery9Impl *)iface; IDirect3DQuery9Impl *This = (IDirect3DQuery9Impl *)iface;
FIXME("(%p) : stub\n", This); TRACE("(%p) Relay\n", This);
return 0; return IWineD3DQuery_GetType(This->wineD3DQuery);
} }
DWORD WINAPI IDirect3DQuery9Impl_GetDataSize(LPDIRECT3DQUERY9 iface) { DWORD WINAPI IDirect3DQuery9Impl_GetDataSize(LPDIRECT3DQUERY9 iface) {
IDirect3DQuery9Impl *This = (IDirect3DQuery9Impl *)iface; IDirect3DQuery9Impl *This = (IDirect3DQuery9Impl *)iface;
FIXME("(%p) : stub\n", This); TRACE("(%p) Relay\n", This);
return 0; return IWineD3DQuery_GetDataSize(This->wineD3DQuery);
} }
HRESULT WINAPI IDirect3DQuery9Impl_Issue(LPDIRECT3DQUERY9 iface, DWORD dwIssueFlags) { HRESULT WINAPI IDirect3DQuery9Impl_Issue(LPDIRECT3DQUERY9 iface, DWORD dwIssueFlags) {
IDirect3DQuery9Impl *This = (IDirect3DQuery9Impl *)iface; IDirect3DQuery9Impl *This = (IDirect3DQuery9Impl *)iface;
FIXME("(%p) : stub\n", This); TRACE("(%p) Relay\n", This);
return D3D_OK; return IWineD3DQuery_Issue(This->wineD3DQuery, dwIssueFlags);
} }
HRESULT WINAPI IDirect3DQuery9Impl_GetData(LPDIRECT3DQUERY9 iface, void* pData, DWORD dwSize, DWORD dwGetDataFlags) { HRESULT WINAPI IDirect3DQuery9Impl_GetData(LPDIRECT3DQUERY9 iface, void* pData, DWORD dwSize, DWORD dwGetDataFlags) {
IDirect3DQuery9Impl *This = (IDirect3DQuery9Impl *)iface; IDirect3DQuery9Impl *This = (IDirect3DQuery9Impl *)iface;
FIXME("(%p) : stub\n", This); TRACE("(%p) Relay\n", This);
return D3D_OK; return IWineD3DQuery_GetData(This->wineD3DQuery, pData, dwSize, dwGetDataFlags);
} }
@ -109,12 +119,11 @@ IDirect3DQuery9Vtbl Direct3DQuery9_Vtbl =
/* IDirect3DDevice9 IDirect3DQuery9 Methods follow: */ /* IDirect3DDevice9 IDirect3DQuery9 Methods follow: */
HRESULT WINAPI IDirect3DDevice9Impl_CreateQuery(LPDIRECT3DDEVICE9 iface, D3DQUERYTYPE Type, IDirect3DQuery9** ppQuery) { HRESULT WINAPI IDirect3DDevice9Impl_CreateQuery(LPDIRECT3DDEVICE9 iface, D3DQUERYTYPE Type, IDirect3DQuery9** ppQuery) {
#if 0
IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface; IDirect3DDevice9Impl *This = (IDirect3DDevice9Impl *)iface;
#endif
IDirect3DQuery9Impl *object = NULL; IDirect3DQuery9Impl *object = NULL;
HRESULT hr = D3D_OK; HRESULT hr = D3D_OK;
TRACE("(%p) Relay\n", This);
if (NULL == ppQuery) { if (NULL == ppQuery) {
return D3DERR_INVALIDCALL; return D3DERR_INVALIDCALL;
} }
@ -128,8 +137,7 @@ HRESULT WINAPI IDirect3DDevice9Impl_CreateQuery(LPDIRECT3DDEVICE9 iface, D3DQUER
object->lpVtbl = &Direct3DQuery9_Vtbl; object->lpVtbl = &Direct3DQuery9_Vtbl;
object->ref = 1; object->ref = 1;
#if 0 hr = IWineD3DDevice_CreateQuery(This->WineD3DDevice, Type, &(object->wineD3DQuery), (IUnknown*)object);
hr = IWineD3DDevice_CreateQuery(This->WineD3DDevice, 9, pVertexElements, &(object->wineD3DQuery));
if (FAILED(hr)) { if (FAILED(hr)) {
/* free up object */ /* free up object */
@ -139,6 +147,6 @@ HRESULT WINAPI IDirect3DDevice9Impl_CreateQuery(LPDIRECT3DDEVICE9 iface, D3DQUER
} else { } else {
*ppQuery = (LPDIRECT3DQUERY9) object; *ppQuery = (LPDIRECT3DQUERY9) object;
} }
#endif TRACE("(%p) : returning %p \n", This, *ppQuery);
return hr; return hr;
} }

View File

@ -14,6 +14,7 @@ C_SRCS = \
directx.c \ directx.c \
drawprim.c \ drawprim.c \
indexbuffer.c \ indexbuffer.c \
query.c \
resource.c \ resource.c \
stateblock.c \ stateblock.c \
surface.c \ surface.c \

View File

@ -217,7 +217,7 @@ void WINAPI IWineD3DDeviceImpl_SetupTextureStates(IWineD3DDevice *iface, DWORD S
/* Note the D3DRS value applies to all textures, but GL has one /* Note the D3DRS value applies to all textures, but GL has one
* per texture, so apply it now ready to be used! * per texture, so apply it now ready to be used!
*/ */
D3DCOLORTOGLFLOAT4(This->stateBlock->renderState[D3DRS_TEXTUREFACTOR], col); D3DCOLORTOGLFLOAT4(This->stateBlock->renderState[WINED3DRS_TEXTUREFACTOR], col);
glTexEnvfv(GL_TEXTURE_ENV, GL_TEXTURE_ENV_COLOR, &col[0]); glTexEnvfv(GL_TEXTURE_ENV, GL_TEXTURE_ENV_COLOR, &col[0]);
checkGLcall("glTexEnvfv(GL_TEXTURE_ENV, GL_TEXTURE_ENV_COLOR, color);"); checkGLcall("glTexEnvfv(GL_TEXTURE_ENV, GL_TEXTURE_ENV_COLOR, color);");
@ -433,12 +433,12 @@ HRESULT WINAPI IWineD3DDeviceImpl_CreateSurface(IWineD3DDevice *iface, UINT Wid
* it is based around 4x4 pixel blocks it requires padding, so allocate enough * it is based around 4x4 pixel blocks it requires padding, so allocate enough
* space! * space!
*********************************/ *********************************/
if (Format == D3DFMT_DXT1) { if (Format == WINED3DFMT_DXT1) {
/* DXT1 is half byte per pixel */ /* DXT1 is half byte per pixel */
object->currentDesc.Size = ((max(Width,4) * object->bytesPerPixel) * max(Height,4)) / 2; object->currentDesc.Size = ((max(Width,4) * object->bytesPerPixel) * max(Height,4)) / 2;
} else if (Format == D3DFMT_DXT2 || Format == D3DFMT_DXT3 || } else if (Format == WINED3DFMT_DXT2 || Format == WINED3DFMT_DXT3 ||
Format == D3DFMT_DXT4 || Format == D3DFMT_DXT5) { Format == WINED3DFMT_DXT4 || Format == WINED3DFMT_DXT5) {
object->currentDesc.Size = ((max(Width,4) * object->bytesPerPixel) * max(Height,4)); object->currentDesc.Size = ((max(Width,4) * object->bytesPerPixel) * max(Height,4));
} else { } else {
object->currentDesc.Size = (Width * object->bytesPerPixel) * Height; object->currentDesc.Size = (Width * object->bytesPerPixel) * Height;
@ -491,7 +491,7 @@ HRESULT WINAPI IWineD3DDeviceImpl_CreateSurface(IWineD3DDevice *iface, UINT Wid
object->locked = FALSE; object->locked = FALSE;
object->lockable = (D3DFMT_D16_LOCKABLE == Format) ? TRUE : Lockable; object->lockable = (WINED3DFMT_D16_LOCKABLE == Format) ? TRUE : Lockable;
/* TODO: memory management */ /* TODO: memory management */
object->allocatedMemory = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,object->currentDesc.Size); object->allocatedMemory = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,object->currentDesc.Size);
if(object->allocatedMemory == NULL ) { if(object->allocatedMemory == NULL ) {
@ -505,7 +505,7 @@ HRESULT WINAPI IWineD3DDeviceImpl_CreateSurface(IWineD3DDevice *iface, UINT Wid
IWineD3DSurface_CleanDirtyRect(*ppSurface); IWineD3DSurface_CleanDirtyRect(*ppSurface);
TRACE("(%p) : w(%d) h(%d) fmt(%d,%s) lockable(%d) surf@%p, surfmem@%p, %d bytes\n", TRACE("(%p) : w(%d) h(%d) fmt(%d,%s) lockable(%d) surf@%p, surfmem@%p, %d bytes\n",
This, Width, Height, Format, debug_d3dformat(Format), This, Width, Height, Format, debug_d3dformat(Format),
(D3DFMT_D16_LOCKABLE == Format), *ppSurface, object->allocatedMemory, object->currentDesc.Size); (WINED3DFMT_D16_LOCKABLE == Format), *ppSurface, object->allocatedMemory, object->currentDesc.Size);
return D3D_OK; return D3D_OK;
} }
@ -754,50 +754,42 @@ HRESULT WINAPI IWineD3DDeviceImpl_CreateCubeTexture(IWineD3DDevice *iface, UINT
return D3D_OK; return D3D_OK;
} }
HRESULT WINAPI IWineD3DDeviceImpl_CreateQuery(IWineD3DDevice *iface, D3DQUERYTYPE Type, void** ppQuery, IUnknown* parent){ HRESULT WINAPI IWineD3DDeviceImpl_CreateQuery(IWineD3DDevice *iface, WINED3DQUERYTYPE Type, IWineD3DQuery **ppQuery, IUnknown* parent){
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface; IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
IWineD3DQueryImpl *object; /*NOTE: impl ref allowed since this is a create function */
if(NULL == ppQuery){ if(NULL == ppQuery){
/* Just a check to see if we support this type of query */ /* Just a check to see if we support this type of query */
HRESULT hr = D3DERR_NOTAVAILABLE; HRESULT hr = D3DERR_NOTAVAILABLE;
#if 0 /* TODO: query support */
/* Lie and say everything is good (we can return ok fake data from a stub) */ /* Lie and say everything is good (we can return ok fake data from a stub) */
switch(Type){ switch(Type){
case D3DQUERYTYPE_VCACHE: case WINED3DQUERYTYPE_VCACHE:
case D3DQUERYTYPE_RESOURCEMANAGER: case WINED3DQUERYTYPE_RESOURCEMANAGER:
case D3DQUERYTYPE_VERTEXSTATS: case WINED3DQUERYTYPE_VERTEXSTATS:
case D3DQUERYTYPE_EVENT: case WINED3DQUERYTYPE_EVENT:
case D3DQUERYTYPE_OCCLUSION: case WINED3DQUERYTYPE_OCCLUSION:
case D3DQUERYTYPE_TIMESTAMP: case WINED3DQUERYTYPE_TIMESTAMP:
case D3DQUERYTYPE_TIMESTAMPDISJOINT: case WINED3DQUERYTYPE_TIMESTAMPDISJOINT:
case D3DQUERYTYPE_TIMESTAMPFREQ: case WINED3DQUERYTYPE_TIMESTAMPFREQ:
case D3DQUERYTYPE_PIPELINETIMINGS: case WINED3DQUERYTYPE_PIPELINETIMINGS:
case D3DQUERYTYPE_INTERFACETIMINGS: case WINED3DQUERYTYPE_INTERFACETIMINGS:
case D3DQUERYTYPE_VERTEXTIMINGS: case WINED3DQUERYTYPE_VERTEXTIMINGS:
case D3DQUERYTYPE_PIXELTIMINGS: case WINED3DQUERYTYPE_PIXELTIMINGS:
case D3DQUERYTYPE_BANDWIDTHTIMINGS: case WINED3DQUERYTYPE_BANDWIDTHTIMINGS:
case D3DQUERYTYPE_CACHEUTILIZATION: case WINED3DQUERYTYPE_CACHEUTILIZATION:
hr = D3D_OK; hr = D3D_OK;
break; break;
default: default:
FIXME("(%p) Unhandled query type %d\n",This , Type); FIXME("(%p) Unhandled query type %d\n",This , Type);
} }
#endif
FIXME("(%p) : Stub request for query type %d returned %ld\n", This, Type, hr); FIXME("(%p) : Stub request for query type %d returned %ld\n", This, Type, hr);
return hr; return hr;
} }
#if 0 /* TODO: query support */
IWineD3DQueryImpl *object; /*NOTE: impl ref allowed since this is a create function */
D3DCREATEOBJECTINSTANCE(object, Query) D3DCREATEOBJECTINSTANCE(object, Query)
object->type = Type; object->type = Type;
object->extendedData = 0; object->extendedData = 0;
TRACE("(%p) : Created Query %p\n", This, object); TRACE("(%p) : Created Query %p\n", This, object);
#else
*ppQuery = NULL;
FIXME("(%p) : Stub\n",This);
#endif
return D3D_OK; return D3D_OK;
} }
@ -1726,7 +1718,7 @@ HRESULT WINAPI IWineD3DDeviceImpl_SetMaterial(IWineD3DDevice *iface, CONST WINED
checkGLcall("glMaterialfv"); checkGLcall("glMaterialfv");
/* Only change material color if specular is enabled, otherwise it is set to black */ /* Only change material color if specular is enabled, otherwise it is set to black */
if (This->stateBlock->renderState[D3DRS_SPECULARENABLE]) { if (This->stateBlock->renderState[WINED3DRS_SPECULARENABLE]) {
glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, (float*) &This->updateStateBlock->material.Specular); glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, (float*) &This->updateStateBlock->material.Specular);
checkGLcall("glMaterialfv"); checkGLcall("glMaterialfv");
} else { } else {
@ -1865,18 +1857,18 @@ HRESULT WINAPI IWineD3DDeviceImpl_SetRenderState(IWineD3DDevice *iface, D3DRENDE
ENTER_GL(); ENTER_GL();
switch (State) { switch (State) {
case D3DRS_FILLMODE : case WINED3DRS_FILLMODE :
switch ((D3DFILLMODE) Value) { switch ((D3DFILLMODE) Value) {
case D3DFILL_POINT : glPolygonMode(GL_FRONT_AND_BACK, GL_POINT); break; case D3DFILL_POINT : glPolygonMode(GL_FRONT_AND_BACK, GL_POINT); break;
case D3DFILL_WIREFRAME : glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); break; case D3DFILL_WIREFRAME : glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); break;
case D3DFILL_SOLID : glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); break; case D3DFILL_SOLID : glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); break;
default: default:
FIXME("Unrecognized D3DRS_FILLMODE value %ld\n", Value); FIXME("Unrecognized WINED3DRS_FILLMODE value %ld\n", Value);
} }
checkGLcall("glPolygonMode (fillmode)"); checkGLcall("glPolygonMode (fillmode)");
break; break;
case D3DRS_LIGHTING : case WINED3DRS_LIGHTING :
if (Value) { if (Value) {
glEnable(GL_LIGHTING); glEnable(GL_LIGHTING);
checkGLcall("glEnable GL_LIGHTING"); checkGLcall("glEnable GL_LIGHTING");
@ -1886,7 +1878,7 @@ HRESULT WINAPI IWineD3DDeviceImpl_SetRenderState(IWineD3DDevice *iface, D3DRENDE
} }
break; break;
case D3DRS_ZENABLE : case WINED3DRS_ZENABLE :
switch ((D3DZBUFFERTYPE) Value) { switch ((D3DZBUFFERTYPE) Value) {
case D3DZB_FALSE: case D3DZB_FALSE:
glDisable(GL_DEPTH_TEST); glDisable(GL_DEPTH_TEST);
@ -1906,7 +1898,7 @@ HRESULT WINAPI IWineD3DDeviceImpl_SetRenderState(IWineD3DDevice *iface, D3DRENDE
} }
break; break;
case D3DRS_CULLMODE : case WINED3DRS_CULLMODE :
/* If we are culling "back faces with clockwise vertices" then /* If we are culling "back faces with clockwise vertices" then
set front faces to be counter clockwise and enable culling set front faces to be counter clockwise and enable culling
@ -1945,7 +1937,7 @@ HRESULT WINAPI IWineD3DDeviceImpl_SetRenderState(IWineD3DDevice *iface, D3DRENDE
} }
break; break;
case D3DRS_SHADEMODE : case WINED3DRS_SHADEMODE :
switch ((D3DSHADEMODE) Value) { switch ((D3DSHADEMODE) Value) {
case D3DSHADE_FLAT: case D3DSHADE_FLAT:
glShadeModel(GL_FLAT); glShadeModel(GL_FLAT);
@ -1965,7 +1957,7 @@ HRESULT WINAPI IWineD3DDeviceImpl_SetRenderState(IWineD3DDevice *iface, D3DRENDE
} }
break; break;
case D3DRS_DITHERENABLE : case WINED3DRS_DITHERENABLE :
if (Value) { if (Value) {
glEnable(GL_DITHER); glEnable(GL_DITHER);
checkGLcall("glEnable GL_DITHER"); checkGLcall("glEnable GL_DITHER");
@ -1975,7 +1967,7 @@ HRESULT WINAPI IWineD3DDeviceImpl_SetRenderState(IWineD3DDevice *iface, D3DRENDE
} }
break; break;
case D3DRS_ZWRITEENABLE : case WINED3DRS_ZWRITEENABLE :
if (Value) { if (Value) {
glDepthMask(1); glDepthMask(1);
checkGLcall("glDepthMask"); checkGLcall("glDepthMask");
@ -1985,7 +1977,7 @@ HRESULT WINAPI IWineD3DDeviceImpl_SetRenderState(IWineD3DDevice *iface, D3DRENDE
} }
break; break;
case D3DRS_ZFUNC : case WINED3DRS_ZFUNC :
{ {
int glParm = GL_LESS; int glParm = GL_LESS;
@ -2006,7 +1998,7 @@ HRESULT WINAPI IWineD3DDeviceImpl_SetRenderState(IWineD3DDevice *iface, D3DRENDE
} }
break; break;
case D3DRS_AMBIENT : case WINED3DRS_AMBIENT :
{ {
float col[4]; float col[4];
D3DCOLORTOGLFLOAT4(Value, col); D3DCOLORTOGLFLOAT4(Value, col);
@ -2017,7 +2009,7 @@ HRESULT WINAPI IWineD3DDeviceImpl_SetRenderState(IWineD3DDevice *iface, D3DRENDE
} }
break; break;
case D3DRS_ALPHABLENDENABLE : case WINED3DRS_ALPHABLENDENABLE :
if (Value) { if (Value) {
glEnable(GL_BLEND); glEnable(GL_BLEND);
checkGLcall("glEnable GL_BLEND"); checkGLcall("glEnable GL_BLEND");
@ -2027,8 +2019,8 @@ HRESULT WINAPI IWineD3DDeviceImpl_SetRenderState(IWineD3DDevice *iface, D3DRENDE
}; };
break; break;
case D3DRS_SRCBLEND : case WINED3DRS_SRCBLEND :
case D3DRS_DESTBLEND : case WINED3DRS_DESTBLEND :
{ {
int newVal = GL_ZERO; int newVal = GL_ZERO;
switch (Value) { switch (Value) {
@ -2057,8 +2049,8 @@ HRESULT WINAPI IWineD3DDeviceImpl_SetRenderState(IWineD3DDevice *iface, D3DRENDE
FIXME("Unrecognized src/dest blend value %ld (%d)\n", Value, State); FIXME("Unrecognized src/dest blend value %ld (%d)\n", Value, State);
} }
if (State == D3DRS_SRCBLEND) This->srcBlend = newVal; if (State == WINED3DRS_SRCBLEND) This->srcBlend = newVal;
if (State == D3DRS_DESTBLEND) This->dstBlend = newVal; if (State == WINED3DRS_DESTBLEND) This->dstBlend = newVal;
TRACE("glBlendFunc src=%x, dst=%x\n", This->srcBlend, This->dstBlend); TRACE("glBlendFunc src=%x, dst=%x\n", This->srcBlend, This->dstBlend);
glBlendFunc(This->srcBlend, This->dstBlend); glBlendFunc(This->srcBlend, This->dstBlend);
@ -2066,7 +2058,7 @@ HRESULT WINAPI IWineD3DDeviceImpl_SetRenderState(IWineD3DDevice *iface, D3DRENDE
} }
break; break;
case D3DRS_ALPHATESTENABLE : case WINED3DRS_ALPHATESTENABLE :
if (Value) { if (Value) {
glEnable(GL_ALPHA_TEST); glEnable(GL_ALPHA_TEST);
checkGLcall("glEnable GL_ALPHA_TEST"); checkGLcall("glEnable GL_ALPHA_TEST");
@ -2076,10 +2068,10 @@ HRESULT WINAPI IWineD3DDeviceImpl_SetRenderState(IWineD3DDevice *iface, D3DRENDE
} }
break; break;
case D3DRS_ALPHAFUNC : case WINED3DRS_ALPHAFUNC :
{ {
int glParm = GL_LESS; int glParm = GL_LESS;
float ref = ((float) This->stateBlock->renderState[D3DRS_ALPHAREF]) / 255.0f; float ref = ((float) This->stateBlock->renderState[WINED3DRS_ALPHAREF]) / 255.0f;
switch ((D3DCMPFUNC) Value) { switch ((D3DCMPFUNC) Value) {
case D3DCMP_NEVER: glParm = GL_NEVER; break; case D3DCMP_NEVER: glParm = GL_NEVER; break;
@ -2100,7 +2092,7 @@ HRESULT WINAPI IWineD3DDeviceImpl_SetRenderState(IWineD3DDevice *iface, D3DRENDE
} }
break; break;
case D3DRS_ALPHAREF : case WINED3DRS_ALPHAREF :
{ {
int glParm = This->alphafunc; int glParm = This->alphafunc;
float ref = 1.0f; float ref = 1.0f;
@ -2112,20 +2104,20 @@ HRESULT WINAPI IWineD3DDeviceImpl_SetRenderState(IWineD3DDevice *iface, D3DRENDE
} }
break; break;
case D3DRS_CLIPPLANEENABLE : case WINED3DRS_CLIPPLANEENABLE :
case D3DRS_CLIPPING : case WINED3DRS_CLIPPING :
{ {
/* Ensure we only do the changed clip planes */ /* Ensure we only do the changed clip planes */
DWORD enable = 0xFFFFFFFF; DWORD enable = 0xFFFFFFFF;
DWORD disable = 0x00000000; DWORD disable = 0x00000000;
/* If enabling / disabling all */ /* If enabling / disabling all */
if (State == D3DRS_CLIPPING) { if (State == WINED3DRS_CLIPPING) {
if (Value) { if (Value) {
enable = This->stateBlock->renderState[D3DRS_CLIPPLANEENABLE]; enable = This->stateBlock->renderState[WINED3DRS_CLIPPLANEENABLE];
disable = 0x00; disable = 0x00;
} else { } else {
disable = This->stateBlock->renderState[D3DRS_CLIPPLANEENABLE]; disable = This->stateBlock->renderState[WINED3DRS_CLIPPLANEENABLE];
enable = 0x00; enable = 0x00;
} }
} else { } else {
@ -2158,7 +2150,7 @@ HRESULT WINAPI IWineD3DDeviceImpl_SetRenderState(IWineD3DDevice *iface, D3DRENDE
} }
break; break;
case D3DRS_BLENDOP : case WINED3DRS_BLENDOP :
{ {
int glParm = GL_FUNC_ADD; int glParm = GL_FUNC_ADD;
@ -2177,7 +2169,7 @@ HRESULT WINAPI IWineD3DDeviceImpl_SetRenderState(IWineD3DDevice *iface, D3DRENDE
} }
break; break;
case D3DRS_TEXTUREFACTOR : case WINED3DRS_TEXTUREFACTOR :
{ {
unsigned int i; unsigned int i;
@ -2206,7 +2198,7 @@ HRESULT WINAPI IWineD3DDeviceImpl_SetRenderState(IWineD3DDevice *iface, D3DRENDE
} }
break; break;
case D3DRS_SPECULARENABLE : case WINED3DRS_SPECULARENABLE :
{ {
/* Originally this used glLightModeli(GL_LIGHT_MODEL_COLOR_CONTROL,GL_SEPARATE_SPECULAR_COLOR) /* Originally this used glLightModeli(GL_LIGHT_MODEL_COLOR_CONTROL,GL_SEPARATE_SPECULAR_COLOR)
and (GL_LIGHT_MODEL_COLOR_CONTROL,GL_SINGLE_COLOR) to swap between enabled/disabled and (GL_LIGHT_MODEL_COLOR_CONTROL,GL_SINGLE_COLOR) to swap between enabled/disabled
@ -2245,7 +2237,7 @@ HRESULT WINAPI IWineD3DDeviceImpl_SetRenderState(IWineD3DDevice *iface, D3DRENDE
} }
break; break;
case D3DRS_STENCILENABLE : case WINED3DRS_STENCILENABLE :
if (Value) { if (Value) {
glEnable(GL_STENCIL_TEST); glEnable(GL_STENCIL_TEST);
checkGLcall("glEnable GL_STENCIL_TEST"); checkGLcall("glEnable GL_STENCIL_TEST");
@ -2255,11 +2247,11 @@ HRESULT WINAPI IWineD3DDeviceImpl_SetRenderState(IWineD3DDevice *iface, D3DRENDE
} }
break; break;
case D3DRS_STENCILFUNC : case WINED3DRS_STENCILFUNC :
{ {
int glParm = GL_ALWAYS; int glParm = GL_ALWAYS;
int ref = This->stateBlock->renderState[D3DRS_STENCILREF]; int ref = This->stateBlock->renderState[WINED3DRS_STENCILREF];
GLuint mask = This->stateBlock->renderState[D3DRS_STENCILMASK]; GLuint mask = This->stateBlock->renderState[WINED3DRS_STENCILMASK];
switch ((D3DCMPFUNC) Value) { switch ((D3DCMPFUNC) Value) {
case D3DCMP_NEVER: glParm=GL_NEVER; break; case D3DCMP_NEVER: glParm=GL_NEVER; break;
@ -2280,11 +2272,11 @@ HRESULT WINAPI IWineD3DDeviceImpl_SetRenderState(IWineD3DDevice *iface, D3DRENDE
} }
break; break;
case D3DRS_STENCILREF : case WINED3DRS_STENCILREF :
{ {
int glParm = This->stencilfunc; int glParm = This->stencilfunc;
int ref = 0; int ref = 0;
GLuint mask = This->stateBlock->renderState[D3DRS_STENCILMASK]; GLuint mask = This->stateBlock->renderState[WINED3DRS_STENCILMASK];
ref = Value; ref = Value;
TRACE("glStencilFunc with Parm=%x, ref=%d, mask=%x\n", glParm, ref, mask); TRACE("glStencilFunc with Parm=%x, ref=%d, mask=%x\n", glParm, ref, mask);
@ -2293,10 +2285,10 @@ HRESULT WINAPI IWineD3DDeviceImpl_SetRenderState(IWineD3DDevice *iface, D3DRENDE
} }
break; break;
case D3DRS_STENCILMASK : case WINED3DRS_STENCILMASK :
{ {
int glParm = This->stencilfunc; int glParm = This->stencilfunc;
int ref = This->stateBlock->renderState[D3DRS_STENCILREF]; int ref = This->stateBlock->renderState[WINED3DRS_STENCILREF];
GLuint mask = Value; GLuint mask = Value;
TRACE("glStencilFunc with Parm=%x, ref=%d, mask=%x\n", glParm, ref, mask); TRACE("glStencilFunc with Parm=%x, ref=%d, mask=%x\n", glParm, ref, mask);
@ -2305,7 +2297,7 @@ HRESULT WINAPI IWineD3DDeviceImpl_SetRenderState(IWineD3DDevice *iface, D3DRENDE
} }
break; break;
case D3DRS_STENCILFAIL : case WINED3DRS_STENCILFAIL :
{ {
GLenum fail ; GLenum fail ;
GLenum zpass ; GLenum zpass ;
@ -2322,7 +2314,7 @@ HRESULT WINAPI IWineD3DDeviceImpl_SetRenderState(IWineD3DDevice *iface, D3DRENDE
checkGLcall("glStencilOp(fail, zfail, zpass);"); checkGLcall("glStencilOp(fail, zfail, zpass);");
} }
break; break;
case D3DRS_STENCILZFAIL : case WINED3DRS_STENCILZFAIL :
{ {
GLenum fail ; GLenum fail ;
GLenum zpass ; GLenum zpass ;
@ -2339,7 +2331,7 @@ HRESULT WINAPI IWineD3DDeviceImpl_SetRenderState(IWineD3DDevice *iface, D3DRENDE
checkGLcall("glStencilOp(fail, zfail, zpass);"); checkGLcall("glStencilOp(fail, zfail, zpass);");
} }
break; break;
case D3DRS_STENCILPASS : case WINED3DRS_STENCILPASS :
{ {
GLenum fail ; GLenum fail ;
GLenum zpass ; GLenum zpass ;
@ -2357,7 +2349,7 @@ HRESULT WINAPI IWineD3DDeviceImpl_SetRenderState(IWineD3DDevice *iface, D3DRENDE
} }
break; break;
case D3DRS_STENCILWRITEMASK : case WINED3DRS_STENCILWRITEMASK :
{ {
glStencilMask(Value); glStencilMask(Value);
TRACE("glStencilMask(%lu)\n", Value); TRACE("glStencilMask(%lu)\n", Value);
@ -2365,9 +2357,9 @@ HRESULT WINAPI IWineD3DDeviceImpl_SetRenderState(IWineD3DDevice *iface, D3DRENDE
} }
break; break;
case D3DRS_FOGENABLE : case WINED3DRS_FOGENABLE :
{ {
if (Value/* && This->stateBlock->renderState[D3DRS_FOGTABLEMODE] != D3DFOG_NONE*/) { if (Value/* && This->stateBlock->renderState[WINED3DRS_FOGTABLEMODE] != D3DFOG_NONE*/) {
glEnable(GL_FOG); glEnable(GL_FOG);
checkGLcall("glEnable GL_FOG"); checkGLcall("glEnable GL_FOG");
} else { } else {
@ -2377,7 +2369,7 @@ HRESULT WINAPI IWineD3DDeviceImpl_SetRenderState(IWineD3DDevice *iface, D3DRENDE
} }
break; break;
case D3DRS_RANGEFOGENABLE : case WINED3DRS_RANGEFOGENABLE :
{ {
if (Value) { if (Value) {
TRACE("Enabled RANGEFOG"); TRACE("Enabled RANGEFOG");
@ -2387,7 +2379,7 @@ HRESULT WINAPI IWineD3DDeviceImpl_SetRenderState(IWineD3DDevice *iface, D3DRENDE
} }
break; break;
case D3DRS_FOGCOLOR : case WINED3DRS_FOGCOLOR :
{ {
float col[4]; float col[4];
D3DCOLORTOGLFLOAT4(Value, col); D3DCOLORTOGLFLOAT4(Value, col);
@ -2397,7 +2389,7 @@ HRESULT WINAPI IWineD3DDeviceImpl_SetRenderState(IWineD3DDevice *iface, D3DRENDE
} }
break; break;
case D3DRS_FOGTABLEMODE : case WINED3DRS_FOGTABLEMODE :
{ {
glHint(GL_FOG_HINT, GL_NICEST); glHint(GL_FOG_HINT, GL_NICEST);
switch (Value) { switch (Value) {
@ -2406,7 +2398,7 @@ HRESULT WINAPI IWineD3DDeviceImpl_SetRenderState(IWineD3DDevice *iface, D3DRENDE
case D3DFOG_EXP2: glFogi(GL_FOG_MODE, GL_EXP2); checkGLcall("glFogi(GL_FOG_MODE, GL_EXP2"); break; case D3DFOG_EXP2: glFogi(GL_FOG_MODE, GL_EXP2); checkGLcall("glFogi(GL_FOG_MODE, GL_EXP2"); break;
case D3DFOG_LINEAR: glFogi(GL_FOG_MODE, GL_LINEAR); checkGLcall("glFogi(GL_FOG_MODE, GL_LINEAR"); break; case D3DFOG_LINEAR: glFogi(GL_FOG_MODE, GL_LINEAR); checkGLcall("glFogi(GL_FOG_MODE, GL_LINEAR"); break;
default: default:
FIXME("Unsupported Value(%lu) for D3DRS_FOGTABLEMODE!\n", Value); FIXME("Unsupported Value(%lu) for WINED3DRS_FOGTABLEMODE!\n", Value);
} }
if (GL_SUPPORT(NV_FOG_DISTANCE)) { if (GL_SUPPORT(NV_FOG_DISTANCE)) {
glFogi(GL_FOG_DISTANCE_MODE_NV, GL_EYE_PLANE_ABSOLUTE_NV); glFogi(GL_FOG_DISTANCE_MODE_NV, GL_EYE_PLANE_ABSOLUTE_NV);
@ -2414,7 +2406,7 @@ HRESULT WINAPI IWineD3DDeviceImpl_SetRenderState(IWineD3DDevice *iface, D3DRENDE
} }
break; break;
case D3DRS_FOGVERTEXMODE : case WINED3DRS_FOGVERTEXMODE :
{ {
glHint(GL_FOG_HINT, GL_FASTEST); glHint(GL_FOG_HINT, GL_FASTEST);
switch (Value) { switch (Value) {
@ -2423,15 +2415,15 @@ HRESULT WINAPI IWineD3DDeviceImpl_SetRenderState(IWineD3DDevice *iface, D3DRENDE
case D3DFOG_EXP2: glFogi(GL_FOG_MODE, GL_EXP2); checkGLcall("glFogi(GL_FOG_MODE, GL_EXP2"); break; case D3DFOG_EXP2: glFogi(GL_FOG_MODE, GL_EXP2); checkGLcall("glFogi(GL_FOG_MODE, GL_EXP2"); break;
case D3DFOG_LINEAR: glFogi(GL_FOG_MODE, GL_LINEAR); checkGLcall("glFogi(GL_FOG_MODE, GL_LINEAR"); break; case D3DFOG_LINEAR: glFogi(GL_FOG_MODE, GL_LINEAR); checkGLcall("glFogi(GL_FOG_MODE, GL_LINEAR"); break;
default: default:
FIXME("Unsupported Value(%lu) for D3DRS_FOGTABLEMODE!\n", Value); FIXME("Unsupported Value(%lu) for WINED3DRS_FOGTABLEMODE!\n", Value);
} }
if (GL_SUPPORT(NV_FOG_DISTANCE)) { if (GL_SUPPORT(NV_FOG_DISTANCE)) {
glFogi(GL_FOG_DISTANCE_MODE_NV, This->stateBlock->renderState[D3DRS_RANGEFOGENABLE] ? GL_EYE_RADIAL_NV : GL_EYE_PLANE_ABSOLUTE_NV); glFogi(GL_FOG_DISTANCE_MODE_NV, This->stateBlock->renderState[WINED3DRS_RANGEFOGENABLE] ? GL_EYE_RADIAL_NV : GL_EYE_PLANE_ABSOLUTE_NV);
} }
} }
break; break;
case D3DRS_FOGSTART : case WINED3DRS_FOGSTART :
{ {
tmpvalue.d = Value; tmpvalue.d = Value;
glFogfv(GL_FOG_START, &tmpvalue.f); glFogfv(GL_FOG_START, &tmpvalue.f);
@ -2440,7 +2432,7 @@ HRESULT WINAPI IWineD3DDeviceImpl_SetRenderState(IWineD3DDevice *iface, D3DRENDE
} }
break; break;
case D3DRS_FOGEND : case WINED3DRS_FOGEND :
{ {
tmpvalue.d = Value; tmpvalue.d = Value;
glFogfv(GL_FOG_END, &tmpvalue.f); glFogfv(GL_FOG_END, &tmpvalue.f);
@ -2449,7 +2441,7 @@ HRESULT WINAPI IWineD3DDeviceImpl_SetRenderState(IWineD3DDevice *iface, D3DRENDE
} }
break; break;
case D3DRS_FOGDENSITY : case WINED3DRS_FOGDENSITY :
{ {
tmpvalue.d = Value; tmpvalue.d = Value;
glFogfv(GL_FOG_DENSITY, &tmpvalue.f); glFogfv(GL_FOG_DENSITY, &tmpvalue.f);
@ -2457,14 +2449,14 @@ HRESULT WINAPI IWineD3DDeviceImpl_SetRenderState(IWineD3DDevice *iface, D3DRENDE
} }
break; break;
case D3DRS_VERTEXBLEND : case WINED3DRS_VERTEXBLEND :
{ {
This->updateStateBlock->vertex_blend = (D3DVERTEXBLENDFLAGS) Value; This->updateStateBlock->vertex_blend = (D3DVERTEXBLENDFLAGS) Value;
TRACE("Vertex Blending state to %ld\n", Value); TRACE("Vertex Blending state to %ld\n", Value);
} }
break; break;
case D3DRS_TWEENFACTOR : case WINED3DRS_TWEENFACTOR :
{ {
tmpvalue.d = Value; tmpvalue.d = Value;
This->updateStateBlock->tween_factor = tmpvalue.f; This->updateStateBlock->tween_factor = tmpvalue.f;
@ -2472,38 +2464,38 @@ HRESULT WINAPI IWineD3DDeviceImpl_SetRenderState(IWineD3DDevice *iface, D3DRENDE
} }
break; break;
case D3DRS_INDEXEDVERTEXBLENDENABLE : case WINED3DRS_INDEXEDVERTEXBLENDENABLE :
{ {
TRACE("Indexed Vertex Blend Enable to %ul\n", (BOOL) Value); TRACE("Indexed Vertex Blend Enable to %ul\n", (BOOL) Value);
} }
break; break;
case D3DRS_COLORVERTEX : case WINED3DRS_COLORVERTEX :
case D3DRS_DIFFUSEMATERIALSOURCE : case WINED3DRS_DIFFUSEMATERIALSOURCE :
case D3DRS_SPECULARMATERIALSOURCE : case WINED3DRS_SPECULARMATERIALSOURCE :
case D3DRS_AMBIENTMATERIALSOURCE : case WINED3DRS_AMBIENTMATERIALSOURCE :
case D3DRS_EMISSIVEMATERIALSOURCE : case WINED3DRS_EMISSIVEMATERIALSOURCE :
{ {
GLenum Parm = GL_AMBIENT_AND_DIFFUSE; GLenum Parm = GL_AMBIENT_AND_DIFFUSE;
if (This->stateBlock->renderState[D3DRS_COLORVERTEX]) { if (This->stateBlock->renderState[WINED3DRS_COLORVERTEX]) {
TRACE("diff %ld, amb %ld, emis %ld, spec %ld\n", TRACE("diff %ld, amb %ld, emis %ld, spec %ld\n",
This->stateBlock->renderState[D3DRS_DIFFUSEMATERIALSOURCE], This->stateBlock->renderState[WINED3DRS_DIFFUSEMATERIALSOURCE],
This->stateBlock->renderState[D3DRS_AMBIENTMATERIALSOURCE], This->stateBlock->renderState[WINED3DRS_AMBIENTMATERIALSOURCE],
This->stateBlock->renderState[D3DRS_EMISSIVEMATERIALSOURCE], This->stateBlock->renderState[WINED3DRS_EMISSIVEMATERIALSOURCE],
This->stateBlock->renderState[D3DRS_SPECULARMATERIALSOURCE]); This->stateBlock->renderState[WINED3DRS_SPECULARMATERIALSOURCE]);
if (This->stateBlock->renderState[D3DRS_DIFFUSEMATERIALSOURCE] == D3DMCS_COLOR1) { if (This->stateBlock->renderState[WINED3DRS_DIFFUSEMATERIALSOURCE] == D3DMCS_COLOR1) {
if (This->stateBlock->renderState[D3DRS_AMBIENTMATERIALSOURCE] == D3DMCS_COLOR1) { if (This->stateBlock->renderState[WINED3DRS_AMBIENTMATERIALSOURCE] == D3DMCS_COLOR1) {
Parm = GL_AMBIENT_AND_DIFFUSE; Parm = GL_AMBIENT_AND_DIFFUSE;
} else { } else {
Parm = GL_DIFFUSE; Parm = GL_DIFFUSE;
} }
} else if (This->stateBlock->renderState[D3DRS_AMBIENTMATERIALSOURCE] == D3DMCS_COLOR1) { } else if (This->stateBlock->renderState[WINED3DRS_AMBIENTMATERIALSOURCE] == D3DMCS_COLOR1) {
Parm = GL_AMBIENT; Parm = GL_AMBIENT;
} else if (This->stateBlock->renderState[D3DRS_EMISSIVEMATERIALSOURCE] == D3DMCS_COLOR1) { } else if (This->stateBlock->renderState[WINED3DRS_EMISSIVEMATERIALSOURCE] == D3DMCS_COLOR1) {
Parm = GL_EMISSION; Parm = GL_EMISSION;
} else if (This->stateBlock->renderState[D3DRS_SPECULARMATERIALSOURCE] == D3DMCS_COLOR1) { } else if (This->stateBlock->renderState[WINED3DRS_SPECULARMATERIALSOURCE] == D3DMCS_COLOR1) {
Parm = GL_SPECULAR; Parm = GL_SPECULAR;
} else { } else {
Parm = -1; Parm = -1;
@ -2522,7 +2514,7 @@ HRESULT WINAPI IWineD3DDeviceImpl_SetRenderState(IWineD3DDevice *iface, D3DRENDE
} }
break; break;
case D3DRS_LINEPATTERN : case WINED3DRS_LINEPATTERN :
{ {
union { union {
DWORD d; DWORD d;
@ -2544,7 +2536,7 @@ HRESULT WINAPI IWineD3DDeviceImpl_SetRenderState(IWineD3DDevice *iface, D3DRENDE
} }
break; break;
case D3DRS_ZBIAS : case WINED3DRS_ZBIAS :
{ {
if (Value) { if (Value) {
tmpvalue.d = Value; tmpvalue.d = Value;
@ -2568,7 +2560,7 @@ HRESULT WINAPI IWineD3DDeviceImpl_SetRenderState(IWineD3DDevice *iface, D3DRENDE
} }
break; break;
case D3DRS_NORMALIZENORMALS : case WINED3DRS_NORMALIZENORMALS :
if (Value) { if (Value) {
glEnable(GL_NORMALIZE); glEnable(GL_NORMALIZE);
checkGLcall("glEnable(GL_NORMALIZE);"); checkGLcall("glEnable(GL_NORMALIZE);");
@ -2578,50 +2570,50 @@ HRESULT WINAPI IWineD3DDeviceImpl_SetRenderState(IWineD3DDevice *iface, D3DRENDE
} }
break; break;
case D3DRS_POINTSIZE : case WINED3DRS_POINTSIZE :
tmpvalue.d = Value; tmpvalue.d = Value;
TRACE("Set point size to %f\n", tmpvalue.f); TRACE("Set point size to %f\n", tmpvalue.f);
glPointSize(tmpvalue.f); glPointSize(tmpvalue.f);
checkGLcall("glPointSize(...);"); checkGLcall("glPointSize(...);");
break; break;
case D3DRS_POINTSIZE_MIN : case WINED3DRS_POINTSIZE_MIN :
if (GL_SUPPORT(EXT_POINT_PARAMETERS)) { if (GL_SUPPORT(EXT_POINT_PARAMETERS)) {
tmpvalue.d = Value; tmpvalue.d = Value;
GL_EXTCALL(glPointParameterfEXT)(GL_POINT_SIZE_MIN_EXT, tmpvalue.f); GL_EXTCALL(glPointParameterfEXT)(GL_POINT_SIZE_MIN_EXT, tmpvalue.f);
checkGLcall("glPointParameterfEXT(...);"); checkGLcall("glPointParameterfEXT(...);");
} else { } else {
FIXME("D3DRS_POINTSIZE_MIN not supported on this opengl\n"); FIXME("WINED3DRS_POINTSIZE_MIN not supported on this opengl\n");
} }
break; break;
case D3DRS_POINTSIZE_MAX : case WINED3DRS_POINTSIZE_MAX :
if (GL_SUPPORT(EXT_POINT_PARAMETERS)) { if (GL_SUPPORT(EXT_POINT_PARAMETERS)) {
tmpvalue.d = Value; tmpvalue.d = Value;
GL_EXTCALL(glPointParameterfEXT)(GL_POINT_SIZE_MAX_EXT, tmpvalue.f); GL_EXTCALL(glPointParameterfEXT)(GL_POINT_SIZE_MAX_EXT, tmpvalue.f);
checkGLcall("glPointParameterfEXT(...);"); checkGLcall("glPointParameterfEXT(...);");
} else { } else {
FIXME("D3DRS_POINTSIZE_MAX not supported on this opengl\n"); FIXME("WINED3DRS_POINTSIZE_MAX not supported on this opengl\n");
} }
break; break;
case D3DRS_POINTSCALE_A : case WINED3DRS_POINTSCALE_A :
case D3DRS_POINTSCALE_B : case WINED3DRS_POINTSCALE_B :
case D3DRS_POINTSCALE_C : case WINED3DRS_POINTSCALE_C :
case D3DRS_POINTSCALEENABLE : case WINED3DRS_POINTSCALEENABLE :
{ {
/* If enabled, supply the parameters, otherwise fall back to defaults */ /* If enabled, supply the parameters, otherwise fall back to defaults */
if (This->stateBlock->renderState[D3DRS_POINTSCALEENABLE]) { if (This->stateBlock->renderState[WINED3DRS_POINTSCALEENABLE]) {
GLfloat att[3] = {1.0f, 0.0f, 0.0f}; GLfloat att[3] = {1.0f, 0.0f, 0.0f};
att[0] = *((float*)&This->stateBlock->renderState[D3DRS_POINTSCALE_A]); att[0] = *((float*)&This->stateBlock->renderState[WINED3DRS_POINTSCALE_A]);
att[1] = *((float*)&This->stateBlock->renderState[D3DRS_POINTSCALE_B]); att[1] = *((float*)&This->stateBlock->renderState[WINED3DRS_POINTSCALE_B]);
att[2] = *((float*)&This->stateBlock->renderState[D3DRS_POINTSCALE_C]); att[2] = *((float*)&This->stateBlock->renderState[WINED3DRS_POINTSCALE_C]);
if (GL_SUPPORT(EXT_POINT_PARAMETERS)) { if (GL_SUPPORT(EXT_POINT_PARAMETERS)) {
GL_EXTCALL(glPointParameterfvEXT)(GL_DISTANCE_ATTENUATION_EXT, att); GL_EXTCALL(glPointParameterfvEXT)(GL_DISTANCE_ATTENUATION_EXT, att);
checkGLcall("glPointParameterfvEXT(GL_DISTANCE_ATTENUATION_EXT, ...);"); checkGLcall("glPointParameterfvEXT(GL_DISTANCE_ATTENUATION_EXT, ...);");
} else { } else {
TRACE("D3DRS_POINTSCALEENABLE not supported on this opengl\n"); TRACE("WINED3DRS_POINTSCALEENABLE not supported on this opengl\n");
} }
} else { } else {
GLfloat att[3] = {1.0f, 0.0f, 0.0f}; GLfloat att[3] = {1.0f, 0.0f, 0.0f};
@ -2629,13 +2621,13 @@ HRESULT WINAPI IWineD3DDeviceImpl_SetRenderState(IWineD3DDevice *iface, D3DRENDE
GL_EXTCALL(glPointParameterfvEXT)(GL_DISTANCE_ATTENUATION_EXT, att); GL_EXTCALL(glPointParameterfvEXT)(GL_DISTANCE_ATTENUATION_EXT, att);
checkGLcall("glPointParameterfvEXT(GL_DISTANCE_ATTENUATION_EXT, ...);"); checkGLcall("glPointParameterfvEXT(GL_DISTANCE_ATTENUATION_EXT, ...);");
} else { } else {
TRACE("D3DRS_POINTSCALEENABLE not supported, but not on either\n"); TRACE("WINED3DRS_POINTSCALEENABLE not supported, but not on either\n");
} }
} }
break; break;
} }
case D3DRS_COLORWRITEENABLE : case WINED3DRS_COLORWRITEENABLE :
{ {
TRACE("Color mask: r(%d) g(%d) b(%d) a(%d)\n", TRACE("Color mask: r(%d) g(%d) b(%d) a(%d)\n",
Value & D3DCOLORWRITEENABLE_RED ? 1 : 0, Value & D3DCOLORWRITEENABLE_RED ? 1 : 0,
@ -2650,7 +2642,7 @@ HRESULT WINAPI IWineD3DDeviceImpl_SetRenderState(IWineD3DDevice *iface, D3DRENDE
} }
break; break;
case D3DRS_LOCALVIEWER : case WINED3DRS_LOCALVIEWER :
{ {
GLint state = (Value) ? 1 : 0; GLint state = (Value) ? 1 : 0;
TRACE("Local Viewer Enable to %ul\n", (BOOL) Value); TRACE("Local Viewer Enable to %ul\n", (BOOL) Value);
@ -2658,7 +2650,7 @@ HRESULT WINAPI IWineD3DDeviceImpl_SetRenderState(IWineD3DDevice *iface, D3DRENDE
} }
break; break;
case D3DRS_LASTPIXEL : case WINED3DRS_LASTPIXEL :
{ {
if (Value) { if (Value) {
TRACE("Last Pixel Drawing Enabled\n"); TRACE("Last Pixel Drawing Enabled\n");
@ -2668,7 +2660,7 @@ HRESULT WINAPI IWineD3DDeviceImpl_SetRenderState(IWineD3DDevice *iface, D3DRENDE
} }
break; break;
case D3DRS_SOFTWAREVERTEXPROCESSING : case WINED3DRS_SOFTWAREVERTEXPROCESSING :
{ {
if (Value) { if (Value) {
TRACE("Software Processing Enabled\n"); TRACE("Software Processing Enabled\n");
@ -2679,30 +2671,30 @@ HRESULT WINAPI IWineD3DDeviceImpl_SetRenderState(IWineD3DDevice *iface, D3DRENDE
break; break;
/** not supported */ /** not supported */
case D3DRS_ZVISIBLE : case WINED3DRS_ZVISIBLE :
{ {
LEAVE_GL(); LEAVE_GL();
return D3DERR_INVALIDCALL; return D3DERR_INVALIDCALL;
} }
/* Unhandled yet...! */ /* Unhandled yet...! */
case D3DRS_EDGEANTIALIAS : case WINED3DRS_EDGEANTIALIAS :
case D3DRS_WRAP0 : case WINED3DRS_WRAP0 :
case D3DRS_WRAP1 : case WINED3DRS_WRAP1 :
case D3DRS_WRAP2 : case WINED3DRS_WRAP2 :
case D3DRS_WRAP3 : case WINED3DRS_WRAP3 :
case D3DRS_WRAP4 : case WINED3DRS_WRAP4 :
case D3DRS_WRAP5 : case WINED3DRS_WRAP5 :
case D3DRS_WRAP6 : case WINED3DRS_WRAP6 :
case D3DRS_WRAP7 : case WINED3DRS_WRAP7 :
case D3DRS_POINTSPRITEENABLE : case WINED3DRS_POINTSPRITEENABLE :
case D3DRS_MULTISAMPLEANTIALIAS : case WINED3DRS_MULTISAMPLEANTIALIAS :
case D3DRS_MULTISAMPLEMASK : case WINED3DRS_MULTISAMPLEMASK :
case D3DRS_PATCHEDGESTYLE : case WINED3DRS_PATCHEDGESTYLE :
case D3DRS_PATCHSEGMENTS : case WINED3DRS_PATCHSEGMENTS :
case D3DRS_DEBUGMONITORTOKEN : case WINED3DRS_DEBUGMONITORTOKEN :
case D3DRS_POSITIONORDER : case WINED3DRS_POSITIONORDER :
case D3DRS_NORMALORDER : case WINED3DRS_NORMALORDER :
/*Put back later: FIXME("(%p)->(%d,%ld) not handled yet\n", This, State, Value); */ /*Put back later: FIXME("(%p)->(%d,%ld) not handled yet\n", This, State, Value); */
FIXME("(%p)->(%d,%ld) not handled yet\n", This, State, Value); FIXME("(%p)->(%d,%ld) not handled yet\n", This, State, Value);
break; break;
@ -3284,7 +3276,7 @@ HRESULT WINAPI IWineD3DDeviceImpl_SetTextureStageState(IWineD3DDevice *iface, DW
determine the texture wrapping mode. determine the texture wrapping mode.
eg. SetTextureStageState( 0, D3DTSS_TEXCOORDINDEX, D3DTSS_TCI_CAMERASPACEPOSITION | 1 ); eg. SetTextureStageState( 0, D3DTSS_TEXCOORDINDEX, D3DTSS_TCI_CAMERASPACEPOSITION | 1 );
means use the vertex position (camera-space) as the input texture coordinates means use the vertex position (camera-space) as the input texture coordinates
for this texture stage, and the wrap mode set in the D3DRS_WRAP1 render for this texture stage, and the wrap mode set in the WINED3DRS_WRAP1 render
state. We do not (yet) support the D3DRENDERSTATE_WRAPx values, nor tie them up state. We do not (yet) support the D3DRENDERSTATE_WRAPx values, nor tie them up
to the TEXCOORDINDEX value */ to the TEXCOORDINDEX value */
@ -3660,13 +3652,13 @@ HRESULT WINAPI IWineD3DDeviceImpl_GetDisplayMode(IWineD3DDevice *iface, UINT iSw
DeleteDC(hdc); DeleteDC(hdc);
switch (bpp) { switch (bpp) {
case 8: pMode->Format = D3DFMT_R8G8B8; break; case 8: pMode->Format = WINED3DFMT_R8G8B8; break;
case 16: pMode->Format = D3DFMT_R5G6B5; break; case 16: pMode->Format = WINED3DFMT_R5G6B5; break;
case 24: /*pMode->Format = D3DFMT_R8G8B8; break; */ case 24: /*pMode->Format = WINED3DFMT_R8G8B8; break; */
case 32: pMode->Format = D3DFMT_A8R8G8B8; break; case 32: pMode->Format = WINED3DFMT_A8R8G8B8; break;
default: default:
FIXME("Unrecognized display mode format\n"); FIXME("Unrecognized display mode format\n");
pMode->Format = D3DFMT_UNKNOWN; pMode->Format = WINED3DFMT_UNKNOWN;
} }
FIXME("(%p) : returning w(%d) h(%d) rr(%d) fmt(%u,%s)\n", This, pMode->Width, pMode->Height, pMode->RefreshRate, FIXME("(%p) : returning w(%d) h(%d) rr(%d) fmt(%u,%s)\n", This, pMode->Width, pMode->Height, pMode->RefreshRate,
@ -3931,7 +3923,7 @@ HRESULT WINAPI IWineD3DDeviceImpl_Clear(IWineD3DDevice *iface, DWORD Count, CONS
/* Restore the old values (why..?) */ /* Restore the old values (why..?) */
if (Flags & D3DCLEAR_STENCIL) { if (Flags & D3DCLEAR_STENCIL) {
glClearStencil(old_stencil_clear_value); glClearStencil(old_stencil_clear_value);
glStencilMask(This->stateBlock->renderState[D3DRS_STENCILWRITEMASK]); glStencilMask(This->stateBlock->renderState[WINED3DRS_STENCILWRITEMASK]);
} }
if (Flags & D3DCLEAR_ZBUFFER) { if (Flags & D3DCLEAR_ZBUFFER) {
glDepthMask(old_ztest); glDepthMask(old_ztest);
@ -3942,10 +3934,10 @@ HRESULT WINAPI IWineD3DDeviceImpl_Clear(IWineD3DDevice *iface, DWORD Count, CONS
old_color_clear_value[1], old_color_clear_value[1],
old_color_clear_value[2], old_color_clear_value[2],
old_color_clear_value[3]); old_color_clear_value[3]);
glColorMask(This->stateBlock->renderState[D3DRS_COLORWRITEENABLE] & D3DCOLORWRITEENABLE_RED ? GL_TRUE : GL_FALSE, glColorMask(This->stateBlock->renderState[WINED3DRS_COLORWRITEENABLE] & D3DCOLORWRITEENABLE_RED ? GL_TRUE : GL_FALSE,
This->stateBlock->renderState[D3DRS_COLORWRITEENABLE] & D3DCOLORWRITEENABLE_GREEN ? GL_TRUE : GL_FALSE, This->stateBlock->renderState[WINED3DRS_COLORWRITEENABLE] & D3DCOLORWRITEENABLE_GREEN ? GL_TRUE : GL_FALSE,
This->stateBlock->renderState[D3DRS_COLORWRITEENABLE] & D3DCOLORWRITEENABLE_BLUE ? GL_TRUE : GL_FALSE, This->stateBlock->renderState[WINED3DRS_COLORWRITEENABLE] & D3DCOLORWRITEENABLE_BLUE ? GL_TRUE : GL_FALSE,
This->stateBlock->renderState[D3DRS_COLORWRITEENABLE] & D3DCOLORWRITEENABLE_ALPHA ? GL_TRUE : GL_FALSE); This->stateBlock->renderState[WINED3DRS_COLORWRITEENABLE] & D3DCOLORWRITEENABLE_ALPHA ? GL_TRUE : GL_FALSE);
} }
glDisable(GL_SCISSOR_TEST); glDisable(GL_SCISSOR_TEST);
@ -3991,7 +3983,7 @@ HRESULT WINAPI IWineD3DDeviceImpl_DrawIndexedPrimitive(IWineD3DDevice *iface,
minIndex, NumVertices, startIndex, baseVIndex, primCount); minIndex, NumVertices, startIndex, baseVIndex, primCount);
IWineD3DIndexBuffer_GetDesc(pIB, &IdxBufDsc); IWineD3DIndexBuffer_GetDesc(pIB, &IdxBufDsc);
if (IdxBufDsc.Format == D3DFMT_INDEX16) { if (IdxBufDsc.Format == WINED3DFMT_INDEX16) {
idxStride = 2; idxStride = 2;
} else { } else {
idxStride = 4; idxStride = 4;
@ -4043,7 +4035,7 @@ HRESULT WINAPI IWineD3DDeviceImpl_DrawIndexedPrimitiveUP(IWineD3DDevice *iface,
if (This->stateBlock->stream_source[0] != NULL) IWineD3DVertexBuffer_Release(This->stateBlock->stream_source[0]); if (This->stateBlock->stream_source[0] != NULL) IWineD3DVertexBuffer_Release(This->stateBlock->stream_source[0]);
if (IndexDataFormat == D3DFMT_INDEX16) { if (IndexDataFormat == WINED3DFMT_INDEX16) {
idxStride = 2; idxStride = 2;
} else { } else {
idxStride = 4; idxStride = 4;
@ -4268,7 +4260,7 @@ HRESULT WINAPI IWineD3DDeviceImpl_SetCursorProperties(IWineD3DDevice* iface, U
TRACE("(%p) : Spot Pos(%u,%u)\n", This, XHotSpot, YHotSpot); TRACE("(%p) : Spot Pos(%u,%u)\n", This, XHotSpot, YHotSpot);
if (D3DFMT_A8R8G8B8 != pSur->currentDesc.Format) { if (WINED3DFMT_A8R8G8B8 != pSur->currentDesc.Format) {
ERR("(%p) : surface(%p) have a invalid format\n", This, pCursorBitmap); ERR("(%p) : surface(%p) have a invalid format\n", This, pCursorBitmap);
return D3DERR_INVALIDCALL; return D3DERR_INVALIDCALL;
} }

View File

@ -35,15 +35,6 @@ extern IDirect3DPixelShaderImpl* PixelShaders[64];
#undef GL_VERSION_1_4 /* To be fixed, caused by mesa headers */ #undef GL_VERSION_1_4 /* To be fixed, caused by mesa headers */
#endif #endif
/* Useful internal structure, holding place for 4 floats */
typedef struct _D3DVECTOR_4 {
float x;
float y;
float z;
float w;
} D3DVECTOR_4;
/* Returns bits for what is expected from the fixed function pipeline, and whether /* Returns bits for what is expected from the fixed function pipeline, and whether
a vertex shader will be in use. Note the fvf bits returned may be split over a vertex shader will be in use. Note the fvf bits returned may be split over
multiple streams only if the vertex shader was created, otherwise it all relates multiple streams only if the vertex shader was created, otherwise it all relates
@ -519,7 +510,7 @@ void draw_vertex(IWineD3DDevice *iface, /* interfac
BOOL isDiffuse, float *dRGBA, /* 1st colors */ BOOL isDiffuse, float *dRGBA, /* 1st colors */
BOOL isSpecular, float *sRGB, /* 2ndry colors */ BOOL isSpecular, float *sRGB, /* 2ndry colors */
BOOL isPtSize, float ptSize, /* pointSize */ BOOL isPtSize, float ptSize, /* pointSize */
D3DVECTOR_4 *texcoords, int *numcoords) /* texture info */ WINED3DVECTOR_4 *texcoords, int *numcoords) /* texture info */
{ {
unsigned int textureNo; unsigned int textureNo;
float s, t, r, q; float s, t, r, q;

337
dlls/wined3d/query.c Normal file
View File

@ -0,0 +1,337 @@
/*
* IWineD3DQuery implementation
*
* Copyright 2005 Oliver Stieber
*
*
*
* 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 "config.h"
#include "wined3d_private.h"
/*
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/directx9_c/directx/graphics/programmingguide/advancedtopics/Queries.asp
*/
WINE_DEFAULT_DEBUG_CHANNEL(d3d);
/* *******************************************
IWineD3DQuery IUnknown parts follow
******************************************* */
HRESULT WINAPI IWineD3DQueryImpl_QueryInterface(IWineD3DQuery *iface, REFIID riid, LPVOID *ppobj)
{
IWineD3DQueryImpl *This = (IWineD3DQueryImpl *)iface;
TRACE("(%p)->(%s,%p)\n",This,debugstr_guid(riid),ppobj);
if (IsEqualGUID(riid, &IID_IUnknown)
|| IsEqualGUID(riid, &IID_IWineD3DQuery)) {
IUnknown_AddRef(iface);
*ppobj = This;
return D3D_OK;
}
return E_NOINTERFACE;
}
ULONG WINAPI IWineD3DQueryImpl_AddRef(IWineD3DQuery *iface) {
IWineD3DQueryImpl *This = (IWineD3DQueryImpl *)iface;
TRACE("(%p) : AddRef increasing from %ld\n", This, This->ref);
return InterlockedIncrement(&This->ref);
}
ULONG WINAPI IWineD3DQueryImpl_Release(IWineD3DQuery *iface) {
IWineD3DQueryImpl *This = (IWineD3DQueryImpl *)iface;
ULONG ref;
TRACE("(%p) : Releasing from %ld\n", This, This->ref);
ref = InterlockedDecrement(&This->ref);
if (ref == 0) {
if(This->extendedData != NULL){
HeapFree(GetProcessHeap(), 0, This->extendedData);
}
HeapFree(GetProcessHeap(), 0, This);
}
return ref;
}
/* *******************************************
IWineD3DQuery IWineD3DQuery parts follow
******************************************* */
HRESULT WINAPI IWineD3DQueryImpl_GetParent(IWineD3DQuery *iface, IUnknown** parent){
IWineD3DQueryImpl *This = (IWineD3DQueryImpl *)iface;
*parent= (IUnknown*) parent;
IUnknown_AddRef(*parent);
TRACE("(%p) : returning %p\n", This, *parent);
return D3D_OK;
}
HRESULT WINAPI IWineD3DQueryImpl_GetDevice(IWineD3DQuery* iface, IWineD3DDevice **pDevice){
IWineD3DQueryImpl *This = (IWineD3DQueryImpl *)iface;
IWineD3DDevice_AddRef((IWineD3DDevice *)This->wineD3DDevice);
*pDevice = (IWineD3DDevice *)This->wineD3DDevice;
TRACE("(%p) returning %p\n", This, *pDevice);
return D3D_OK;
}
HRESULT WINAPI IWineD3DQueryImpl_GetData(IWineD3DQuery* iface, void* pData, DWORD dwSize, DWORD dwGetDataFlags){
IWineD3DQueryImpl *This = (IWineD3DQueryImpl *)iface;
if(dwSize == 0){
/*you can use this method to poll the resource for the query status*/
/*We return success(S_OK) if we support a feature, and faikure(S_FALSE) if we don't, just return success and fluff it for now*/
return S_OK;
}else{
}
switch (This->type){
case WINED3DQUERYTYPE_VCACHE:
{
WINED3DDEVINFO_VCACHE *data = (WINED3DDEVINFO_VCACHE *)pData;
data->Pattern = MAKEFOURCC('C','A','C','H');
data->OptMethod = 0; /*0 get longest strips, 1 optimize vertex cache*/
data->CacheSize = 0; /*cache size, only required if OptMethod == 1*/
data->MagicNumber = 0; /*only required if OptMethod == 1 (used internally)*/
}
break;
case WINED3DQUERYTYPE_RESOURCEMANAGER:
{
WINED3DDEVINFO_RESOURCEMANAGER *data = (WINED3DDEVINFO_RESOURCEMANAGER *)pData;
int i;
for(i = 0; i < D3DRTYPECOUNT; i++){
/*I'm setting the default values to 1 so as to reduce the risk of a div/0 in the caller*/
/* isTextureResident could be used to get some of this infomration */
data->stats[i].bThrashing = FALSE;
data->stats[i].ApproxBytesDownloaded = 1;
data->stats[i].NumEvicts = 1;
data->stats[i].NumVidCreates = 1;
data->stats[i].LastPri = 1;
data->stats[i].NumUsed = 1;
data->stats[i].NumUsedInVidMem = 1;
data->stats[i].WorkingSet = 1;
data->stats[i].WorkingSetBytes = 1;
data->stats[i].TotalManaged = 1;
data->stats[i].TotalBytes = 1;
}
}
break;
case WINED3DQUERYTYPE_VERTEXSTATS:
{
WINED3DDEVINFO_VERTEXSTATS *data = (WINED3DDEVINFO_VERTEXSTATS *)pData;
data->NumRenderedTriangles = 1;
data->NumExtraClippingTriangles = 1;
}
break;
case WINED3DQUERYTYPE_EVENT:
{
BOOL* data = pData;
*data = TRUE; /*Don't know what this is supposed to be*/
}
break;
case WINED3DQUERYTYPE_OCCLUSION:
{
DWORD* data = pData;
*data = 1;
/* TODO: opengl occlusion queries
http://www.gris.uni-tuebingen.de/~bartz/Publications/paper/hww98.pdf
http://oss.sgi.com/projects/ogl-sample/registry/ARB/occlusion_query.txt
http://oss.sgi.com/projects/ogl-sample/registry/ARB/occlusion_query.txt
*/
}
break;
case WINED3DQUERYTYPE_TIMESTAMP:
{
UINT64* data = pData;
*data = 1; /*Don't know what this is supposed to be*/
}
break;
case WINED3DQUERYTYPE_TIMESTAMPDISJOINT:
{
BOOL* data = pData;
*data = FALSE; /*Don't know what this is supposed to be*/
}
break;
case WINED3DQUERYTYPE_TIMESTAMPFREQ:
{
UINT64* data = pData;
*data = 1; /*Don't know what this is supposed to be*/
}
break;
case WINED3DQUERYTYPE_PIPELINETIMINGS:
{
WINED3DDEVINFO_PIPELINETIMINGS *data = (WINED3DDEVINFO_PIPELINETIMINGS *)pData;
data->VertexProcessingTimePercent = 1.0f;
data->PixelProcessingTimePercent = 1.0f;
data->OtherGPUProcessingTimePercent = 97.0f;
data->GPUIdleTimePercent = 1.0f;
}
break;
case WINED3DQUERYTYPE_INTERFACETIMINGS:
{
WINED3DDEVINFO_INTERFACETIMINGS *data = (WINED3DDEVINFO_INTERFACETIMINGS *)pData;
data->WaitingForGPUToUseApplicationResourceTimePercent = 1.0f;
data->WaitingForGPUToAcceptMoreCommandsTimePercent = 1.0f;
data->WaitingForGPUToStayWithinLatencyTimePercent = 1.0f;
data->WaitingForGPUExclusiveResourceTimePercent = 1.0f;
data->WaitingForGPUOtherTimePercent = 96.0f;
}
break;
case WINED3DQUERYTYPE_VERTEXTIMINGS:
{
WINED3DDEVINFO_STAGETIMINGS *data = (WINED3DDEVINFO_STAGETIMINGS *)pData;
data->MemoryProcessingPercent = 50.0f;
data->ComputationProcessingPercent = 50.0f;
}
break;
case WINED3DQUERYTYPE_PIXELTIMINGS:
{
WINED3DDEVINFO_STAGETIMINGS *data = (WINED3DDEVINFO_STAGETIMINGS *)pData;
data->MemoryProcessingPercent = 50.0f;
data->ComputationProcessingPercent = 50.0f;
}
break;
case WINED3DQUERYTYPE_BANDWIDTHTIMINGS:
{
WINED3DDEVINFO_BANDWIDTHTIMINGS *data = (WINED3DDEVINFO_BANDWIDTHTIMINGS *)pData;
data->MaxBandwidthUtilized = 1.0f;
data->FrontEndUploadMemoryUtilizedPercent = 1.0f;
data->VertexRateUtilizedPercent = 1.0f;
data->TriangleSetupRateUtilizedPercent = 1.0f;
data->FillRateUtilizedPercent = 97.0f;
}
break;
case WINED3DQUERYTYPE_CACHEUTILIZATION:
{
WINED3DDEVINFO_CACHEUTILIZATION *data = (WINED3DDEVINFO_CACHEUTILIZATION *)pData;
data->TextureCacheHitRate = 1.0f;
data->PostTransformVertexCacheHitRate = 1.0f;
}
break;
default:
FIXME("(%p) Unhandled query type %d\n",This , This->type);
};
/*dwGetDataFlags = 0 || D3DGETDATA_FLUSH
D3DGETDATA_FLUSH may return D3DERR_DEVICELOST if the device is lost
*/
FIXME("(%p) : stub \n", This);
return S_OK; /* S_OK if the query data is available*/
}
DWORD WINAPI IWineD3DQueryImpl_GetDataSize(IWineD3DQuery* iface){
IWineD3DQueryImpl *This = (IWineD3DQueryImpl *)iface;
int dataSize = 0;
FIXME("(%p) : stub \n", This);
switch(This->type){
case WINED3DQUERYTYPE_VCACHE:
dataSize = sizeof(WINED3DDEVINFO_VCACHE);
break;
case WINED3DQUERYTYPE_RESOURCEMANAGER:
dataSize = sizeof(WINED3DDEVINFO_RESOURCEMANAGER);
break;
case WINED3DQUERYTYPE_VERTEXSTATS:
dataSize = sizeof(WINED3DDEVINFO_VERTEXSTATS);
break;
case WINED3DQUERYTYPE_EVENT:
dataSize = sizeof(BOOL);
break;
case WINED3DQUERYTYPE_OCCLUSION:
dataSize = sizeof(DWORD);
/*
http://www.gris.uni-tuebingen.de/~bartz/Publications/paper/hww98.pdf
http://oss.sgi.com/projects/ogl-sample/registry/ARB/occlusion_query.txt
http://oss.sgi.com/projects/ogl-sample/registry/ARB/occlusion_query.txt
*/
break;
case WINED3DQUERYTYPE_TIMESTAMP:
dataSize = sizeof(UINT64);
break;
case WINED3DQUERYTYPE_TIMESTAMPDISJOINT:
dataSize = sizeof(BOOL);
break;
case WINED3DQUERYTYPE_TIMESTAMPFREQ:
dataSize = sizeof(UINT64);
break;
case WINED3DQUERYTYPE_PIPELINETIMINGS:
dataSize = sizeof(WINED3DDEVINFO_PIPELINETIMINGS);
break;
case WINED3DQUERYTYPE_INTERFACETIMINGS:
dataSize = sizeof(WINED3DDEVINFO_INTERFACETIMINGS);
break;
case WINED3DQUERYTYPE_VERTEXTIMINGS:
dataSize = sizeof(WINED3DDEVINFO_STAGETIMINGS);
break;
case WINED3DQUERYTYPE_PIXELTIMINGS:
dataSize = sizeof(WINED3DDEVINFO_STAGETIMINGS);
break;
case WINED3DQUERYTYPE_BANDWIDTHTIMINGS:
dataSize = sizeof(WINED3DQUERYTYPE_BANDWIDTHTIMINGS);
break;
case WINED3DQUERYTYPE_CACHEUTILIZATION:
dataSize = sizeof(WINED3DDEVINFO_CACHEUTILIZATION);
break;
default:
FIXME("(%p) Unhandled query type %d\n",This , This->type);
dataSize = 0;
}
return dataSize;
}
WINED3DQUERYTYPE WINAPI IWineD3DQueryImpl_GetType(IWineD3DQuery* iface){
IWineD3DQueryImpl *This = (IWineD3DQueryImpl *)iface;
return This->type;
}
HRESULT WINAPI IWineD3DQueryImpl_Issue(IWineD3DQuery* iface, DWORD dwIssueFlags){
IWineD3DQueryImpl *This = (IWineD3DQueryImpl *)iface;
FIXME("(%p) : stub \n", This);
return D3D_OK; /* can be D3DERR_INVALIDCALL. */
}
/**********************************************************
* IWineD3DQuery VTbl follows
**********************************************************/
IWineD3DQueryVtbl IWineD3DQuery_Vtbl =
{
/*** IUnknown methods ***/
IWineD3DQueryImpl_QueryInterface,
IWineD3DQueryImpl_AddRef,
IWineD3DQueryImpl_Release,
/*** IWineD3Dquery methods ***/
IWineD3DQueryImpl_GetParent,
IWineD3DQueryImpl_GetDevice,
IWineD3DQueryImpl_GetData,
IWineD3DQueryImpl_GetDataSize,
IWineD3DQueryImpl_GetType,
IWineD3DQueryImpl_Issue
};

View File

@ -101,102 +101,102 @@ HRESULT WINAPI IWineD3DStateBlockImpl_InitStartupStateBlock(IWineD3DStateBlock*
/* Render states: */ /* Render states: */
if (ThisDevice->presentParms.EnableAutoDepthStencil) { if (ThisDevice->presentParms.EnableAutoDepthStencil) {
IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, D3DRS_ZENABLE, D3DZB_TRUE); IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, WINED3DRS_ZENABLE, D3DZB_TRUE);
} else { } else {
IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, D3DRS_ZENABLE, D3DZB_FALSE); IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, WINED3DRS_ZENABLE, D3DZB_FALSE);
} }
IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, D3DRS_FILLMODE, D3DFILL_SOLID); IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, WINED3DRS_FILLMODE, D3DFILL_SOLID);
IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, D3DRS_SHADEMODE, D3DSHADE_GOURAUD); IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, WINED3DRS_SHADEMODE, D3DSHADE_GOURAUD);
lp.lp.wRepeatFactor = 0; lp.lp.wLinePattern = 0; lp.lp.wRepeatFactor = 0; lp.lp.wLinePattern = 0;
IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, D3DRS_LINEPATTERN, lp.d); IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, WINED3DRS_LINEPATTERN, lp.d);
IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, D3DRS_ZWRITEENABLE, TRUE); IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, WINED3DRS_ZWRITEENABLE, TRUE);
IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, D3DRS_ALPHATESTENABLE, FALSE); IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, WINED3DRS_ALPHATESTENABLE, FALSE);
IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, D3DRS_LASTPIXEL, TRUE); IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, WINED3DRS_LASTPIXEL, TRUE);
IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, D3DRS_SRCBLEND, D3DBLEND_ONE); IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, WINED3DRS_SRCBLEND, D3DBLEND_ONE);
IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, D3DRS_DESTBLEND, D3DBLEND_ZERO); IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, WINED3DRS_DESTBLEND, D3DBLEND_ZERO);
IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, D3DRS_CULLMODE, D3DCULL_CCW); IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, WINED3DRS_CULLMODE, D3DCULL_CCW);
IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, D3DRS_ZFUNC, D3DCMP_LESSEQUAL); IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, WINED3DRS_ZFUNC, D3DCMP_LESSEQUAL);
IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, D3DRS_ALPHAFUNC, D3DCMP_ALWAYS); IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, WINED3DRS_ALPHAFUNC, D3DCMP_ALWAYS);
IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, D3DRS_ALPHAREF, 0xff); /*??*/ IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, WINED3DRS_ALPHAREF, 0xff); /*??*/
IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, D3DRS_DITHERENABLE, FALSE); IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, WINED3DRS_DITHERENABLE, FALSE);
IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, D3DRS_ALPHABLENDENABLE, FALSE); IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, WINED3DRS_ALPHABLENDENABLE, FALSE);
IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, D3DRS_FOGENABLE, FALSE); IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, WINED3DRS_FOGENABLE, FALSE);
IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, D3DRS_SPECULARENABLE, FALSE); IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, WINED3DRS_SPECULARENABLE, FALSE);
IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, D3DRS_ZVISIBLE, 0); IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, WINED3DRS_ZVISIBLE, 0);
IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, D3DRS_FOGCOLOR, 0); IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, WINED3DRS_FOGCOLOR, 0);
IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, D3DRS_FOGTABLEMODE, D3DFOG_NONE); IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, WINED3DRS_FOGTABLEMODE, D3DFOG_NONE);
tmpfloat.f = 0.0f; tmpfloat.f = 0.0f;
IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, D3DRS_FOGSTART, tmpfloat.d); IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, WINED3DRS_FOGSTART, tmpfloat.d);
tmpfloat.f = 1.0f; tmpfloat.f = 1.0f;
IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, D3DRS_FOGEND, tmpfloat.d); IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, WINED3DRS_FOGEND, tmpfloat.d);
tmpfloat.f = 1.0f; tmpfloat.f = 1.0f;
IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, D3DRS_FOGDENSITY, tmpfloat.d); IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, WINED3DRS_FOGDENSITY, tmpfloat.d);
IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, D3DRS_EDGEANTIALIAS, FALSE); IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, WINED3DRS_EDGEANTIALIAS, FALSE);
IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, D3DRS_ZBIAS, 0); IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, WINED3DRS_ZBIAS, 0);
IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, D3DRS_RANGEFOGENABLE, FALSE); IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, WINED3DRS_RANGEFOGENABLE, FALSE);
IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, D3DRS_STENCILENABLE, FALSE); IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, WINED3DRS_STENCILENABLE, FALSE);
IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, D3DRS_STENCILFAIL, D3DSTENCILOP_KEEP); IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, WINED3DRS_STENCILFAIL, D3DSTENCILOP_KEEP);
IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, D3DRS_STENCILZFAIL, D3DSTENCILOP_KEEP); IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, WINED3DRS_STENCILZFAIL, D3DSTENCILOP_KEEP);
IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, D3DRS_STENCILPASS, D3DSTENCILOP_KEEP); IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, WINED3DRS_STENCILPASS, D3DSTENCILOP_KEEP);
/* Setting stencil func also uses values for stencil ref/mask, so manually set defaults /* Setting stencil func also uses values for stencil ref/mask, so manually set defaults
* so only a single call performed (and ensure defaults initialized before making that call) * so only a single call performed (and ensure defaults initialized before making that call)
* *
* IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, D3DRS_STENCILREF, 0); * IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, WINED3DRS_STENCILREF, 0);
* IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, D3DRS_STENCILMASK, 0xFFFFFFFF); * IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, WINED3DRS_STENCILMASK, 0xFFFFFFFF);
*/ */
This->renderState[D3DRS_STENCILREF] = 0; This->renderState[WINED3DRS_STENCILREF] = 0;
This->renderState[D3DRS_STENCILMASK] = 0xFFFFFFFF; This->renderState[WINED3DRS_STENCILMASK] = 0xFFFFFFFF;
IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, D3DRS_STENCILFUNC, D3DCMP_ALWAYS); IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, WINED3DRS_STENCILFUNC, D3DCMP_ALWAYS);
IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, D3DRS_STENCILWRITEMASK, 0xFFFFFFFF); IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, WINED3DRS_STENCILWRITEMASK, 0xFFFFFFFF);
IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, D3DRS_TEXTUREFACTOR, 0xFFFFFFFF); IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, WINED3DRS_TEXTUREFACTOR, 0xFFFFFFFF);
IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, D3DRS_WRAP0, 0); IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, WINED3DRS_WRAP0, 0);
IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, D3DRS_WRAP1, 0); IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, WINED3DRS_WRAP1, 0);
IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, D3DRS_WRAP2, 0); IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, WINED3DRS_WRAP2, 0);
IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, D3DRS_WRAP3, 0); IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, WINED3DRS_WRAP3, 0);
IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, D3DRS_WRAP4, 0); IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, WINED3DRS_WRAP4, 0);
IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, D3DRS_WRAP5, 0); IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, WINED3DRS_WRAP5, 0);
IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, D3DRS_WRAP6, 0); IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, WINED3DRS_WRAP6, 0);
IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, D3DRS_WRAP7, 0); IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, WINED3DRS_WRAP7, 0);
IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, D3DRS_CLIPPING, TRUE); IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, WINED3DRS_CLIPPING, TRUE);
IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, D3DRS_LIGHTING, TRUE); IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, WINED3DRS_LIGHTING, TRUE);
IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, D3DRS_AMBIENT, 0); IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, WINED3DRS_AMBIENT, 0);
IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, D3DRS_FOGVERTEXMODE, D3DFOG_NONE); IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, WINED3DRS_FOGVERTEXMODE, D3DFOG_NONE);
IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, D3DRS_COLORVERTEX, TRUE); IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, WINED3DRS_COLORVERTEX, TRUE);
IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, D3DRS_LOCALVIEWER, TRUE); IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, WINED3DRS_LOCALVIEWER, TRUE);
IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, D3DRS_NORMALIZENORMALS, FALSE); IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, WINED3DRS_NORMALIZENORMALS, FALSE);
IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, D3DRS_DIFFUSEMATERIALSOURCE, D3DMCS_COLOR1); IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, WINED3DRS_DIFFUSEMATERIALSOURCE, D3DMCS_COLOR1);
IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, D3DRS_SPECULARMATERIALSOURCE, D3DMCS_COLOR2); IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, WINED3DRS_SPECULARMATERIALSOURCE, D3DMCS_COLOR2);
IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, D3DRS_AMBIENTMATERIALSOURCE, D3DMCS_COLOR2); IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, WINED3DRS_AMBIENTMATERIALSOURCE, D3DMCS_COLOR2);
IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, D3DRS_EMISSIVEMATERIALSOURCE, D3DMCS_MATERIAL); IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, WINED3DRS_EMISSIVEMATERIALSOURCE, D3DMCS_MATERIAL);
IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, D3DRS_VERTEXBLEND, D3DVBF_DISABLE); IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, WINED3DRS_VERTEXBLEND, D3DVBF_DISABLE);
IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, D3DRS_CLIPPLANEENABLE, 0); IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, WINED3DRS_CLIPPLANEENABLE, 0);
IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, D3DRS_SOFTWAREVERTEXPROCESSING, FALSE); IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, WINED3DRS_SOFTWAREVERTEXPROCESSING, FALSE);
tmpfloat.f = 1.0f; tmpfloat.f = 1.0f;
IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, D3DRS_POINTSIZE, tmpfloat.d); IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, WINED3DRS_POINTSIZE, tmpfloat.d);
tmpfloat.f = 0.0f; tmpfloat.f = 0.0f;
IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, D3DRS_POINTSIZE_MIN, tmpfloat.d); IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, WINED3DRS_POINTSIZE_MIN, tmpfloat.d);
IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, D3DRS_POINTSPRITEENABLE, FALSE); IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, WINED3DRS_POINTSPRITEENABLE, FALSE);
IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, D3DRS_POINTSCALEENABLE, FALSE); IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, WINED3DRS_POINTSCALEENABLE, FALSE);
IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, D3DRS_POINTSCALE_A, TRUE); IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, WINED3DRS_POINTSCALE_A, TRUE);
IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, D3DRS_POINTSCALE_B, TRUE); IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, WINED3DRS_POINTSCALE_B, TRUE);
IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, D3DRS_POINTSCALE_C, TRUE); IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, WINED3DRS_POINTSCALE_C, TRUE);
IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, D3DRS_MULTISAMPLEANTIALIAS, TRUE); IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, WINED3DRS_MULTISAMPLEANTIALIAS, TRUE);
IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, D3DRS_MULTISAMPLEMASK, 0xFFFFFFFF); IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, WINED3DRS_MULTISAMPLEMASK, 0xFFFFFFFF);
IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, D3DRS_PATCHEDGESTYLE, D3DPATCHEDGE_DISCRETE); IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, WINED3DRS_PATCHEDGESTYLE, D3DPATCHEDGE_DISCRETE);
tmpfloat.f = 1.0f; tmpfloat.f = 1.0f;
IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, D3DRS_PATCHSEGMENTS, tmpfloat.d); IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, WINED3DRS_PATCHSEGMENTS, tmpfloat.d);
IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, D3DRS_DEBUGMONITORTOKEN, D3DDMT_DISABLE); IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, WINED3DRS_DEBUGMONITORTOKEN, D3DDMT_DISABLE);
tmpfloat.f = 64.0f; tmpfloat.f = 64.0f;
IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, D3DRS_POINTSIZE_MAX, tmpfloat.d); IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, WINED3DRS_POINTSIZE_MAX, tmpfloat.d);
IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, D3DRS_INDEXEDVERTEXBLENDENABLE, FALSE); IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, WINED3DRS_INDEXEDVERTEXBLENDENABLE, FALSE);
IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, D3DRS_COLORWRITEENABLE, 0x0000000F); IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, WINED3DRS_COLORWRITEENABLE, 0x0000000F);
tmpfloat.f = 0.0f; tmpfloat.f = 0.0f;
IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, D3DRS_TWEENFACTOR, tmpfloat.d); IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, WINED3DRS_TWEENFACTOR, tmpfloat.d);
IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, D3DRS_BLENDOP, D3DBLENDOP_ADD); IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, WINED3DRS_BLENDOP, D3DBLENDOP_ADD);
IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, D3DRS_POSITIONORDER, D3DORDER_CUBIC); IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, WINED3DRS_POSITIONORDER, WINED3DDEGREE_CUBIC);
IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, D3DRS_NORMALORDER, D3DORDER_LINEAR); IWineD3DDevice_SetRenderState((IWineD3DDevice *)This->wineD3DDevice, WINED3DRS_NORMALORDER, WINED3DDEGREE_LINEAR);
/** clipping status */ /** clipping status */
This->clip_status.ClipUnion = 0; This->clip_status.ClipUnion = 0;

View File

@ -167,9 +167,9 @@ HRESULT WINAPI IWineD3DSurfaceImpl_LockRect(IWineD3DSurface *iface, D3DLOCKED_RE
/* DXTn formats don't have exact pitches as they are to the new row of blocks, /* DXTn formats don't have exact pitches as they are to the new row of blocks,
where each block is 4x4 pixels, 8 bytes (dxt1) and 16 bytes (dxt3/5) where each block is 4x4 pixels, 8 bytes (dxt1) and 16 bytes (dxt3/5)
ie pitch = (width/4) * bytes per block */ ie pitch = (width/4) * bytes per block */
if (This->currentDesc.Format == D3DFMT_DXT1) /* DXT1 is 8 bytes per block */ if (This->currentDesc.Format == WINED3DFMT_DXT1) /* DXT1 is 8 bytes per block */
pLockedRect->Pitch = (This->currentDesc.Width/4) * 8; pLockedRect->Pitch = (This->currentDesc.Width/4) * 8;
else if (This->currentDesc.Format == D3DFMT_DXT3 || This->currentDesc.Format == D3DFMT_DXT5) /* DXT3/5 is 16 bytes per block */ else if (This->currentDesc.Format == WINED3DFMT_DXT3 || This->currentDesc.Format == WINED3DFMT_DXT5) /* DXT3/5 is 16 bytes per block */
pLockedRect->Pitch = (This->currentDesc.Width/4) * 16; pLockedRect->Pitch = (This->currentDesc.Width/4) * 16;
else else
pLockedRect->Pitch = This->bytesPerPixel * This->currentDesc.Width; /* Bytes / row */ pLockedRect->Pitch = This->bytesPerPixel * This->currentDesc.Width; /* Bytes / row */
@ -184,7 +184,7 @@ HRESULT WINAPI IWineD3DSurfaceImpl_LockRect(IWineD3DSurface *iface, D3DLOCKED_RE
} else { } else {
TRACE("Lock Rect (%p) = l %ld, t %ld, r %ld, b %ld\n", pRect, pRect->left, pRect->top, pRect->right, pRect->bottom); TRACE("Lock Rect (%p) = l %ld, t %ld, r %ld, b %ld\n", pRect, pRect->left, pRect->top, pRect->right, pRect->bottom);
if (This->currentDesc.Format == D3DFMT_DXT1) { /* DXT1 is half byte per pixel */ if (This->currentDesc.Format == WINED3DFMT_DXT1) { /* DXT1 is half byte per pixel */
pLockedRect->pBits = This->allocatedMemory + (pLockedRect->Pitch * pRect->top) + ((pRect->left * This->bytesPerPixel/2)); pLockedRect->pBits = This->allocatedMemory + (pLockedRect->Pitch * pRect->top) + ((pRect->left * This->bytesPerPixel/2));
} else { } else {
pLockedRect->pBits = This->allocatedMemory + (pLockedRect->Pitch * pRect->top) + (pRect->left * This->bytesPerPixel); pLockedRect->pBits = This->allocatedMemory + (pLockedRect->Pitch * pRect->top) + (pRect->left * This->bytesPerPixel);
@ -392,21 +392,21 @@ HRESULT WINAPI IWineD3DSurfaceImpl_UnlockRect(IWineD3DSurface *iface) {
glRasterPos3i(This->lockedRect.left, This->lockedRect.top, 1); glRasterPos3i(This->lockedRect.left, This->lockedRect.top, 1);
vcheckGLcall("glRasterPos2f"); vcheckGLcall("glRasterPos2f");
switch (This->currentDesc.Format) { switch (This->currentDesc.Format) {
case D3DFMT_R5G6B5: case WINED3DFMT_R5G6B5:
{ {
glDrawPixels(This->lockedRect.right - This->lockedRect.left, (This->lockedRect.bottom - This->lockedRect.top)-1, glDrawPixels(This->lockedRect.right - This->lockedRect.left, (This->lockedRect.bottom - This->lockedRect.top)-1,
GL_RGB, GL_UNSIGNED_SHORT_5_6_5, This->allocatedMemory); GL_RGB, GL_UNSIGNED_SHORT_5_6_5, This->allocatedMemory);
vcheckGLcall("glDrawPixels"); vcheckGLcall("glDrawPixels");
} }
break; break;
case D3DFMT_R8G8B8: case WINED3DFMT_R8G8B8:
{ {
glDrawPixels(This->lockedRect.right - This->lockedRect.left, (This->lockedRect.bottom - This->lockedRect.top)-1, glDrawPixels(This->lockedRect.right - This->lockedRect.left, (This->lockedRect.bottom - This->lockedRect.top)-1,
GL_RGB, GL_UNSIGNED_BYTE, This->allocatedMemory); GL_RGB, GL_UNSIGNED_BYTE, This->allocatedMemory);
vcheckGLcall("glDrawPixels"); vcheckGLcall("glDrawPixels");
} }
break; break;
case D3DFMT_A8R8G8B8: case WINED3DFMT_A8R8G8B8:
{ {
glPixelStorei(GL_PACK_SWAP_BYTES, TRUE); glPixelStorei(GL_PACK_SWAP_BYTES, TRUE);
vcheckGLcall("glPixelStorei"); vcheckGLcall("glPixelStorei");
@ -485,9 +485,9 @@ HRESULT WINAPI IWineD3DSurfaceImpl_LoadTexture(IWineD3DSurface *iface, GLenum gl
if (gl_level != 0) if (gl_level != 0)
FIXME("Surface in texture is only supported for level 0\n"); FIXME("Surface in texture is only supported for level 0\n");
else if (This->currentDesc.Format == D3DFMT_P8 || This->currentDesc.Format == D3DFMT_A8P8 || else if (This->currentDesc.Format == WINED3DFMT_P8 || This->currentDesc.Format == WINED3DFMT_A8P8 ||
This->currentDesc.Format == D3DFMT_DXT1 || This->currentDesc.Format == D3DFMT_DXT3 || This->currentDesc.Format == WINED3DFMT_DXT1 || This->currentDesc.Format == WINED3DFMT_DXT3 ||
This->currentDesc.Format == D3DFMT_DXT5) This->currentDesc.Format == WINED3DFMT_DXT5)
FIXME("Format %d not supported\n", This->currentDesc.Format); FIXME("Format %d not supported\n", This->currentDesc.Format);
else { else {
glCopyTexImage2D(gl_target, glCopyTexImage2D(gl_target,
@ -506,7 +506,7 @@ HRESULT WINAPI IWineD3DSurfaceImpl_LoadTexture(IWineD3DSurface *iface, GLenum gl
return D3D_OK; return D3D_OK;
} }
if ((This->currentDesc.Format == D3DFMT_P8 || This->currentDesc.Format == D3DFMT_A8P8) && if ((This->currentDesc.Format == WINED3DFMT_P8 || This->currentDesc.Format == WINED3DFMT_A8P8) &&
!GL_SUPPORT(EXT_PALETTED_TEXTURE)) { !GL_SUPPORT(EXT_PALETTED_TEXTURE)) {
/** /**
* wanted a paletted texture and not really support it in HW * wanted a paletted texture and not really support it in HW
@ -523,7 +523,7 @@ HRESULT WINAPI IWineD3DSurfaceImpl_LoadTexture(IWineD3DSurface *iface, GLenum gl
*dst++ = pal[color].peRed; *dst++ = pal[color].peRed;
*dst++ = pal[color].peGreen; *dst++ = pal[color].peGreen;
*dst++ = pal[color].peBlue; *dst++ = pal[color].peBlue;
if (This->currentDesc.Format == D3DFMT_A8P8) if (This->currentDesc.Format == WINED3DFMT_A8P8)
*dst++ = pal[color].peFlags; *dst++ = pal[color].peFlags;
else else
*dst++ = 0xFF; *dst++ = 0xFF;
@ -558,9 +558,9 @@ HRESULT WINAPI IWineD3DSurfaceImpl_LoadTexture(IWineD3DSurface *iface, GLenum gl
return D3D_OK; return D3D_OK;
} }
if (This->currentDesc.Format == D3DFMT_DXT1 || if (This->currentDesc.Format == WINED3DFMT_DXT1 ||
This->currentDesc.Format == D3DFMT_DXT3 || This->currentDesc.Format == WINED3DFMT_DXT3 ||
This->currentDesc.Format == D3DFMT_DXT5) { This->currentDesc.Format == WINED3DFMT_DXT5) {
if (GL_SUPPORT(EXT_TEXTURE_COMPRESSION_S3TC)) { if (GL_SUPPORT(EXT_TEXTURE_COMPRESSION_S3TC)) {
TRACE("Calling glCompressedTexImage2D %x i=%d, intfmt=%x, w=%d, h=%d,0=%d, sz=%d, Mem=%p\n", TRACE("Calling glCompressedTexImage2D %x i=%d, intfmt=%x, w=%d, h=%d,0=%d, sz=%d, Mem=%p\n",
gl_target, gl_target,
@ -657,8 +657,8 @@ HRESULT WINAPI IWineD3DSurfaceImpl_SaveSnapshot(IWineD3DSurface *iface, const ch
fprintf(f, "P6\n%u %u\n255\n", This->currentDesc.Width, This->currentDesc.Height); fprintf(f, "P6\n%u %u\n255\n", This->currentDesc.Width, This->currentDesc.Height);
switch (This->currentDesc.Format) { switch (This->currentDesc.Format) {
case D3DFMT_X8R8G8B8: case WINED3DFMT_X8R8G8B8:
case D3DFMT_A8R8G8B8: case WINED3DFMT_A8R8G8B8:
{ {
DWORD color; DWORD color;
for (i = 0; i < This->currentDesc.Width * This->currentDesc.Height; i++) { for (i = 0; i < This->currentDesc.Width * This->currentDesc.Height; i++) {
@ -669,7 +669,7 @@ HRESULT WINAPI IWineD3DSurfaceImpl_SaveSnapshot(IWineD3DSurface *iface, const ch
} }
} }
break; break;
case D3DFMT_R8G8B8: case WINED3DFMT_R8G8B8:
{ {
BYTE* color; BYTE* color;
for (i = 0; i < This->currentDesc.Width * This->currentDesc.Height; i++) { for (i = 0; i < This->currentDesc.Width * This->currentDesc.Height; i++) {
@ -680,7 +680,7 @@ HRESULT WINAPI IWineD3DSurfaceImpl_SaveSnapshot(IWineD3DSurface *iface, const ch
} }
} }
break; break;
case D3DFMT_A1R5G5B5: case WINED3DFMT_A1R5G5B5:
{ {
WORD color; WORD color;
for (i = 0; i < This->currentDesc.Width * This->currentDesc.Height; i++) { for (i = 0; i < This->currentDesc.Width * This->currentDesc.Height; i++) {
@ -691,7 +691,7 @@ HRESULT WINAPI IWineD3DSurfaceImpl_SaveSnapshot(IWineD3DSurface *iface, const ch
} }
} }
break; break;
case D3DFMT_A4R4G4B4: case WINED3DFMT_A4R4G4B4:
{ {
WORD color; WORD color;
for (i = 0; i < This->currentDesc.Width * This->currentDesc.Height; i++) { for (i = 0; i < This->currentDesc.Width * This->currentDesc.Height; i++) {
@ -703,7 +703,7 @@ HRESULT WINAPI IWineD3DSurfaceImpl_SaveSnapshot(IWineD3DSurface *iface, const ch
} }
break; break;
case D3DFMT_R5G6B5: case WINED3DFMT_R5G6B5:
{ {
WORD color; WORD color;
for (i = 0; i < This->currentDesc.Width * This->currentDesc.Height; i++) { for (i = 0; i < This->currentDesc.Width * This->currentDesc.Height; i++) {

View File

@ -31,46 +31,58 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3d);
const char* debug_d3dformat(D3DFORMAT fmt) { const char* debug_d3dformat(D3DFORMAT fmt) {
switch (fmt) { switch (fmt) {
#define FMT_TO_STR(fmt) case fmt: return #fmt #define FMT_TO_STR(fmt) case fmt: return #fmt
FMT_TO_STR(D3DFMT_UNKNOWN); FMT_TO_STR(WINED3DFMT_UNKNOWN);
FMT_TO_STR(D3DFMT_R8G8B8); FMT_TO_STR(WINED3DFMT_R8G8B8);
FMT_TO_STR(D3DFMT_A8R8G8B8); FMT_TO_STR(WINED3DFMT_A8R8G8B8);
FMT_TO_STR(D3DFMT_X8R8G8B8); FMT_TO_STR(WINED3DFMT_X8R8G8B8);
FMT_TO_STR(D3DFMT_R5G6B5); FMT_TO_STR(WINED3DFMT_R5G6B5);
FMT_TO_STR(D3DFMT_X1R5G5B5); FMT_TO_STR(WINED3DFMT_X1R5G5B5);
FMT_TO_STR(D3DFMT_A1R5G5B5); FMT_TO_STR(WINED3DFMT_A1R5G5B5);
FMT_TO_STR(D3DFMT_A4R4G4B4); FMT_TO_STR(WINED3DFMT_A4R4G4B4);
FMT_TO_STR(D3DFMT_R3G3B2); FMT_TO_STR(WINED3DFMT_R3G3B2);
FMT_TO_STR(D3DFMT_A8); FMT_TO_STR(WINED3DFMT_A8);
FMT_TO_STR(D3DFMT_A8R3G3B2); FMT_TO_STR(WINED3DFMT_A8R3G3B2);
FMT_TO_STR(D3DFMT_X4R4G4B4); FMT_TO_STR(WINED3DFMT_X4R4G4B4);
FMT_TO_STR(D3DFMT_A8P8); FMT_TO_STR(WINED3DFMT_G16R16);
FMT_TO_STR(D3DFMT_P8); FMT_TO_STR(WINED3DFMT_A2R10G10B10);
FMT_TO_STR(D3DFMT_L8); FMT_TO_STR(WINED3DFMT_A16B16G16R16);
FMT_TO_STR(D3DFMT_A8L8); FMT_TO_STR(WINED3DFMT_A8P8);
FMT_TO_STR(D3DFMT_A4L4); FMT_TO_STR(WINED3DFMT_P8);
FMT_TO_STR(D3DFMT_V8U8); FMT_TO_STR(WINED3DFMT_L8);
FMT_TO_STR(D3DFMT_L6V5U5); FMT_TO_STR(WINED3DFMT_A8L8);
FMT_TO_STR(D3DFMT_X8L8V8U8); FMT_TO_STR(WINED3DFMT_A4L4);
FMT_TO_STR(D3DFMT_Q8W8V8U8); FMT_TO_STR(WINED3DFMT_V8U8);
FMT_TO_STR(D3DFMT_V16U16); FMT_TO_STR(WINED3DFMT_L6V5U5);
FMT_TO_STR(D3DFMT_W11V11U10); FMT_TO_STR(WINED3DFMT_X8L8V8U8);
FMT_TO_STR(D3DFMT_UYVY); FMT_TO_STR(WINED3DFMT_Q8W8V8U8);
FMT_TO_STR(D3DFMT_YUY2); FMT_TO_STR(WINED3DFMT_V16U16);
FMT_TO_STR(D3DFMT_DXT1); FMT_TO_STR(WINED3DFMT_W11V11U10);
FMT_TO_STR(D3DFMT_DXT2); FMT_TO_STR(WINED3DFMT_A2W10V10U10);
FMT_TO_STR(D3DFMT_DXT3); FMT_TO_STR(WINED3DFMT_UYVY);
FMT_TO_STR(D3DFMT_DXT4); FMT_TO_STR(WINED3DFMT_YUY2);
FMT_TO_STR(D3DFMT_DXT5); FMT_TO_STR(WINED3DFMT_DXT1);
FMT_TO_STR(D3DFMT_D16_LOCKABLE); FMT_TO_STR(WINED3DFMT_DXT2);
FMT_TO_STR(D3DFMT_D32); FMT_TO_STR(WINED3DFMT_DXT3);
FMT_TO_STR(D3DFMT_D15S1); FMT_TO_STR(WINED3DFMT_DXT4);
FMT_TO_STR(D3DFMT_D24S8); FMT_TO_STR(WINED3DFMT_DXT5);
FMT_TO_STR(D3DFMT_D16); FMT_TO_STR(WINED3DFMT_MULTI2_ARGB);
FMT_TO_STR(D3DFMT_D24X8); FMT_TO_STR(WINED3DFMT_G8R8_G8B8);
FMT_TO_STR(D3DFMT_D24X4S4); FMT_TO_STR(WINED3DFMT_R8G8_B8G8);
FMT_TO_STR(D3DFMT_VERTEXDATA); FMT_TO_STR(WINED3DFMT_D16_LOCKABLE);
FMT_TO_STR(D3DFMT_INDEX16); FMT_TO_STR(WINED3DFMT_D32);
FMT_TO_STR(D3DFMT_INDEX32); FMT_TO_STR(WINED3DFMT_D15S1);
FMT_TO_STR(WINED3DFMT_D24S8);
FMT_TO_STR(WINED3DFMT_D24X8);
FMT_TO_STR(WINED3DFMT_D24X4S4);
FMT_TO_STR(WINED3DFMT_D16);
FMT_TO_STR(WINED3DFMT_D32F_LOCKABLE);
FMT_TO_STR(WINED3DFMT_VERTEXDATA);
FMT_TO_STR(WINED3DFMT_INDEX16);
FMT_TO_STR(WINED3DFMT_INDEX32);
FMT_TO_STR(WINED3DFMT_Q16W16V16U16);
FMT_TO_STR(WINED3DFMT_R16F);
FMT_TO_STR(WINED3DFMT_G16R16F);
FMT_TO_STR(WINED3DFMT_A16B16G16R16F);
#undef FMT_TO_STR #undef FMT_TO_STR
default: default:
FIXME("Unrecognized %u D3DFORMAT!\n", fmt); FIXME("Unrecognized %u D3DFORMAT!\n", fmt);
@ -147,82 +159,82 @@ const char* debug_d3dprimitivetype(D3DPRIMITIVETYPE PrimitiveType) {
const char* debug_d3drenderstate(DWORD state) { const char* debug_d3drenderstate(DWORD state) {
switch (state) { switch (state) {
#define D3DSTATE_TO_STR(u) case u: return #u #define D3DSTATE_TO_STR(u) case u: return #u
D3DSTATE_TO_STR(D3DRS_ZENABLE ); D3DSTATE_TO_STR(WINED3DRS_ZENABLE );
D3DSTATE_TO_STR(D3DRS_FILLMODE ); D3DSTATE_TO_STR(WINED3DRS_FILLMODE );
D3DSTATE_TO_STR(D3DRS_SHADEMODE ); D3DSTATE_TO_STR(WINED3DRS_SHADEMODE );
D3DSTATE_TO_STR(D3DRS_LINEPATTERN ); D3DSTATE_TO_STR(WINED3DRS_LINEPATTERN );
D3DSTATE_TO_STR(D3DRS_ZWRITEENABLE ); D3DSTATE_TO_STR(WINED3DRS_ZWRITEENABLE );
D3DSTATE_TO_STR(D3DRS_ALPHATESTENABLE ); D3DSTATE_TO_STR(WINED3DRS_ALPHATESTENABLE );
D3DSTATE_TO_STR(D3DRS_LASTPIXEL ); D3DSTATE_TO_STR(WINED3DRS_LASTPIXEL );
D3DSTATE_TO_STR(D3DRS_SRCBLEND ); D3DSTATE_TO_STR(WINED3DRS_SRCBLEND );
D3DSTATE_TO_STR(D3DRS_DESTBLEND ); D3DSTATE_TO_STR(WINED3DRS_DESTBLEND );
D3DSTATE_TO_STR(D3DRS_CULLMODE ); D3DSTATE_TO_STR(WINED3DRS_CULLMODE );
D3DSTATE_TO_STR(D3DRS_ZFUNC ); D3DSTATE_TO_STR(WINED3DRS_ZFUNC );
D3DSTATE_TO_STR(D3DRS_ALPHAREF ); D3DSTATE_TO_STR(WINED3DRS_ALPHAREF );
D3DSTATE_TO_STR(D3DRS_ALPHAFUNC ); D3DSTATE_TO_STR(WINED3DRS_ALPHAFUNC );
D3DSTATE_TO_STR(D3DRS_DITHERENABLE ); D3DSTATE_TO_STR(WINED3DRS_DITHERENABLE );
D3DSTATE_TO_STR(D3DRS_ALPHABLENDENABLE ); D3DSTATE_TO_STR(WINED3DRS_ALPHABLENDENABLE );
D3DSTATE_TO_STR(D3DRS_FOGENABLE ); D3DSTATE_TO_STR(WINED3DRS_FOGENABLE );
D3DSTATE_TO_STR(D3DRS_SPECULARENABLE ); D3DSTATE_TO_STR(WINED3DRS_SPECULARENABLE );
D3DSTATE_TO_STR(D3DRS_ZVISIBLE ); D3DSTATE_TO_STR(WINED3DRS_ZVISIBLE );
D3DSTATE_TO_STR(D3DRS_FOGCOLOR ); D3DSTATE_TO_STR(WINED3DRS_FOGCOLOR );
D3DSTATE_TO_STR(D3DRS_FOGTABLEMODE ); D3DSTATE_TO_STR(WINED3DRS_FOGTABLEMODE );
D3DSTATE_TO_STR(D3DRS_FOGSTART ); D3DSTATE_TO_STR(WINED3DRS_FOGSTART );
D3DSTATE_TO_STR(D3DRS_FOGEND ); D3DSTATE_TO_STR(WINED3DRS_FOGEND );
D3DSTATE_TO_STR(D3DRS_FOGDENSITY ); D3DSTATE_TO_STR(WINED3DRS_FOGDENSITY );
D3DSTATE_TO_STR(D3DRS_EDGEANTIALIAS ); D3DSTATE_TO_STR(WINED3DRS_EDGEANTIALIAS );
D3DSTATE_TO_STR(D3DRS_ZBIAS ); D3DSTATE_TO_STR(WINED3DRS_ZBIAS );
D3DSTATE_TO_STR(D3DRS_RANGEFOGENABLE ); D3DSTATE_TO_STR(WINED3DRS_RANGEFOGENABLE );
D3DSTATE_TO_STR(D3DRS_STENCILENABLE ); D3DSTATE_TO_STR(WINED3DRS_STENCILENABLE );
D3DSTATE_TO_STR(D3DRS_STENCILFAIL ); D3DSTATE_TO_STR(WINED3DRS_STENCILFAIL );
D3DSTATE_TO_STR(D3DRS_STENCILZFAIL ); D3DSTATE_TO_STR(WINED3DRS_STENCILZFAIL );
D3DSTATE_TO_STR(D3DRS_STENCILPASS ); D3DSTATE_TO_STR(WINED3DRS_STENCILPASS );
D3DSTATE_TO_STR(D3DRS_STENCILFUNC ); D3DSTATE_TO_STR(WINED3DRS_STENCILFUNC );
D3DSTATE_TO_STR(D3DRS_STENCILREF ); D3DSTATE_TO_STR(WINED3DRS_STENCILREF );
D3DSTATE_TO_STR(D3DRS_STENCILMASK ); D3DSTATE_TO_STR(WINED3DRS_STENCILMASK );
D3DSTATE_TO_STR(D3DRS_STENCILWRITEMASK ); D3DSTATE_TO_STR(WINED3DRS_STENCILWRITEMASK );
D3DSTATE_TO_STR(D3DRS_TEXTUREFACTOR ); D3DSTATE_TO_STR(WINED3DRS_TEXTUREFACTOR );
D3DSTATE_TO_STR(D3DRS_WRAP0 ); D3DSTATE_TO_STR(WINED3DRS_WRAP0 );
D3DSTATE_TO_STR(D3DRS_WRAP1 ); D3DSTATE_TO_STR(WINED3DRS_WRAP1 );
D3DSTATE_TO_STR(D3DRS_WRAP2 ); D3DSTATE_TO_STR(WINED3DRS_WRAP2 );
D3DSTATE_TO_STR(D3DRS_WRAP3 ); D3DSTATE_TO_STR(WINED3DRS_WRAP3 );
D3DSTATE_TO_STR(D3DRS_WRAP4 ); D3DSTATE_TO_STR(WINED3DRS_WRAP4 );
D3DSTATE_TO_STR(D3DRS_WRAP5 ); D3DSTATE_TO_STR(WINED3DRS_WRAP5 );
D3DSTATE_TO_STR(D3DRS_WRAP6 ); D3DSTATE_TO_STR(WINED3DRS_WRAP6 );
D3DSTATE_TO_STR(D3DRS_WRAP7 ); D3DSTATE_TO_STR(WINED3DRS_WRAP7 );
D3DSTATE_TO_STR(D3DRS_CLIPPING ); D3DSTATE_TO_STR(WINED3DRS_CLIPPING );
D3DSTATE_TO_STR(D3DRS_LIGHTING ); D3DSTATE_TO_STR(WINED3DRS_LIGHTING );
D3DSTATE_TO_STR(D3DRS_AMBIENT ); D3DSTATE_TO_STR(WINED3DRS_AMBIENT );
D3DSTATE_TO_STR(D3DRS_FOGVERTEXMODE ); D3DSTATE_TO_STR(WINED3DRS_FOGVERTEXMODE );
D3DSTATE_TO_STR(D3DRS_COLORVERTEX ); D3DSTATE_TO_STR(WINED3DRS_COLORVERTEX );
D3DSTATE_TO_STR(D3DRS_LOCALVIEWER ); D3DSTATE_TO_STR(WINED3DRS_LOCALVIEWER );
D3DSTATE_TO_STR(D3DRS_NORMALIZENORMALS ); D3DSTATE_TO_STR(WINED3DRS_NORMALIZENORMALS );
D3DSTATE_TO_STR(D3DRS_DIFFUSEMATERIALSOURCE ); D3DSTATE_TO_STR(WINED3DRS_DIFFUSEMATERIALSOURCE );
D3DSTATE_TO_STR(D3DRS_SPECULARMATERIALSOURCE ); D3DSTATE_TO_STR(WINED3DRS_SPECULARMATERIALSOURCE );
D3DSTATE_TO_STR(D3DRS_AMBIENTMATERIALSOURCE ); D3DSTATE_TO_STR(WINED3DRS_AMBIENTMATERIALSOURCE );
D3DSTATE_TO_STR(D3DRS_EMISSIVEMATERIALSOURCE ); D3DSTATE_TO_STR(WINED3DRS_EMISSIVEMATERIALSOURCE );
D3DSTATE_TO_STR(D3DRS_VERTEXBLEND ); D3DSTATE_TO_STR(WINED3DRS_VERTEXBLEND );
D3DSTATE_TO_STR(D3DRS_CLIPPLANEENABLE ); D3DSTATE_TO_STR(WINED3DRS_CLIPPLANEENABLE );
D3DSTATE_TO_STR(D3DRS_SOFTWAREVERTEXPROCESSING ); D3DSTATE_TO_STR(WINED3DRS_SOFTWAREVERTEXPROCESSING );
D3DSTATE_TO_STR(D3DRS_POINTSIZE ); D3DSTATE_TO_STR(WINED3DRS_POINTSIZE );
D3DSTATE_TO_STR(D3DRS_POINTSIZE_MIN ); D3DSTATE_TO_STR(WINED3DRS_POINTSIZE_MIN );
D3DSTATE_TO_STR(D3DRS_POINTSPRITEENABLE ); D3DSTATE_TO_STR(WINED3DRS_POINTSPRITEENABLE );
D3DSTATE_TO_STR(D3DRS_POINTSCALEENABLE ); D3DSTATE_TO_STR(WINED3DRS_POINTSCALEENABLE );
D3DSTATE_TO_STR(D3DRS_POINTSCALE_A ); D3DSTATE_TO_STR(WINED3DRS_POINTSCALE_A );
D3DSTATE_TO_STR(D3DRS_POINTSCALE_B ); D3DSTATE_TO_STR(WINED3DRS_POINTSCALE_B );
D3DSTATE_TO_STR(D3DRS_POINTSCALE_C ); D3DSTATE_TO_STR(WINED3DRS_POINTSCALE_C );
D3DSTATE_TO_STR(D3DRS_MULTISAMPLEANTIALIAS ); D3DSTATE_TO_STR(WINED3DRS_MULTISAMPLEANTIALIAS );
D3DSTATE_TO_STR(D3DRS_MULTISAMPLEMASK ); D3DSTATE_TO_STR(WINED3DRS_MULTISAMPLEMASK );
D3DSTATE_TO_STR(D3DRS_PATCHEDGESTYLE ); D3DSTATE_TO_STR(WINED3DRS_PATCHEDGESTYLE );
D3DSTATE_TO_STR(D3DRS_PATCHSEGMENTS ); D3DSTATE_TO_STR(WINED3DRS_PATCHSEGMENTS );
D3DSTATE_TO_STR(D3DRS_DEBUGMONITORTOKEN ); D3DSTATE_TO_STR(WINED3DRS_DEBUGMONITORTOKEN );
D3DSTATE_TO_STR(D3DRS_POINTSIZE_MAX ); D3DSTATE_TO_STR(WINED3DRS_POINTSIZE_MAX );
D3DSTATE_TO_STR(D3DRS_INDEXEDVERTEXBLENDENABLE ); D3DSTATE_TO_STR(WINED3DRS_INDEXEDVERTEXBLENDENABLE );
D3DSTATE_TO_STR(D3DRS_COLORWRITEENABLE ); D3DSTATE_TO_STR(WINED3DRS_COLORWRITEENABLE );
D3DSTATE_TO_STR(D3DRS_TWEENFACTOR ); D3DSTATE_TO_STR(WINED3DRS_TWEENFACTOR );
D3DSTATE_TO_STR(D3DRS_BLENDOP ); D3DSTATE_TO_STR(WINED3DRS_BLENDOP );
D3DSTATE_TO_STR(D3DRS_POSITIONORDER ); D3DSTATE_TO_STR(WINED3DRS_POSITIONORDER );
D3DSTATE_TO_STR(D3DRS_NORMALORDER ); D3DSTATE_TO_STR(WINED3DRS_NORMALORDER );
#undef D3DSTATE_TO_STR #undef D3DSTATE_TO_STR
default: default:
FIXME("Unrecognized %lu render state!\n", state); FIXME("Unrecognized %lu render state!\n", state);
@ -1540,9 +1552,9 @@ GLint D3DFmt2GLIntFmt(IWineD3DDeviceImpl* This, D3DFORMAT fmt) {
if (GL_SUPPORT(EXT_TEXTURE_COMPRESSION_S3TC)) { if (GL_SUPPORT(EXT_TEXTURE_COMPRESSION_S3TC)) {
switch (fmt) { switch (fmt) {
case D3DFMT_DXT1: retVal = GL_COMPRESSED_RGBA_S3TC_DXT1_EXT; break; case WINED3DFMT_DXT1: retVal = GL_COMPRESSED_RGBA_S3TC_DXT1_EXT; break;
case D3DFMT_DXT3: retVal = GL_COMPRESSED_RGBA_S3TC_DXT3_EXT; break; case WINED3DFMT_DXT3: retVal = GL_COMPRESSED_RGBA_S3TC_DXT3_EXT; break;
case D3DFMT_DXT5: retVal = GL_COMPRESSED_RGBA_S3TC_DXT5_EXT; break; case WINED3DFMT_DXT5: retVal = GL_COMPRESSED_RGBA_S3TC_DXT5_EXT; break;
default: default:
/* stupid compiler */ /* stupid compiler */
break; break;
@ -1552,29 +1564,29 @@ GLint D3DFmt2GLIntFmt(IWineD3DDeviceImpl* This, D3DFORMAT fmt) {
if (retVal == 0) { if (retVal == 0) {
switch (fmt) { switch (fmt) {
/* Paletted */ /* Paletted */
case D3DFMT_P8: retVal = GL_COLOR_INDEX8_EXT; break; case WINED3DFMT_P8: retVal = GL_COLOR_INDEX8_EXT; break;
case D3DFMT_A8P8: retVal = GL_COLOR_INDEX8_EXT; break; case WINED3DFMT_A8P8: retVal = GL_COLOR_INDEX8_EXT; break;
/* Luminance */ /* Luminance */
case D3DFMT_L8: retVal = GL_LUMINANCE8; break; case WINED3DFMT_L8: retVal = GL_LUMINANCE8; break;
case D3DFMT_A8L8: retVal = GL_LUMINANCE8_ALPHA8; break; case WINED3DFMT_A8L8: retVal = GL_LUMINANCE8_ALPHA8; break;
case D3DFMT_A4L4: retVal = GL_LUMINANCE4_ALPHA4; break; case WINED3DFMT_A4L4: retVal = GL_LUMINANCE4_ALPHA4; break;
/* Bump */ /* Bump */
case D3DFMT_V8U8: retVal = GL_COLOR_INDEX8_EXT; break; case WINED3DFMT_V8U8: retVal = GL_COLOR_INDEX8_EXT; break;
case D3DFMT_V16U16: retVal = GL_COLOR_INDEX; break; case WINED3DFMT_V16U16: retVal = GL_COLOR_INDEX; break;
case D3DFMT_L6V5U5: retVal = GL_COLOR_INDEX8_EXT; break; case WINED3DFMT_L6V5U5: retVal = GL_COLOR_INDEX8_EXT; break;
case D3DFMT_X8L8V8U8: retVal = GL_COLOR_INDEX; break; case WINED3DFMT_X8L8V8U8: retVal = GL_COLOR_INDEX; break;
/* color buffer */ /* color buffer */
case D3DFMT_R3G3B2: retVal = GL_R3_G3_B2; break; case WINED3DFMT_R3G3B2: retVal = GL_R3_G3_B2; break;
case D3DFMT_R5G6B5: retVal = GL_RGB5; break; /* fixme: internal format 6 for g? */ case WINED3DFMT_R5G6B5: retVal = GL_RGB5; break; /* fixme: internal format 6 for g? */
case D3DFMT_R8G8B8: retVal = GL_RGB8; break; case WINED3DFMT_R8G8B8: retVal = GL_RGB8; break;
case D3DFMT_A1R5G5B5: retVal = GL_RGB5_A1; break; case WINED3DFMT_A1R5G5B5: retVal = GL_RGB5_A1; break;
case D3DFMT_X1R5G5B5: retVal = GL_RGB5_A1; break; case WINED3DFMT_X1R5G5B5: retVal = GL_RGB5_A1; break;
case D3DFMT_A4R4G4B4: retVal = GL_RGBA4; break; case WINED3DFMT_A4R4G4B4: retVal = GL_RGBA4; break;
case D3DFMT_X4R4G4B4: retVal = GL_RGBA4; break; case WINED3DFMT_X4R4G4B4: retVal = GL_RGBA4; break;
case D3DFMT_A8R8G8B8: retVal = GL_RGBA8; break; case WINED3DFMT_A8R8G8B8: retVal = GL_RGBA8; break;
case D3DFMT_X8R8G8B8: retVal = GL_RGBA8; break; case WINED3DFMT_X8R8G8B8: retVal = GL_RGBA8; break;
/* to see */ /* to see */
case D3DFMT_A8: retVal = GL_ALPHA8; break; case WINED3DFMT_A8: retVal = GL_ALPHA8; break;
default: default:
FIXME("Unhandled fmt(%u,%s)\n", fmt, debug_d3dformat(fmt)); FIXME("Unhandled fmt(%u,%s)\n", fmt, debug_d3dformat(fmt));
retVal = GL_RGB8; retVal = GL_RGB8;
@ -1589,9 +1601,9 @@ GLenum D3DFmt2GLFmt(IWineD3DDeviceImpl* This, D3DFORMAT fmt) {
if (GL_SUPPORT(EXT_TEXTURE_COMPRESSION_S3TC)) { if (GL_SUPPORT(EXT_TEXTURE_COMPRESSION_S3TC)) {
switch (fmt) { switch (fmt) {
case D3DFMT_DXT1: retVal = GL_COMPRESSED_RGBA_S3TC_DXT1_EXT; break; case WINED3DFMT_DXT1: retVal = GL_COMPRESSED_RGBA_S3TC_DXT1_EXT; break;
case D3DFMT_DXT3: retVal = GL_COMPRESSED_RGBA_S3TC_DXT3_EXT; break; case WINED3DFMT_DXT3: retVal = GL_COMPRESSED_RGBA_S3TC_DXT3_EXT; break;
case D3DFMT_DXT5: retVal = GL_COMPRESSED_RGBA_S3TC_DXT5_EXT; break; case WINED3DFMT_DXT5: retVal = GL_COMPRESSED_RGBA_S3TC_DXT5_EXT; break;
default: default:
/* stupid compiler */ /* stupid compiler */
break; break;
@ -1601,29 +1613,29 @@ GLenum D3DFmt2GLFmt(IWineD3DDeviceImpl* This, D3DFORMAT fmt) {
if (retVal == 0) { if (retVal == 0) {
switch (fmt) { switch (fmt) {
/* Paletted */ /* Paletted */
case D3DFMT_P8: retVal = GL_COLOR_INDEX; break; case WINED3DFMT_P8: retVal = GL_COLOR_INDEX; break;
case D3DFMT_A8P8: retVal = GL_COLOR_INDEX; break; case WINED3DFMT_A8P8: retVal = GL_COLOR_INDEX; break;
/* Luminance */ /* Luminance */
case D3DFMT_L8: retVal = GL_LUMINANCE; break; case WINED3DFMT_L8: retVal = GL_LUMINANCE; break;
case D3DFMT_A8L8: retVal = GL_LUMINANCE_ALPHA; break; case WINED3DFMT_A8L8: retVal = GL_LUMINANCE_ALPHA; break;
case D3DFMT_A4L4: retVal = GL_LUMINANCE_ALPHA; break; case WINED3DFMT_A4L4: retVal = GL_LUMINANCE_ALPHA; break;
/* Bump */ /* Bump */
case D3DFMT_V8U8: retVal = GL_COLOR_INDEX; break; case WINED3DFMT_V8U8: retVal = GL_COLOR_INDEX; break;
case D3DFMT_V16U16: retVal = GL_COLOR_INDEX; break; case WINED3DFMT_V16U16: retVal = GL_COLOR_INDEX; break;
case D3DFMT_L6V5U5: retVal = GL_COLOR_INDEX; break; case WINED3DFMT_L6V5U5: retVal = GL_COLOR_INDEX; break;
case D3DFMT_X8L8V8U8: retVal = GL_COLOR_INDEX; break; case WINED3DFMT_X8L8V8U8: retVal = GL_COLOR_INDEX; break;
/* color buffer */ /* color buffer */
case D3DFMT_R3G3B2: retVal = GL_BGR; break; case WINED3DFMT_R3G3B2: retVal = GL_BGR; break;
case D3DFMT_R5G6B5: retVal = GL_RGB; break; case WINED3DFMT_R5G6B5: retVal = GL_RGB; break;
case D3DFMT_R8G8B8: retVal = GL_RGB; break; case WINED3DFMT_R8G8B8: retVal = GL_RGB; break;
case D3DFMT_A1R5G5B5: retVal = GL_BGRA; break; case WINED3DFMT_A1R5G5B5: retVal = GL_BGRA; break;
case D3DFMT_X1R5G5B5: retVal = GL_BGRA; break; case WINED3DFMT_X1R5G5B5: retVal = GL_BGRA; break;
case D3DFMT_A4R4G4B4: retVal = GL_BGRA; break; case WINED3DFMT_A4R4G4B4: retVal = GL_BGRA; break;
case D3DFMT_X4R4G4B4: retVal = GL_BGRA; break; case WINED3DFMT_X4R4G4B4: retVal = GL_BGRA; break;
case D3DFMT_A8R8G8B8: retVal = GL_BGRA; break; case WINED3DFMT_A8R8G8B8: retVal = GL_BGRA; break;
case D3DFMT_X8R8G8B8: retVal = GL_BGRA; break; case WINED3DFMT_X8R8G8B8: retVal = GL_BGRA; break;
/* to see */ /* to see */
case D3DFMT_A8: retVal = GL_ALPHA; break; case WINED3DFMT_A8: retVal = GL_ALPHA; break;
default: default:
FIXME("Unhandled fmt(%u,%s)\n", fmt, debug_d3dformat(fmt)); FIXME("Unhandled fmt(%u,%s)\n", fmt, debug_d3dformat(fmt));
retVal = GL_BGR; retVal = GL_BGR;
@ -1639,9 +1651,9 @@ GLenum D3DFmt2GLType(IWineD3DDeviceImpl* This, D3DFORMAT fmt) {
if (GL_SUPPORT(EXT_TEXTURE_COMPRESSION_S3TC)) { if (GL_SUPPORT(EXT_TEXTURE_COMPRESSION_S3TC)) {
switch (fmt) { switch (fmt) {
case D3DFMT_DXT1: retVal = 0; break; case WINED3DFMT_DXT1: retVal = 0; break;
case D3DFMT_DXT3: retVal = 0; break; case WINED3DFMT_DXT3: retVal = 0; break;
case D3DFMT_DXT5: retVal = 0; break; case WINED3DFMT_DXT5: retVal = 0; break;
default: default:
/* stupid compiler */ /* stupid compiler */
break; break;
@ -1651,29 +1663,29 @@ GLenum D3DFmt2GLType(IWineD3DDeviceImpl* This, D3DFORMAT fmt) {
if (retVal == 0) { if (retVal == 0) {
switch (fmt) { switch (fmt) {
/* Paletted */ /* Paletted */
case D3DFMT_P8: retVal = GL_UNSIGNED_BYTE; break; case WINED3DFMT_P8: retVal = GL_UNSIGNED_BYTE; break;
case D3DFMT_A8P8: retVal = GL_UNSIGNED_BYTE; break; case WINED3DFMT_A8P8: retVal = GL_UNSIGNED_BYTE; break;
/* Luminance */ /* Luminance */
case D3DFMT_L8: retVal = GL_UNSIGNED_BYTE; break; case WINED3DFMT_L8: retVal = GL_UNSIGNED_BYTE; break;
case D3DFMT_A8L8: retVal = GL_UNSIGNED_BYTE; break; case WINED3DFMT_A8L8: retVal = GL_UNSIGNED_BYTE; break;
case D3DFMT_A4L4: retVal = GL_UNSIGNED_BYTE; break; case WINED3DFMT_A4L4: retVal = GL_UNSIGNED_BYTE; break;
/* Bump */ /* Bump */
case D3DFMT_V8U8: retVal = GL_UNSIGNED_BYTE; break; case WINED3DFMT_V8U8: retVal = GL_UNSIGNED_BYTE; break;
case D3DFMT_V16U16: retVal = GL_UNSIGNED_SHORT; break; case WINED3DFMT_V16U16: retVal = GL_UNSIGNED_SHORT; break;
case D3DFMT_L6V5U5: retVal = GL_UNSIGNED_SHORT_5_5_5_1; break; case WINED3DFMT_L6V5U5: retVal = GL_UNSIGNED_SHORT_5_5_5_1; break;
case D3DFMT_X8L8V8U8: retVal = GL_UNSIGNED_BYTE; break; case WINED3DFMT_X8L8V8U8: retVal = GL_UNSIGNED_BYTE; break;
/* Color buffer */ /* Color buffer */
case D3DFMT_R3G3B2: retVal = GL_UNSIGNED_BYTE_2_3_3_REV; break; case WINED3DFMT_R3G3B2: retVal = GL_UNSIGNED_BYTE_2_3_3_REV; break;
case D3DFMT_R5G6B5: retVal = GL_UNSIGNED_SHORT_5_6_5; break; case WINED3DFMT_R5G6B5: retVal = GL_UNSIGNED_SHORT_5_6_5; break;
case D3DFMT_R8G8B8: retVal = GL_UNSIGNED_BYTE; break; case WINED3DFMT_R8G8B8: retVal = GL_UNSIGNED_BYTE; break;
case D3DFMT_A1R5G5B5: retVal = GL_UNSIGNED_SHORT_1_5_5_5_REV; break; case WINED3DFMT_A1R5G5B5: retVal = GL_UNSIGNED_SHORT_1_5_5_5_REV; break;
case D3DFMT_X1R5G5B5: retVal = GL_UNSIGNED_SHORT_1_5_5_5_REV; break; case WINED3DFMT_X1R5G5B5: retVal = GL_UNSIGNED_SHORT_1_5_5_5_REV; break;
case D3DFMT_A4R4G4B4: retVal = GL_UNSIGNED_SHORT_4_4_4_4_REV; break; case WINED3DFMT_A4R4G4B4: retVal = GL_UNSIGNED_SHORT_4_4_4_4_REV; break;
case D3DFMT_X4R4G4B4: retVal = GL_UNSIGNED_SHORT_4_4_4_4_REV; break; case WINED3DFMT_X4R4G4B4: retVal = GL_UNSIGNED_SHORT_4_4_4_4_REV; break;
case D3DFMT_A8R8G8B8: retVal = GL_UNSIGNED_INT_8_8_8_8_REV; break; case WINED3DFMT_A8R8G8B8: retVal = GL_UNSIGNED_INT_8_8_8_8_REV; break;
case D3DFMT_X8R8G8B8: retVal = GL_UNSIGNED_INT_8_8_8_8_REV; break; case WINED3DFMT_X8R8G8B8: retVal = GL_UNSIGNED_INT_8_8_8_8_REV; break;
/* to see */ /* to see */
case D3DFMT_A8: retVal = GL_ALPHA; break; case WINED3DFMT_A8: retVal = GL_ALPHA; break;
default: default:
FIXME("Unhandled fmt(%u,%s)\n", fmt, debug_d3dformat(fmt)); FIXME("Unhandled fmt(%u,%s)\n", fmt, debug_d3dformat(fmt));
retVal = GL_UNSIGNED_BYTE; retVal = GL_UNSIGNED_BYTE;
@ -1689,45 +1701,45 @@ SHORT D3DFmtGetBpp(IWineD3DDeviceImpl* This, D3DFORMAT fmt) {
switch (fmt) { switch (fmt) {
/* color buffer */ /* color buffer */
case D3DFMT_R3G3B2: retVal = 1; break; case WINED3DFMT_R3G3B2: retVal = 1; break;
case D3DFMT_R5G6B5: retVal = 2; break; case WINED3DFMT_R5G6B5: retVal = 2; break;
case D3DFMT_R8G8B8: retVal = 3; break; case WINED3DFMT_R8G8B8: retVal = 3; break;
case D3DFMT_A1R5G5B5: retVal = 2; break; case WINED3DFMT_A1R5G5B5: retVal = 2; break;
case D3DFMT_X1R5G5B5: retVal = 2; break; case WINED3DFMT_X1R5G5B5: retVal = 2; break;
case D3DFMT_A4R4G4B4: retVal = 2; break; case WINED3DFMT_A4R4G4B4: retVal = 2; break;
case D3DFMT_X4R4G4B4: retVal = 2; break; case WINED3DFMT_X4R4G4B4: retVal = 2; break;
case D3DFMT_A8R8G8B8: retVal = 4; break; case WINED3DFMT_A8R8G8B8: retVal = 4; break;
case D3DFMT_X8R8G8B8: retVal = 4; break; case WINED3DFMT_X8R8G8B8: retVal = 4; break;
/* Paletted */ /* Paletted */
case D3DFMT_P8: retVal = 1; break; case WINED3DFMT_P8: retVal = 1; break;
case D3DFMT_A8P8: retVal = 2; break; case WINED3DFMT_A8P8: retVal = 2; break;
/* depth/stencil buffer */ /* depth/stencil buffer */
case D3DFMT_D16_LOCKABLE: retVal = 2; break; case WINED3DFMT_D16_LOCKABLE: retVal = 2; break;
case D3DFMT_D16: retVal = 2; break; case WINED3DFMT_D16: retVal = 2; break;
case D3DFMT_D32: retVal = 4; break; case WINED3DFMT_D32: retVal = 4; break;
case D3DFMT_D15S1: retVal = 2; break; case WINED3DFMT_D15S1: retVal = 2; break;
case D3DFMT_D24X4S4: retVal = 4; break; case WINED3DFMT_D24X4S4: retVal = 4; break;
case D3DFMT_D24S8: retVal = 4; break; case WINED3DFMT_D24S8: retVal = 4; break;
case D3DFMT_D24X8: retVal = 4; break; case WINED3DFMT_D24X8: retVal = 4; break;
/* Luminance */ /* Luminance */
case D3DFMT_L8: retVal = 1; break; case WINED3DFMT_L8: retVal = 1; break;
case D3DFMT_A4L4: retVal = 1; break; case WINED3DFMT_A4L4: retVal = 1; break;
case D3DFMT_A8L8: retVal = 2; break; case WINED3DFMT_A8L8: retVal = 2; break;
/* Bump */ /* Bump */
case D3DFMT_V8U8: retVal = 2; break; case WINED3DFMT_V8U8: retVal = 2; break;
case D3DFMT_L6V5U5: retVal = 2; break; case WINED3DFMT_L6V5U5: retVal = 2; break;
case D3DFMT_V16U16: retVal = 4; break; case WINED3DFMT_V16U16: retVal = 4; break;
case D3DFMT_X8L8V8U8: retVal = 4; break; case WINED3DFMT_X8L8V8U8: retVal = 4; break;
/* Compressed */ /* Compressed */
case D3DFMT_DXT1: retVal = 1; break; /* Actually 8 bytes per 16 pixels - Special cased later */ case WINED3DFMT_DXT1: retVal = 1; break; /* Actually 8 bytes per 16 pixels - Special cased later */
case D3DFMT_DXT3: retVal = 1; break; /* Actually 16 bytes per 16 pixels */ case WINED3DFMT_DXT3: retVal = 1; break; /* Actually 16 bytes per 16 pixels */
case D3DFMT_DXT5: retVal = 1; break; /* Actually 16 bytes per 16 pixels */ case WINED3DFMT_DXT5: retVal = 1; break; /* Actually 16 bytes per 16 pixels */
/* to see */ /* to see */
case D3DFMT_A8: retVal = 1; break; case WINED3DFMT_A8: retVal = 1; break;
/* unknown */ /* unknown */
case D3DFMT_UNKNOWN: case WINED3DFMT_UNKNOWN:
/* Guess at the highest value of the above */ /* Guess at the highest value of the above */
TRACE("D3DFMT_UNKNOWN - Guessing at 4 bytes/pixel %u\n", fmt); TRACE("WINED3DFMT_UNKNOWN - Guessing at 4 bytes/pixel %u\n", fmt);
retVal = 4; retVal = 4;
break; break;

View File

@ -126,13 +126,12 @@ extern int num_lock;
#define MAX_STREAMS 16 /* Maximum possible streams - used for fixed size arrays #define MAX_STREAMS 16 /* Maximum possible streams - used for fixed size arrays
See MaxStreams in MSDN under GetDeviceCaps */ See MaxStreams in MSDN under GetDeviceCaps */
/* Maximum number of constants provided to the shaders */
#define HIGHEST_TRANSFORMSTATE 512 #define HIGHEST_TRANSFORMSTATE 512
/* Highest value in D3DTRANSFORMSTATETYPE */ /* Highest value in D3DTRANSFORMSTATETYPE */
#define HIGHEST_RENDER_STATE 209 #define HIGHEST_TEXTURE_STATE D3DTSS_CONSTANT
/* Highest D3DRS_ value */
#define HIGHEST_TEXTURE_STATE 32
/* Highest D3DTSS_ value */ /* Highest D3DTSS_ value */
#define WINED3D_VSHADER_MAX_CONSTANTS 96 #define HIGHEST_SAMPLER_STATE D3DSAMP_DMAPOFFSET
/* Maximum number of constants provided to the shaders */ /* Maximum number of constants provided to the shaders */
#define MAX_CLIPPLANES D3DMAXUSERCLIPPLANES #define MAX_CLIPPLANES D3DMAXUSERCLIPPLANES
@ -666,7 +665,7 @@ typedef struct SAVEDSTATES {
BOOL textures[8]; BOOL textures[8];
BOOL transform[HIGHEST_TRANSFORMSTATE]; BOOL transform[HIGHEST_TRANSFORMSTATE];
BOOL viewport; BOOL viewport;
BOOL renderState[HIGHEST_RENDER_STATE]; BOOL renderState[WINEHIGHEST_RENDER_STATE];
BOOL textureState[8][HIGHEST_TEXTURE_STATE]; BOOL textureState[8][HIGHEST_TEXTURE_STATE];
BOOL clipplane[MAX_CLIPPLANES]; BOOL clipplane[MAX_CLIPPLANES];
BOOL vertexDecl; BOOL vertexDecl;
@ -727,7 +726,7 @@ struct IWineD3DStateBlockImpl
FLOAT tween_factor; FLOAT tween_factor;
/* RenderState */ /* RenderState */
DWORD renderState[HIGHEST_RENDER_STATE]; DWORD renderState[WINEHIGHEST_RENDER_STATE];
/* Texture */ /* Texture */
IWineD3DBaseTexture *textures[8]; IWineD3DBaseTexture *textures[8];
@ -740,6 +739,31 @@ struct IWineD3DStateBlockImpl
extern IWineD3DStateBlockVtbl IWineD3DStateBlock_Vtbl; extern IWineD3DStateBlockVtbl IWineD3DStateBlock_Vtbl;
/*****************************************************************************
* IWineD3DQueryImpl implementation structure (extends IUnknown)
*/
typedef struct IWineD3DQueryImpl
{
IWineD3DQueryVtbl *lpVtbl;
DWORD ref; /* Note: Ref counting not required */
IUnknown *parent;
/*TODO: replace with iface usage */
#if 0
IWineD3DDevice *wineD3DDevice;
#else
IWineD3DDeviceImpl *wineD3DDevice;
#endif
/* IWineD3DQuery fields */
D3DQUERYTYPE type;
void *extendedData;
} IWineD3DQueryImpl;
extern IWineD3DQueryVtbl IWineD3DQuery_Vtbl;
/***************************************************************************** /*****************************************************************************
* Utility function prototypes * Utility function prototypes
*/ */

View File

@ -1,6 +1,7 @@
/* /*
* Copyright (C) 2002-2003 Jason Edmeades * Copyright (C) 2002-2003 Jason Edmeades
* Raphael Junqueira * Copyright (C) 2002-2003 Raphael Junqueira
* Copyright (C) 2005 Oliver Stieber
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
@ -73,6 +74,7 @@
#define D3DLOCK_NOSYSLOCK 0x0800 #define D3DLOCK_NOSYSLOCK 0x0800
#define D3DLOCK_NOOVERWRITE 0x1000 #define D3DLOCK_NOOVERWRITE 0x1000
#define D3DLOCK_DISCARD 0x2000 #define D3DLOCK_DISCARD 0x2000
#define D3DLOCK_DONOTWAIT 0x4000
#define D3DLOCK_NO_DIRTY_UPDATE 0x8000 #define D3DLOCK_NO_DIRTY_UPDATE 0x8000
#define D3DMAXUSERCLIPPLANES 32 #define D3DMAXUSERCLIPPLANES 32
@ -86,6 +88,7 @@
#define D3DRENDERSTATE_WRAPBIAS 128UL #define D3DRENDERSTATE_WRAPBIAS 128UL
/* MSDN has this in d3d9caps.h, but it should be here */
#define D3DTSS_TCI_PASSTHRU 0x00000 #define D3DTSS_TCI_PASSTHRU 0x00000
#define D3DTSS_TCI_CAMERASPACENORMAL 0x10000 #define D3DTSS_TCI_CAMERASPACENORMAL 0x10000
#define D3DTSS_TCI_CAMERASPACEPOSITION 0x20000 #define D3DTSS_TCI_CAMERASPACEPOSITION 0x20000
@ -99,15 +102,25 @@
#define D3DTS_WORLD3 D3DTS_WORLDMATRIX(3) #define D3DTS_WORLD3 D3DTS_WORLDMATRIX(3)
#define D3DTS_WORLDMATRIX(index) (D3DTRANSFORMSTATETYPE)(index + 256) #define D3DTS_WORLDMATRIX(index) (D3DTRANSFORMSTATETYPE)(index + 256)
#define D3DUSAGE_RENDERTARGET 0x01 #define D3DUSAGE_RENDERTARGET 0x00000001L
#define D3DUSAGE_DEPTHSTENCIL 0x02 #define D3DUSAGE_DEPTHSTENCIL 0x00000002L
#define D3DUSAGE_WRITEONLY 0x08 #define D3DUSAGE_WRITEONLY 0x00000008L
#define D3DUSAGE_SOFTWAREPROCESSING 0x10 #define D3DUSAGE_SOFTWAREPROCESSING 0x00000010L
#define D3DUSAGE_DONOTCLIP 0x20 #define D3DUSAGE_DONOTCLIP 0x00000020L
#define D3DUSAGE_POINTS 0x40 #define D3DUSAGE_POINTS 0x00000040L
#define D3DUSAGE_RTPATCHES 0x80 #define D3DUSAGE_RTPATCHES 0x00000080L
#define D3DUSAGE_NPATCHES 0x100 #define D3DUSAGE_NPATCHES 0x00000100L
#define D3DUSAGE_DYNAMIC 0x200 #define D3DUSAGE_DYNAMIC 0x00000200L
#define D3DUSAGE_AUTOGENMIPMAP 0x00000400L
#define D3DUSAGE_DMAP 0x00004000L
#define D3DUSAGE_QUERY_FILTER 0x00020000L
#define D3DUSAGE_QUERY_LEGACYBUMPMAP 0x00008000L
#define D3DUSAGE_QUERY_POSTPIXELSHADER_BLENDING 0x00080000L
#define D3DUSAGE_QUERY_SRGBREAD 0x00010000L
#define D3DUSAGE_QUERY_SRGBWRITE 0x00040000L
#define D3DUSAGE_QUERY_VERTEXTEXTURE 0x00100000L
#define D3DWRAP_U 1 #define D3DWRAP_U 1
#define D3DWRAP_V 2 #define D3DWRAP_V 2
@ -164,8 +177,19 @@
#define D3DCOLORWRITEENABLE_BLUE (1L<<2) #define D3DCOLORWRITEENABLE_BLUE (1L<<2)
#define D3DCOLORWRITEENABLE_ALPHA (1L<<3) #define D3DCOLORWRITEENABLE_ALPHA (1L<<3)
#define D3DPV_DONOTCOPYDATA (1 << 0)
#define D3DSTREAMSOURCE_INDEXEDDATA (1 << 30)
#define D3DSTREAMSOURCE_INSTANCEDATA (2 << 30)
#define D3D_MAX_SIMULTANEOUS_RENDERTARGETS 4 #define D3D_MAX_SIMULTANEOUS_RENDERTARGETS 4
#define MAXD3DDECLLENGTH 64 /* +end marker */
#define MAXD3DDECLMETHOD D3DDECLMETHOD_LOOKUPPRESAMPLED
#define MAXD3DDECLTYPE D3DDECLTYPE_UNUSED
#define MAXD3DDECLUSAGE D3DDECLUSAGE_SAMPLE
#define MAXD3DDECLUSAGEINDEX 15
#define D3DDMAPSAMPLER 256 #define D3DDMAPSAMPLER 256
#define D3DVERTEXTEXTURESAMPLER0 (D3DDMAPSAMPLER+1) #define D3DVERTEXTEXTURESAMPLER0 (D3DDMAPSAMPLER+1)
#define D3DVERTEXTEXTURESAMPLER1 (D3DDMAPSAMPLER+2) #define D3DVERTEXTEXTURESAMPLER1 (D3DDMAPSAMPLER+2)
@ -176,6 +200,14 @@
((DWORD)(BYTE)(ch0) | ((DWORD)(BYTE)(ch1) << 8) | \ ((DWORD)(BYTE)(ch0) | ((DWORD)(BYTE)(ch1) << 8) | \
((DWORD)(BYTE)(ch2) << 16) | ((DWORD)(BYTE)(ch3) << 24 )) ((DWORD)(BYTE)(ch2) << 16) | ((DWORD)(BYTE)(ch3) << 24 ))
/* Constants used by D3DPRESENT_PARAMETERS. when creating a device or swapchain */
#define D3DPRESENTFLAG_LOCKABLE_BACKBUFFER 0x00000001 /* Create a lockable backbuffer */
#define D3DPRESENTFLAG_DISCARD_DEPTHSTENCIL 0x00000002 /* Discard Z buffer */
#define D3DPRESENTFLAG_DEVICECLIP 0x00000004 /* Clip the window blited into the client area 2k + xp only */
#define D3DPRESENTFLAG_VIDEO 0x00000010 /* backbuffer 'may' contain video data */
/**************************** /****************************
* Vertex Shaders Declaration * Vertex Shaders Declaration
@ -198,21 +230,32 @@ typedef enum _D3DDECLUSAGE {
D3DDECLUSAGE_SAMPLE = 13 D3DDECLUSAGE_SAMPLE = 13
} D3DDECLUSAGE; } D3DDECLUSAGE;
#define MAXD3DDECLUSAGE D3DDECLUSAGE_SAMPLE /* MSDN is quite confussing at this point...
#define MAXD3DDECLUSAGEINDEX 15 http://msdn.microsoft.com/archive/default.asp?url=/archive/en-us/directx9_c/directx/graphics/reference/d3d/constants/OTHER_D3D.asp
#define MAXD3DDECLLENGTH 64 says D3DMAX, and D3DMAXDECLUSAGE = D3DDECLUSAGE_DEPTH
http://msdn.microsoft.com/library/default.asp?url=/archive/en-us/directx9_c_summer_03/directx/graphics/reference/d3d/constants/other_d3d.asp
says MAXD3D, and D3DDECLUSAGE_SAMPLE
So both are defined
*/
#define D3DMAXDECLUSAGE D3DDECLUSAGE_SAMPLE
#define D3DMAXDECLUSAGEINDEX 15
#define D3DMAXDECLLENGTH 18
#define D3DMAXDECLUSAGE_DX8 D3DDECLUSAGE_TEXCOORD
typedef enum _D3DDECLMETHOD { typedef enum _D3DDECLMETHOD {
D3DDECLMETHOD_DEFAULT = 0, D3DDECLMETHOD_DEFAULT = 0,
D3DDECLMETHOD_PARTIALU, D3DDECLMETHOD_PARTIALU = 1,
D3DDECLMETHOD_PARTIALV, D3DDECLMETHOD_PARTIALV = 2,
D3DDECLMETHOD_CROSSUV, D3DDECLMETHOD_CROSSUV = 3,
D3DDECLMETHOD_UV, D3DDECLMETHOD_UV = 4,
D3DDECLMETHOD_LOOKUP, D3DDECLMETHOD_LOOKUP = 5,
D3DDECLMETHOD_LOOKUPPRESAMPLED D3DDECLMETHOD_LOOKUPPRESAMPLED = 6
} D3DDECLMETHOD; } D3DDECLMETHOD;
#define MAXD3DDECLMETHOD D3DDECLMETHOD_LOOKUPPRESAMPLED
#define D3DMAXDECLMETHOD D3DDECLMETHOD_LOOKUPPRESAMPLED
typedef enum _D3DDECLTYPE { typedef enum _D3DDECLTYPE {
D3DDECLTYPE_FLOAT1 = 0, D3DDECLTYPE_FLOAT1 = 0,
@ -236,7 +279,7 @@ typedef enum _D3DDECLTYPE {
D3DDECLTYPE_UNUSED = 17, D3DDECLTYPE_UNUSED = 17,
} D3DDECLTYPE; } D3DDECLTYPE;
#define MAXD3DDECLTYPE D3DDECLTYPE_UNUSED #define D3DMAXDECLTYPE D3DDECLTYPE_UNUSED
typedef struct _D3DVERTEXELEMENT9 { typedef struct _D3DVERTEXELEMENT9 {
WORD Stream; WORD Stream;
@ -247,6 +290,29 @@ typedef struct _D3DVERTEXELEMENT9 {
BYTE UsageIndex; BYTE UsageIndex;
} D3DVERTEXELEMENT9, *LPD3DVERTEXELEMENT9; } D3DVERTEXELEMENT9, *LPD3DVERTEXELEMENT9;
typedef enum _D3DQUERYTYPE {
D3DQUERYTYPE_VCACHE = 4,
D3DQUERYTYPE_RESOURCEMANAGER = 5,
D3DQUERYTYPE_VERTEXSTATS = 6,
D3DQUERYTYPE_EVENT = 8,
D3DQUERYTYPE_OCCLUSION = 9,
D3DQUERYTYPE_TIMESTAMP = 10,
D3DQUERYTYPE_TIMESTAMPDISJOINT = 11,
D3DQUERYTYPE_TIMESTAMPFREQ = 12,
D3DQUERYTYPE_PIPELINETIMINGS = 13,
D3DQUERYTYPE_INTERFACETIMINGS = 14,
D3DQUERYTYPE_VERTEXTIMINGS = 15,
D3DQUERYTYPE_PIXELTIMINGS = 16,
D3DQUERYTYPE_BANDWIDTHTIMINGS = 17,
D3DQUERYTYPE_CACHEUTILIZATION = 18
} D3DQUERYTYPE;
#define D3DISSUE_BEGIN (1 << 1)
#define D3DISSUE_END (1 << 0)
#define D3DGETDATA_FLUSH (1 << 0)
#define D3DDECL_END() {0xFF,0,D3DDECLTYPE_UNUSED,0,0,0} #define D3DDECL_END() {0xFF,0,D3DDECLTYPE_UNUSED,0,0,0}
#define D3DDP_MAXTEXCOORD 8 #define D3DDP_MAXTEXCOORD 8
@ -582,6 +648,8 @@ typedef enum _D3DBACKBUFFER_TYPE {
D3DBACKBUFFER_TYPE_FORCE_DWORD = 0x7fffffff D3DBACKBUFFER_TYPE_FORCE_DWORD = 0x7fffffff
} D3DBACKBUFFER_TYPE; } D3DBACKBUFFER_TYPE;
#define D3DPRESENT_BACK_BUFFER_MAX 3L
typedef enum _D3DBASISTYPE { typedef enum _D3DBASISTYPE {
D3DBASIS_BEZIER = 0, D3DBASIS_BEZIER = 0,
D3DBASIS_BSPLINE = 1, D3DBASIS_BSPLINE = 1,
@ -658,6 +726,15 @@ typedef enum _D3DDEBUGMONITORTOKENS {
D3DDMT_FORCE_DWORD = 0x7fffffff D3DDMT_FORCE_DWORD = 0x7fffffff
} D3DDEBUGMONITORTOKENS; } D3DDEBUGMONITORTOKENS;
typedef enum _D3DDEGREETYPE {
D3DDEGREE_LINEAR = 1,
D3DDEGREE_QUADRATIC = 2,
D3DDEGREE_CUBIC = 3,
D3DDEGREE_QUINTIC = 5,
D3DDEGREE_FORCE_DWORD = 0x7fffffff
} D3DDEGREETYPE;
typedef enum _D3DDEVTYPE { typedef enum _D3DDEVTYPE {
D3DDEVTYPE_HAL = 1, D3DDEVTYPE_HAL = 1,
D3DDEVTYPE_REF = 2, D3DDEVTYPE_REF = 2,
@ -697,6 +774,13 @@ typedef enum _D3DFORMAT {
D3DFMT_A8 = 28, D3DFMT_A8 = 28,
D3DFMT_A8R3G3B2 = 29, D3DFMT_A8R3G3B2 = 29,
D3DFMT_X4R4G4B4 = 30, D3DFMT_X4R4G4B4 = 30,
D3DFMT_A2B10G10R10 = 31,
D3DFMT_A8B8G8R8 = 32,
D3DFMT_X8B8G8R8 = 33,
D3DFMT_G16R16 = 34,
D3DFMT_A2R10G10B10 = 35,
D3DFMT_A16B16G16R16 = 36,
D3DFMT_A8P8 = 40, D3DFMT_A8P8 = 40,
D3DFMT_P8 = 41, D3DFMT_P8 = 41,
@ -711,6 +795,7 @@ typedef enum _D3DFORMAT {
D3DFMT_Q8W8V8U8 = 63, D3DFMT_Q8W8V8U8 = 63,
D3DFMT_V16U16 = 64, D3DFMT_V16U16 = 64,
D3DFMT_W11V11U10 = 65, D3DFMT_W11V11U10 = 65,
D3DFMT_A2W10V10U10 = 67,
D3DFMT_UYVY = MAKEFOURCC('U', 'Y', 'V', 'Y'), D3DFMT_UYVY = MAKEFOURCC('U', 'Y', 'V', 'Y'),
D3DFMT_YUY2 = MAKEFOURCC('Y', 'U', 'Y', '2'), D3DFMT_YUY2 = MAKEFOURCC('Y', 'U', 'Y', '2'),
@ -719,18 +804,35 @@ typedef enum _D3DFORMAT {
D3DFMT_DXT3 = MAKEFOURCC('D', 'X', 'T', '3'), D3DFMT_DXT3 = MAKEFOURCC('D', 'X', 'T', '3'),
D3DFMT_DXT4 = MAKEFOURCC('D', 'X', 'T', '4'), D3DFMT_DXT4 = MAKEFOURCC('D', 'X', 'T', '4'),
D3DFMT_DXT5 = MAKEFOURCC('D', 'X', 'T', '5'), D3DFMT_DXT5 = MAKEFOURCC('D', 'X', 'T', '5'),
D3DFMT_MULTI2_ARGB = MAKEFOURCC('M', 'E', 'T', '1'),
D3DFMT_G8R8_G8B8 = MAKEFOURCC('G', 'R', 'G', 'B'),
D3DFMT_R8G8_B8G8 = MAKEFOURCC('R', 'G', 'B', 'G'),
D3DFMT_D16_LOCKABLE = 70, D3DFMT_D16_LOCKABLE = 70,
D3DFMT_D32 = 71, D3DFMT_D32 = 71,
D3DFMT_D15S1 = 73, D3DFMT_D15S1 = 73,
D3DFMT_D24S8 = 75,
D3DFMT_D16 = 80,
D3DFMT_D24X8 = 77, D3DFMT_D24X8 = 77,
D3DFMT_D24X4S4 = 79, D3DFMT_D24X4S4 = 79,
D3DFMT_D16 = 80,
D3DFMT_D32F_LOCKABLE = 82,
D3DFMT_D24FS8 = 83,
D3DFMT_VERTEXDATA = 100, D3DFMT_VERTEXDATA = 100,
D3DFMT_INDEX16 = 101, D3DFMT_INDEX16 = 101,
D3DFMT_INDEX32 = 102, D3DFMT_INDEX32 = 102,
D3DFMT_Q16W16V16U16 = 110,
/* Flaoting point formats */
D3DFMT_R16F = 111,
D3DFMT_G16R16F = 112,
D3DFMT_A16B16G16R16F = 113,
/* IEEE formats */
D3DFMT_R32F = 114,
D3DFMT_G32R32F = 115,
D3DFMT_A32B32G32R32F = 116,
D3DFMT_CxV8U8 = 117,
D3DFMT_FORCE_DWORD = 0xFFFFFFFF D3DFMT_FORCE_DWORD = 0xFFFFFFFF
} D3DFORMAT; } D3DFORMAT;
@ -753,6 +855,7 @@ typedef enum _D3DMATERIALCOLORSOURCE {
typedef enum _D3DMULTISAMPLE_TYPE { typedef enum _D3DMULTISAMPLE_TYPE {
D3DMULTISAMPLE_NONE = 0, D3DMULTISAMPLE_NONE = 0,
D3DMULTISAMPLE_NONMASKABLE = 1,
D3DMULTISAMPLE_2_SAMPLES = 2, D3DMULTISAMPLE_2_SAMPLES = 2,
D3DMULTISAMPLE_3_SAMPLES = 3, D3DMULTISAMPLE_3_SAMPLES = 3,
D3DMULTISAMPLE_4_SAMPLES = 4, D3DMULTISAMPLE_4_SAMPLES = 4,
@ -772,6 +875,7 @@ typedef enum _D3DMULTISAMPLE_TYPE {
D3DMULTISAMPLE_FORCE_DWORD = 0xffffffff D3DMULTISAMPLE_FORCE_DWORD = 0xffffffff
} D3DMULTISAMPLE_TYPE; } D3DMULTISAMPLE_TYPE;
#if 0
typedef enum _D3DORDERTYPE { typedef enum _D3DORDERTYPE {
D3DORDER_LINEAR = 1, D3DORDER_LINEAR = 1,
D3DORDER_QUADRATIC = 2, D3DORDER_QUADRATIC = 2,
@ -780,7 +884,7 @@ typedef enum _D3DORDERTYPE {
D3DORDER_FORCE_DWORD = 0x7fffffff D3DORDER_FORCE_DWORD = 0x7fffffff
} D3DORDERTYPE; } D3DORDERTYPE;
#endif
typedef enum _D3DPATCHEDGESTYLE { typedef enum _D3DPATCHEDGESTYLE {
D3DPATCHEDGE_DISCRETE = 0, D3DPATCHEDGE_DISCRETE = 0,
D3DPATCHEDGE_CONTINUOUS = 1, D3DPATCHEDGE_CONTINUOUS = 1,
@ -812,7 +916,6 @@ typedef enum _D3DRENDERSTATETYPE {
D3DRS_ZENABLE = 7, D3DRS_ZENABLE = 7,
D3DRS_FILLMODE = 8, D3DRS_FILLMODE = 8,
D3DRS_SHADEMODE = 9, D3DRS_SHADEMODE = 9,
D3DRS_LINEPATTERN = 10,
D3DRS_ZWRITEENABLE = 14, D3DRS_ZWRITEENABLE = 14,
D3DRS_ALPHATESTENABLE = 15, D3DRS_ALPHATESTENABLE = 15,
D3DRS_LASTPIXEL = 16, D3DRS_LASTPIXEL = 16,
@ -826,14 +929,11 @@ typedef enum _D3DRENDERSTATETYPE {
D3DRS_ALPHABLENDENABLE = 27, D3DRS_ALPHABLENDENABLE = 27,
D3DRS_FOGENABLE = 28, D3DRS_FOGENABLE = 28,
D3DRS_SPECULARENABLE = 29, D3DRS_SPECULARENABLE = 29,
D3DRS_ZVISIBLE = 30,
D3DRS_FOGCOLOR = 34, D3DRS_FOGCOLOR = 34,
D3DRS_FOGTABLEMODE = 35, D3DRS_FOGTABLEMODE = 35,
D3DRS_FOGSTART = 36, D3DRS_FOGSTART = 36,
D3DRS_FOGEND = 37, D3DRS_FOGEND = 37,
D3DRS_FOGDENSITY = 38, D3DRS_FOGDENSITY = 38,
D3DRS_EDGEANTIALIAS = 40,
D3DRS_ZBIAS = 47,
D3DRS_RANGEFOGENABLE = 48, D3DRS_RANGEFOGENABLE = 48,
D3DRS_STENCILENABLE = 52, D3DRS_STENCILENABLE = 52,
D3DRS_STENCILFAIL = 53, D3DRS_STENCILFAIL = 53,
@ -865,7 +965,6 @@ typedef enum _D3DRENDERSTATETYPE {
D3DRS_EMISSIVEMATERIALSOURCE = 148, D3DRS_EMISSIVEMATERIALSOURCE = 148,
D3DRS_VERTEXBLEND = 151, D3DRS_VERTEXBLEND = 151,
D3DRS_CLIPPLANEENABLE = 152, D3DRS_CLIPPLANEENABLE = 152,
D3DRS_SOFTWAREVERTEXPROCESSING = 153,
D3DRS_POINTSIZE = 154, D3DRS_POINTSIZE = 154,
D3DRS_POINTSIZE_MIN = 155, D3DRS_POINTSIZE_MIN = 155,
D3DRS_POINTSPRITEENABLE = 156, D3DRS_POINTSPRITEENABLE = 156,
@ -876,15 +975,14 @@ typedef enum _D3DRENDERSTATETYPE {
D3DRS_MULTISAMPLEANTIALIAS = 161, D3DRS_MULTISAMPLEANTIALIAS = 161,
D3DRS_MULTISAMPLEMASK = 162, D3DRS_MULTISAMPLEMASK = 162,
D3DRS_PATCHEDGESTYLE = 163, D3DRS_PATCHEDGESTYLE = 163,
D3DRS_PATCHSEGMENTS = 164,
D3DRS_DEBUGMONITORTOKEN = 165, D3DRS_DEBUGMONITORTOKEN = 165,
D3DRS_POINTSIZE_MAX = 166, D3DRS_POINTSIZE_MAX = 166,
D3DRS_INDEXEDVERTEXBLENDENABLE = 167, D3DRS_INDEXEDVERTEXBLENDENABLE = 167,
D3DRS_COLORWRITEENABLE = 168, D3DRS_COLORWRITEENABLE = 168,
D3DRS_TWEENFACTOR = 170, D3DRS_TWEENFACTOR = 170,
D3DRS_BLENDOP = 171, D3DRS_BLENDOP = 171,
D3DRS_POSITIONORDER = 172, D3DRS_POSITIONDEGREE = 172,
D3DRS_NORMALORDER = 173, D3DRS_NORMALDEGREE = 173,
D3DRS_SCISSORTESTENABLE = 174, D3DRS_SCISSORTESTENABLE = 174,
D3DRS_SLOPESCALEDEPTHBIAS = 175, D3DRS_SLOPESCALEDEPTHBIAS = 175,
D3DRS_ANTIALIASEDLINEENABLE = 176, D3DRS_ANTIALIASEDLINEENABLE = 176,
@ -934,6 +1032,8 @@ typedef enum _D3DRESOURCETYPE {
D3DRTYPE_FORCE_DWORD = 0x7fffffff D3DRTYPE_FORCE_DWORD = 0x7fffffff
} D3DRESOURCETYPE; } D3DRESOURCETYPE;
#define D3DRTYPECOUNT (D3DRTYPE_INDEXBUFFER+1)
typedef enum _D3DSHADEMODE { typedef enum _D3DSHADEMODE {
D3DSHADE_FLAT = 1, D3DSHADE_FLAT = 1,
D3DSHADE_GOURAUD = 2, D3DSHADE_GOURAUD = 2,
@ -967,8 +1067,6 @@ typedef enum _D3DSWAPEFFECT {
D3DSWAPEFFECT_DISCARD = 1, D3DSWAPEFFECT_DISCARD = 1,
D3DSWAPEFFECT_FLIP = 2, D3DSWAPEFFECT_FLIP = 2,
D3DSWAPEFFECT_COPY = 3, D3DSWAPEFFECT_COPY = 3,
D3DSWAPEFFECT_COPY_VSYNC = 4,
D3DSWAPEFFECT_FORCE_DWORD = 0xFFFFFFFF D3DSWAPEFFECT_FORCE_DWORD = 0xFFFFFFFF
} D3DSWAPEFFECT; } D3DSWAPEFFECT;
@ -1037,6 +1135,7 @@ typedef enum _D3DTEXTURESTAGESTATETYPE {
D3DTSS_BUMPENVMAT10 = 9, D3DTSS_BUMPENVMAT10 = 9,
D3DTSS_BUMPENVMAT11 = 10, D3DTSS_BUMPENVMAT11 = 10,
D3DTSS_TEXCOORDINDEX = 11, D3DTSS_TEXCOORDINDEX = 11,
#if 1 /* TODO: remove once samplerstates are implemented. */
D3DTSS_ADDRESSU = 13, D3DTSS_ADDRESSU = 13,
D3DTSS_ADDRESSV = 14, D3DTSS_ADDRESSV = 14,
D3DTSS_BORDERCOLOR = 15, D3DTSS_BORDERCOLOR = 15,
@ -1046,6 +1145,7 @@ typedef enum _D3DTEXTURESTAGESTATETYPE {
D3DTSS_MIPMAPLODBIAS = 19, D3DTSS_MIPMAPLODBIAS = 19,
D3DTSS_MAXMIPLEVEL = 20, D3DTSS_MAXMIPLEVEL = 20,
D3DTSS_MAXANISOTROPY = 21, D3DTSS_MAXANISOTROPY = 21,
#endif
D3DTSS_BUMPENVLSCALE = 22, D3DTSS_BUMPENVLSCALE = 22,
D3DTSS_BUMPENVLOFFSET = 23, D3DTSS_BUMPENVLOFFSET = 23,
D3DTSS_TEXTURETRANSFORMFLAGS = 24, D3DTSS_TEXTURETRANSFORMFLAGS = 24,
@ -1172,6 +1272,75 @@ typedef struct _D3DDEVICE_CREATION_PARAMETERS {
DWORD BehaviorFlags; DWORD BehaviorFlags;
} D3DDEVICE_CREATION_PARAMETERS; } D3DDEVICE_CREATION_PARAMETERS;
typedef struct _D3DDEVINFO_D3D9BANDWIDTHTIMINGS {
float MaxBandwidthUtilized;
float FrontEndUploadMemoryUtilizedPercent;
float VertexRateUtilizedPercent;
float TriangleSetupRateUtilizedPercent;
float FillRateUtilizedPercent;
} D3DDEVINFO_D3D9BANDWIDTHTIMINGS;
typedef struct _D3DDEVINFO_D3D9CACHEUTILIZATION {
float TextureCacheHitRate;
float PostTransformVertexCacheHitRate;
} D3DDEVINFO_D3D9CACHEUTILIZATION;
typedef struct _D3DDEVINFO_D3D9INTERFACETIMINGS {
float WaitingForGPUToUseApplicationResourceTimePercent;
float WaitingForGPUToAcceptMoreCommandsTimePercent;
float WaitingForGPUToStayWithinLatencyTimePercent;
float WaitingForGPUExclusiveResourceTimePercent;
float WaitingForGPUOtherTimePercent;
} D3DDEVINFO_D3D9INTERFACETIMINGS;
typedef struct _D3DDEVINFO_D3D9PIPELINETIMINGS {
float VertexProcessingTimePercent;
float PixelProcessingTimePercent;
float OtherGPUProcessingTimePercent;
float GPUIdleTimePercent;
} D3DDEVINFO_D3D9PIPELINETIMINGS;
typedef struct _D3DDEVINFO_D3D9STAGETIMINGS {
float MemoryProcessingPercent;
float ComputationProcessingPercent;
} D3DDEVINFO_D3D9STAGETIMINGS;
/* Vertex cache optimization hints. */
typedef struct D3DDEVINFO_VCACHE {
/* Must be a 4 char code FOURCC (e.g. CACH) */
DWORD Pattern;
/* 0 to get the longest strips, 1 vertex cache */
DWORD OptMethod;
/* Cache size to use (only valid if OptMethod==1) */
DWORD CacheSize;
/* internal for deciding when to restart strips, non user modifyable (only valid if OptMethod==1) */
DWORD MagicNumber;
} D3DDEVINFO_VCACHE;
typedef struct D3DRESOURCESTATS {
BOOL bThrashing;
DWORD ApproxBytesDownloaded;
DWORD NumEvicts;
DWORD NumVidCreates;
DWORD LastPri;
DWORD NumUsed;
DWORD NumUsedInVidMem;
DWORD WorkingSet;
DWORD WorkingSetBytes;
DWORD TotalManaged;
DWORD TotalBytes;
} D3DRESOURCESTATS;
typedef struct _D3DDEVINFO_D3DRESOURCEMANAGER {
D3DRESOURCESTATS stats[D3DRTYPECOUNT];
} D3DDEVINFO_D3DRESOURCEMANAGER;
typedef struct _D3DDEVINFO_D3DVERTEXSTATS {
DWORD NumRenderedTriangles;
DWORD NumExtraClippingTriangles;
} D3DDEVINFO_D3DVERTEXSTATS;
typedef struct _D3DDISPLAYMODE { typedef struct _D3DDISPLAYMODE {
UINT Width; UINT Width;
UINT Height; UINT Height;
@ -1296,7 +1465,7 @@ typedef struct _D3DRECTPATCH_INFO {
UINT Height; UINT Height;
UINT Stride; UINT Stride;
D3DBASISTYPE Basis; D3DBASISTYPE Basis;
D3DORDERTYPE Order; D3DDEGREETYPE Degree;
} D3DRECTPATCH_INFO; } D3DRECTPATCH_INFO;
typedef struct _D3DSURFACE_DESC { typedef struct _D3DSURFACE_DESC {
@ -1314,7 +1483,7 @@ typedef struct _D3DTRIPATCH_INFO {
UINT StartVertexOffset; UINT StartVertexOffset;
UINT NumVertices; UINT NumVertices;
D3DBASISTYPE Basis; D3DBASISTYPE Basis;
D3DORDERTYPE Order; D3DDEGREETYPE Degree;
} D3DTRIPATCH_INFO; } D3DTRIPATCH_INFO;
typedef struct _D3DVERTEXBUFFER_DESC { typedef struct _D3DVERTEXBUFFER_DESC {
@ -1346,12 +1515,4 @@ typedef struct _D3DVOLUME_DESC {
UINT Depth; UINT Depth;
} D3DVOLUME_DESC; } D3DVOLUME_DESC;
typedef enum _D3DQUERYTYPE {
D3DQUERYTYPE_VCACHE = 4,
D3DQUERYTYPE_RESOURCEMANAGER = 5,
D3DQUERYTYPE_VERTEXSTATS = 6,
D3DQUERYTYPE_EVENT = 8,
D3DQUERYTYPE_OCCLUSION = 9
} D3DQUERYTYPE;
#endif /* __WINE_D3D9TYPES_H */ #endif /* __WINE_D3D9TYPES_H */

View File

@ -31,6 +31,7 @@
# error You must include d3d8.h or d3d9.h header to use this header # error You must include d3d8.h or d3d9.h header to use this header
#endif #endif
#include "wined3d_types.h"
/***************************************************************** /*****************************************************************
* THIS FILE MUST NOT CONTAIN X11 or MESA DEFINES * THIS FILE MUST NOT CONTAIN X11 or MESA DEFINES
* PLEASE USE wine/wined3d_gl.h INSTEAD * PLEASE USE wine/wined3d_gl.h INSTEAD
@ -114,113 +115,6 @@ DEFINE_GUID(IID_IWineD3DQuery,
0x905ddbac, 0x6f30, 0x11d9, 0xc6, 0x87, 0x0, 0x4, 0x61, 0x42, 0xc1, 0x4f); 0x905ddbac, 0x6f30, 0x11d9, 0xc6, 0x87, 0x0, 0x4, 0x61, 0x42, 0xc1, 0x4f);
/*****************************************************************************
* WineD3D Structures to be used when d3d8 and d3d9 are incompatible
*/
typedef enum _WINED3DSAMPLERSTATETYPE {
WINED3DSAMP_ADDRESSU = 1,
WINED3DSAMP_ADDRESSV = 2,
WINED3DSAMP_ADDRESSW = 3,
WINED3DSAMP_BORDERCOLOR = 4,
WINED3DSAMP_MAGFILTER = 5,
WINED3DSAMP_MINFILTER = 6,
WINED3DSAMP_MIPFILTER = 7,
WINED3DSAMP_MIPMAPLODBIAS = 8,
WINED3DSAMP_MAXMIPLEVEL = 9,
WINED3DSAMP_MAXANISOTROPY = 10,
WINED3DSAMP_SRGBTEXTURE = 11,
WINED3DSAMP_ELEMENTINDEX = 12,
WINED3DSAMP_DMAPOFFSET = 13,
WINED3DSAMP_FORCE_DWORD = 0x7fffffff,
} WINED3DSAMPLERSTATETYPE;
typedef struct _WINED3DADAPTER_IDENTIFIER {
char *Driver;
char *Description;
char *DeviceName;
LARGE_INTEGER *DriverVersion;
DWORD *VendorId;
DWORD *DeviceId;
DWORD *SubSysId;
DWORD *Revision;
GUID *DeviceIdentifier;
DWORD *WHQLLevel;
} WINED3DADAPTER_IDENTIFIER;
typedef struct _WINED3DPRESENT_PARAMETERS {
UINT *BackBufferWidth;
UINT *BackBufferHeight;
D3DFORMAT *BackBufferFormat;
UINT *BackBufferCount;
D3DMULTISAMPLE_TYPE *MultiSampleType;
DWORD *MultiSampleQuality;
D3DSWAPEFFECT *SwapEffect;
HWND *hDeviceWindow;
BOOL *Windowed;
BOOL *EnableAutoDepthStencil;
D3DFORMAT *AutoDepthStencilFormat;
DWORD *Flags;
UINT *FullScreen_RefreshRateInHz;
UINT *PresentationInterval;
} WINED3DPRESENT_PARAMETERS;
typedef struct _WINED3DSURFACE_DESC
{
D3DFORMAT *Format;
D3DRESOURCETYPE *Type;
DWORD *Usage;
D3DPOOL *Pool;
UINT *Size;
D3DMULTISAMPLE_TYPE *MultiSampleType;
DWORD *MultiSampleQuality;
UINT *Width;
UINT *Height;
} WINED3DSURFACE_DESC;
typedef struct _WINED3DVOLUME_DESC
{
D3DFORMAT *Format;
D3DRESOURCETYPE *Type;
DWORD *Usage;
D3DPOOL *Pool;
UINT *Size;
UINT *Width;
UINT *Height;
UINT *Depth;
} WINED3DVOLUME_DESC;
typedef struct _WINED3DVERTEXELEMENT {
WORD Stream;
WORD Offset;
BYTE Type;
BYTE Method;
BYTE Usage;
BYTE UsageIndex;
} WINED3DVERTEXELEMENT, *LPWINED3DVERTEXELEMENT;
typedef enum _WINED3DQUERYTYPE {
WINED3DQUERYTYPE_VCACHE = 4,
WINED3DQUERYTYPE_RESOURCEMANAGER = 5,
WINED3DQUERYTYPE_VERTEXSTATS = 6,
WINED3DQUERYTYPE_EVENT = 8,
WINED3DQUERYTYPE_OCCLUSION = 9,
WINED3DQUERYTYPE_TIMESTAMP = 10,
WINED3DQUERYTYPE_TIMESTAMPDISJOINT = 11,
WINED3DQUERYTYPE_TIMESTAMPFREQ = 12,
WINED3DQUERYTYPE_PIPELINETIMINGS = 13,
WINED3DQUERYTYPE_INTERFACETIMINGS = 14,
WINED3DQUERYTYPE_VERTEXTIMINGS = 15,
WINED3DQUERYTYPE_PIXELTIMINGS = 16,
WINED3DQUERYTYPE_BANDWIDTHTIMINGS = 17,
WINED3DQUERYTYPE_CACHEUTILIZATION = 18
} WINED3DQUERYTYPE;
/* The following have differing names, but actually are the same layout. */ /* The following have differing names, but actually are the same layout. */
/* Also, D3DCAPS8 is a subset of D3DCAPS9 so can be typecase as long as /* Also, D3DCAPS8 is a subset of D3DCAPS9 so can be typecase as long as
none of the 9 fields are accessed when the device is d3d8 */ none of the 9 fields are accessed when the device is d3d8 */
@ -260,6 +154,7 @@ typedef struct IWineD3DVolume IWineD3DVolume;
typedef struct IWineD3DVertexDeclaration IWineD3DVertexDeclaration; typedef struct IWineD3DVertexDeclaration IWineD3DVertexDeclaration;
typedef struct IWineD3DVertexShader IWineD3DVertexShader; typedef struct IWineD3DVertexShader IWineD3DVertexShader;
typedef struct IWineD3DPixelShader IWineD3DPixelShader; typedef struct IWineD3DPixelShader IWineD3DPixelShader;
typedef struct IWineD3DQuery IWineD3DQuery;
/***************************************************************************** /*****************************************************************************
* Callback functions required for predefining surfaces / stencils * Callback functions required for predefining surfaces / stencils
@ -386,7 +281,7 @@ DECLARE_INTERFACE_(IWineD3DDevice,IUnknown)
STDMETHOD(CreateVolumeTexture)(THIS_ UINT Width, UINT Height, UINT Depth, UINT Levels, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, IWineD3DVolumeTexture** ppVolumeTexture, HANDLE* pSharedHandle, IUnknown *parent, D3DCB_CREATEVOLUMEFN pFn) PURE; STDMETHOD(CreateVolumeTexture)(THIS_ UINT Width, UINT Height, UINT Depth, UINT Levels, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, IWineD3DVolumeTexture** ppVolumeTexture, HANDLE* pSharedHandle, IUnknown *parent, D3DCB_CREATEVOLUMEFN pFn) PURE;
STDMETHOD(CreateVolume)(THIS_ UINT Width, UINT Height, UINT Depth, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, IWineD3DVolume** ppVolumeTexture, HANDLE* pSharedHandle, IUnknown *parent) PURE; STDMETHOD(CreateVolume)(THIS_ UINT Width, UINT Height, UINT Depth, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, IWineD3DVolume** ppVolumeTexture, HANDLE* pSharedHandle, IUnknown *parent) PURE;
STDMETHOD(CreateCubeTexture)(THIS_ UINT EdgeLength, UINT Levels, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, IWineD3DCubeTexture** ppCubeTexture, HANDLE* pSharedHandle, IUnknown *parent, D3DCB_CREATESURFACEFN pFn) PURE; STDMETHOD(CreateCubeTexture)(THIS_ UINT EdgeLength, UINT Levels, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, IWineD3DCubeTexture** ppCubeTexture, HANDLE* pSharedHandle, IUnknown *parent, D3DCB_CREATESURFACEFN pFn) PURE;
STDMETHOD(CreateQuery)(THIS_ WINED3DQUERYTYPE Type, void **ppQuery, IUnknown *pParent); STDMETHOD(CreateQuery)(THIS_ WINED3DQUERYTYPE Type, IWineD3DQuery **ppQuery, IUnknown *pParent);
STDMETHOD(CreateAdditionalSwapChain)(THIS_ WINED3DPRESENT_PARAMETERS* pPresentationParameters, void** pSwapChain, IUnknown* pParent, D3DCB_CREATERENDERTARGETFN pFn, D3DCB_CREATEDEPTHSTENCILSURFACEFN pFn2); STDMETHOD(CreateAdditionalSwapChain)(THIS_ WINED3DPRESENT_PARAMETERS* pPresentationParameters, void** pSwapChain, IUnknown* pParent, D3DCB_CREATERENDERTARGETFN pFn, D3DCB_CREATEDEPTHSTENCILSURFACEFN pFn2);
STDMETHOD(CreateVertexDeclaration)(THIS_ CONST VOID* pDeclaration, IWineD3DVertexDeclaration** ppDecl, IUnknown* pParent) PURE; STDMETHOD(CreateVertexDeclaration)(THIS_ CONST VOID* pDeclaration, IWineD3DVertexDeclaration** ppDecl, IUnknown* pParent) PURE;
STDMETHOD(CreateVertexShader)(THIS_ CONST DWORD* pFunction, IWineD3DVertexShader** ppShader, IUnknown *pParent) PURE; STDMETHOD(CreateVertexShader)(THIS_ CONST DWORD* pFunction, IWineD3DVertexShader** ppShader, IUnknown *pParent) PURE;
@ -1193,6 +1088,41 @@ DECLARE_INTERFACE_(IWineD3DStateBlock,IUnknown)
#define IWineD3DStateBlock_InitStartupStateBlock(p) (p)->lpVtbl->InitStartupStateBlock(p) #define IWineD3DStateBlock_InitStartupStateBlock(p) (p)->lpVtbl->InitStartupStateBlock(p)
#endif #endif
/*****************************************************************************
* WineD3DQuery interface
*/
#define INTERFACE IWineD3DQuery
DECLARE_INTERFACE_(IWineD3DQuery,IUnknown)
{
/*** IUnknown methods ***/
STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void **ppvObject) PURE;
STDMETHOD_(ULONG,AddRef)(THIS) PURE;
STDMETHOD_(ULONG,Release)(THIS) PURE;
/*** IWineD3DQuery methods ***/
STDMETHOD(GetParent)(THIS_ IUnknown **pParent) PURE;
STDMETHOD(GetDevice)(THIS_ IWineD3DDevice **ppDevice) PURE;
STDMETHOD(GetData)(THIS_ void *pData, DWORD dwSize, DWORD dwGetDataFlags) PURE;
STDMETHOD_(DWORD,GetDataSize)(THIS) PURE;
STDMETHOD_(WINED3DQUERYTYPE, GetType)(THIS) PURE;
STDMETHOD(Issue)(THIS_ DWORD dwIssueFlags) PURE;
};
#undef INTERFACE
#if !defined(__cplusplus) || defined(CINTERFACE)
/*** IUnknown methods ***/
#define IWineD3DQuery_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
#define IWineD3DQuery_AddRef(p) (p)->lpVtbl->AddRef(p)
#define IWineD3DQuery_Release(p) (p)->lpVtbl->Release(p)
/*** IWineD3DQuery methods ***/
#define IWineD3DQuery_GetParent(p,a) (p)->lpVtbl->GetParent(p,a)
#define IWineD3DQuery_GetDevice(p,a) (p)->lpVtbl->GetDevice(p,a)
#define IWineD3DQuery_GetData(p,a,b,c) (p)->lpVtbl->GetData(p,a,b,c)
#define IWineD3DQuery_GetDataSize(p) (p)->lpVtbl->GetDataSize(p)
#define IWineD3DQuery_GetType(p) (p)->lpVtbl->GetType(p)
#define IWineD3DQuery_Issue(p,a) (p)->lpVtbl->Issue(p,a)
#endif
/***************************************************************************** /*****************************************************************************
* IWineD3DVertexShader interface * IWineD3DVertexShader interface

View File

@ -23,36 +23,44 @@
#ifndef __WINE_WINED3D_TYPES_H #ifndef __WINE_WINED3D_TYPES_H
#define __WINE_WINED3D_TYPES_H #define __WINE_WINED3D_TYPES_H
typedef struct _D3DVECTOR_3 { /* TODO: remove the dependency on d3d9 or d3d8 */
#if !defined( __WINE_D3D8_H ) && !defined( __WINE_D3D9_H )
# error You must include d3d8.h or d3d9.h header to use this header
#endif
#define WINED3D_VSHADER_MAX_CONSTANTS 96
#define WINED3D_PSHADER_MAX_CONSTANTS 32
typedef struct _WINED3DVECTOR_3 {
float x; float x;
float y; float y;
float z; float z;
} D3DVECTOR_3; } WINED3DVECTOR_3;
typedef struct _D3DVECTOR_4 { typedef struct _WINED3DVECTOR_4 {
float x; float x;
float y; float y;
float z; float z;
float w; float w;
} D3DVECTOR_4; } WINED3DVECTOR_4;
typedef struct D3DSHADERVECTOR { typedef struct WINED3DSHADERVECTOR {
float x; float x;
float y; float y;
float z; float z;
float w; float w;
} D3DSHADERVECTOR; } WINED3DSHADERVECTOR;
typedef struct D3DSHADERSCALAR { typedef struct WINED3DSHADERSCALAR {
float x; float x;
} D3DSHADERSCALAR; } WINED3DSHADERSCALAR;
typedef D3DSHADERVECTOR VSHADERCONSTANTS8[D3D_VSHADER_MAX_CONSTANTS]; typedef WINED3DSHADERVECTOR WINEVSHADERCONSTANTS8[WINED3D_VSHADER_MAX_CONSTANTS];
typedef struct VSHADERDATA { typedef struct VSHADERDATA {
/** Run Time Shader Function Constants */ /** Run Time Shader Function Constants */
/*D3DXBUFFER* constants;*/ /*D3DXBUFFER* constants;*/
VSHADERCONSTANTS8 C; WINEVSHADERCONSTANTS8 C;
/** Shader Code as char ... */ /** Shader Code as char ... */
CONST DWORD* code; CONST DWORD* code;
UINT codeLength; UINT codeLength;
@ -60,24 +68,24 @@ typedef struct VSHADERDATA {
/** temporary here waiting for buffer code */ /** temporary here waiting for buffer code */
typedef struct VSHADERINPUTDATA { typedef struct VSHADERINPUTDATA {
D3DSHADERVECTOR V[17]; WINED3DSHADERVECTOR V[17];
} VSHADERINPUTDATA; } WINEVSHADERINPUTDATA;
/** temporary here waiting for buffer code */ /** temporary here waiting for buffer code */
typedef struct VSHADEROUTPUTDATA { typedef struct VSHADEROUTPUTDATA {
D3DSHADERVECTOR oPos; WINED3DSHADERVECTOR oPos;
D3DSHADERVECTOR oD[2]; WINED3DSHADERVECTOR oD[2];
D3DSHADERVECTOR oT[8]; WINED3DSHADERVECTOR oT[8];
D3DSHADERVECTOR oFog; WINED3DSHADERVECTOR oFog;
D3DSHADERVECTOR oPts; WINED3DSHADERVECTOR oPts;
} VSHADEROUTPUTDATA; } WINEVSHADEROUTPUTDATA;
typedef D3DSHADERVECTOR PSHADERCONSTANTS8[D3D_PSHADER_MAX_CONSTANTS]; typedef WINED3DSHADERVECTOR WINEPSHADERCONSTANTS8[WINED3D_PSHADER_MAX_CONSTANTS];
typedef struct PSHADERDATA { typedef struct PSHADERDATA {
/** Run Time Shader Function Constants */ /** Run Time Shader Function Constants */
/*D3DXBUFFER* constants;*/ /*D3DXBUFFER* constants;*/
PSHADERCONSTANTS8 C; WINEPSHADERCONSTANTS8 C;
/** Shader Code as char ... */ /** Shader Code as char ... */
CONST DWORD* code; CONST DWORD* code;
UINT codeLength; UINT codeLength;
@ -85,16 +93,449 @@ typedef struct PSHADERDATA {
/** temporary here waiting for buffer code */ /** temporary here waiting for buffer code */
typedef struct PSHADERINPUTDATA { typedef struct PSHADERINPUTDATA {
D3DSHADERVECTOR V[2]; WINED3DSHADERVECTOR V[2];
D3DSHADERVECTOR T[8]; WINED3DSHADERVECTOR T[8];
D3DSHADERVECTOR S[16]; WINED3DSHADERVECTOR S[16];
/*D3DSHADERVECTOR R[12];*/ /*D3DSHADERVECTOR R[12];*/
} PSHADERINPUTDATA; } WINEPSHADERINPUTDATA;
/** temporary here waiting for buffer code */ /** temporary here waiting for buffer code */
typedef struct PSHADEROUTPUTDATA { typedef struct PSHADEROUTPUTDATA {
D3DSHADERVECTOR oC[4]; WINED3DSHADERVECTOR oC[4];
D3DSHADERVECTOR oDepth; WINED3DSHADERVECTOR oDepth;
} PSHADEROUTPUTDATA; } WINEPSHADEROUTPUTDATA;
/*****************************************************************************
* WineD3D Structures to be used when d3d8 and d3d9 are incompatible
*/
typedef enum _WINED3DDEGREETYPE {
WINED3DDEGREE_LINEAR = 1,
WINED3DDEGREE_QUADRATIC = 2,
WINED3DDEGREE_CUBIC = 3,
WINED3DDEGREE_QUINTIC = 5,
WINED3DDEGREE_FORCE_DWORD = 0x7fffffff
} WINED3DDEGREETYPE;
typedef enum _WINED3DFORMAT {
WINED3DFMT_UNKNOWN = 0,
WINED3DFMT_R8G8B8 = 20,
WINED3DFMT_A8R8G8B8 = 21,
WINED3DFMT_X8R8G8B8 = 22,
WINED3DFMT_R5G6B5 = 23,
WINED3DFMT_X1R5G5B5 = 24,
WINED3DFMT_A1R5G5B5 = 25,
WINED3DFMT_A4R4G4B4 = 26,
WINED3DFMT_R3G3B2 = 27,
WINED3DFMT_A8 = 28,
WINED3DFMT_A8R3G3B2 = 29,
WINED3DFMT_X4R4G4B4 = 30,
WINED3DFMT_A2B10G10R10 = 31,
WINED3DFMT_A8B8G8R8 = 32,
WINED3DFMT_X8B8G8R8 = 33,
WINED3DFMT_G16R16 = 34,
WINED3DFMT_A2R10G10B10 = 35,
WINED3DFMT_A16B16G16R16 = 36,
WINED3DFMT_A8P8 = 40,
WINED3DFMT_P8 = 41,
WINED3DFMT_L8 = 50,
WINED3DFMT_A8L8 = 51,
WINED3DFMT_A4L4 = 52,
WINED3DFMT_V8U8 = 60,
WINED3DFMT_L6V5U5 = 61,
WINED3DFMT_X8L8V8U8 = 62,
WINED3DFMT_Q8W8V8U8 = 63,
WINED3DFMT_V16U16 = 64,
WINED3DFMT_W11V11U10 = 65,
WINED3DFMT_A2W10V10U10 = 67,
WINED3DFMT_UYVY = MAKEFOURCC('U', 'Y', 'V', 'Y'),
WINED3DFMT_YUY2 = MAKEFOURCC('Y', 'U', 'Y', '2'),
WINED3DFMT_DXT1 = MAKEFOURCC('D', 'X', 'T', '1'),
WINED3DFMT_DXT2 = MAKEFOURCC('D', 'X', 'T', '2'),
WINED3DFMT_DXT3 = MAKEFOURCC('D', 'X', 'T', '3'),
WINED3DFMT_DXT4 = MAKEFOURCC('D', 'X', 'T', '4'),
WINED3DFMT_DXT5 = MAKEFOURCC('D', 'X', 'T', '5'),
WINED3DFMT_MULTI2_ARGB = MAKEFOURCC('M', 'E', 'T', '1'),
WINED3DFMT_G8R8_G8B8 = MAKEFOURCC('G', 'R', 'G', 'B'),
WINED3DFMT_R8G8_B8G8 = MAKEFOURCC('R', 'G', 'B', 'G'),
WINED3DFMT_D16_LOCKABLE = 70,
WINED3DFMT_D32 = 71,
WINED3DFMT_D15S1 = 73,
WINED3DFMT_D24S8 = 75,
WINED3DFMT_D24X8 = 77,
WINED3DFMT_D24X4S4 = 79,
WINED3DFMT_D16 = 80,
WINED3DFMT_D32F_LOCKABLE = 82,
WINED3DFMT_D24FS8 = 83,
WINED3DFMT_VERTEXDATA = 100,
WINED3DFMT_INDEX16 = 101,
WINED3DFMT_INDEX32 = 102,
WINED3DFMT_Q16W16V16U16 = 110,
/* Flaoting point formats */
WINED3DFMT_R16F = 111,
WINED3DFMT_G16R16F = 112,
WINED3DFMT_A16B16G16R16F = 113,
/* IEEE formats */
WINED3DFMT_R32F = 114,
WINED3DFMT_G32R32F = 115,
WINED3DFMT_A32B32G32R32F = 116,
WINED3DFMT_CxV8U8 = 117,
WINED3DFMT_FORCE_DWORD = 0xFFFFFFFF
} WINED3DFORMAT;
typedef enum _WINED3DRENDERSTATETYPE {
WINED3DRS_ZENABLE = 7,
WINED3DRS_FILLMODE = 8,
WINED3DRS_SHADEMODE = 9,
WINED3DRS_LINEPATTERN = 10,
WINED3DRS_ZWRITEENABLE = 14,
WINED3DRS_ALPHATESTENABLE = 15,
WINED3DRS_LASTPIXEL = 16,
WINED3DRS_SRCBLEND = 19,
WINED3DRS_DESTBLEND = 20,
WINED3DRS_CULLMODE = 22,
WINED3DRS_ZFUNC = 23,
WINED3DRS_ALPHAREF = 24,
WINED3DRS_ALPHAFUNC = 25,
WINED3DRS_DITHERENABLE = 26,
WINED3DRS_ALPHABLENDENABLE = 27,
WINED3DRS_FOGENABLE = 28,
WINED3DRS_SPECULARENABLE = 29,
WINED3DRS_ZVISIBLE = 30,
WINED3DRS_FOGCOLOR = 34,
WINED3DRS_FOGTABLEMODE = 35,
WINED3DRS_FOGSTART = 36,
WINED3DRS_FOGEND = 37,
WINED3DRS_FOGDENSITY = 38,
WINED3DRS_EDGEANTIALIAS = 40,
WINED3DRS_ZBIAS = 47,
WINED3DRS_RANGEFOGENABLE = 48,
WINED3DRS_STENCILENABLE = 52,
WINED3DRS_STENCILFAIL = 53,
WINED3DRS_STENCILZFAIL = 54,
WINED3DRS_STENCILPASS = 55,
WINED3DRS_STENCILFUNC = 56,
WINED3DRS_STENCILREF = 57,
WINED3DRS_STENCILMASK = 58,
WINED3DRS_STENCILWRITEMASK = 59,
WINED3DRS_TEXTUREFACTOR = 60,
WINED3DRS_WRAP0 = 128,
WINED3DRS_WRAP1 = 129,
WINED3DRS_WRAP2 = 130,
WINED3DRS_WRAP3 = 131,
WINED3DRS_WRAP4 = 132,
WINED3DRS_WRAP5 = 133,
WINED3DRS_WRAP6 = 134,
WINED3DRS_WRAP7 = 135,
WINED3DRS_CLIPPING = 136,
WINED3DRS_LIGHTING = 137,
WINED3DRS_AMBIENT = 139,
WINED3DRS_FOGVERTEXMODE = 140,
WINED3DRS_COLORVERTEX = 141,
WINED3DRS_LOCALVIEWER = 142,
WINED3DRS_NORMALIZENORMALS = 143,
WINED3DRS_DIFFUSEMATERIALSOURCE = 145,
WINED3DRS_SPECULARMATERIALSOURCE = 146,
WINED3DRS_AMBIENTMATERIALSOURCE = 147,
WINED3DRS_EMISSIVEMATERIALSOURCE = 148,
WINED3DRS_VERTEXBLEND = 151,
WINED3DRS_CLIPPLANEENABLE = 152,
WINED3DRS_SOFTWAREVERTEXPROCESSING = 153,
WINED3DRS_POINTSIZE = 154,
WINED3DRS_POINTSIZE_MIN = 155,
WINED3DRS_POINTSPRITEENABLE = 156,
WINED3DRS_POINTSCALEENABLE = 157,
WINED3DRS_POINTSCALE_A = 158,
WINED3DRS_POINTSCALE_B = 159,
WINED3DRS_POINTSCALE_C = 160,
WINED3DRS_MULTISAMPLEANTIALIAS = 161,
WINED3DRS_MULTISAMPLEMASK = 162,
WINED3DRS_PATCHEDGESTYLE = 163,
WINED3DRS_PATCHSEGMENTS = 164,
WINED3DRS_DEBUGMONITORTOKEN = 165,
WINED3DRS_POINTSIZE_MAX = 166,
WINED3DRS_INDEXEDVERTEXBLENDENABLE = 167,
WINED3DRS_COLORWRITEENABLE = 168,
WINED3DRS_TWEENFACTOR = 170,
WINED3DRS_BLENDOP = 171,
WINED3DRS_POSITIONORDER = 172,
WINED3DRS_NORMALORDER = 173,
WINED3DRS_POSITIONDEGREE = 172,
WINED3DRS_NORMALDEGREE = 173,
WINED3DRS_SCISSORTESTENABLE = 174,
WINED3DRS_SLOPESCALEDEPTHBIAS = 175,
WINED3DRS_ANTIALIASEDLINEENABLE = 176,
WINED3DRS_MINTESSELLATIONLEVEL = 178,
WINED3DRS_MAXTESSELLATIONLEVEL = 179,
WINED3DRS_ADAPTIVETESS_X = 180,
WINED3DRS_ADAPTIVETESS_Y = 181,
WINED3DRS_ADAPTIVETESS_Z = 182,
WINED3DRS_ADAPTIVETESS_W = 183,
WINED3DRS_ENABLEADAPTIVETESSELLATION= 184,
WINED3DRS_TWOSIDEDSTENCILMODE = 185,
WINED3DRS_CCW_STENCILFAIL = 186,
WINED3DRS_CCW_STENCILZFAIL = 187,
WINED3DRS_CCW_STENCILPASS = 188,
WINED3DRS_CCW_STENCILFUNC = 189,
WINED3DRS_COLORWRITEENABLE1 = 190,
WINED3DRS_COLORWRITEENABLE2 = 191,
WINED3DRS_COLORWRITEENABLE3 = 192,
WINED3DRS_BLENDFACTOR = 193,
WINED3DRS_SRGBWRITEENABLE = 194,
WINED3DRS_DEPTHBIAS = 195,
WINED3DRS_WRAP8 = 198,
WINED3DRS_WRAP9 = 199,
WINED3DRS_WRAP10 = 200,
WINED3DRS_WRAP11 = 201,
WINED3DRS_WRAP12 = 202,
WINED3DRS_WRAP13 = 203,
WINED3DRS_WRAP14 = 204,
WINED3DRS_WRAP15 = 205,
WINED3DRS_SEPARATEALPHABLENDENABLE = 206,
WINED3DRS_SRCBLENDALPHA = 207,
WINED3DRS_DESTBLENDALPHA = 208,
WINED3DRS_BLENDOPALPHA = 209,
WINED3DRS_FORCE_DWORD = 0x7fffffff
} WINED3DRENDERSTATETYPE;
#define WINEHIGHEST_RENDER_STATE WINED3DRS_BLENDOPALPHA
/* Highest D3DRS_ value */
typedef enum _WINED3DSWAPEFFECT {
WINED3DSWAPEFFECT_DISCARD = 1,
WINED3DSWAPEFFECT_FLIP = 2,
WINED3DSWAPEFFECT_COPY = 3,
WINED3DSWAPEFFECT_COPY_VSYNC = 4,
WINED3DSWAPEFFECT_FORCE_DWORD = 0xFFFFFFFF
} WINED3DSWAPEFFECT;
typedef enum _WINED3DSAMPLERSTATETYPE {
WINED3DSAMP_ADDRESSU = 1,
WINED3DSAMP_ADDRESSV = 2,
WINED3DSAMP_ADDRESSW = 3,
WINED3DSAMP_BORDERCOLOR = 4,
WINED3DSAMP_MAGFILTER = 5,
WINED3DSAMP_MINFILTER = 6,
WINED3DSAMP_MIPFILTER = 7,
WINED3DSAMP_MIPMAPLODBIAS = 8,
WINED3DSAMP_MAXMIPLEVEL = 9,
WINED3DSAMP_MAXANISOTROPY = 10,
WINED3DSAMP_SRGBTEXTURE = 11,
WINED3DSAMP_ELEMENTINDEX = 12,
WINED3DSAMP_DMAPOFFSET = 13,
WINED3DSAMP_FORCE_DWORD = 0x7fffffff,
} WINED3DSAMPLERSTATETYPE;
typedef struct _WINEDD3DRECTPATCH_INFO {
UINT StartVertexOffsetWidth;
UINT StartVertexOffsetHeight;
UINT Width;
UINT Height;
UINT Stride;
D3DBASISTYPE Basis;
WINED3DDEGREETYPE Degree;
} WINED3DRECTPATCH_INFO;
typedef struct _WINED3DADAPTER_IDENTIFIER {
char *Driver;
char *Description;
char *DeviceName;
LARGE_INTEGER *DriverVersion;
DWORD *VendorId;
DWORD *DeviceId;
DWORD *SubSysId;
DWORD *Revision;
GUID *DeviceIdentifier;
DWORD *WHQLLevel;
} WINED3DADAPTER_IDENTIFIER;
typedef struct _WINED3DPRESENT_PARAMETERS {
UINT *BackBufferWidth;
UINT *BackBufferHeight;
D3DFORMAT *BackBufferFormat;
UINT *BackBufferCount;
D3DMULTISAMPLE_TYPE *MultiSampleType;
DWORD *MultiSampleQuality;
D3DSWAPEFFECT *SwapEffect;
HWND *hDeviceWindow;
BOOL *Windowed;
BOOL *EnableAutoDepthStencil;
D3DFORMAT *AutoDepthStencilFormat;
DWORD *Flags;
UINT *FullScreen_RefreshRateInHz;
UINT *PresentationInterval;
} WINED3DPRESENT_PARAMETERS;
typedef struct _WINED3DSURFACE_DESC
{
D3DFORMAT *Format;
D3DRESOURCETYPE *Type;
DWORD *Usage;
D3DPOOL *Pool;
UINT *Size;
D3DMULTISAMPLE_TYPE *MultiSampleType;
DWORD *MultiSampleQuality;
UINT *Width;
UINT *Height;
} WINED3DSURFACE_DESC;
typedef struct _WINED3DVOLUME_DESC
{
D3DFORMAT *Format;
D3DRESOURCETYPE *Type;
DWORD *Usage;
D3DPOOL *Pool;
UINT *Size;
UINT *Width;
UINT *Height;
UINT *Depth;
} WINED3DVOLUME_DESC;
typedef struct _WINED3DVERTEXELEMENT {
WORD Stream;
WORD Offset;
BYTE Type;
BYTE Method;
BYTE Usage;
BYTE UsageIndex;
} WINED3DVERTEXELEMENT, *LPWINED3DVERTEXELEMENT;
typedef enum _WINED3DQUERYTYPE {
WINED3DQUERYTYPE_VCACHE = 4,
WINED3DQUERYTYPE_RESOURCEMANAGER = 5,
WINED3DQUERYTYPE_VERTEXSTATS = 6,
WINED3DQUERYTYPE_EVENT = 8,
WINED3DQUERYTYPE_OCCLUSION = 9,
WINED3DQUERYTYPE_TIMESTAMP = 10,
WINED3DQUERYTYPE_TIMESTAMPDISJOINT = 11,
WINED3DQUERYTYPE_TIMESTAMPFREQ = 12,
WINED3DQUERYTYPE_PIPELINETIMINGS = 13,
WINED3DQUERYTYPE_INTERFACETIMINGS = 14,
WINED3DQUERYTYPE_VERTEXTIMINGS = 15,
WINED3DQUERYTYPE_PIXELTIMINGS = 16,
WINED3DQUERYTYPE_BANDWIDTHTIMINGS = 17,
WINED3DQUERYTYPE_CACHEUTILIZATION = 18
} WINED3DQUERYTYPE;
#define WINED3DISSUE_BEGIN (1 << 1)
#define WINED3DISSUE_END (1 << 0)
#define WINED3DGETDATA_FLUSH (1 << 0)
typedef struct _WINED3DDEVICE_CREATION_PARAMETERS {
UINT AdapterOrdinal;
D3DDEVTYPE DeviceType;
HWND hFocusWindow;
DWORD BehaviorFlags;
} WINED3DDEVICE_CREATION_PARAMETERS;
typedef struct _WINED3DDEVINFO_BANDWIDTHTIMINGS {
float MaxBandwidthUtilized;
float FrontEndUploadMemoryUtilizedPercent;
float VertexRateUtilizedPercent;
float TriangleSetupRateUtilizedPercent;
float FillRateUtilizedPercent;
} WINED3DDEVINFO_BANDWIDTHTIMINGS;
typedef struct _WINED3DDEVINFO_CACHEUTILIZATION {
float TextureCacheHitRate;
float PostTransformVertexCacheHitRate;
} WINED3DDEVINFO_CACHEUTILIZATION;
typedef struct _WINED3DDEVINFO_INTERFACETIMINGS {
float WaitingForGPUToUseApplicationResourceTimePercent;
float WaitingForGPUToAcceptMoreCommandsTimePercent;
float WaitingForGPUToStayWithinLatencyTimePercent;
float WaitingForGPUExclusiveResourceTimePercent;
float WaitingForGPUOtherTimePercent;
} WINED3DDEVINFO_INTERFACETIMINGS;
typedef struct _WINED3DDEVINFO_PIPELINETIMINGS {
float VertexProcessingTimePercent;
float PixelProcessingTimePercent;
float OtherGPUProcessingTimePercent;
float GPUIdleTimePercent;
} WINED3DDEVINFO_PIPELINETIMINGS;
typedef struct _WINED3DDEVINFO_STAGETIMINGS {
float MemoryProcessingPercent;
float ComputationProcessingPercent;
} WINED3DDEVINFO_STAGETIMINGS;
typedef struct WINED3DRESOURCESTATS {
BOOL bThrashing;
DWORD ApproxBytesDownloaded;
DWORD NumEvicts;
DWORD NumVidCreates;
DWORD LastPri;
DWORD NumUsed;
DWORD NumUsedInVidMem;
DWORD WorkingSet;
DWORD WorkingSetBytes;
DWORD TotalManaged;
DWORD TotalBytes;
} WINED3DRESOURCESTATS;
typedef enum _WINED3DRESOURCETYPE {
WINED3DRTYPE_SURFACE = 1,
WINED3DRTYPE_VOLUME = 2,
WINED3DRTYPE_TEXTURE = 3,
WINED3DRTYPE_VOLUMETEXTURE = 4,
WINED3DRTYPE_CUBETEXTURE = 5,
WINED3DRTYPE_VERTEXBUFFER = 6,
WINED3DRTYPE_INDEXBUFFER = 7,
WINED3DRTYPE_FORCE_DWORD = 0x7fffffff
} WINED3DRESOURCETYPE;
#define WINED3DRTYPECOUNT (WINED3DRTYPE_INDEXBUFFER+1)
typedef struct _WINED3DDEVINFO_RESOURCEMANAGER {
WINED3DRESOURCESTATS stats[WINED3DRTYPECOUNT];
} WINED3DDEVINFO_RESOURCEMANAGER;
typedef struct _WINED3DDEVINFO_VERTEXSTATS {
DWORD NumRenderedTriangles;
DWORD NumExtraClippingTriangles;
} WINED3DDEVINFO_VERTEXSTATS;
/*Vertex cache optimization hints.*/
typedef struct WINED3DDEVINFO_VCACHE {
/*Must be a 4 char code FOURCC (e.g. CACH)*/
DWORD Pattern;
/*0 to get the longest strips, 1 vertex cache*/
DWORD OptMethod;
/*Cache size to use (only valid if OptMethod==1) */
DWORD CacheSize;
/*internal for deciding when to restart strips, non user modifyable (only valid if OptMethod==1)*/
DWORD MagicNumber;
} WINED3DDEVINFO_VCACHE;
#endif #endif