c bindings to irrlicht

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
kenna
Posts: 15
Joined: Sun May 27, 2007 1:22 am
Location: Finland

c bindings to irrlicht

Post by kenna »

Hi,

somewhat of a newb programmer here ^^ Would it be possible to create c bindings to irrlicht? I'm not a fan of OO and would rather have procedural c. The binary code is probably nearly the same, I just don't like to develop in C++, C#, .net or whatever, just regular old-school ansi c ^^

Or is it somehow possible to program in c without bindings...?

And how would I go about to create these bindings...? would using the header files be enough, and rewriting the source files...? Just asking
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

You can write all your game code in C, just use the Irrlicht objects where necessary. Then compile everythign with a C++ compiler. After all, most C is just badly written C++.
Luben
Posts: 568
Joined: Sun Oct 09, 2005 10:12 am
Location: #irrlicht @freenode

Post by Luben »

hybrid, why is that? Do you have examples of what is good and bad c? Just curious :)
If you don't have anything nice to say, don't say anything at all.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Now, it's simply less than C++. You don't have all the fancy OO stuff, but 99% of (good?) old C code is correct C++ code. So if you read C code as C++ code it's simply badly written because the author did not use OO.
Dorth
Posts: 931
Joined: Sat May 26, 2007 11:03 pm

Post by Dorth »

While OO in itself might still be debatable, the fact is not 99% of the c is included in c++, but more 99.99% . Considering the amazing compilers of today, there is also not much if any penalty to use a slightly higher language. Because of that, coding in c++ alow all the tricks and uses of c while also giving you access to more tools and libraries at no additional cost (unless you seek compatibillity with a VERY old machine, in which case, I don't think Irrlicht would work, not even in software mode :P )
kenna
Posts: 15
Joined: Sun May 27, 2007 1:22 am
Location: Finland

Post by kenna »

In my oppinion OO is questionable, the only reason for OO is to retain the structure which is lost with "regular" code, or something like that, I can't really remember what I read in some article...and which IMHO isn't really that important, and can easily be implemented in c with proper design, although I guess most are just too lazy ^~^.

However, different languages are suited for different jobs, OO just shouldn't be touted as some super language superior to all other. Good old fashion assembly is still the best, and c in second place, at least IMHO.

Not being able to design and create a program in assembly or c, is simply not being able to design and create a well designed program. High-level assembly programming is actually quite cool. I've been designing my own language which is basically a HLAL or mid-level as I like to call it.

Simpler is always better, and that's assembly, higher-level languages are for portability (even though mid-level could do that too), or to create a certain "notation" for assembly, even C++, nothing but a complex form of notation, which really boils down to personal taste.
lester
Posts: 86
Joined: Mon Jan 29, 2007 3:33 pm

Post by lester »

We are using exactly the C bindings for irrlicht in IrrlichtNET.CP. Take a look at the http://sourceforge.net/projects/irrlichtnetcp for the sources of IrrlichtW.dll, maybe you'll find it interesting
kenna
Posts: 15
Joined: Sun May 27, 2007 1:22 am
Location: Finland

Post by kenna »

lester wrote:We are using exactly the C bindings for irrlicht in IrrlichtNET.CP. Take a look at the http://sourceforge.net/projects/irrlichtnetcp for the sources of IrrlichtW.dll, maybe you'll find it interesting
very interesting indeed, too bad it's .net
garrittg
Posts: 117
Joined: Wed Apr 20, 2005 6:17 pm
Location: Iowa, USA
Contact:

Post by garrittg »

my Irrlicht BlitzMax module has a set of C functions wrapping up nearly all of Irrlicht. may be of interest:

http://www.gprogs.com/irrlicht.mod/2007 ... ht.mod.zip

just ignore the .bmx files as they are BlitzMax specific.
lester
Posts: 86
Joined: Mon Jan 29, 2007 3:33 pm

Post by lester »

kenna wrote: very interesting indeed, too bad it's .net
nope, it's pure c (well not actually, it has some c++ classes though, especially for event handling) The .net layer is just above a c wrapper.
Dorth
Posts: 931
Joined: Sat May 26, 2007 11:03 pm

Post by Dorth »

Yeah, kenna, now you're being overzealous on the other side. Statement such as simpler is better, assembly is best, etc. are too questionable by a long reach. Take a company develloping a game style WoW. And like WoW, they want it on as many platform as they can. The lower your level, the more stuff you'll have to do multiple time, once for every system.

Also, a good compiler CAN simplify a well designed, well thought application to something as good as an assembler design, or nearly, and you can go reclaim the parts you lost with a disassembler and then integrating the assembly code itself in your higher lvl app (all recent c++ IDE supports assembler integration).

Anyway, dont swear by one or the other in 100% of the case, since both have uses, higher and lower, OO and non-OO. To each is style, as long as it runs as it should, as fast as it can and that everybody that will get in contact with the code can understand it ^^
lester
Posts: 86
Joined: Mon Jan 29, 2007 3:33 pm

Post by lester »

And like WoW, they want it on as many platform as they can.
What do you mean under this "many platform"? Win98,WinXP and WinVista? What a tremendous style of portability!
Dances
Posts: 454
Joined: Sat Jul 02, 2005 1:45 am
Location: Canada
Contact:

Post by Dances »

Regardless of WoW's state games written with Irrlicht (which is in C++) are quite cross platform.
Dorth
Posts: 931
Joined: Sat May 26, 2007 11:03 pm

Post by Dorth »

You forgot Mac ^^
and anyhow, I'm sure you can sustain the mental effort to find any other reference to any application or game that is known to run across platform, now can you?
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Hey guys, I'm doing hardware development with C++. ASM is necessary for compiler developers, nothing more. If you are required to do inline assembler in your app you're using the wrong compiler.
Post Reply