I was recently tasked with designing my own resource class and I noticed you the following in your declaration:
Code:
class SceneGraphResource : public Resource
{
public:
static Resource *factoryFunc( const std::string &name, int flags )
{ return new SceneGraphResource( name, flags ); }
And again
Code:
static Resource *factoryFunc( const std::string &name, int flags )
{ return new TextureResource( name, flags ); }
What is the purpose of such a repetition when it is clearly a common function to the parent class. The following declaration is valid:
Code:
template <class Derived>
class Resource {
public:
static Resource *factoryFunc(const std::string& name, int flags) {
return new Derived(name, flag);
}
};
class Texture : public Resource<Texture> {};
While the declaration may looks slightly odd it is part of the curiously recursive template pattern defined in section 16.3 of Templates the complete guide. I have also noticed the following:
Code:
bool checkDDS( const char *data, int size );
Wouldn't this be more appropriate?
Code:
bool checkDDS( const char *data, size_t size );
Just some suggestions I came up with after browsing through your code, if you dislike them feel free to provide me with a technical response of why you disagree that is all I am interested in. Thanks for your time.