# 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 #define NOMINMAX // required to stop windows.h screwing up std::min definition
    00041 #include <d3d9.h>
    00042 #include <d3dx9.h>
    00043 #include <dxerr9.h>
    00044 #include "OgreMemoryMacros.h"
    00045
    00046
    00047 namespace Ogre
    00048 {
    00049     // Predefine classes
    00050     class D3D9RenderSystem;
    00051     class D3D9RenderWindow;
    00052     class D3D9Texture;
    00053     class D3D9TextureManager;
    00054     class D3D9Driver;
    00055     class D3D9DriverList;
    00056     class D3D9VideoMode;
    00057     class D3D9VideoModeList;
    00058     class D3D9GpuProgram;
    00059     class D3D9GpuProgramManager;
    00060     class D3D9HardwareBufferManager;
    00061     class D3D9HardwareIndexBuffer;
    00062     class D3D9HLSLProgramFactory;
    00063     class D3D9HLSLProgram;
    00064     class D3D9VertexDeclaration;
    00065
    00066 // Should we ask D3D to manage vertex/index buffers automatically?
    00067 // Doing so avoids lost devices, but also has a performance impact
    00068 // which is unacceptably bad when using very large buffers
    00069 #define OGRE_D3D_MANAGE_BUFFERS 1
    00070
    00071     //-------------------------------------------
    00072     // Windows setttings
    00073     //-------------------------------------------
    00074 #if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
    00075 #   if OGRE_DYNAMIC_LINKAGE == 0
    00076 #       pragma warn( "No dynamic linkage" )
    00077 #       define _OgreD3D9Export
    00078 #   else
    00079 #       ifdef OGRED3DENGINEDLL_EXPORTS
    00080 #           define _OgreD3D9Export __declspec(dllexport)
    00081 #       else
    00082 #           define _OgreD3D9Export __declspec(dllimport)
    00083 #       endif
    00084 #   endif
    00085 #endif  // OGRE_WIN32
    00086 }
    00087 #endif

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