I am going to use Ogre3D as the rendering engine for our 3D software. I am not sure if I need to use the engine as it is, or if I need to write a wrapper for the parts I want to use. What are the advantages and disadvantages of both writing a wrapper, and not writing a wrapper?
Ogre3D is already a wrapper/abstraction for OpenGL/DirectX. Adding another wrapper on top of that might be overkill, unless you will write a completely other rendering engine that will replace the functionality you used from Ogre. It's hard to judge, since I don't know how much of the Ogre API you're going to use.
Ogre3D already works for Linux/PC/Mac/iOS and apparently Google Native Client (which will probably also work on Android).
Generally there are situations where a wrapper might be a good idea (Gajet makes some good points) but in your current situation I'd rather invest some time to get Ogre3D running on all your target platforms. Maybe you'll have to write some additional code to achieve that, but I think it's probably less than writing a wrapper that works with different engines. And if you happen to be able to port Ogre3D to another platform, it would be a great service to the community.
writing a wrapper will help you in some ways:
- you can change engine whenever you like, you'll just have to change your wrapper's implementation. this is especially useful if you think you might someday change your target platform.
- when you write a wrapper your whole game code will share similar coding style. for example you know all functions start will small letters or all classes star with capital letters or any other coding style that you think of.
but there are also some drawbacks:
- you may restrict engine functionalities, by your wrapper. that's just possible if you don't want to copy all the features engine provide with exactly same structures.
- it always takes time to write something. both from programmers and computer. there are also many potential bugs you might introduce and whenever you need a new feature from engine you need to first write a wrapper to make that feature available in your code. it may decrease production speed alot.