Skip to main content

History: Alternative Languages

Source of version: 2

Copy to clipboard
            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:
* ((Python-Ogre|PyOgre)), for Python-Ogre
* ((Ogre4j)), for Java
* ((MOGRE)), ((OgreDotNet|OgreNet)) for .NET (VB, C#, Delphi, Boo)



!!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 ((OgreDotNet|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
{img src="img/wiki_up/PyOgre_Transparent.gif" alt="" align="left"}
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 [http://www.thinkware.se/cgi-bin/thinki.cgi/PythonQuotes|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 [http://psyco.sourceforge.net|Psyco] and [http://www.cosc.canterbury.ac.nz/~greg/python/Pyrex/|Pyrex]

To use Python with Ogre, you use the binding/wrapper Python-Ogre. Do you want to know more? __Read more on ((Python-Ogre|PyOgre))__.

!!!Java
{img src="img/wiki_up/Ogre4J_Transparent.png" alt="" align="left"}
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. ([http://en.wikipedia.org/wiki/Java_programming_language|Source]) (this text should be rewritten/another source should be found)

__Read more on ((Ogre4j)).__

!!!.NET
||{img src="img/wiki_up/MOGRE.png" alt="" align="left"}
{img src="img/wiki_up/Ogredotnet-logo1.gif" alt="" align="left"}||
.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)__.

        

History

Information Version
Tue 04 of Feb, 2014 10:50 GMT-0000 edoardo Updated MOGRE logo image 8
Wed 17 of Apr, 2013 15:30 GMT-0000 bvanevery removed inactive projects 7
Sat 09 of Apr, 2011 04:38 GMT-0000 jjjet42 6
Fri 27 of Aug, 2010 06:10 GMT-0000 andy 5
Fri 27 of Aug, 2010 04:31 GMT-0000 andy 4
Sat 09 of Jan, 2010 15:00 GMT-0000 Beauty corrected link 3
Wed 23 of Dec, 2009 22:17 GMT-0000 jacmoe 2
Fri 09 of Oct, 2009 15:12 GMT-0000 OgreWikiBot Robot: Cosmetic changes 1