#ifndef WINE_D3DHALGL_H_INCLUDED
#define WINE_D3DHALGL_H_INCLUDED

#include "windef.h"
#include "ddrawi.h"
#include "d3dtypes.h"

#define COMPUTE_FOG_COORDINATE

#if DIRECT3D_VERSION < 0x0900
/* have to keep FVF parsing d3d9 compatible */
#undef D3DFVF_POSITION_MASK
#define D3DFVF_POSITION_MASK 0x400E
#define D3DFVF_XYZW          0x4002
#define D3DFVF_LASTBETA_D3DCOLOR 0x8000
#endif

#define D3DFVF_GLCOLORORDER 0x2000 /* colours reordered to RGBA */
#define D3DFVF_XYZGLW 0x4004 /* RHW converted to W */

typedef struct
{
    D3DDP_PTRSTRIDE position;
    D3DDP_PTRSTRIDE normal;
    D3DDP_PTRSTRIDE color[2];
    D3DDP_PTRSTRIDE textureCoords[D3DDP_MAXTEXCOORD];

    D3DDP_PTRSTRIDE blend_weights;
    D3DDP_PTRSTRIDE matrix_indices;
    D3DDP_PTRSTRIDE fog_coordinate;
} GLDRAWPRIMITIVESTRIDEDDATA, *LPGLDRAWPRIMITIVESTRIDEDDATA;

struct GL_D3D_DriverCallbacks
{
    DWORD dwSize;
    DWORD (*D3dVbGetConvertedFVF)(LPDDRAWI_DDRAWSURFACE_LCL vb);
    LPVOID (*D3dVbPreRender)(LPDDRAWI_DDRAWSURFACE_LCL vb,
			     LPGLDRAWPRIMITIVESTRIDEDDATA data,
			     BOOL convert,
			     DWORD vstart, DWORD vcount,
			     const WORD* indices, DWORD nindices,
			     DWORD indexbase);
    void (*D3dVbPostRender)(LPDDRAWI_DDRAWSURFACE_LCL vb);
    BOOL (*D3dRenderLock)(ULONG_PTR dwhContext, BOOL draw, LPBOOL invert);
    void (*D3dRenderUnlock)(ULONG_PTR dwhContext, BOOL draw);
    void (*D3dRenderArea)(ULONG_PTR dwhContext, LPRECT rect, BOOL clear);
};

DEFINE_GUID( GUID_WineGLD3DCallbacks, 0xC1E3F5C6, 0xEC82, 0x4B53, 0x94, 0xCA,
	     0xAE, 0x4F, 0x08, 0xE0, 0x46, 0x7C );

#endif
