gogre3d - using ogre3d in go

Anything and everything that's related to OGRE or the wider graphics field that doesn't fit into the other forums.
User avatar
galaktor
Kobold
Posts: 33
Joined: Tue Nov 04, 2008 10:57 pm
x 5

gogre3d - using ogre3d in go

Post 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...
gogre3d - ogre bindings for golang
https://github.com/galaktor/gogre3d

llcoi - Low level C Ogre3D Interface
https://bitbucket.org/galaktor/llcoi
User avatar
Zonder
Ogre Magi
Posts: 1172
Joined: Mon Aug 04, 2008 7:51 pm
Location: Manchester - England
x 76

Re: gogre3d - using ogre3d in go

Post 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
There are 10 types of people in the world: Those who understand binary, and those who don't...
User avatar
galaktor
Kobold
Posts: 33
Joined: Tue Nov 04, 2008 10:57 pm
x 5

Re: gogre3d - using ogre3d in go

Post by galaktor »

I'll have a look at that C interface. It's almost guaranteed to be better than my dirty c-level access.
gogre3d - ogre bindings for golang
https://github.com/galaktor/gogre3d

llcoi - Low level C Ogre3D Interface
https://bitbucket.org/galaktor/llcoi
User avatar
galaktor
Kobold
Posts: 33
Joined: Tue Nov 04, 2008 10:57 pm
x 5

Re: gogre3d - using ogre3d in go

Post 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.
gogre3d - ogre bindings for golang
https://github.com/galaktor/gogre3d

llcoi - Low level C Ogre3D Interface
https://bitbucket.org/galaktor/llcoi