Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

So the question is 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 vs writing a wrapper for the parts I want to use, what are the pros cons of each way ?

share|improve this question
add comment

2 Answers

up vote 5 down vote accepted

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.

Edit: Apparently Ogre3D has already been ported to Android. Here's a thread abut porting Ogre to Android.

share|improve this answer
add comment

writing a wrapper will help you in some ways:

  1. 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.
  2. 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:

  1. 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.
  2. 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.
share|improve this answer
1  
Even if you have a lot of experience with different rendering engines you are going to spend a LOT of time creating a usable abstraction. Why do you think that you're going to be swapping around renderers? –  Patrick Hughes Oct 2 '11 at 15:53
    
@PatrickHughes: As I said you have to if you want to change your target platform. for example if you write your game for iOS and then you try porting it to PC, you have to change your renderer! –  Ali.S Oct 2 '11 at 16:32
    
well I am in a situation where I need it to work on both PC and Android. even though the Android version will be a very limited compared to the pc .. I might write my own renderer for the android sorry I didn't mention that in the question. –  concept3d Oct 2 '11 at 16:34
1  
Moreover if you are using a (stupid) language that do not support inlining (such as ActionScript or Java), a wrapper will decrease performances. –  Lohoris Oct 4 '11 at 13:14
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.