1
/***********************************************************************
2
filename: CEGuiD3D9BaseApplication.h
5
*************************************************************************/
6
/***************************************************************************
7
* Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team
9
* Permission is hereby granted, free of charge, to any person obtaining
10
* a copy of this software and associated documentation files (the
11
* "Software"), to deal in the Software without restriction, including
12
* without limitation the rights to use, copy, modify, merge, publish,
13
* distribute, sublicense, and/or sell copies of the Software, and to
14
* permit persons to whom the Software is furnished to do so, subject to
15
* the following conditions:
17
* The above copyright notice and this permission notice shall be
18
* included in all copies or substantial portions of the Software.
20
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
21
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
22
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
23
* IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
24
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
25
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
26
* OTHER DEALINGS IN THE SOFTWARE.
27
***************************************************************************/
28
#ifndef _CEGuiD3D9BaseApplication_h_
29
#define _CEGuiD3D9BaseApplication_h_
31
#include "CEGuiBaseApplication.h"
32
#include "CEGUIGeometryBuffer.h"
34
#if defined( __WIN32__ ) || defined( _WIN32 )
35
# define WIN32_LEAN_AND_MEAN
38
// undefine Microsoft macro evilness
43
//Updated for linking of static libs
45
# pragma comment(lib, "d3d9.lib")
47
# if defined(CEGUI_STATIC)
48
# pragma comment(lib, "CEGUIDirect3D9Renderer_Static_d.lib")
50
# pragma comment(lib, "CEGUIDirect3D9Renderer_d.lib")
53
# if defined(CEGUI_STATIC)
54
# pragma comment(lib, "CEGUIDirect3D9Renderer_Static.lib")
56
# pragma comment(lib, "CEGUIDirect3D9Renderer.lib")
62
struct CEGuiBaseApplicationImpl;
65
class CEGuiD3D9BaseApplication : public CEGuiBaseApplication
72
CEGuiD3D9BaseApplication();
79
~CEGuiD3D9BaseApplication();
81
// Implementation of base class abstract methods.
82
bool execute(CEGuiSample* sampleApp);
86
/*************************************************************************
87
Implementation Methods
88
*************************************************************************/
91
Initialises Direct3D system.
93
bool initialiseDirect3D(unsigned int width, unsigned int height, unsigned int adapter, bool windowed);
98
Do reset of Direct3D device
101
- true if the device was reset successfully
102
- false if the device was not reset.
104
bool resetDirect3D(void);
106
void doFPSUpdate(void);
108
bool overlayHandler(const CEGUI::EventArgs& args);
110
/*************************************************************************
112
*************************************************************************/
113
CEGuiBaseApplicationImpl* pimpl;;
115
// counter used to track elapsed time (for time pulse injection)
116
DWORD d_lastFrameTime;
118
DWORD d_fps_lastTime;
121
char d_fps_textbuff[16];
122
CEGUI::GeometryBuffer* d_fps_geometry;
123
CEGUI::GeometryBuffer* d_logo_geometry;
126
#endif // end of guard _CEGuiD3D9BaseApplication_h_