user32: Fix LB_ITEMFROMPOINT tests for listbox control.
[wine] / dlls / d3d8 / d3d8_private.h
index 0466137..229762b 100644 (file)
@@ -33,7 +33,6 @@
 #include "wingdi.h"
 #include "wine/debug.h"
 #include "d3d8.h"
-#include "ddraw.h"
 #include "wine/wined3d_interface.h"
 
 /* Device caps */
@@ -124,6 +123,9 @@ typedef struct IDirect3DVertexShaderDeclarationImpl IDirect3DVertexShaderDeclara
 /* Advance declaration of structures to satisfy compiler */
 typedef struct IDirect3DVertexShader8Impl IDirect3DVertexShader8Impl;
 
+/* Global critical section */
+extern CRITICAL_SECTION d3d8_cs;
+
 /* ===========================================================================
     The interfactes themselves
    =========================================================================== */
@@ -165,6 +167,12 @@ extern const IDirect3DDevice8Vtbl Direct3DDevice8_Vtbl;
 
 typedef void * shader_handle;
 
+struct FvfToDecl
+{
+    DWORD fvf;
+    IWineD3DVertexDeclaration *decl;
+};
+
 struct IDirect3DDevice8Impl
 {
     /* IUnknown fields */
@@ -177,6 +185,10 @@ struct IDirect3DDevice8Impl
     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;
 };
@@ -437,6 +449,9 @@ struct IDirect3DVolumeTexture8Impl
 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);
 
@@ -487,6 +502,38 @@ typedef struct  IDirect3DStateBlock8Impl {
     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
  */
@@ -554,6 +601,7 @@ struct IDirect3DVertexShader8Impl {
   LONG ref;
 
   shader_handle                    *handle;
+  IDirect3DVertexDeclaration8      *vertex_declaration;
   IWineD3DVertexShader             *wineD3DVertexShader;
 };
 
@@ -585,11 +633,14 @@ typedef struct IDirect3DPixelShader8Impl {
  *
  * 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,