OGRE  1.7
Object-Oriented Graphics Rendering Engine
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
OgreD3D11Prerequisites.h
Go to the documentation of this file.
1 /*
2 -----------------------------------------------------------------------------
3 This source file is part of OGRE
4 (Object-oriented Graphics Rendering Engine)
5 For the latest info, see http://www.ogre3d.org/
6 
7 Copyright (c) 2000-2011 Torus Knot Software Ltd
8 
9 Permission is hereby granted, free of charge, to any person obtaining a copy
10 of this software and associated documentation files (the "Software"), to deal
11 in the Software without restriction, including without limitation the rights
12 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13 copies of the Software, and to permit persons to whom the Software is
14 furnished to do so, subject to the following conditions:
15 
16 The above copyright notice and this permission notice shall be included in
17 all copies or substantial portions of the Software.
18 
19 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25 THE SOFTWARE.
26 -----------------------------------------------------------------------------
27 */
28 #ifndef __D3D11PREREQUISITES_H__
29 #define __D3D11PREREQUISITES_H__
30 
31 #include "OgrePrerequisites.h"
32 #include "WIN32/OgreMinGWSupport.h" // extra defines for MinGW to deal with DX SDK
33 
34 // Define versions for if DirectX is in use (Win32 only)
35 #define DIRECT3D_VERSION 0x0900
36 
37 // some D3D commonly used macros
38 #define SAFE_DELETE(p) { if(p) { delete (p); (p)=NULL; } }
39 #define SAFE_DELETE_ARRAY(p) { if(p) { delete[] (p); (p)=NULL; } }
40 #define SAFE_RELEASE(p) { if(p) { (p)->Release(); (p)=NULL; } }
41 
42 
43 #undef NOMINMAX
44 #define NOMINMAX // required to stop windows.h screwing up std::min definition
45 #include <d3d11.h>
46 #include <d3dx11.h>
47 #include <d3d11shader.h>
48 #include <D3Dcompiler.h>
49 
50 
51 namespace Ogre
52 {
53  // Predefine classes
54  class D3D11RenderSystem;
55  class D3D11RenderWindow;
56  class D3D11Texture;
57  class D3D11TextureManager;
58  class D3D11Driver;
59  class D3D11DriverList;
60  class D3D11VideoMode;
61  class D3D11VideoModeList;
62  class D3D11GpuProgram;
63  class D3D11GpuProgramManager;
64  class D3D11HardwareBufferManager;
65  class D3D11HardwareIndexBuffer;
66  class D3D11HLSLProgramFactory;
67  class D3D11HLSLProgram;
68  class D3D11VertexDeclaration;
69  class D3D11Device;
70  class D3D11HardwareBuffer;
71  class D3D11HardwarePixelBuffer;
72 
73  // Should we ask D3D to manage vertex/index buffers automatically?
74  // Doing so avoids lost devices, but also has a performance impact
75  // which is unacceptably bad when using very large buffers
76 #define OGRE_D3D_MANAGE_BUFFERS 1
77 
78  //-------------------------------------------
79  // Windows setttings
80  //-------------------------------------------
81 #if (OGRE_PLATFORM == OGRE_PLATFORM_WIN32) && !defined(OGRE_STATIC_LIB)
82 # ifdef OGRED3DENGINEDLL_EXPORTS
83 # define _OgreD3D11Export __declspec(dllexport)
84 # else
85 # if defined( __MINGW32__ )
86 # define _OgreD3D11Export
87 # else
88 # define _OgreD3D11Export __declspec(dllimport)
89 # endif
90 # endif
91 #else
92 # define _OgreD3D11Export
93 #endif // OGRE_WIN32
94 }
95 #endif