If you haven't done so already, be sure to visit the Wiki Portal to read about how the wiki works. Especially the Ogre Wiki Overview page.
C++ is the first language you think of when you start reading about OGRE, since that's what it is written in, and most of the content on this wiki deals with C++. However, there are a few alternative languages that you might be interested to hear you can also use with OGRE. This page will serve as a quick introduction to the reasons you might want to change from C++, and will also mention a little about each language.
Here are quick links to the pages of the different wrappers:
- PyOgre, for Python-Ogre
- Ogre4j, for Java
- MOGRE, OgreDotNet for .NET (VB, C#, Delphi, Boo)
- (GMOGRE
), for GML
Why use something else?
Why use C++? The #1 reason to use C++ is that it produces fast code. A graphics engine requires a lot of speed, because it needs to handle a tremendous amount of data as fast as it possibly can. So, C++ is a great choice for, in this case, OGRE. But, C++ requires a lot of the programmer. A lot of things have to be considered by the programmer at all times, things that aren't there in other languages because they are designed differently. The result of this is that programming in C++ can be a lot less productive than choosing a programming language that isn't necessarily so focused on speed, but rather focused on giving the programmer as many tools as he or she needs to be more efficient.
"How big can the difference between languages be?", you ask. Big! But I'll leave that up to you to find out...
How does it work?
There are two ways to convert OGRE to other languages. The first is to write a port of OGRE, which basically means that you rewrite OGRE entirely in another language.
The second option is to make a wrapper. A wrapper can be described as an additional layer written in the new language, and when you call an OGRE method, the wrapper "forwards" the call to the real C++ method. This of course means that it is slightly slower to use a wrapper than to use C++ directly, but remember that it's only slower to make the actual calls; the code that gets executed is still written in C++ so you get most of the speed. Especially when you consider that you usually don't have to make that many calls to OGRE (most are for setting up the scene). There is more information on wrappers in the OgreNet page.
Of course, you don't have to convert OGRE at all - it's already done for the languages mentioned below!
The languages
There are currently three languages, beside from C++, that you can use with OGRE. Each has different aspects that may or may not suit your needs.
Python
Python is one of the more powerful languages that you can use. It has numerous features that make your life as a programmer a lot easier, and is often reported
to make you more than ten times as productive compared to C++. One of the reasons for this is that Python code is often very short, and very readable (yes, at the same time!). Python is a bytecode interpreted language, which means that it can be marginally slower than C++, especially the first time a Python program is run. Python code can, however, be precompiled to minimize that first-run hit, and a number of performance optimization options exist, such as Psyco
and Pyrex
To use Python with Ogre, you use the binding/wrapper Python-Ogre. Do you want to know more? Read more on Python-Ogre.
Java
Java is a reflective, object-oriented programming language developed initially by James Gosling and colleagues at Sun Microsystems. Initially called Oak (named after the oak trees outside Gosling's office), it was intended to replace C++, although the feature set better resembles that of Objective-C. Java should not be confused with JavaScript, which shares only the name and a similar C-like syntax. Sun Microsystems currently maintains and updates Java regularly. (Source
) (this text should be rewritten/another source should be found)
Read more on Ogre4j.
.NET
|
|
.NET isn't really a language; It is family of languages.* C# ("C Sharp" or "C Pound" depending on who you ask) is a lot like Java in structure and usage, but with some additional concepts of C++. The misconception about C# is that it's a "new version of C++". Other then syntax, the two are nothing alike.
- Visual Basic (VB.NET). This one gets a lot of flak due to the (deservedly) poor reputation of previous versions of Visual Basic (VB4, VB5, VB6, etc...). It is important to understand that VB.NET is a completely different language than its predecessors. It is just as fast as C# and only slightly less powerful (no operator overloading and less stringent type safety), but easier to use for the developer due to very nice auto formatting, auto-complete, and overload listings as you type. As with C# in regard to C++, the only thing VB.NET holds in common with previous Visual Basic incarnations is the syntax.
- Delphi. Designed by the same architect who engineered C#, Delphi shares many traits with C#, but is argued to use a somewhat friendlier syntax.
If you want to use one of the .NET languages, check out MOGRE (Managed OGRE).
Contributors to this page: jjjet42
,
OgreWikiBot
,
jacmoe
,
Beauty
and
andy
.
Page last modified on Saturday 09 of April, 2011 04:38:28 GMT by jjjet42
.
The content on this page is licensed under the terms of the Creative Commons Attribution-ShareAlike License.
As an exception, any source code contributed within the content is released into the Public Domain.

