OGRE-Next: Ogre::TextureGpuManagerListener Class Reference

| OGRE-Next 3.0.0 Object-Oriented Graphics Rendering Engine

Loading...
Searching...
No Matches
Ogre::TextureGpuManagerListener Class Referenceabstract
Core » Resources

`#include <OgreTextureGpuManagerListener.h>`

Inheritance diagram for Ogre::TextureGpuManagerListener:
[legend]

## Public Member Functions
| ~TextureGpuManagerListener () override
virtual uint32 | getFiltersFor (const String &name, const String &aliasName, uint32 filters) const =0
| getFiltersFor Gets a chance to alter the filters needed for the given texture to load
virtual size_t | getNumSlicesFor (TextureGpu *texture, TextureGpuManager *textureManager)=0
| Ogre normally puts Textures into pools (a Type2DArray texture) for efficient rendering Note that only textures of the same resolution and format can be put together in the same pool.
Public Member Functions inherited from Ogre::TextureGpuListener
virtual | ~TextureGpuListener ()
virtual void | notifyTextureChanged (TextureGpu *texture, TextureGpuListener::Reason reason, void *extraData)=0
| Called when a TextureGpu changed in a way that affects how it is displayed:
virtual bool | shouldStayLoaded (TextureGpu *texture)
| Return true if this TextureGpu should likely stay loaded or else graphical changes could occur.

## Additional Inherited Members
Public Types inherited from Ogre::TextureGpuListener
enum | Reason { Unknown , FromStorageToSysRam , FromSysRamToStorage , GainedResidency , LostResidency , PoolTextureSlotChanged , ResidentToSysRamSync , MetadataCacheOutOfDate , ExceptionThrown , FsaaSettingAlteredByApi , ReadyForRendering , Deleted }

## Constructor & Destructor Documentation

## ◆ ~TextureGpuManagerListener()

Ogre::TextureGpuManagerListener::~TextureGpuManagerListener | ( |  | ) |
| override

## Member Function Documentation

## ◆ getFiltersFor()

virtual uint32 Ogre::TextureGpuManagerListener::getFiltersFor | ( | const String & | name,
|  | const String & | aliasName,
|  | uint32 | filters ) const
| pure virtual

getFiltersFor Gets a chance to alter the filters needed for the given texture to load

Parameters

  name | Name of the texture
  aliasName | Alias name of the texture
  filters | Current filters that are to be applied

Returns
  Actual filters to apply, if the listener modifies them

Implemented in Ogre::DefaultTextureGpuManagerListener.

## ◆ getNumSlicesFor()

virtual size_t Ogre::TextureGpuManagerListener::getNumSlicesFor | ( | TextureGpu * | texture,
|  | TextureGpuManager * | textureManager )
| pure virtual

Ogre normally puts Textures into pools (a Type2DArray texture) for efficient rendering Note that only textures of the same resolution and format can be put together in the same pool.

This creates two issues:

- Unless it is known in advance, we do not know how large the array should be. if we create a pool that can hold 64 entries but only 1 texture is actually needed, then we waste a lot of GPU memory.
- Large textures, such as 4096x4096 RGBA8 occupy a lot of memory 64MB. These pools should not contain a large number of entries. For example creating a pool of 8 entries of these textures means we'd be asking the OS for 512MB of contiguous memory. Due to memory fragmentation, such request is likely to fail and cause Out of Memory conditions.
  Parameters

    texture | The first texture to which will be creating a pool based on its parameters
    textureManager | The manager, in case you need more info.

  Returns
    How many entries the pool should be able to hold.

Implemented in Ogre::DefaultTextureGpuManagerListener.

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

- OgreTextureGpuManagerListener.h