00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef DIRECT_X_DEFINITION_H_
00026 #define DIRECT_X_DEFINITION_H_
00027
00028
00029 #define _WIN32_WINNT 0x400
00030 #include <Windows.h>
00031
00032 #ifdef _DEBUG
00033
00034 #define D3D_DEBUG_INFO
00035 #endif// End of _DEBUG
00036
00037
00038 #include <d3d9.h>
00039
00040
00041 #include <d3dx9.h>
00042
00043
00044 #define DIRECTINPUT_VERSION 0x800
00045 #include <dinput.h>
00046
00047
00048 #include <dsound.h>
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059 #define DirectXSucceeded(dxStatus) ((dxStatus) >= 0)
00060
00061
00062
00063
00064
00065
00066
00067 #define DirectXFailed(dxStatus) ((dxStatus) < 0)
00068
00069
00070
00071 #ifdef _DEBUG
00072
00073
00074
00075
00076
00077
00078 #define DirectXAssert(expression) \
00079 if(DirectXFailed(expression)){\
00080 DebugOut("DirectXAssert %s %d\n", __FILE__, __LINE__);\
00081 _asm{ int 3 }\
00082 }
00083
00084
00085
00086
00087
00088
00089
00090
00091 #define DirectXAssertMessage(expression, message) \
00092 if(DirectXFailed(expression)){\
00093 DebugOut("DirectXAssert %s\n%s %d\n", message, __FILE__, __LINE__);\
00094 _asm{ int 3 }\
00095 }
00096
00097
00098
00099
00100
00101
00102
00103 #define DirectXCheck(expression) DirectXAssert(expression)
00104
00105
00106
00107
00108
00109
00110
00111
00112 #define DirectXCheckMessage(expression, message) \
00113 DirectXAssertMessage(expression, message)
00114
00115
00116
00117 #else // _DEBUG
00118
00119
00120 #define DirectXAssert(expression)
00121
00122
00123 #define DirectXAssertMessage(expression, message)
00124
00125
00126 #define DirectXCheck(expression) (expression)
00127
00128
00129 #define DirectXCheckMessage(expression, message) (expression)
00130
00131 #endif// End of _DEBUG
00132
00133
00134
00135
00136
00137
00138
00139
00140 typedef IDirect3D9 Direct3D;
00141
00142
00143 typedef IDirect3DDevice9 Direct3DDevice;
00144
00145
00146 typedef IDirect3DStateBlock9 Direct3DStateBlock;
00147
00148
00149 typedef IDirect3DSurface9 Direct3DSurface;
00150
00151
00152 typedef IDirect3DIndexBuffer9 Direct3DIndexBuffer;
00153
00154
00155 typedef IDirect3DVertexDeclaration9 Direct3DVertexDeclaration;
00156
00157
00158 typedef IDirect3DVertexBuffer9 Direct3DVertexBuffer;
00159
00160
00161 typedef IDirect3DIndexBuffer9 Direct3DIndexBuffer;
00162
00163
00164 typedef IDirect3DTexture9 Direct3DTexture;
00165
00166
00167
00168
00169 typedef ID3DXBuffer Direct3DXBuffer;
00170
00171
00172 typedef ID3DXMesh Direct3DXMesh;
00173
00174
00175
00176
00177 typedef IDirectInput8 DirectInput;
00178
00179
00180 typedef IDirectInputDevice8 DirectInputDevice;
00181
00182
00183
00184
00185 typedef IDirectSound8 DirectSound;
00186
00187
00188 typedef IDirectSoundBuffer DirectSoundPrimaryBuffer;
00189
00190
00191 typedef IDirectSoundBuffer8 DirectSoundBuffer;
00192
00193
00194 typedef IDirectSoundNotify8 DirectSoundNotify;
00195
00196
00197 typedef IDirectSound3DBuffer8 DirectSound3DBuffer;
00198
00199
00200 typedef IDirectSound3DListener8 DirectSound3DListener;
00201
00202
00203
00204
00205
00206
00207
00208
00209 typedef D3DADAPTER_IDENTIFIER9 D3DAdapterIdentifier;
00210
00211
00212 typedef D3DCAPS9 D3DCapacity;
00213
00214
00215 typedef D3DSURFACE_DESC D3DSurfaceDescription;
00216
00217
00218 typedef D3DVIEWPORT9 D3DViewport;
00219
00220
00221 typedef D3DLIGHT9 D3DLight;
00222
00223
00224 typedef D3DMATERIAL9 D3DMaterial;
00225
00226
00227 typedef D3DVERTEXELEMENT9 D3DVertexElement;
00228
00229
00230
00231
00232
00233
00234
00235
00236 #define Direct3DCreate Direct3DCreate9
00237
00238
00239
00240
00241 #define DirectInputCreate DirectInput8Create
00242
00243
00244
00245
00246
00247
00248
00249
00250 #define DirectInputInterfaceID IID_IDirectInput8
00251
00252
00253 #define DirectInputDeviceClass_GameController DI8DEVCLASS_GAMECTRL
00254
00255
00256
00257
00258 #define DirectSoundBufferInterfaceID IID_IDirectSoundBuffer8
00259
00260
00261 #define DirectSoundNotifyInterfaceID IID_IDirectSoundNotify8
00262
00263
00264 #define DirectSound3DBufferInterfaceID IID_IDirectSound3DBuffer8
00265
00266
00267 #define DirectSound3DListenerInterfaceID IID_IDirectSound3DListener8
00268
00269
00270
00271
00272
00273
00274 #pragma comment(lib, "dxguid.lib")
00275
00276
00277 #pragma comment(lib, "d3d9.lib")
00278
00279
00280 #ifdef _DEBUG
00281 #pragma comment(lib, "d3dx9d.lib")
00282 #else
00283 #pragma comment(lib, "d3dx9.lib")
00284 #endif
00285
00286
00287 #pragma comment(lib, "dinput8.lib")
00288
00289
00290 #pragma comment(lib, "dsound.lib")
00291
00292
00293
00294
00295 #endif // End of DIRECT_X_DEFINITION_H_
00296