OGRE-Next
4.0.0unstable
Object-Oriented Graphics Rendering Engine
|
This is a Default implementation of TextureGpuManagerListener based on heuristics. More...
#include <OgreTextureGpuManagerListener.h>
Public Member Functions | |
DefaultTextureGpuManagerListener () | |
uint32 | getFiltersFor (const String &name, const String &aliasName, uint32 filters) const override |
getFiltersFor Gets a chance to alter the filters needed for the given texture to load More... | |
size_t | getNumSlicesFor (TextureGpu *texture, TextureGpuManager *textureManager) override |
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. More... | |
void | notifyTextureChanged (TextureGpu *texture, TextureGpuListener::Reason reason, void *extraData) override |
Called when a TextureGpu changed in a way that affects how it is displayed: More... | |
Public Member Functions inherited from Ogre::TextureGpuManagerListener | |
~TextureGpuManagerListener () override | |
Public Member Functions inherited from Ogre::TextureGpuListener | |
virtual | ~TextureGpuListener () |
virtual bool | shouldStayLoaded (TextureGpu *texture) |
Return true if this TextureGpu should likely stay loaded or else graphical changes could occur. More... | |
Public Attributes | |
uint32 | mMaxResolutionToApplyMinSlices [4] |
If texture resolution is <= maxResolutionToApplyMinSlices[i]; we'll apply minSlicesPerPool[i]. More... | |
uint16 | mMinSlicesPerPool [4] |
Minimum slices per pool, regardless of maxBytesPerPool. More... | |
bool | mPackNonPow2 |
Whether non-power-of-2 textures should also be pooled, or we should return 1. More... | |
Additional Inherited Members | |
Public Types inherited from Ogre::TextureGpuListener | |
enum | Reason { Unknown , FromStorageToSysRam , FromSysRamToStorage , GainedResidency , LostResidency , PoolTextureSlotChanged , ResidentToSysRamSync , MetadataCacheOutOfDate , ExceptionThrown , FsaaSettingAlteredByApi , ReadyForRendering , Deleted } |
This is a Default implementation of TextureGpuManagerListener based on heuristics.
These heuristics can be adjusted by modifying its member variables directly.
Ogre::DefaultTextureGpuManagerListener::DefaultTextureGpuManagerListener | ( | ) |
|
overridevirtual |
getFiltersFor Gets a chance to alter the filters needed for the given texture to load
name | Name of the texture |
aliasName | Alias name of the texture |
filters | Current filters that are to be applied |
Implements Ogre::TextureGpuManagerListener.
|
overridevirtual |
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:
texture | The first texture to which will be creating a pool based on its parameters |
textureManager | The manager, in case you need more info. |
Implements Ogre::TextureGpuManagerListener.
|
overridevirtual |
Called when a TextureGpu changed in a way that affects how it is displayed:
Implements Ogre::TextureGpuListener.
uint32 Ogre::DefaultTextureGpuManagerListener::mMaxResolutionToApplyMinSlices[4] |
If texture resolution is <= maxResolutionToApplyMinSlices[i]; we'll apply minSlicesPerPool[i].
Otherwise, we'll apply minSlicesPerPool[i+1] If resolution > mMaxResolutionToApplyMinSlices[N]; then minSlicesPerPool = 1;
uint16 Ogre::DefaultTextureGpuManagerListener::mMinSlicesPerPool[4] |
Minimum slices per pool, regardless of maxBytesPerPool.
It's also the starting num of slices. See mMaxResolutionToApplyMinSlices
bool Ogre::DefaultTextureGpuManagerListener::mPackNonPow2 |
Whether non-power-of-2 textures should also be pooled, or we should return 1.