'const' attribute in RenderSystemCapabilities

What it says on the tin: a place to discuss proposed new features.
Post Reply
User avatar
jycorbel
Gnoblar
Posts: 8
Joined: Tue Feb 14, 2012 11:11 am

'const' attribute in RenderSystemCapabilities

Post by jycorbel »

I was wondering why the function Ogre::RenderSystemCapabilities::hasCapabilitiy(const Capabilities) is const but Ogre::RenderSystemCapabilities::isCapabilityRenderSystemSpecific(const Capabilities) is not.

When we retrieve capabilities from render system, we get a const pointer (that's normal) which prevent us to use isCapabilityRenderSystemSpecific function. I don't want to use a const_cast, could you confirm that this function can be mark as 'const' and fix this please ?

I use the last release : 1.7.4 (14th January 2012).

This is the code of the function to check it quicker :

Code: Select all

		/** Returns true if capability is render system specific
		*/
		bool isCapabilityRenderSystemSpecific(const Capabilities c) const
		{
			int cat = c >> OGRE_CAPS_BITSHIFT;
			if(cat == CAPS_CATEGORY_GL || cat == CAPS_CATEGORY_D3D9)
				return true;
			return false;
		}
Post Reply