LightsprintSDK 2021.08.08
|
#include <RRMaterial.h>
Public Types | |
typedef RRMaterials * | Loader(const RRString &filename, RRFileLocator *textureLocator, bool *aborting) |
typedef bool | Saver(const RRMaterials *materials, const RRString &filename) |
Public Member Functions | |
bool | save (const RRString &filename) const |
Public Member Functions inherited from rr::RRVector< RRMaterial * > | |
RRVector () | |
RRVector (const RRVector &a) | |
RRVector & | operator= (const RRVector &a) |
void | resize (unsigned newSize, RRMaterial * initial=RRMaterial *()) |
void | push_back (RRMaterial * a) |
void | pop_back () |
void | erase (RRMaterial * *e) |
size_t | size () const |
RRMaterial * & | operator[] (unsigned i) |
const RRMaterial * & | operator[] (unsigned i) const |
void | clear () |
RRMaterial * * | begin () |
const RRMaterial * * | begin () const |
RRMaterial * * | end () |
const RRMaterial * * | end () const |
void | insert (RRMaterial * *_where, const RRMaterial * *_first, const RRMaterial * *_last) |
bool | operator== (const RRVector< RRMaterial * > &a) const |
bool | operator!= (const RRVector< RRMaterial * > &a) const |
~RRVector () | |
Static Public Member Functions | |
static RRMaterials * | load (const RRString &filename, RRFileLocator *textureLocator) |
static void | registerLoader (const char *extensions, Loader *loader) |
static void | registerSaver (const char *extensions, Saver *saver) |
static const char * | getSupportedLoaderExtensions () |
static const char * | getSupportedSaverExtensions () |
Additional Inherited Members | |
Protected Attributes inherited from rr::RRVector< RRMaterial * > | |
RRMaterial * * | c |
unsigned | numAllocated |
unsigned | numUsed |
Material library, collection of materials.
Material collection that can be loaded or saved to disk. Individual materials are not owned by collection, they are not deleted in destructor.
typedef RRMaterials * rr::RRMaterials::Loader(const RRString &filename, RRFileLocator *textureLocator, bool *aborting) |
Template of custom material loader.
typedef bool rr::RRMaterials::Saver(const RRMaterials *materials, const RRString &filename) |
Template of custom material saver.
|
static |
Loads materials from file, returns true on success.
bool rr::RRMaterials::save | ( | const RRString & | filename | ) | const |
Saves materials to file, returns true on success.
|
static |
Registers material loader so it can be used by RRMaterial::load().
Extensions are case insensitive, in "*.rrmaterial;*.mtl" format.
Several loaders are implemented in LightsprintIO library, rr_io::registerIO() will register all of them for you (by calling this function several times).
Multiple loaders may be registered, even for the same extension. If first loader fails to load scene, second one is tried etc.
|
static |
Similar to registerLoader().
|
static |
Returns list of supported loader extensions in "*.rrmaterial;*.mtl" format.
All extensions of registered loaders are returned in one static string, don't free() it. nullptr is returned if no loaders were registered.
|
static |
Returns list of supported saver extensions in "*.rrmaterial;*.mtl" format.
All extensions of registered savers are returned in one static string, don't free() it. nullptr is returned if no savers were registered.