28 #ifndef __RenderSystemCapabilitiesSerializer_H__
29 #define __RenderSystemCapabilitiesSerializer_H__
71 enum CapabilityKeywordType {UNDEFINED_CAPABILITY_TYPE = 0, SET_STRING_METHOD, SET_INT_METHOD, SET_BOOL_METHOD, SET_REAL_METHOD,
105 mCapabilitiesMap.insert(CapabilitiesMap::value_type(name, cap));
122 mKeywordTypeMap.insert(KeywordTypeMap::value_type(keyword, type));
127 KeywordTypeMap::const_iterator it = mKeywordTypeMap.find(keyword);
128 if(it != mKeywordTypeMap.end())
132 logParseError(
"Can't find the type for keyword: " + keyword);
133 return UNDEFINED_CAPABILITY_TYPE;
139 mSetStringMethodDispatchTable.insert(SetStringMethodDispatchTable::value_type(keyword, method));
144 SetStringMethodDispatchTable::iterator methodIter = mSetStringMethodDispatchTable.find(keyword);
145 if (methodIter != mSetStringMethodDispatchTable.end())
147 SetStringMethod m = (*methodIter).second;
148 (mCurrentCapabilities->*m)(val);
152 logParseError(
"undefined keyword: " + keyword);
159 mSetIntMethodDispatchTable.insert(SetIntMethodDispatchTable::value_type(keyword, method));
164 SetIntMethodDispatchTable::iterator methodIter = mSetIntMethodDispatchTable.find(keyword);
165 if (methodIter != mSetIntMethodDispatchTable.end())
167 SetIntMethod m = (*methodIter).second;
168 (mCurrentCapabilities->*m)(val);
172 logParseError(
"undefined keyword: " + keyword);
179 mSetBoolMethodDispatchTable.insert(SetBoolMethodDispatchTable::value_type(keyword, method));
184 SetBoolMethodDispatchTable::iterator methodIter = mSetBoolMethodDispatchTable.find(keyword);
185 if (methodIter != mSetBoolMethodDispatchTable.end())
187 SetBoolMethod m = (*methodIter).second;
188 (mCurrentCapabilities->*m)(val);
192 logParseError(
"undefined keyword: " + keyword);
199 mSetRealMethodDispatchTable.insert(SetRealMethodDispatchTable::value_type(keyword, method));
204 SetRealMethodDispatchTable::iterator methodIter = mSetRealMethodDispatchTable.find(keyword);
205 if (methodIter != mSetRealMethodDispatchTable.end())
207 SetRealMethod m = (*methodIter).second;
208 (mCurrentCapabilities->*m)(val);
212 logParseError(
"undefined keyword: " + keyword);
218 mCurrentCapabilities->addShaderProfile(val);
224 if(mCapabilitiesMap.find(name) == mCapabilitiesMap.end())
226 logParseError(
"Undefined capability: " + name);
233 mCurrentCapabilities->setCapability(cap);
237 void initialiaseDispatchTables();
239 void parseCapabilitiesLines(CapabilitiesLinesList& linesList);
241 void logParseError(
const String& error)
const;
RenderSystemCapabilities * mCurrentCapabilities
void addSetIntMethod(String keyword, SetIntMethod method)
float Real
Software floating point type.
void addCapabilitiesMapping(String name, Capabilities cap)
void callSetIntMethod(String &keyword, ushort val)
CapabilityKeywordType getKeywordType(const String &keyword) const
map< String, SetRealMethod >::type SetRealMethodDispatchTable
void addSetRealMethod(String keyword, SetRealMethod method)
void callSetRealMethod(String &keyword, Real val)
void callSetStringMethod(String &keyword, String &val)
map< String, CapabilityKeywordType >::type KeywordTypeMap
void addShaderProfile(String &val)
map< String, SetIntMethod >::type SetIntMethodDispatchTable
CapabilitiesMap mCapabilitiesMap
Capabilities
Enum describing the different hardware capabilities we want to check for OGRE_CAPS_VALUE(a, b) defines each capability.
void addSetStringMethod(String keyword, SetStringMethod method)
SetBoolMethodDispatchTable mSetBoolMethodDispatchTable
KeywordTypeMap mKeywordTypeMap
Superclass for all objects that wish to use custom memory allocators when their new / delete operator...
void addKeywordType(String keyword, CapabilityKeywordType type)
void setCapabilityEnumBool(String &name, bool val)
map< String, SetStringMethod >::type SetStringMethodDispatchTable
void addSetBoolMethod(String keyword, SetBoolMethod method)
map< String, Capabilities >::type CapabilitiesMap
SetStringMethodDispatchTable mSetStringMethodDispatchTable
SetRealMethodDispatchTable mSetRealMethodDispatchTable
DataStreamPtr mCurrentStream
virtual ~RenderSystemCapabilitiesSerializer()
default destructor
singleton class for storing the capabilities of the graphics card.
SetIntMethodDispatchTable mSetIntMethodDispatchTable
Class for serializing RenderSystemCapabilities to / from a .rendercaps script.
vector< std::pair< String, int > >::type CapabilitiesLinesList
void callSetBoolMethod(String &keyword, bool val)
map< String, SetBoolMethod >::type SetBoolMethodDispatchTable