Reputation:
I'm curious how to write an abstraction layer. By abstraction layer, I mean a wrapper above one or more 3rd party libraries.
Or do I have to solve it like this?
#include<an3rdpartyl>
#include<another3rdpartyl>
class layer
{
private:
an3rdpartyl* object1;
another3rdpartyl* object2;
public:
//...
int loadModel(char* file)
{
return object2->LoadMeshFromFile(file);
}
//...
};
Upvotes: 1
Views: 1728
Reputation: 29209
Take a look at the Facade, Adapter, and Bridge patterns. Or even better, just pick up the "Gang of Four" Design Patterns book and learn about software design in a whole new light.
Upvotes: 1