d3d8_private.h revision a3133ef29cdf3656735d569fd64e54c9286effc0
/*
* Direct3D 8 private include file
*
* Copyright 2002-2004 Jason Edmeades
* Copyright 2003-2004 Raphael Junqueira
* Copyright 2004 Christian Costa
*
* 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
/*
* Sun LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
* other than GPL or LGPL is available it will apply instead, Sun elects to use only
* the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
* a choice of LGPL license versions is made available with the language indicating
* that LGPLv2 or any later version may be used, or where a choice of which version
* of the LGPL is applied is otherwise unspecified.
*/
#ifndef __WINE_D3D8_PRIVATE_H
#define __WINE_D3D8_PRIVATE_H
#include <stdarg.h>
#define NONAMELESSUNION
#define NONAMELESSSTRUCT
#define COBJMACROS
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
#include "d3d8.h"
/* CreateVertexShader can return > 0xFFFF */
#define VS_HIGHESTFIXEDFXF 0xF0000000
/* ===========================================================================
Macros
=========================================================================== */
/* Not nice, but it lets wined3d support different versions of directx */
/* Direct3D8 Interfaces: */
typedef struct IDirect3DBaseTexture8Impl IDirect3DBaseTexture8Impl;
typedef struct IDirect3DVolumeTexture8Impl IDirect3DVolumeTexture8Impl;
typedef struct IDirect3D8Impl IDirect3D8Impl;
typedef struct IDirect3DDevice8Impl IDirect3DDevice8Impl;
typedef struct IDirect3DTexture8Impl IDirect3DTexture8Impl;
typedef struct IDirect3DCubeTexture8Impl IDirect3DCubeTexture8Impl;
typedef struct IDirect3DIndexBuffer8Impl IDirect3DIndexBuffer8Impl;
typedef struct IDirect3DSurface8Impl IDirect3DSurface8Impl;
typedef struct IDirect3DSwapChain8Impl IDirect3DSwapChain8Impl;
typedef struct IDirect3DResource8Impl IDirect3DResource8Impl;
typedef struct IDirect3DVolume8Impl IDirect3DVolume8Impl;
typedef struct IDirect3DVertexBuffer8Impl IDirect3DVertexBuffer8Impl;
/** Private Interfaces: */
typedef struct IDirect3DStateBlockImpl IDirect3DStateBlockImpl;
typedef struct IDirect3DVertexShaderImpl IDirect3DVertexShaderImpl;
typedef struct IDirect3DPixelShaderImpl IDirect3DPixelShaderImpl;
/* Advance declaration of structures to satisfy compiler */
typedef struct IDirect3DVertexShader8Impl IDirect3DVertexShader8Impl;
/* ===========================================================================
The interfaces themselves
=========================================================================== */
/* ---------- */
/* IDirect3D8 */
/* ---------- */
/*****************************************************************************
* Predeclare the interface implementation structures
*/
/*****************************************************************************
* IDirect3D implementation structure
*/
struct IDirect3D8Impl
{
/* IUnknown fields */
const IDirect3D8Vtbl *lpVtbl;
/* The WineD3D device */
};
/* ---------------- */
/* IDirect3DDevice8 */
/* ---------------- */
/*****************************************************************************
* Predeclare the interface implementation structures
*/
/*****************************************************************************
* IDirect3DDevice8 implementation structure
*/
#define D3D8_INITIAL_HANDLE_TABLE_SIZE 64
#define D3D8_INVALID_HANDLE ~0U
enum d3d8_handle_type
{
};
struct d3d8_handle_entry
{
void *object;
enum d3d8_handle_type type;
};
struct d3d8_handle_table
{
struct d3d8_handle_entry *entries;
struct d3d8_handle_entry *free_entries;
};
struct FvfToDecl
{
struct IDirect3DVertexDeclaration8 *decl;
};
struct IDirect3DDevice8Impl
{
/* IUnknown fields */
const IDirect3DDevice8Vtbl *lpVtbl;
/* But what about baseVertexIndex in state blocks? hmm... it may be a better idea to pass this to wined3d */
struct d3d8_handle_table handle_table;
/* FVF management */
/* Avoids recursion with nested ReleaseRef to 0 */
};
/* ---------------- */
/* IDirect3DVolume8 */
/* ---------------- */
/*****************************************************************************
* IDirect3DVolume8 implementation structure
*/
struct IDirect3DVolume8Impl
{
/* IUnknown fields */
const IDirect3DVolume8Vtbl *lpVtbl;
/* IDirect3DVolume8 fields */
/* The volume container */
/* If set forward refcounting to this object */
};
HRESULT volume_init(IDirect3DVolume8Impl *volume, IDirect3DDevice8Impl *device, UINT width, UINT height,
/* ------------------- */
/* IDirect3DSwapChain8 */
/* ------------------- */
/*****************************************************************************
* Predeclare the interface implementation structures
*/
/*****************************************************************************
* IDirect3DSwapChain8 implementation structure
*/
struct IDirect3DSwapChain8Impl
{
/* IUnknown fields */
const IDirect3DSwapChain8Vtbl *lpVtbl;
/* IDirect3DSwapChain8 fields */
/* Parent reference */
};
/* ----------------- */
/* IDirect3DSurface8 */
/* ----------------- */
/*****************************************************************************
* IDirect3DSurface8 implementation structure
*/
struct IDirect3DSurface8Impl
{
/* IUnknown fields */
const IDirect3DSurface8Vtbl *lpVtbl;
/* IDirect3DSurface8 fields */
/* Parent reference */
/* The surface container */
/* If set forward refcounting to this object */
};
DWORD usage, D3DPOOL pool, D3DMULTISAMPLE_TYPE multisample_type, DWORD multisample_quality) DECLSPEC_HIDDEN;
/* ------------------ */
/* IDirect3DResource8 */
/* ------------------ */
/*****************************************************************************
* Predeclare the interface implementation structures
*/
/*****************************************************************************
* IDirect3DResource8 implementation structure
*/
struct IDirect3DResource8Impl
{
/* IUnknown fields */
const IDirect3DResource8Vtbl *lpVtbl;
/* IDirect3DResource8 fields */
};
/* ---------------------- */
/* IDirect3DVertexBuffer8 */
/* ---------------------- */
/*****************************************************************************
* IDirect3DVertexBuffer8 implementation structure
*/
struct IDirect3DVertexBuffer8Impl
{
/* IUnknown fields */
const IDirect3DVertexBuffer8Vtbl *lpVtbl;
/* IDirect3DResource8 fields */
/* Parent reference */
};
/* --------------------- */
/* IDirect3DIndexBuffer8 */
/* --------------------- */
/*****************************************************************************
* IDirect3DIndexBuffer8 implementation structure
*/
struct IDirect3DIndexBuffer8Impl
{
/* IUnknown fields */
const IDirect3DIndexBuffer8Vtbl *lpVtbl;
/* IDirect3DResource8 fields */
/* Parent reference */
};
/* --------------------- */
/* IDirect3DBaseTexture8 */
/* --------------------- */
/*****************************************************************************
* IDirect3DBaseTexture8 implementation structure
*/
struct IDirect3DBaseTexture8Impl
{
/* IUnknown fields */
const IDirect3DBaseTexture8Vtbl *lpVtbl;
/* IDirect3DResource8 fields */
};
/* --------------------- */
/* IDirect3DCubeTexture8 */
/* --------------------- */
/*****************************************************************************
* IDirect3DCubeTexture8 implementation structure
*/
struct IDirect3DCubeTexture8Impl
{
/* IUnknown fields */
const IDirect3DCubeTexture8Vtbl *lpVtbl;
/* IDirect3DResource8 fields */
/* Parent reference */
};
/* ----------------- */
/* IDirect3DTexture8 */
/* ----------------- */
/*****************************************************************************
* IDirect3DTexture8 implementation structure
*/
struct IDirect3DTexture8Impl
{
/* IUnknown fields */
const IDirect3DTexture8Vtbl *lpVtbl;
/* IDirect3DResourc8 fields */
/* Parent reference */
};
/* ----------------------- */
/* IDirect3DVolumeTexture8 */
/* ----------------------- */
/*****************************************************************************
* IDirect3DVolumeTexture8 implementation structure
*/
struct IDirect3DVolumeTexture8Impl
{
/* IUnknown fields */
const IDirect3DVolumeTexture8Vtbl *lpVtbl;
/* IDirect3DResource8 fields */
/* Parent reference */
};
UINT width, UINT height, UINT depth, UINT levels, DWORD usage, D3DFORMAT format, D3DPOOL pool) DECLSPEC_HIDDEN;
/* ----------------------- */
/* IDirect3DStateBlockImpl */
/* ----------------------- */
/* TODO: Generate a valid GUIDs */
/* {83B073CE-6F30-11d9-C687-00046142C14F} */
0x83b073ce, 0x6f30, 0x11d9, 0xc6, 0x87, 0x0, 0x4, 0x61, 0x42, 0xc1, 0x4f);
0x5dd7478d, 0xcbf3, 0x41a6, 0x8c, 0xfd, 0xfd, 0x19, 0x2b, 0x11, 0xc7, 0x90);
0xefc5557e, 0x6265, 0x4613, 0x8a, 0x94, 0x43, 0x85, 0x78, 0x89, 0xeb, 0x36);
0x6d3bdbdc, 0x5b02, 0x4415, 0xb8, 0x52, 0xce, 0x5e, 0x8b, 0xcc, 0xb2, 0x89);
/*****************************************************************************
* IDirect3DStateBlock8 interface
*/
#define INTERFACE IDirect3DStateBlock8
{
/*** IUnknown methods ***/
/*** IDirect3DStateBlock9 methods ***/
};
/*** IUnknown methods ***/
/*** IDirect3DStateBlock9 methods ***/
/*****************************************************************************
* Predeclare the interface implementation structures
*/
/*****************************************************************************
* IDirect3DStateBlock implementation structure
*/
typedef struct IDirect3DStateBlock8Impl {
/* IUnknown fields */
const IDirect3DStateBlock8Vtbl *lpVtbl;
/* IDirect3DResource8 fields */
/*****************************************************************************
* IDirect3DVertexDeclaration8 interface
*/
#define INTERFACE IDirect3DVertexDeclaration8
{
/*** IUnknown methods ***/
};
/*** IUnknown methods ***/
typedef struct {
/*****************************************************************************
* IDirect3DVertexShader8 interface
*/
#define INTERFACE IDirect3DVertexShader8
{
/*** IUnknown methods ***/
};
/*** IUnknown methods ***/
/* ------------------------- */
/* IDirect3DVertexShader8Impl */
/* ------------------------- */
/*****************************************************************************
* IDirect3DPixelShader8 interface
*/
#define INTERFACE IDirect3DPixelShader8
{
/*** IUnknown methods ***/
};
/*** IUnknown methods ***/
/*****************************************************************************
* IDirect3DVertexShader implementation structure
*/
struct IDirect3DVertexShader8Impl {
const IDirect3DVertexShader8Vtbl *lpVtbl;
};
const DWORD *declaration, const DWORD *byte_code, DWORD shader_handle, DWORD usage) DECLSPEC_HIDDEN;
#define D3D8_MAX_VERTEX_SHADER_CONSTANTF 256
/*****************************************************************************
* IDirect3DPixelShader implementation structure
*/
typedef struct IDirect3DPixelShader8Impl {
const IDirect3DPixelShader8Vtbl *lpVtbl;
/**
* Internals functions
*
* to see how not defined it here
*/
void load_local_constants(const DWORD *d3d8_elements, IWineD3DVertexShader *wined3d_vertex_shader) DECLSPEC_HIDDEN;
/* Callbacks */
#endif /* __WINE_D3DX8_PRIVATE_H */