OGRE-Next  3.0.0
Object-Oriented Graphics Rendering Engine
Ogre::HlmsJson Class Reference

HLMS stands for "High Level Material System". More...

#include <OgreHlmsJson.h>

+ Inheritance diagram for Ogre::HlmsJson:

Classes

struct  NamedBlocks
 

Public Member Functions

 HlmsJson (HlmsManager *hlmsManager, HlmsJsonListener *listener)
 
 ~HlmsJson ()
 
String getName (const HlmsBlendblock *blendblock) const
 
String getName (const HlmsMacroblock *macroblock) const
 
void loadMaterials (const String &filename, const String &resourceGroup, const char *jsonString, const String &additionalTextureExtension)
 Loads all Hlms datablocks from a JSON formatted string. More...
 
void saveMaterial (const HlmsDatablock *datablock, String &outString, const String &additionalTextureExtension)
 Saves a single datablock to a string. More...
 
void saveMaterials (const Hlms *hlms, String &outString, const String &additionalTextureExtension, bool sortByName=false)
 Saves all the Datablocks defined in the given Hlms into a JSON formatted string. More...
 

Static Public Member Functions

static String getName (const HlmsSamplerblock *samplerblock)
 
static SceneBlendFactor parseBlendFactor (const char *value)
 
static SceneBlendOperation parseBlendOperation (const char *value)
 
static CompareFunction parseCompareFunction (const char *value)
 
static CullingMode parseCullMode (const char *value)
 
static FilterOptions parseFilterOptions (const char *value)
 
static PolygonMode parsePolygonMode (const char *value)
 
static TextureAddressingMode parseTextureAddressingMode (const char *value)
 
static void toQuotedStr (CompareFunction value, String &outString)
 
static void toQuotedStr (CullingMode value, String &outString)
 
static void toQuotedStr (FilterOptions value, String &outString)
 
static void toQuotedStr (PolygonMode value, String &outString)
 
static void toQuotedStr (SceneBlendFactor value, String &outString)
 
static void toQuotedStr (SceneBlendOperation value, String &outString)
 
static void toQuotedStr (TextureAddressingMode value, String &outString)
 
static void toStr (const ColourValue &value, String &outString)
 
static void toStr (const Vector2 &value, String &outString)
 
static void toStr (const Vector3 &value, String &outString)
 
static void toStr (const Vector4 &value, String &outString)
 

Detailed Description

HLMS stands for "High Level Material System".

Constructor & Destructor Documentation

◆ HlmsJson()

Ogre::HlmsJson::HlmsJson ( HlmsManager hlmsManager,
HlmsJsonListener listener 
)

◆ ~HlmsJson()

Ogre::HlmsJson::~HlmsJson ( )

Member Function Documentation

◆ getName() [1/3]

String Ogre::HlmsJson::getName ( const HlmsBlendblock blendblock) const

◆ getName() [2/3]

String Ogre::HlmsJson::getName ( const HlmsMacroblock macroblock) const

◆ getName() [3/3]

static String Ogre::HlmsJson::getName ( const HlmsSamplerblock samplerblock)
static

◆ loadMaterials()

void Ogre::HlmsJson::loadMaterials ( const String filename,
const String resourceGroup,
const char *  jsonString,
const String additionalTextureExtension 
)

Loads all Hlms datablocks from a JSON formatted string.

Remarks
Will throw ERR_INVALIDPARAMS if JSON is invalid.
Parameters
filenameName of the file. It's only used for providing additional info on the log about where it is failing.
resourceGroupSee filename argument.
jsonStringNull-terminated C string (UTF8) containing valid JSON with the Hlms definitions.
additionalTextureExtensionAdditional string to append to the texture files while loading. e.g. if texture to load is "mytex.png" and additionalTextureExtension = ".dds" then the actual texture loaded will be "mytex.png.dds" Leave it blank if you don't know what to put

◆ parseBlendFactor()

static SceneBlendFactor Ogre::HlmsJson::parseBlendFactor ( const char *  value)
static

◆ parseBlendOperation()

static SceneBlendOperation Ogre::HlmsJson::parseBlendOperation ( const char *  value)
static

◆ parseCompareFunction()

static CompareFunction Ogre::HlmsJson::parseCompareFunction ( const char *  value)
static

◆ parseCullMode()

static CullingMode Ogre::HlmsJson::parseCullMode ( const char *  value)
static

◆ parseFilterOptions()

static FilterOptions Ogre::HlmsJson::parseFilterOptions ( const char *  value)
static

◆ parsePolygonMode()

static PolygonMode Ogre::HlmsJson::parsePolygonMode ( const char *  value)
static

◆ parseTextureAddressingMode()

static TextureAddressingMode Ogre::HlmsJson::parseTextureAddressingMode ( const char *  value)
static

◆ saveMaterial()

void Ogre::HlmsJson::saveMaterial ( const HlmsDatablock datablock,
String outString,
const String additionalTextureExtension 
)

Saves a single datablock to a string.

Parameters
datablockMaterial to save.
outString[out] String with valid JSON output. String is appended to existing contents.
additionalTextureExtensionAdditional string to append to the texture files while saving. e.g. if texture name is "mytex.png" and additionalTextureExtension = ".dds" then the actual texture saved will be "mytex.png.dds" Leave it blank if you don't know what to put

◆ saveMaterials()

void Ogre::HlmsJson::saveMaterials ( const Hlms hlms,
String outString,
const String additionalTextureExtension,
bool  sortByName = false 
)

Saves all the Datablocks defined in the given Hlms into a JSON formatted string.

Parameters
hlmsHlms from whose materials to save.
outString[out] String with valid JSON output. String is appended to existing contents.
additionalTextureExtensionAdditional string to append to the texture files while saving. e.g. if texture name is "mytex.png" and additionalTextureExtension = ".dds" then the actual texture saved will be "mytex.png.dds" Leave it blank if you don't know what to put
sortByNameUse true if output JSON should have materials sorted alphabetically by name (case sensitive).

◆ toQuotedStr() [1/7]

static void Ogre::HlmsJson::toQuotedStr ( CompareFunction  value,
String outString 
)
static

◆ toQuotedStr() [2/7]

static void Ogre::HlmsJson::toQuotedStr ( CullingMode  value,
String outString 
)
static

◆ toQuotedStr() [3/7]

static void Ogre::HlmsJson::toQuotedStr ( FilterOptions  value,
String outString 
)
static

◆ toQuotedStr() [4/7]

static void Ogre::HlmsJson::toQuotedStr ( PolygonMode  value,
String outString 
)
static

◆ toQuotedStr() [5/7]

static void Ogre::HlmsJson::toQuotedStr ( SceneBlendFactor  value,
String outString 
)
static

◆ toQuotedStr() [6/7]

static void Ogre::HlmsJson::toQuotedStr ( SceneBlendOperation  value,
String outString 
)
static

◆ toQuotedStr() [7/7]

static void Ogre::HlmsJson::toQuotedStr ( TextureAddressingMode  value,
String outString 
)
static

◆ toStr() [1/4]

static void Ogre::HlmsJson::toStr ( const ColourValue value,
String outString 
)
static

◆ toStr() [2/4]

static void Ogre::HlmsJson::toStr ( const Vector2 value,
String outString 
)
static

◆ toStr() [3/4]

static void Ogre::HlmsJson::toStr ( const Vector3 value,
String outString 
)
static

◆ toStr() [4/4]

static void Ogre::HlmsJson::toStr ( const Vector4 value,
String outString 
)
static

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