Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

OgreD3D9Prerequisites.h

Go to the documentation of this file.
00001 /*
00002 -----------------------------------------------------------------------------
00003 This source file is part of OGRE
00004     (Object-oriented Graphics Rendering Engine)
00005 For the latest info, see http://www.ogre3d.org/
00006 
00007 Copyright (c) 2000-2005 The OGRE Team
00008 Also see acknowledgements in Readme.html
00009 
00010 This program is free software; you can redistribute it and/or modify it under
00011 the terms of the GNU Lesser General Public License as published by the Free Software
00012 Foundation; either version 2 of the License, or (at your option) any later
00013 version.
00014 
00015 This program is distributed in the hope that it will be useful, but WITHOUT
00016 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
00017 FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
00018 
00019 You should have received a copy of the GNU Lesser General Public License along with
00020 this program; if not, write to the Free Software Foundation, Inc., 59 Temple
00021 Place - Suite 330, Boston, MA 02111-1307, USA, or go to
00022 http://www.gnu.org/copyleft/lesser.txt.
00023 -----------------------------------------------------------------------------
00024 */
00025 #ifndef __D3D9PREREQUISITES_H__
00026 #define __D3D9PREREQUISITES_H__
00027 
00028 #include "OgrePrerequisites.h"
00029 
00030 // Define versions for if DirectX is in use (Win32 only)
00031 #define DIRECT3D_VERSION 0x0900
00032 
00033 // some D3D commonly used macros
00034 #define SAFE_DELETE(p)       { if(p) { delete (p);     (p)=NULL; } }
00035 #define SAFE_DELETE_ARRAY(p) { if(p) { delete[] (p);   (p)=NULL; } }
00036 #define SAFE_RELEASE(p)      { if(p) { (p)->Release(); (p)=NULL; } }
00037 
00038 
00039 #include "OgreNoMemoryMacros.h"
00040 #undef NOMINMAX
00041 #define NOMINMAX // required to stop windows.h screwing up std::min definition
00042 #include <d3d9.h>
00043 #include <d3dx9.h>
00044 #include <dxerr9.h>
00045 #include "OgreMemoryMacros.h"
00046 
00047 
00048 namespace Ogre
00049 {
00050     // Predefine classes
00051     class D3D9RenderSystem;
00052     class D3D9RenderWindow;
00053     class D3D9Texture;
00054     class D3D9TextureManager;
00055     class D3D9Driver;
00056     class D3D9DriverList;
00057     class D3D9VideoMode;
00058     class D3D9VideoModeList;
00059     class D3D9GpuProgram;
00060     class D3D9GpuProgramManager;
00061     class D3D9HardwareBufferManager;
00062     class D3D9HardwareIndexBuffer;
00063     class D3D9HLSLProgramFactory;
00064     class D3D9HLSLProgram;
00065     class D3D9VertexDeclaration;
00066 
00067 // Should we ask D3D to manage vertex/index buffers automatically?
00068 // Doing so avoids lost devices, but also has a performance impact
00069 // which is unacceptably bad when using very large buffers
00070 #define OGRE_D3D_MANAGE_BUFFERS 1
00071 
00072     //-------------------------------------------
00073     // Windows setttings
00074     //-------------------------------------------
00075 #if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
00076 #   if OGRE_DYNAMIC_LINKAGE == 0
00077 #       pragma warn( "No dynamic linkage" )
00078 #       define _OgreD3D9Export
00079 #   else
00080 #       ifdef OGRED3DENGINEDLL_EXPORTS
00081 #           define _OgreD3D9Export __declspec(dllexport)
00082 #       else
00083 #           define _OgreD3D9Export __declspec(dllimport)
00084 #       endif
00085 #   endif
00086 #endif  // OGRE_WIN32
00087 }
00088 #endif

Copyright © 2000-2005 by The OGRE Team
Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 2.5 License.
Last modified Sun Mar 12 14:37:39 2006