OGRE-Next  4.0.0unstable
Object-Oriented Graphics Rendering Engine
Ogre::OGRE_HLMS_TEXTURE_BASE_CLASS Class Reference

This is not a regular header, therefore it has no include guards. More...

#include <OgreHlmsTextureBaseClass.h>

+ Inheritance diagram for Ogre::OGRE_HLMS_TEXTURE_BASE_CLASS:

Public Member Functions

 OGRE_HLMS_TEXTURE_BASE_CLASS (IdString name, Hlms *creator, const HlmsMacroblock *macroblock, const HlmsBlendblock *blendblock, const HlmsParamVec &params)
 
 ~OGRE_HLMS_TEXTURE_BASE_CLASS () override
 
void _setSamplerblock (uint8 texType, const HlmsSamplerblock *samplerblockPtr)
 Same as setSamplerblock, but samplerblockPtr is a raw samplerblock retrieved from HlmsManager, and is assumed to have its reference count already be incremented for us. More...
 
void _setTexture (uint8 texType, TextureGpu *texture, const HlmsSamplerblock *samplerblockPtr=0, uint16 sliceIdx=std::numeric_limits< uint16 >::max())
 Same as setTexture, but samplerblockPtr is a raw samplerblock retrieved from HlmsManager, and is assumed to have its reference count already be incremented for us (note HlmsManager::getSamplerblock() already increments the ref. More...
 
uint8 getIndexToDescriptorSampler (uint8 texType)
 Do not call this function if RSC_SEPARATE_SAMPLERS_FROM_TEXTURES is not set. More...
 
uint8 getIndexToDescriptorTexture (uint8 texType)
 This function has O( log N ) complexity, but O(1) if the texture was not set. More...
 
const HlmsSamplerblockgetSamplerblock (uint8 texType) const
 
TextureGpugetTexture (uint8 texType) const
 
void loadAllTextures ()
 
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...
 
void preload () override
 Tells datablock to start loading all of its textures (if not loaded already) and any other resource it may need. More...
 
void saveTextures (const String &folderPath, set< String >::type &savedTextures, bool saveOitd, bool saveOriginal, HlmsTextureExportListener *listener) override
 
void setAlphaTestThreshold (float threshold) override
 Alpha test's threshold. More...
 
void setSamplerblock (uint8 texType, const HlmsSamplerblock &params)
 Sets a new sampler block to be associated with the texture (i.e. More...
 
void setTexture (uint8 texType, TextureGpu *texture, const HlmsSamplerblock *refParams=0, uint16 sliceIdx=std::numeric_limits< uint16 >::max())
 Sets a new texture for rendering. More...
 
bool shouldStayLoaded (TextureGpu *texture) override
 Return true if this TextureGpu should likely stay loaded or else graphical changes could occur. More...
 
- Public Member Functions inherited from Ogre::HlmsDatablock
 HlmsDatablock (IdString name, Hlms *creator, const HlmsMacroblock *macroblock, const HlmsBlendblock *blendblock, const HlmsParamVec &params)
 
virtual ~HlmsDatablock ()
 
void _linkRenderable (Renderable *renderable)
 
void _unlinkRenderable (Renderable *renderable)
 
virtual void calculateHash ()
 Calculates the hashes needed for sorting by the RenderQueue (i.e. mTextureHash) More...
 
HlmsDatablockclone (String name) const
 Creates a copy of this datablock with the same settings, but a different name. More...
 
bool getAlphaHashing () const
 
CompareFunction getAlphaTest () const
 
bool getAlphaTestShadowCasterOnly () const
 
float getAlphaTestThreshold () const
 
const HlmsBlendblockgetBlendblock (bool casterBlock=false) const
 
HlmsgetCreator () const
 
int32 getCustomPieceFileIdHash (ShaderType shaderType) const
 Returns the internal ID generated by setCustomPieceFile() and setCustomPieceCodeFromMemory(). More...
 
const StringgetCustomPieceFileStr (ShaderType shaderType) const
 Returns the filename argument set to setCustomPieceFile() and setCustomPieceCodeFromMemory(). More...
 
virtual ColourValue getDiffuseColour () const
 Returns the closest match for a diffuse colour, if applicable by the actual implementation. More...
 
virtual TextureGpugetDiffuseTexture () const
 Returns the closest match for a diffuse texture, if applicable by the actual implementation. More...
 
virtual ColourValue getEmissiveColour () const
 Returns the closest match for a emissive colour, if applicable by the actual implementation. More...
 
virtual TextureGpugetEmissiveTexture () const
 Returns the closest match for a emissive texture, if applicable by the actual implementation. More...
 
void getFilenameAndResourceGroup (String const **outFilename, String const **outResourceGroup) const
 
const vector< Renderable * >::type & getLinkedRenderables () const
 
const HlmsMacroblockgetMacroblock (bool casterBlock=false) const
 
IdString getName () const
 
const StringgetNameStr () const
 
virtual bool hasCustomShadowMacroblock () const
 
void setAlphaHashing (bool bAlphaHashing)
 Uses a trick to mimic true Order Independent Transparency alpha blending. More...
 
virtual void setAlphaTest (CompareFunction compareFunction, bool shadowCasterOnly=false, bool useAlphaFromTextures=true)
 Sets the alpha test to the given compare function. More...
 
void setBlendblock (const HlmsBlendblock &blendblock, bool casterBlock=false, bool overrideCasterBlock=true)
 Sets a new blendblock that matches the same parameter as the input. More...
 
void setBlendblock (const HlmsBlendblock *blendblock, bool casterBlock=false, bool overrideCasterBlock=true)
 Sets the blendblock from the given pointer that was already retrieved from the HlmsManager. More...
 
void setCustomPieceCodeFromMemory (const String &filename, const String &shaderCode, ShaderType shaderType)
 Same as setCustomPieceFile() but sources the code from memory instead of from disk. More...
 
void setCustomPieceFile (const String &filename, const String &resourceGroup, ShaderType shaderType)
 Sets the filename of a piece file to be parsed from disk. More...
 
void setMacroblock (const HlmsMacroblock &macroblock, bool casterBlock=false, bool overrideCasterBlock=true)
 Sets a new macroblock that matches the same parameter as the input. More...
 
void setMacroblock (const HlmsMacroblock *macroblock, bool casterBlock=false, bool overrideCasterBlock=true)
 Sets the macroblock from the given pointer that was already retrieved from the HlmsManager. More...
 
- Public Member Functions inherited from Ogre::ConstBufferPoolUser
 ConstBufferPoolUser ()
 
const ConstBufferPool::BufferPoolgetAssignedPool () const
 
uint32 getAssignedSlot () const
 
uint8 getDirtyFlags () const
 
- Public Member Functions inherited from Ogre::TextureGpuListener
virtual ~TextureGpuListener ()
 

Additional Inherited Members

- Public Types inherited from Ogre::TextureGpuListener
enum  Reason {
  Unknown , FromStorageToSysRam , FromSysRamToStorage , GainedResidency ,
  LostResidency , PoolTextureSlotChanged , ResidentToSysRamSync , MetadataCacheOutOfDate ,
  ExceptionThrown , FsaaSettingAlteredByApi , ReadyForRendering , Deleted
}
 
- Static Public Member Functions inherited from Ogre::HlmsDatablock
static const char * getCmpString (CompareFunction compareFunction)
 
- Public Attributes inherited from Ogre::HlmsDatablock
bool mAllowTextureResidencyChange
 When false, we won't try to have Textures become resident. More...
 
uint16 mMacroblockHash [2]
 
float mShadowConstantBias
 
uint32 mTextureHash
 
uint8 mType
 

Detailed Description

This is not a regular header, therefore it has no include guards.

This header contains a base class that defines common functionality across multiple Hlms datablock implementations that need textures. However C++ does not let us statically define the size of mTexIndices, mTextures & mSamplerblocks array; we would have to either force the same maximum to all implementations, or use the heap.

Therefore this header uses macros to customize each base class for each implementations. DO NOT INCLUDE THIS HEADER DIRECTLY.

The way to include this header is by doing:

#define _OgreHlmsTextureBaseClassExport _OgreHlmsUnlitExport
#define OGRE_HLMS_TEXTURE_BASE_CLASS HlmsUnlitBaseTextureDatablock
#define OGRE_HLMS_TEXTURE_BASE_MAX_TEX NUM_UNLIT_TEXTURE_TYPES
#define OGRE_HLMS_CREATOR_CLASS HlmsUnlit
#undef _OgreHlmsTextureBaseClassExport
#undef OGRE_HLMS_TEXTURE_BASE_CLASS
#undef OGRE_HLMS_TEXTURE_BASE_MAX_TEX
#undef OGRE_HLMS_CREATOR_CLASS

Where all the necessary macros are defined prior to including this header, and once we're done, we undef these macros.

When OGRE_HLMS_TEXTURE_BASE_CLASS is not defined, the *.inl version of this file will include a few headers in order to get proper syntax highlighting.


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