Page 1 of 1

gogre3d - using ogre3d in go

Posted: Fri Aug 31, 2012 9:07 am
by galaktor
I'm starting a toy game project, and I'm using go (http://golang.org/)

I think go is an interesting language for games since it's similar in performance to C, yet very concise and has a high signal/noise ratio. It interops nicely with C. Since ogre does not have a "normal" C interface, I wrapped some of the basic logic myself, quick and dirty for experimentation's sake.

The experimental code:
https://github.com/galaktor/gogre3d
Not very clean or idiomatic, but it's worth looking at the code:
using gogre3d: https://github.com/galaktor/gogre3d/blo ... r/runit.go
go wrapper: https://github.com/galaktor/gogre3d/blo ... gogre3d.go
c wrapper: https://github.com/galaktor/gogre3d/blo ... /ogrec.cpp

Disclaimer: I'm not at all an expert C/C++ programmer, and I'm just learning go - don't expect any miracles here :-)


For my purposes at the moment, manually maintaining a custom slim wrapper is sufficient. I am curious however if anybody else is interested in using ogre in go. We might be able to combine efforts and make it more comprehensive.

To wrap c++ for go, it's common to use SWIG. I know that SWIG has been used for other, now pretty much deprecated wrappers (OgreDotNet, PyOgre). I don't know SWIG very well, nor the gritty details of the Ogre code base, so it's hard for me to understand why SWIG was a problem. If anybody here can give me some better understanding of pros/cons of SWIG with ogre, I'd appreciate it! I'll play around a bit with it myself, but I won't spend much time on it just for myself. Maybe if there's more interest, and possibly some support.

So, bottom line: anybody else interested in getting ogre working in golang, and willing to help make it happen?

Sorry if this is the wrong spot for this post, I couldn't find a good place in the "Addons" forum...

Re: gogre3d - using ogre3d in go

Posted: Fri Aug 31, 2012 9:29 am
by Zonder
C bindings for OGRE are in development not sure the extent of their completness

http://ogre3d.org/forums/viewtopic.php?f=3&t=63153

Re: gogre3d - using ogre3d in go

Posted: Fri Aug 31, 2012 9:33 am
by galaktor
I'll have a look at that C interface. It's almost guaranteed to be better than my dirty c-level access.

Re: gogre3d - using ogre3d in go

Posted: Fri Aug 31, 2012 10:03 am
by galaktor
A few thoughts regarding that C interface come to mind - I'll try to contact the authors separately, but I might as well mention it here:
  • does it compile to a single dll?
  • what are the dependencies for building the wrapper? it shouldn't be more than the used ogre header files, yet from looking at CMakeLists.txt, it seems to be doing more
  • can I link to it using just ogre_interface.h? that would be very convenient
  • is it being used/maintained at all? Last checkin was March 2011...
I know this has come up before, but Ogre should really provide an official (even if limited) C interface...would make porting/interop much easier.

Re: gogre3d - using ogre3d in go

Posted: Sun Dec 16, 2012 1:48 am
by Nauk
Nice work, I totally missed that :) Kudos