| GL Studio C++ Runtime API

Public Member Functions | Static Public Member Functions | List of all members
TextureLoaderList Class Reference

`#include <texture_loader.h>`

Inheritance diagram for TextureLoaderList:

## Public Member Functions
| TextureLoaderList ()
void | InsertObject (TextureLoader *importer)
char * | FilterString ()
Image * | LoadTexture (const char *filename, const Image::LoadOptions &options, bool allowNPOT=true)
Image * | LoadTextureWithOptimization (const char *filename, const Image::LoadOptions &options, const bool optimizeTextureLoad, bool allowNPOT=true)
TextureLoader * | SupportsExtension (const char *ext)
Public Member Functions inherited from List_c
int | IsEmpty ()
void | Empty ()
ListItem * | First ()
ListItem * | Last ()
ListItem * | Nth (int where)
void | InsertAfter (int where, const void *data, int size, void **parentPtr)
void | InsertAfter (ListItem *after, const void *data, int size, void **parentPtr)
void | InsertAfter (ListItem *after, ListItem *pNewNode)
void | InsertBefore (ListItem *before, ListItem *pNewNode)
void | Push (const void *data, int size, void **parentPtr)
void | Push (const void *data, int size)
void | Push (ListItem *pNewNode)
void | Enqueue (const void *data, int size, void **parentPtr)
void | Enqueue (const void *data, int size)
void | Enqueue (ListItem *pNewNode)
void * | Dequeue ()
void * | GetElement (int where)
int | Count ()
void | Delete (ListItem *element)
void | AddNodeWithPriority (ListItem *pNewNode, int priority)
void | AddNodeWithPriority (const void *data, int size, int priority)
void | ForwardIterator (ListIterator func, void *data=NULL)
void | BackwardIterator (ListIterator func, void *data=NULL)
void | Iterator (ListIterator func, void *data, ListIteratorDirection direction)

## Static Public Member Functions
static TextureLoaderList * | Instance ()
static void | SetOptimizeTextureLoading (const bool enable)
static bool | IsOptimizeTextureLoading ()

## Additional Inherited Members
Public Attributes inherited from List_c
int | _count
| Number of items in the list.
Protected Attributes inherited from List_c
ListItem * | _pHead
| Pointer to the head (first item) of the list.
ListItem * | _pTail
| Pointer to the tail (last item) of the list.

## Detailed Description

A list of (pointers to) texture loader objects.

## Constructor & Destructor Documentation

## ◆ TextureLoaderList()

TextureLoaderList | ( |  | ) |

A singleton interface

## Member Function Documentation

## ◆ FilterString()

char * FilterString | ( |  | ) |

Creates and returns a file filter string for all of the file types that have been registered by Texture Loaders

Returns
  Filter string

## ◆ InsertObject()

void InsertObject | ( | TextureLoader * | importer | ) |

Insert the loader into the list at the specified location

Parameters

  importer |

## ◆ Instance()

static TextureLoaderList * Instance | ( |  | ) |
| static

A singleton interface

Returns
  A pointer to the one and only instance

## ◆ IsOptimizeTextureLoading()

static bool IsOptimizeTextureLoading | ( |  | ) |
| static

determine if texture loading optimization is enabled

Returns
  true if enabled else false

## ◆ LoadTexture()

Image * LoadTexture | ( | const char * | filename,
|  | const Image::LoadOptions & | options,
|  | bool | allowNPOT = `true`
| ) |  |

Load the specified texture file. Try all loaders to see if any of them support the given file type.

Parameters

  filename | The file to load the image from
  options | Options to load the image with
  allowNPOT | If the image is allowed to be non-power of two (NPOT)

Returns
  NULL if the file type isn't supported or if loading fails

## ◆ LoadTextureWithOptimization()

Image * LoadTextureWithOptimization | ( | const char * | filename,
|  | const Image::LoadOptions & | options,
|  | const bool | optimizeTextureLoad,
|  | bool | allowNPOT = `true`
| ) |  |

Load the specified texture file optionally attempting to optimize the load by looking at previously loaded images. Try all loaders to see if any of them support the given file type.

Parameters

  filename | The file to load the image from
  options | Options to load the image with
  optimizeTextureLoad | true to attempt loading optimization else false to force a load
  allowNPOT | If the image is allowed to be non-power of two (NPOT)

Returns
  NULL if the file type isn't supported or if loading fails

## ◆ SetOptimizeTextureLoading()

static void SetOptimizeTextureLoading | ( | const bool | enable | ) |
| static

enable / disable texture loading optimization (defaults to enabled)

Parameters

  enable | true to enable else false

## ◆ SupportsExtension()

TextureLoader * SupportsExtension | ( | const char * | ext | ) |

Finds the registered texture loader, if any, that supports the given file extension.

Parameters

  ext | The (case insensitive) file extension

Returns
  A pointer to the registered loader, or NULL if no loader exists

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

- texture_loader.h