PixelLightAPI  .
Public Member Functions | Static Public Attributes
PLRenderer::TextureManager Class Reference

This is a manager for the texture resource. More...

#include <TextureManager.h>

Inheritance diagram for PLRenderer::TextureManager:
Inheritance graph
[legend]

List of all members.

Public Member Functions

RendererContextGetRendererContext () const
 Returns the owner renderer context of this manager.
float GetTextureQuality () const
 Returns the texture quality.
PLRENDERER_API void SetTextureQuality (float fQuality)
 Sets the texture quality.
bool GetTextureFit () const
 Returns whether the next lower valid texture size should be taken or the higher one.
void SetTextureFit (bool bLower=true)
 Sets whether the next lower valid texture size should be taken or the higher one.
bool AreTextureMipmapsAllowed () const
 Returns whether or not the usage of texture mipmaps is allowed.
void SetTextureMipmapsAllowed (bool bAllowed)
 Sets whether or not the usage of texture mipmaps is allowed.
bool IsTextureCompressionAllowed () const
 Returns whether or not the usage of texture compression is allowed.
void SetTextureCompressionAllowed (bool bAllowed)
 Sets whether or not the usage of texture compression is allowed.
PLRENDERER_API bool ReloadTextures ()
 Reloads all textures.
PLRENDERER_API TextureCreateTexture (const PLCore::String &sName, TextureBuffer &cTextureBuffer)
 Creates a new texture.
PLRENDERER_API TextureCreateTexture (const PLCore::String &sName, const PLCore::String &sParameters)
 Creates a texture resource using a texture creator.

Static Public Attributes

static PLRENDERER_API const
PLCore::String 
Default

Detailed Description

This is a manager for the texture resource.

Note:
  • Unloads unused resources automatically by default

Member Function Documentation

Returns the owner renderer context of this manager.

Returns:
Reference to the owner renderer context of this manager

Returns the texture quality.

Returns:
Texture quality, 1 best, 0 worst
See also:
PLRENDERER_API void PLRenderer::TextureManager::SetTextureQuality ( float  fQuality)

Sets the texture quality.

Parameters:
[in]fQualityTexture quality, 1.0 best, 0.0 worst, default is 1.0
Note:
  • Only has an influence on newly loaded textures, not already loaded ones
  • If the given texture quality is outside the specified range, it's clamped automatically to the nearest borders

Returns whether the next lower valid texture size should be taken or the higher one.

Returns:
If 'true' the next lower valid texture size will be taken, if 'false' the next higher one is chosen
Remarks:
Normally the texture manager will automatically correct invalid texture sizes. With the texture fit setting you can setup whether the next lower or higher valid texture size is selected automatically.
void PLRenderer::TextureManager::SetTextureFit ( bool  bLower = true) [inline]

Sets whether the next lower valid texture size should be taken or the higher one.

Parameters:
[in]bLowerShould the next lower valid texture size be chosen? If 'false' the next higher will be taken
See also:
Note:
  • Only has an influence on newly loaded textures, not already loaded ones

Returns whether or not the usage of texture mipmaps is allowed.

Returns:
'true' if the usage of texture mipmaps is allowed, else 'false'
See also:
void PLRenderer::TextureManager::SetTextureMipmapsAllowed ( bool  bAllowed) [inline]

Sets whether or not the usage of texture mipmaps is allowed.

Parameters:
[in]bAllowed'true' if the usage of texture mipmaps is allowed, else 'false', default is 'true'
Note:
  • Only has an influence on newly loaded textures, not already loaded ones

Returns whether or not the usage of texture compression is allowed.

Returns:
'true' if the usage of texture compression is allowed, else 'false'
See also:

Sets whether or not the usage of texture compression is allowed.

Parameters:
[in]bAllowed'true' if the usage of texture compression is allowed, else 'false', default is 'true'
Note:
  • Only has an influence on newly loaded textures, not already loaded ones

Reloads all textures.

Returns:
'true' if all went fine, else 'false'
PLRENDERER_API Texture* PLRenderer::TextureManager::CreateTexture ( const PLCore::String sName,
TextureBuffer cTextureBuffer 
)

Creates a new texture.

Parameters:
[in]sNameTexture name
[in]cTextureBufferTexture buffer to use
Returns:
Pointer to the new texture, a null pointer on error
Remarks:
A texture wraps up a texture buffer for more comfortable usage within high-level components. In rare situations one texture buffer needs to be referenced by multiple textures - this is what this method is used for. When creating a texture with this method, the given texture buffer is just shared and therefore not automatically destroyed when the texture gets destroyed. If possible, try to avoid using this method because it's somewhat ugly!
PLRENDERER_API Texture* PLRenderer::TextureManager::CreateTexture ( const PLCore::String sName,
const PLCore::String sParameters 
)

Creates a texture resource using a texture creator.

Parameters:
[in]sNameTexture creator class name (for instance "PLRenderer::TextureCreatorTurbulence3D")
[in]sParametersTexture creator parameters. (for instance "XSize='64' YSize='32'") This parameters depend on the used texture creator.
Returns:
Pointer to the created resource, a null pointer if there was an error (maybe unknown class or the class is not derived from 'PLRenderer::TextureCreator')

Member Data Documentation

PLRENDERER_API const PLCore::String PLRenderer::TextureManager::Default [static]

Default texture


The documentation for this class was generated from the following files:


PixelLight PixelLight 0.9.11-R1
Copyright (C) 2002-2012 by The PixelLight Team
Last modified Thu Feb 23 2012 14:09:40
The content of this PixelLight document is published under the
Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported