Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | File Members

DirectXDefinition.h

Go to the documentation of this file.
00001 //------------------------------------------------------------------------------
00002 // Lamp : Open source game middleware
00003 // Copyright (C) 2004  Junpei Ohtani ( Email : junpee@users.sourceforge.jp )
00004 //
00005 // This library is free software; you can redistribute it and/or
00006 // modify it under the terms of the GNU Lesser General Public
00007 // License as published by the Free Software Foundation; either
00008 // version 2.1 of the License, or (at your option) any later version.
00009 //
00010 // This library is distributed in the hope that it will be useful,
00011 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013 // Lesser General Public License for more details.
00014 //
00015 // You should have received a copy of the GNU Lesser General Public
00016 // License along with this library; if not, write to the Free Software
00017 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00018 //------------------------------------------------------------------------------
00019 
00020 /** @file
00021  * DirectX定義ヘッダ
00022  * @author Junpee
00023  */
00024 
00025 #ifndef DIRECT_X_DEFINITION_H_
00026 #define DIRECT_X_DEFINITION_H_
00027 
00028 /// ウィンドウズヘッダ。WinNT4.0、Win98以降
00029 #define _WIN32_WINNT 0x400
00030 #include <Windows.h>
00031 
00032 #ifdef _DEBUG
00033 /// デバッグ時にDirectGraphicsのデバッグ情報を出力する
00034 #define D3D_DEBUG_INFO
00035 #endif// End of _DEBUG
00036 
00037 // DirectGraphics
00038 #include <d3d9.h>
00039 
00040 // DirectGraphicsエクステンション
00041 #include <d3dx9.h>
00042 
00043 /// DirectInputバージョン8
00044 #define DIRECTINPUT_VERSION 0x800
00045 #include <dinput.h>
00046 
00047 // DirectSound
00048 #include <dsound.h>
00049 
00050 //------------------------------------------------------------------------------
00051 // DirectX用マクロ
00052 //------------------------------------------------------------------------------
00053 /**
00054  * DirectXの成功
00055  *
00056  * リリース時にも実行されます
00057  * @param dxStatus DirectXのステータス。成功していればtrueを返す
00058  */
00059 #define DirectXSucceeded(dxStatus) ((dxStatus) >= 0)
00060 
00061 /**
00062  * DirectXの失敗
00063  *
00064  * リリース時にも実行されます
00065  * @param dxStatus DirectXのステータス。失敗していればtrueを返す
00066  */
00067 #define DirectXFailed(dxStatus) ((dxStatus) < 0)
00068 
00069 //------------------------------------------------------------------------------
00070 // デバッグ時
00071 #ifdef _DEBUG
00072 /**
00073  * DirectXのアサート
00074  *
00075  * リリース時には実行されません
00076  * @param expression 失敗だとアサートが発生します
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  * DirectXのメッセージ付アサート
00086  *
00087  * リリース時には実行されません
00088  * @param expression 失敗だとアサートが発生します
00089  * @param message アサート時に出力するメッセージ
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  * DirectXのチェック
00099  *
00100  * リリース時にチェックは実行されませんが、引数の構文は実行されます
00101  * @param expression 失敗だとアサートが発生します
00102  */
00103 #define DirectXCheck(expression) DirectXAssert(expression)
00104 
00105 /**
00106  * DirectXのメッセージ付チェック
00107  *
00108  * リリース時にチェックは実行されませんが、引数の構文は実行されます
00109  * @param expression 失敗だとアサートが発生します
00110  * @param message アサート時に出力するメッセージ
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 /// DirectXのチェックダミー
00126 #define DirectXCheck(expression) (expression)
00127 
00128 /// DirectXのメッセージ付チェックダミー
00129 #define DirectXCheckMessage(expression, message) (expression)
00130 
00131 #endif// End of _DEBUG
00132 
00133 //------------------------------------------------------------------------------
00134 // バージョンナンバー無しインターフェースの定義
00135 //------------------------------------------------------------------------------
00136 
00137 // DirectGraphics
00138 
00139 /// Direct3D
00140 typedef IDirect3D9 Direct3D;
00141 
00142 /// Direct3DDevice
00143 typedef IDirect3DDevice9 Direct3DDevice;
00144 
00145 /// Direct3DStateBlock
00146 typedef IDirect3DStateBlock9 Direct3DStateBlock;
00147 
00148 /// Direct3DSurface
00149 typedef IDirect3DSurface9 Direct3DSurface;
00150 
00151 /// Direct3DIndexBuffer
00152 typedef IDirect3DIndexBuffer9 Direct3DIndexBuffer;
00153 
00154 /// Direct3DVertexDeclaration
00155 typedef IDirect3DVertexDeclaration9 Direct3DVertexDeclaration;
00156 
00157 /// Direct3DVertexBuffer
00158 typedef IDirect3DVertexBuffer9 Direct3DVertexBuffer;
00159 
00160 /// Direct3DIndexBuffer
00161 typedef IDirect3DIndexBuffer9 Direct3DIndexBuffer;
00162 
00163 /// Direct3DTexture
00164 typedef IDirect3DTexture9 Direct3DTexture;
00165 
00166 // DirectGraphicsExtension
00167 
00168 /// Direct3DXBuffer
00169 typedef ID3DXBuffer Direct3DXBuffer;
00170 
00171 /// Direct3DXMesh
00172 typedef ID3DXMesh Direct3DXMesh;
00173 
00174 // DirectInput
00175 
00176 /// DirectInput
00177 typedef IDirectInput8 DirectInput;
00178 
00179 /// DirectInputDevice
00180 typedef IDirectInputDevice8 DirectInputDevice;
00181 
00182 // DirectSound
00183 
00184 /// DirectSound
00185 typedef IDirectSound8 DirectSound;
00186 
00187 /// DirectSoundPrimaryBuffer
00188 typedef IDirectSoundBuffer DirectSoundPrimaryBuffer;
00189 
00190 /// DirectSoundBuffer
00191 typedef IDirectSoundBuffer8 DirectSoundBuffer;
00192 
00193 /// DirectSoundNotify
00194 typedef IDirectSoundNotify8 DirectSoundNotify;
00195 
00196 /// DirectSound3DBuffer
00197 typedef IDirectSound3DBuffer8 DirectSound3DBuffer;
00198 
00199 /// DirectSound3DBuffer
00200 typedef IDirectSound3DListener8 DirectSound3DListener;
00201 
00202 //------------------------------------------------------------------------------
00203 // バージョンナンバー無し構造体の定義
00204 //------------------------------------------------------------------------------
00205 
00206 // DirectGraphics
00207 
00208 /// D3DADAPTER_IDENTIFIER
00209 typedef D3DADAPTER_IDENTIFIER9 D3DAdapterIdentifier;
00210 
00211 /// D3DCAPS
00212 typedef D3DCAPS9 D3DCapacity;
00213 
00214 /// D3DSURFACE_DESC
00215 typedef D3DSURFACE_DESC D3DSurfaceDescription;
00216 
00217 /// D3DVIEWPORT9
00218 typedef D3DVIEWPORT9 D3DViewport;
00219 
00220 /// D3DLIGHT9
00221 typedef D3DLIGHT9 D3DLight;
00222 
00223 /// D3DMATERIAL9
00224 typedef D3DMATERIAL9 D3DMaterial;
00225 
00226 /// D3DVERTEXELEMENT9
00227 typedef D3DVERTEXELEMENT9 D3DVertexElement;
00228 
00229 //------------------------------------------------------------------------------
00230 // バージョンナンバー無し関数の定義
00231 //------------------------------------------------------------------------------
00232 
00233 // DirectGraphics
00234 
00235 /// Direct3DCreate
00236 #define Direct3DCreate Direct3DCreate9
00237 
00238 // DirectInput
00239 
00240 /// DirectInputCreate
00241 #define DirectInputCreate DirectInput8Create
00242 
00243 //------------------------------------------------------------------------------
00244 // バージョンナンバー無し定数の定義
00245 //------------------------------------------------------------------------------
00246 
00247 // DirectInput
00248 
00249 /// DirectInputInterfaceID
00250 #define DirectInputInterfaceID IID_IDirectInput8
00251 
00252 /// DirectInputDeviceClass_GameController
00253 #define DirectInputDeviceClass_GameController DI8DEVCLASS_GAMECTRL
00254 
00255 // DirectSound
00256 
00257 /// DirectSoundBufferInterfaceID
00258 #define DirectSoundBufferInterfaceID IID_IDirectSoundBuffer8
00259 
00260 /// DirectSoundNotifyInterfaceID
00261 #define DirectSoundNotifyInterfaceID IID_IDirectSoundNotify8
00262 
00263 /// DirectSound3DBufferInterfaceID
00264 #define DirectSound3DBufferInterfaceID IID_IDirectSound3DBuffer8
00265 
00266 /// DirectSound3DBufferInterfaceID
00267 #define DirectSound3DListenerInterfaceID IID_IDirectSound3DListener8
00268 
00269 //------------------------------------------------------------------------------
00270 // DirectXライブラリの追加
00271 //------------------------------------------------------------------------------
00272 
00273 // DirectXGUID
00274 #pragma comment(lib, "dxguid.lib")
00275 
00276 // DirectGraphics
00277 #pragma comment(lib, "d3d9.lib")
00278 
00279 // DirectXグラフィックスエクステンションライブラリの追加
00280 #ifdef _DEBUG
00281     #pragma comment(lib, "d3dx9d.lib")
00282 #else
00283     #pragma comment(lib, "d3dx9.lib")
00284 #endif
00285 
00286 // DirectInput
00287 #pragma comment(lib, "dinput8.lib")
00288 
00289 // DirectSound
00290 #pragma comment(lib, "dsound.lib")
00291 
00292 //dxerr9.lib
00293 
00294 //------------------------------------------------------------------------------
00295 #endif // End of DIRECT_X_DEFINITION_H_
00296 //------------------------------------------------------------------------------

Generated on Wed Mar 16 10:29:30 2005 for Lamp by doxygen 1.3.2