#include "wingdi.h"
#include "wine/debug.h"
#include "d3d8.h"
-#include "ddraw.h"
#include "wine/wined3d_interface.h"
/* Device caps */
/* Advance declaration of structures to satisfy compiler */
typedef struct IDirect3DVertexShader8Impl IDirect3DVertexShader8Impl;
+/* Global critical section */
+extern CRITICAL_SECTION d3d8_cs;
+
/* ===========================================================================
The interfactes themselves
=========================================================================== */
typedef void * shader_handle;
+struct FvfToDecl
+{
+ DWORD fvf;
+ IWineD3DVertexDeclaration *decl;
+};
+
struct IDirect3DDevice8Impl
{
/* IUnknown fields */
shader_handle *shader_handles;
shader_handle *free_shader_handles;
+ /* FVF management */
+ struct FvfToDecl *decls;
+ UINT numConvertedDecls, declArraySize;
+
/* Avoids recursion with nested ReleaseRef to 0 */
BOOL inDestruction;
};
DEFINE_GUID(IID_IDirect3DStateBlock8,
0x83b073ce, 0x6f30, 0x11d9, 0xc6, 0x87, 0x0, 0x4, 0x61, 0x42, 0xc1, 0x4f);
+DEFINE_GUID(IID_IDirect3DVertexDeclaration8,
+0x5dd7478d, 0xcbf3, 0x41a6, 0x8c, 0xfd, 0xfd, 0x19, 0x2b, 0x11, 0xc7, 0x90);
+
DEFINE_GUID(IID_IDirect3DVertexShader8,
0xefc5557e, 0x6265, 0x4613, 0x8a, 0x94, 0x43, 0x85, 0x78, 0x89, 0xeb, 0x36);
IWineD3DStateBlock *wineD3DStateBlock;
} IDirect3DStateBlock8Impl;
+/*****************************************************************************
+ * IDirect3DVertexDeclaration8 interface
+ */
+#define INTERFACE IDirect3DVertexDeclaration8
+DECLARE_INTERFACE_(IDirect3DVertexDeclaration8, IUnknown)
+{
+ /*** IUnknown methods ***/
+ STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** obj_ptr) PURE;
+ STDMETHOD_(ULONG,AddRef)(THIS) PURE;
+ STDMETHOD_(ULONG,Release)(THIS) PURE;
+};
+#undef INTERFACE
+
+/*** IUnknown methods ***/
+#define IDirect3DVertexDeclaration8_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
+#define IDirect3DVertexDeclaration8_AddRef(p) (p)->lpVtbl->AddRef(p)
+#define IDirect3DVertexDeclaration8_Release(p) (p)->lpVtbl->Release(p)
+
+/*** Implementation ***/
+extern const IDirect3DVertexDeclaration8Vtbl Direct3DVertexDeclaration8_Vtbl;
+
+typedef struct {
+ const IDirect3DVertexDeclaration8Vtbl *lpVtbl;
+ LONG ref_count;
+
+ DWORD *elements;
+ DWORD elements_size; /* Size of elements, in bytes */
+
+ IWineD3DVertexDeclaration *wined3d_vertex_declaration;
+} IDirect3DVertexDeclaration8Impl;
+
+
/*****************************************************************************
* IDirect3DVertexShader9 interface
*/
LONG ref;
shader_handle *handle;
+ IDirect3DVertexDeclaration8 *vertex_declaration;
IWineD3DVertexShader *wineD3DVertexShader;
};
*
* to see how not defined it here
*/
+void load_local_constants(const DWORD *d3d8_elements, IWineD3DVertexShader *wined3d_vertex_shader);
+size_t convert_to_wined3d_declaration(const DWORD *d3d8_elements, DWORD *d3d8_elements_size, WINED3DVERTEXELEMENT **wined3d_elements);
/* Callbacks */
extern HRESULT WINAPI D3D8CB_CreateSurface(IUnknown *device, IUnknown *pSuperior, UINT Width, UINT Height,
WINED3DFORMAT Format, DWORD Usage, WINED3DPOOL Pool, UINT Level,
- IWineD3DSurface** ppSurface, HANDLE* pSharedHandle);
+ WINED3DCUBEMAP_FACES Face, IWineD3DSurface** ppSurface,
+ HANDLE* pSharedHandle);
extern HRESULT WINAPI D3D8CB_CreateVolume(IUnknown *pDevice, IUnknown *pSuperior, UINT Width, UINT Height, UINT Depth,
WINED3DFORMAT Format, WINED3DPOOL Pool, DWORD Usage,