Crazy Eddie's GUI System  0.8.7
RendererModules/Direct3D9/TextureTarget.h
1 /***********************************************************************
2  created: Fri Feb 13 2009
3  author: Paul D Turner
4 *************************************************************************/
5 /***************************************************************************
6  * Copyright (C) 2004 - 2011 Paul D Turner & The CEGUI Development Team
7  *
8  * Permission is hereby granted, free of charge, to any person obtaining
9  * a copy of this software and associated documentation files (the
10  * "Software"), to deal in the Software without restriction, including
11  * without limitation the rights to use, copy, modify, merge, publish,
12  * distribute, sublicense, and/or sell copies of the Software, and to
13  * permit persons to whom the Software is furnished to do so, subject to
14  * the following conditions:
15  *
16  * The above copyright notice and this permission notice shall be
17  * included in all copies or substantial portions of the Software.
18  *
19  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
20  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
21  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
22  * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
23  * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
24  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
25  * OTHER DEALINGS IN THE SOFTWARE.
26  ***************************************************************************/
27 #ifndef _CEGUIDirect3D9TextureTarget_h_
28 #define _CEGUIDirect3D9TextureTarget_h_
29 
30 #include "CEGUI/RendererModules/Direct3D9/RenderTarget.h"
31 #include "../../TextureTarget.h"
32 #include <d3d9.h>
33 
34 #if defined(_MSC_VER)
35 # pragma warning(push)
36 # pragma warning(disable : 4250)
37 # pragma warning(disable : 4251)
38 #endif
39 
40 // Start of CEGUI namespace section
41 namespace CEGUI
42 {
43 class Direct3D9Texture;
44 
46 class DIRECT3D9_GUIRENDERER_API Direct3D9TextureTarget : public Direct3D9RenderTarget<TextureTarget>
47 {
48 public:
50  virtual ~Direct3D9TextureTarget();
51 
53  void preD3DReset();
54 
56  void postD3DReset();
57 
58  // overrides from Direct3D9RenderTarget
59  void activate();
60  void deactivate();
61  // implementation of RenderTarget interface
62  bool isImageryCache() const;
63  // implementation of TextureTarget interface
64  void clear();
65  Texture& getTexture() const;
66  void declareRenderSize(const Sizef& sz);
67  bool isRenderingInverted() const;
68 
69 protected:
71  static const float DEFAULT_SIZE;
73  static uint s_textureNumber;
76 
83 
88 
90  LPDIRECT3DTEXTURE9 d_texture;
92  LPDIRECT3DSURFACE9 d_surface;
96  LPDIRECT3DSURFACE9 d_prevColourSurface;
97 };
98 
99 } // End of CEGUI namespace section
100 
101 #if defined(_MSC_VER)
102 # pragma warning(pop)
103 #endif
104 
105 #endif // end of guard _CEGUIDirect3D9TextureTarget_h_
CEGUI::Direct3D9TextureTarget::postD3DReset
void postD3DReset()
auto called via the Renderer after Reset on the Direct3DDevice9.
CEGUI::Direct3D9TextureTarget::declareRenderSize
void declareRenderSize(const Sizef &sz)
Used to declare to the TextureTarget the largest size, in pixels, of the next set of incoming renderi...
CEGUI::Direct3D9TextureTarget::getTexture
Texture & getTexture() const
Return a pointer to the CEGUI::Texture that the TextureTarget is using.
CEGUI::Direct3D9TextureTarget::d_CEGUITexture
Direct3D9Texture * d_CEGUITexture
we use this to wrap d_texture so it can be used by the core CEGUI lib.
Definition: RendererModules/Direct3D9/TextureTarget.h:94
CEGUI::Direct3D9TextureTarget::disableRenderTexture
void disableRenderTexture()
switch back to previous surface
CEGUI::Direct3D9TextureTarget::s_textureNumber
static uint s_textureNumber
static data used for creating texture names
Definition: RendererModules/Direct3D9/TextureTarget.h:73
CEGUI::Direct3D9RenderTarget
Intermediate Direct3D9 implementation of a RenderTarget.
Definition: RendererModules/Direct3D9/RenderTarget.h:49
CEGUI
Main namespace for Crazy Eddie's GUI Library.
Definition: arch_overview.dox:1
CEGUI::Direct3D9TextureTarget::d_surface
LPDIRECT3DSURFACE9 d_surface
Direct3D9 surface for the texture.
Definition: RendererModules/Direct3D9/TextureTarget.h:92
CEGUI::Direct3D9TextureTarget
Direct3D9TextureTarget - allows rendering to an Direct3D9 texture via .
Definition: RendererModules/Direct3D9/TextureTarget.h:47
CEGUI::Direct3D9TextureTarget::isImageryCache
bool isImageryCache() const
Return whether the RenderTarget is an implementation that caches actual rendered imagery.
CEGUI::Direct3D9TextureTarget::enableRenderTexture
void enableRenderTexture()
switch to the texture surface & depth buffer
CEGUI::Texture
Abstract base class specifying the required interface for Texture objects.
Definition: Texture.h:54
CEGUI::Direct3D9TextureTarget::resizeRenderTexture
void resizeRenderTexture()
resize the texture
CEGUI::Direct3D9TextureTarget::preD3DReset
void preD3DReset()
auto called via the Renderer prior to Reset on the Direct3DDevice9.
CEGUI::Direct3D9Texture
Texture implementation for the Direct3D9Renderer.
Definition: RendererModules/Direct3D9/Texture.h:45
CEGUI::Direct3D9TextureTarget::deactivate
void deactivate()
Deactivate the render target after having completed rendering.
CEGUI::Direct3D9TextureTarget::activate
void activate()
Activate the render target and put it in a state ready to be drawn to.
CEGUI::Direct3D9TextureTarget::initialiseRenderTexture
void initialiseRenderTexture()
allocate and set up the texture used for rendering.
CEGUI::Direct3D9TextureTarget::clear
void clear()
Clear the surface of the underlying texture.
CEGUI::Direct3D9TextureTarget::d_prevColourSurface
LPDIRECT3DSURFACE9 d_prevColourSurface
colour surface that was in use before this target was activated.
Definition: RendererModules/Direct3D9/TextureTarget.h:96
CEGUI::Size< float >
CEGUI::Direct3D9TextureTarget::DEFAULT_SIZE
static const float DEFAULT_SIZE
default size of created texture objects
Definition: RendererModules/Direct3D9/TextureTarget.h:71
CEGUI::String
String class used within the GUI system.
Definition: String.h:64
CEGUI::Direct3D9TextureTarget::d_texture
LPDIRECT3DTEXTURE9 d_texture
Direct3D9 texture that's rendered to.
Definition: RendererModules/Direct3D9/TextureTarget.h:90
CEGUI::Direct3D9TextureTarget::generateTextureName
static String generateTextureName()
helper to generate unique texture names
CEGUI::Direct3D9TextureTarget::isRenderingInverted
bool isRenderingInverted() const
Return whether rendering done on the target texture is inverted in relation to regular textures.
CEGUI::Direct3D9Renderer
Renderer class to interface with Direct3D 9.
Definition: RendererModules/Direct3D9/Renderer.h:65
CEGUI::Direct3D9TextureTarget::cleanupRenderTexture
void cleanupRenderTexture()
clean up the texture used for rendering.