HDK
|
#include <GLTextureHandler.h>
Public Member Functions | |
bool | bindImage (ImagePtr image, const ImageSamplingProperties &samplingProperties) override |
bool | unbindImage (ImagePtr image) override |
Unbind an image. More... | |
bool | createRenderResources (ImagePtr image, bool generateMipMaps, bool useAsRenderTarget=false) override |
Create rendering resources for the given image. More... | |
void | releaseRenderResources (ImagePtr image=nullptr) override |
int | getBoundTextureLocation (unsigned int resourceId) |
Return the bound texture location for a given resource. More... | |
Public Member Functions inherited from ImageHandler | |
virtual | ~ImageHandler () |
void | addLoader (ImageLoaderPtr loader) |
StringSet | supportedExtensions () |
Get a list of extensions supported by the handler. More... | |
bool | saveImage (const FilePath &filePath, ConstImagePtr image, bool verticalFlip=false) |
ImagePtr | acquireImage (const FilePath &filePath, const Color4 &defaultColor=Color4(0.0f)) |
void | unbindImages () |
Unbind all images that are currently stored in the cache. More... | |
void | setSearchPath (const FileSearchPath &path) |
Set the search path to be used for finding images on the file system. More... | |
const FileSearchPath & | getSearchPath () const |
Return the image search path. More... | |
void | setFilenameResolver (StringResolverPtr resolver) |
Set the filename resolver for images. More... | |
StringResolverPtr | getFilenameResolver () const |
Return the filename resolver for images. More... | |
void | clearImageCache () |
ImagePtr | getZeroImage () const |
Return a fallback image with zeroes in all channels. More... | |
ImageVec | getReferencedImages (ConstDocumentPtr doc) |
Static Public Member Functions | |
static ImageHandlerPtr | create (ImageLoaderPtr imageLoader) |
static int | mapAddressModeToGL (ImageSamplingProperties::AddressMode addressModeEnum) |
Utility to map an address mode enumeration to an OpenGL address mode. More... | |
static int | mapFilterTypeToGL (ImageSamplingProperties::FilterType filterTypeEnum, bool enableMipmaps) |
Utility to map a filter type enumeration to an OpenGL filter type. More... | |
static void | mapTextureFormatToGL (Image::BaseType baseType, unsigned int channelCount, bool srgb, int &glType, int &glFormat, int &glInternalFormat) |
Utility to map generic texture properties to OpenGL texture formats. More... | |
Static Public Member Functions inherited from ImageHandler | |
static ImageHandlerPtr | create (ImageLoaderPtr imageLoader) |
Protected Member Functions | |
GLTextureHandler (ImageLoaderPtr imageLoader) | |
int | getNextAvailableTextureLocation () |
Protected Member Functions inherited from ImageHandler | |
ImageHandler (ImageLoaderPtr imageLoader) | |
ImagePtr | loadImage (const FilePath &filePath) |
void | cacheImage (const string &filePath, ImagePtr image) |
ImagePtr | getCachedImage (const FilePath &filePath) |
Protected Attributes | |
std::vector< unsigned int > | _boundTextureLocations |
Protected Attributes inherited from ImageHandler | |
ImageLoaderMap | _imageLoaders |
ImageMap | _imageCache |
FileSearchPath | _searchPath |
StringResolverPtr | _resolver |
ImagePtr | _zeroImage |
An OpenGL texture handler class
Definition at line 23 of file GLTextureHandler.h.
|
protected |
|
overridevirtual |
Bind an image. This method will bind the texture to an active texture unit as defined by the corresponding image description. The method will fail if there are not enough available image units to bind to.
Reimplemented from ImageHandler.
|
inlinestatic |
Definition at line 26 of file GLTextureHandler.h.
|
overridevirtual |
Create rendering resources for the given image.
Reimplemented from ImageHandler.
Return the bound texture location for a given resource.
|
protected |
|
static |
Utility to map an address mode enumeration to an OpenGL address mode.
|
static |
Utility to map a filter type enumeration to an OpenGL filter type.
|
static |
Utility to map generic texture properties to OpenGL texture formats.
Release rendering resources for the given image, or for all cached images if no image pointer is specified.
Reimplemented from ImageHandler.
|
overridevirtual |
Unbind an image.
Reimplemented from ImageHandler.
|
protected |
Definition at line 67 of file GLTextureHandler.h.