
13 Nov
2008
13 Nov
'08
2:25 a.m.
Michael Marcin wrote:
It would go to the factory's construct method which might look like:
void TextureFactory::construct( void* address, const std::string& filename ) { // complex work involving lots of 3rd party libraries // happens here GLuint glTextureName = LoadImage( filename );
// texture stays simple new(address) Texture( glTextureName, filename ); }
Rather than doing this, it might be more elegant to return a factory function, such as in_place or functional/factory.