Original post by MJP
For your constructor initialization problem...I'm not sure if it's necessarily the best way to solve it, but you could use some sort of factory function for instantiation of your Model class. This would allow you hide the details of your error/exception handling from the code that's using your framework, and give you an opportunity to pass it references to modules that are internal to your frame work (texture managers, error handlers). This approach also gives you some other interesting options, such as using a custom memory allocator to allocate memory for the models. Or you can have your function return an abstract interface class, if you want to completely hide the public interface from the implementation.
Just trying to give you some ideas to work with, at any rate. [smile]
thanks for the suggestion. This might be a good idea actually. I'm not sure if I understand what you mean with "factory function" (reading up on design patterns right now due to the suggestions in this thread, I found out I missed out on quite a lot of theory which I should've known before starting this project, exception handling included) but as far as I get it you mean I'd just write a function that encapsulates creating a model instance and adding it to the manager, and possibly other stuff like error handling, etc.
Just to check if I got it right (keeping in mind that a scene manager might not be the best place to do this), I could do something like this:
SceneMgr->Insert ( file );
SceneMgr::Insert( const std::string& file )
boost::shared_ptr<Model> mdl = new Model ( file );
Insert( mdl );
catch ( Exception )
localErrorHandlerPtr->Notify( Exception );