aboutsummaryrefslogtreecommitdiff
path: root/mp/src/materialsystem/shaderapidx9/locald3dtypes.h
blob: ad4535585e7667221fc6cc4c0649f2c0879ddd30 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose: 
//
// $NoKeywords: $
//===========================================================================//

#ifndef LOCALD3DTYPES_H
#define LOCALD3DTYPES_H

#ifdef _WIN32
#pragma once
#endif

#if defined( DX10 ) && !defined( DX_TO_GL_ABSTRACTION )

#include <d3d10.h>
#include <d3dx10.h>

struct IDirect3D10BaseTexture
{
	ID3D10Resource			 *m_pBaseTexture;
	ID3D10ShaderResourceView *m_pSRView;
	ID3D10RenderTargetView	 *m_pRTView;
};

class CDx10Types
{
public:
	typedef struct IDirect3D10BaseTexture	IDirect3DTexture;
	// FIXME: What is this called now ? 
	// typedef ID3D10TextureCube			IDirect3DCubeTexture;
	typedef ID3D10Texture3D					IDirect3DVolumeTexture;
	typedef ID3D10Device					IDirect3DDevice;
	typedef D3D10_VIEWPORT					D3DVIEWPORT;
	typedef ID3D10Buffer					IDirect3DIndexBuffer;
	typedef ID3D10Buffer					IDirect3DVertexBuffer;
	typedef ID3D10VertexShader				IDirect3DVertexShader;
	typedef ID3D10PixelShader				IDirect3DPixelShader;
	typedef ID3D10ShaderResourceView		IDirect3DSurface;
	typedef ID3DX10Font						ID3DXFont;
	typedef ID3D10Query						ID3DQuery;

	typedef ID3D10Device					*LPDIRECT3DDEVICE;
	typedef ID3D10Buffer					*LPDIRECT3DINDEXBUFFER;
	typedef ID3D10Buffer					*LPDIRECT3DVERTEXBUFFER;
};

#endif // defined( DX10 ) && !defined( DX_TO_GL_ABSTRACTION )


#if !defined( _X360 ) && !defined( DX_TO_GL_ABSTRACTION )
#ifdef _DEBUG
#define D3D_DEBUG_INFO 1
#endif
#endif

struct IDirect3DTexture9;
struct IDirect3DBaseTexture9;
struct IDirect3DCubeTexture9;
struct IDirect3D9;
struct IDirect3DDevice9;
struct IDirect3DSurface9;
struct IDirect3DIndexBuffer9;
struct IDirect3DVertexBuffer9;
struct IDirect3DVertexShader9;
struct IDirect3DPixelShader9;
struct IDirect3DVolumeTexture9;

typedef struct _D3DLIGHT9				D3DLIGHT9;
typedef struct _D3DADAPTER_IDENTIFIER9	D3DADAPTER_IDENTIFIER9;
typedef struct _D3DCAPS9				D3DCAPS9;
typedef struct _D3DVIEWPORT9			D3DVIEWPORT9;
typedef struct _D3DMATERIAL9			D3DMATERIAL9;
typedef IDirect3DTexture9				IDirect3DTexture;
typedef IDirect3DBaseTexture9			IDirect3DBaseTexture;
typedef IDirect3DCubeTexture9			IDirect3DCubeTexture;
typedef IDirect3DVolumeTexture9 		IDirect3DVolumeTexture;
typedef IDirect3DDevice9				IDirect3DDevice;
typedef D3DMATERIAL9					D3DMATERIAL;
typedef D3DLIGHT9						D3DLIGHT;
typedef IDirect3DSurface9				IDirect3DSurface;
typedef D3DCAPS9						D3DCAPS;
typedef IDirect3DIndexBuffer9			IDirect3DIndexBuffer;
typedef IDirect3DVertexBuffer9			IDirect3DVertexBuffer;
typedef IDirect3DPixelShader9			IDirect3DPixelShader;
typedef IDirect3DDevice					*LPDIRECT3DDEVICE;
typedef IDirect3DIndexBuffer			*LPDIRECT3DINDEXBUFFER;
typedef IDirect3DVertexBuffer			*LPDIRECT3DVERTEXBUFFER;

class CDx9Types
{
public:
	typedef IDirect3DTexture9				IDirect3DTexture;
	typedef IDirect3DBaseTexture9			IDirect3DBaseTexture;
	typedef IDirect3DCubeTexture9			IDirect3DCubeTexture;
	typedef IDirect3DVolumeTexture9 		IDirect3DVolumeTexture;
	typedef IDirect3DDevice9				IDirect3DDevice;
	typedef D3DMATERIAL9					D3DMATERIAL;
	typedef D3DLIGHT9						D3DLIGHT;
	typedef IDirect3DSurface9				IDirect3DSurface;
	typedef D3DCAPS9						D3DCAPS;
	typedef IDirect3DIndexBuffer9			IDirect3DIndexBuffer;
	typedef IDirect3DVertexBuffer9			IDirect3DVertexBuffer;
	typedef IDirect3DPixelShader9			IDirect3DPixelShader;
	typedef IDirect3DDevice					*LPDIRECT3DDEVICE;
	typedef IDirect3DIndexBuffer			*LPDIRECT3DINDEXBUFFER;
	typedef IDirect3DVertexBuffer			*LPDIRECT3DVERTEXBUFFER;
};

typedef void *HardwareShader_t;

//-----------------------------------------------------------------------------
// The vertex and pixel shader type
//-----------------------------------------------------------------------------
typedef int VertexShader_t;
typedef int PixelShader_t;	

//-----------------------------------------------------------------------------
// Bitpattern for an invalid shader
//-----------------------------------------------------------------------------
#define INVALID_SHADER	( 0xFFFFFFFF )
#define INVALID_HARDWARE_SHADER ( NULL )

#define D3DSAMP_NOTSUPPORTED					D3DSAMP_FORCE_DWORD
#define D3DRS_NOTSUPPORTED						D3DRS_FORCE_DWORD

#include "togl/rendermechanism.h"

#if defined( _X360 )

// not supported, keeping for port ease
#define D3DSAMP_SRGBTEXTURE						D3DSAMP_NOTSUPPORTED
#define D3DRS_LIGHTING							D3DRS_NOTSUPPORTED
#define D3DRS_DIFFUSEMATERIALSOURCE				D3DRS_NOTSUPPORTED
#define D3DRS_SPECULARENABLE					D3DRS_NOTSUPPORTED
#define D3DRS_SHADEMODE							D3DRS_NOTSUPPORTED
#define D3DRS_LASTPIXEL							D3DRS_NOTSUPPORTED
#define D3DRS_DITHERENABLE						D3DRS_NOTSUPPORTED
#define D3DRS_FOGENABLE							D3DRS_NOTSUPPORTED
#define D3DRS_FOGCOLOR							D3DRS_NOTSUPPORTED
#define D3DRS_FOGTABLEMODE						D3DRS_NOTSUPPORTED
#define D3DRS_FOGSTART							D3DRS_NOTSUPPORTED
#define D3DRS_FOGEND							D3DRS_NOTSUPPORTED
#define D3DRS_FOGDENSITY						D3DRS_NOTSUPPORTED
#define D3DRS_RANGEFOGENABLE					D3DRS_NOTSUPPORTED
#define D3DRS_TEXTUREFACTOR						D3DRS_NOTSUPPORTED
#define D3DRS_CLIPPING							D3DRS_NOTSUPPORTED
#define D3DRS_AMBIENT							D3DRS_NOTSUPPORTED
#define D3DRS_FOGVERTEXMODE						D3DRS_NOTSUPPORTED
#define D3DRS_COLORVERTEX						D3DRS_NOTSUPPORTED
#define D3DRS_LOCALVIEWER						D3DRS_NOTSUPPORTED
#define D3DRS_NORMALIZENORMALS					D3DRS_NOTSUPPORTED
#define D3DRS_SPECULARMATERIALSOURCE			D3DRS_NOTSUPPORTED
#define D3DRS_AMBIENTMATERIALSOURCE				D3DRS_NOTSUPPORTED
#define D3DRS_EMISSIVEMATERIALSOURCE			D3DRS_NOTSUPPORTED	
#define D3DRS_VERTEXBLEND						D3DRS_NOTSUPPORTED
#define D3DRS_POINTSCALEENABLE					D3DRS_NOTSUPPORTED
#define D3DRS_POINTSCALE_A						D3DRS_NOTSUPPORTED
#define D3DRS_POINTSCALE_B						D3DRS_NOTSUPPORTED
#define D3DRS_POINTSCALE_C						D3DRS_NOTSUPPORTED
#define D3DRS_PATCHEDGESTYLE					D3DRS_NOTSUPPORTED
#define D3DRS_DEBUGMONITORTOKEN					D3DRS_NOTSUPPORTED
#define D3DRS_INDEXEDVERTEXBLENDENABLE			D3DRS_NOTSUPPORTED
#define D3DRS_TWEENFACTOR						D3DRS_NOTSUPPORTED
#define D3DRS_POSITIONDEGREE					D3DRS_NOTSUPPORTED
#define D3DRS_NORMALDEGREE						D3DRS_NOTSUPPORTED
#define D3DRS_ANTIALIASEDLINEENABLE				D3DRS_NOTSUPPORTED
#define D3DRS_ADAPTIVETESS_X					D3DRS_NOTSUPPORTED
#define D3DRS_ADAPTIVETESS_Y					D3DRS_NOTSUPPORTED
#define D3DRS_ADAPTIVETESS_Z					D3DRS_NOTSUPPORTED
#define D3DRS_ADAPTIVETESS_W					D3DRS_NOTSUPPORTED
#define D3DRS_ENABLEADAPTIVETESSELLATION		D3DRS_NOTSUPPORTED
#define D3DRS_SRGBWRITEENABLE					D3DRS_NOTSUPPORTED
#define D3DLOCK_DISCARD							0
#define D3DUSAGE_DYNAMIC						0
#define D3DUSAGE_AUTOGENMIPMAP					0
#define D3DDEVTYPE_REF							D3DDEVTYPE_HAL
#define D3DENUM_WHQL_LEVEL						0
#define D3DCREATE_SOFTWARE_VERTEXPROCESSING		D3DCREATE_HARDWARE_VERTEXPROCESSING
#define D3DDMT_ENABLE							0

typedef enum D3DSHADEMODE
{
	D3DSHADE_FLAT = 0,
	D3DSHADE_GOURAUD = 0,
};

#endif // _X360

#endif // LOCALD3DTYPES_H