Crazy Eddie's GUI System  0.8.4
CEGUI::Direct3D9Renderer Class Reference

Renderer class to interface with Direct3D 9. More...

+ Inheritance diagram for CEGUI::Direct3D9Renderer:
+ Collaboration diagram for CEGUI::Direct3D9Renderer:

List of all members.

Public Member Functions

void preD3DReset ()
 support function to be called prior to a Reset on the Direct3DDevice9.
void postD3DReset ()
 support function to be called after a Reset on the Direct3DDevice9.
LPDIRECT3DDEVICE9 getDevice () const
 return the Direct3D 9 Device interface used by this renderer object.
TexturecreateTexture (const String &name, LPDIRECT3DTEXTURE9 tex)
 create a CEGUI::texture from an existing D3D texture
bool supportsNonSquareTexture ()
 return true if we can use non square textures.
bool supportsNPOTTextures ()
 return true if we can use NPOT texture dimensions.
Sizef getAdjustedSize (const Sizef &sz)
 returns Size object from sz adjusted for hardware capabilities.
void setupRenderingBlendMode (const BlendMode mode, const bool force=false)
 set the render states for the specified BlendMode.
RenderTargetgetDefaultRenderTarget ()
 Returns the default RenderTarget object. The default render target is is typically one that targets the entire screen (or rendering window).
GeometryBuffercreateGeometryBuffer ()
 Create a new GeometryBuffer and return a reference to it. You should remove the GeometryBuffer from any RenderQueues and call destroyGeometryBuffer when you want to destroy the GeometryBuffer.
void destroyGeometryBuffer (const GeometryBuffer &buffer)
 Destroy a GeometryBuffer that was returned when calling the createGeometryBuffer function. Before destroying any GeometryBuffer you should ensure that it has been removed from any RenderQueue that was using it.
void destroyAllGeometryBuffers ()
 Destroy all GeometryBuffer objects created by this Renderer.
TextureTargetcreateTextureTarget ()
 Create a TextureTarget that can be used to cache imagery; this is a RenderTarget that does not lose it's content from one frame to another.
void destroyTextureTarget (TextureTarget *target)
 Function that cleans up TextureTarget objects created with the createTextureTarget function.
void destroyAllTextureTargets ()
 Destory all TextureTarget objects created by this Renderer.
TexturecreateTexture (const String &name)
 Create a 'null' Texture object.
TexturecreateTexture (const String &name, const String &filename, const String &resourceGroup)
 Create a Texture object using the given image file.
TexturecreateTexture (const String &name, const Sizef &size)
 Create a Texture object with the given pixel dimensions as specified by size.
void destroyTexture (Texture &texture)
 Destroy a Texture object that was previously created by calling the createTexture functions.
void destroyTexture (const String &name)
 Destroy a Texture object that was previously created by calling the createTexture functions.
void destroyAllTextures ()
 Destroy all Texture objects created by this Renderer.
TexturegetTexture (const String &name) const
 Return a Texture object that was previously created by calling the createTexture functions.
bool isTextureDefined (const String &name) const
 Return whether a texture with the given name exists.
void beginRendering ()
 Perform any operations required to put the system into a state ready for rendering operations to begin.
void endRendering ()
 Perform any operations required to finalise rendering.
void setDisplaySize (const Sizef &sz)
 Set the size of the display or host window in pixels for this Renderer object.
const SizefgetDisplaySize () const
 Return the size of the display or host window in pixels.
const Vector2fgetDisplayDPI () const
 Return the resolution of the display or host window in dots per inch.
uint getMaxTextureSize () const
 Return the pixel size of the maximum supported texture.
const StringgetIdentifierString () const
 Return identification string for the renderer module.

Static Public Member Functions

static Direct3D9RendererbootstrapSystem (LPDIRECT3DDEVICE9 device, const int abi=CEGUI_VERSION_ABI)
 Convenience function that creates the required objects to initialise the CEGUI system.
static void destroySystem ()
 Convenience function to cleanup the CEGUI system and related objects that were created by calling the bootstrapSystem function.
static Direct3D9Renderercreate (LPDIRECT3DDEVICE9 device, const int abi=CEGUI_VERSION_ABI)
 Create an Direct3D9Renderer object.
static void destroy (Direct3D9Renderer &renderer)
 Destroy an Direct3D9Renderer object.

Detailed Description

Renderer class to interface with Direct3D 9.


Member Function Documentation

static Direct3D9Renderer& CEGUI::Direct3D9Renderer::bootstrapSystem ( LPDIRECT3DDEVICE9  device,
const int  abi = CEGUI_VERSION_ABI 
) [static]

Convenience function that creates the required objects to initialise the CEGUI system.

This will create and initialise the following objects for you:

Parameters:
deviceLPDIRECT3DDEVICE9 of the device that is to be used for CEGUI rendering operations.
abiThis must be set to CEGUI_VERSION_ABI
Returns:
Reference to the CEGUI::Direct3D9Renderer object that was created.

Create a new GeometryBuffer and return a reference to it. You should remove the GeometryBuffer from any RenderQueues and call destroyGeometryBuffer when you want to destroy the GeometryBuffer.

Returns:
GeometryBuffer object.

Implements CEGUI::Renderer.

Create a 'null' Texture object.

Parameters:
nameString holding the name for the new texture. Texture names must be unique within the Renderer.
Returns:
A newly created Texture object. The returned Texture object has no size or imagery associated with it.

Implements CEGUI::Renderer.

Texture& CEGUI::Direct3D9Renderer::createTexture ( const String name,
const String filename,
const String resourceGroup 
) [virtual]

Create a Texture object using the given image file.

Parameters:
nameString holding the name for the new texture. Texture names must be unique within the Renderer.
filenameString object that specifies the path and filename of the image file to use when creating the texture.
resourceGroupString objet that specifies the resource group identifier to be passed to the resource provider when loading the texture file filename.
Returns:
A newly created Texture object. The initial content of the texture memory is the requested image file.
Note:
Due to possible limitations of the underlying hardware, API or engine, the final size of the texture may not match the size of the loaded file. You can check the ultimate sizes by querying the Texture object after creation.

Implements CEGUI::Renderer.

Texture& CEGUI::Direct3D9Renderer::createTexture ( const String name,
const Sizef size 
) [virtual]

Create a Texture object with the given pixel dimensions as specified by size.

Parameters:
nameString holding the name for the new texture. Texture names must be unique within the Renderer.
sizeSize object that describes the desired texture size.
Returns:
A newly created Texture object. The initial contents of the texture memory is undefined.
Note:
Due to possible limitations of the underlying hardware, API or engine, the final size of the texture may not match the requested size. You can check the ultimate sizes by querying the Texture object after creation.

Implements CEGUI::Renderer.

Create a TextureTarget that can be used to cache imagery; this is a RenderTarget that does not lose it's content from one frame to another.

If the renderer is unable to offer such a thing, 0 should be returned.

Returns:
Pointer to a TextureTarget object that is suitable for caching imagery, or 0 if the renderer is unable to offer such a thing.

Implements CEGUI::Renderer.

static void CEGUI::Direct3D9Renderer::destroy ( Direct3D9Renderer renderer) [static]

Destroy an Direct3D9Renderer object.

Parameters:
rendererThe Direct3D9Renderer object to be destroyed.

Destroy a GeometryBuffer that was returned when calling the createGeometryBuffer function. Before destroying any GeometryBuffer you should ensure that it has been removed from any RenderQueue that was using it.

Parameters:
bufferThe GeometryBuffer object to be destroyed.

Implements CEGUI::Renderer.

static void CEGUI::Direct3D9Renderer::destroySystem ( ) [static]

Convenience function to cleanup the CEGUI system and related objects that were created by calling the bootstrapSystem function.

This function will destroy the following objects for you:

Note:
If you did not initialise CEGUI by calling the bootstrapSystem function, you should not call this, but rather delete any objects you created manually.
void CEGUI::Direct3D9Renderer::destroyTexture ( Texture texture) [virtual]

Destroy a Texture object that was previously created by calling the createTexture functions.

Parameters:
textureTexture object to be destroyed.

Implements CEGUI::Renderer.

void CEGUI::Direct3D9Renderer::destroyTexture ( const String name) [virtual]

Destroy a Texture object that was previously created by calling the createTexture functions.

Parameters:
nameString holding the name of the texture to destroy.

Implements CEGUI::Renderer.

Function that cleans up TextureTarget objects created with the createTextureTarget function.

Parameters:
targetA pointer to a TextureTarget object that was previously returned from a call to createTextureTarget.

Implements CEGUI::Renderer.

Returns the default RenderTarget object. The default render target is is typically one that targets the entire screen (or rendering window).

Returns:
Reference to a RenderTarget object.

Implements CEGUI::Renderer.

Return the resolution of the display or host window in dots per inch.

Returns:
Vector2 object that describes the resolution of the display or host window in DPI.

Implements CEGUI::Renderer.

const Sizef& CEGUI::Direct3D9Renderer::getDisplaySize ( ) const [virtual]

Return the size of the display or host window in pixels.

Returns:
Size object describing the pixel dimesntions of the current display or host window.

Implements CEGUI::Renderer.

Return identification string for the renderer module.

Returns:
String object holding text that identifies the Renderer in use.

Implements CEGUI::Renderer.

Return the pixel size of the maximum supported texture.

Returns:
Size of the maximum supported texture in pixels.

Implements CEGUI::Renderer.

Texture& CEGUI::Direct3D9Renderer::getTexture ( const String name) const [virtual]

Return a Texture object that was previously created by calling the createTexture functions.

Parameters:
nameString holding the name of the Texture object to be returned.

Implements CEGUI::Renderer.

void CEGUI::Direct3D9Renderer::setDisplaySize ( const Sizef size) [virtual]

Set the size of the display or host window in pixels for this Renderer object.

This is intended to be called by the System as part of the notification process when display size changes are notified to it via the System::notifyDisplaySizeChanged function.

Note:
The Renderer implementation should not use this function other than to perform internal state updates on the Renderer and related objects.
Parameters:
sizeSize object describing the dimesions of the current or host window in pixels.

Implements CEGUI::Renderer.

 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends