1 | //--------------------------------------------------------------------------------------
|
---|
2 | // File: DxStdAfx.h
|
---|
3 | //
|
---|
4 | // Desc: Header file that is the standard includes for the DirectX SDK samples
|
---|
5 | //
|
---|
6 | // Copyright (c) Microsoft Corporation. All rights reserved.
|
---|
7 | //--------------------------------------------------------------------------------------
|
---|
8 | #pragma once
|
---|
9 | #ifndef DXSDK_STDAFX_H
|
---|
10 | #define DXSDK_STDAFX_H
|
---|
11 |
|
---|
12 | #define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers
|
---|
13 | #define STRICT
|
---|
14 |
|
---|
15 | // Works with Windows 2000 and later and Windows 98 or later
|
---|
16 | #undef _WIN32_IE
|
---|
17 | #undef WINVER
|
---|
18 | #undef _WIN32_WINDOWS
|
---|
19 | #undef _WIN32_WINNT
|
---|
20 | #define WINVER 0x0500
|
---|
21 | #define _WIN32_WINDOWS 0x0410
|
---|
22 | #define _WIN32_WINNT 0x0500
|
---|
23 |
|
---|
24 | #include <windows.h>
|
---|
25 | #include <assert.h>
|
---|
26 | #include <wchar.h>
|
---|
27 | #include <mmsystem.h>
|
---|
28 | #include <commctrl.h> // for InitCommonControls()
|
---|
29 | #include <shellapi.h> // for ExtractIcon()
|
---|
30 | #include <new.h> // for placement new
|
---|
31 | #include <math.h>
|
---|
32 | #include <limits.h>
|
---|
33 | #include <stdio.h>
|
---|
34 |
|
---|
35 |
|
---|
36 | // Enable extra D3D debugging in debug builds if using the debug DirectX runtime.
|
---|
37 | // This makes D3D objects work well in the debugger watch window, but slows down
|
---|
38 | // performance slightly.
|
---|
39 | #if defined(DEBUG) | defined(_DEBUG)
|
---|
40 | #define D3D_DEBUG_INFO
|
---|
41 | #endif
|
---|
42 |
|
---|
43 | // Direct3D includes
|
---|
44 | #include <d3d9.h>
|
---|
45 | #include <d3dx9.h>
|
---|
46 | #include <dxerr9.h>
|
---|
47 |
|
---|
48 | // DirectSound includes
|
---|
49 | #include <mmsystem.h>
|
---|
50 | #include <mmreg.h>
|
---|
51 | #include <dsound.h>
|
---|
52 |
|
---|
53 | // strsafe.h deprecates old unsecure string functions. If you
|
---|
54 | // really do not want to it to (not recommended), then uncomment the next line and
|
---|
55 | // comment out the following lines:
|
---|
56 |
|
---|
57 | //#define STRSAFE_NO_DEPRECATE
|
---|
58 | #pragma deprecated(strncpy)
|
---|
59 | #pragma deprecated(wcsncpy)
|
---|
60 | #pragma deprecated(_tcsncpy)
|
---|
61 | #pragma deprecated(wcsncat)
|
---|
62 | #pragma deprecated(strncat)
|
---|
63 | #pragma deprecated(_tcsncat)
|
---|
64 |
|
---|
65 | #include <strsafe.h>
|
---|
66 |
|
---|
67 | #include "DXUT.h"
|
---|
68 | #include "DXUTmisc.h"
|
---|
69 | #include "DXUTenum.h"
|
---|
70 | #include "DXUTeffectmap.h"
|
---|
71 | #include "DXUTmesh.h"
|
---|
72 | #include "DXUTgui.h"
|
---|
73 | #include "DXUTsettingsDlg.h"
|
---|
74 | #include "DXUTSound.h"
|
---|
75 |
|
---|
76 | #if defined(DEBUG) | defined(_DEBUG)
|
---|
77 | #ifndef V
|
---|
78 | #define V(x) { hr = x; if( FAILED(hr) ) { DXUTTrace( __FILE__, (DWORD)__LINE__, hr, L#x, true ); } }
|
---|
79 | #endif
|
---|
80 | #ifndef V_RETURN
|
---|
81 | #define V_RETURN(x) { hr = x; if( FAILED(hr) ) { return DXUTTrace( __FILE__, (DWORD)__LINE__, hr, L#x, true ); } }
|
---|
82 | #endif
|
---|
83 | #else
|
---|
84 | #ifndef V
|
---|
85 | #define V(x) { hr = x; }
|
---|
86 | #endif
|
---|
87 | #ifndef V_RETURN
|
---|
88 | #define V_RETURN(x) { hr = x; if( FAILED(hr) ) { return hr; } }
|
---|
89 | #endif
|
---|
90 | #endif
|
---|
91 |
|
---|
92 | #ifndef SAFE_DELETE
|
---|
93 | #define SAFE_DELETE(p) { if(p) { delete (p); (p)=NULL; } }
|
---|
94 | #endif
|
---|
95 | #ifndef SAFE_DELETE_ARRAY
|
---|
96 | #define SAFE_DELETE_ARRAY(p) { if(p) { delete[] (p); (p)=NULL; } }
|
---|
97 | #endif
|
---|
98 | #ifndef SAFE_RELEASE
|
---|
99 | #define SAFE_RELEASE(p) { if(p) { (p)->Release(); (p)=NULL; } }
|
---|
100 | #endif
|
---|
101 |
|
---|
102 | #endif // !defined(DXSDK_STDAFX_H)
|
---|