C interface as core feature
-
- OGRE Retired Moderator
- Posts: 20570
- Joined: Thu Jan 22, 2004 10:13 am
- Location: Denmark
- x 179
Re: C interface as core feature
And probably use it as a base for this C interface thing.
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
-
- Kobold
- Posts: 28
- Joined: Sat Jul 04, 2009 4:01 am
- Location: United States
- x 2
Re: C interface as core feature
Not certain if you've had any luck with RPythonic, but I've just cloned your repo here and added D2 bindings to LLCOI (and thus to OGRE and OIS) in a new "contrib" directory at the root of the project (wasn't sure where to put it, to be honest.) They've currently been tested using DMD 2.059 and DMD 2.060HEAD, but only using Linux as I don't have a Windows machine here.jacmoe wrote:I think I'll take RPythonic for a spin, Hartsantler.
And probably use it as a base for this C interface thing.
I'm not sure how to issue a pull request via google code (I'm used to bitbucket and github) but you're more than welcome to include it in your project using LLCOI's license.
Thanks to everyone for all of their hard work.
-
- Orc Shaman
- Posts: 788
- Joined: Mon Jan 18, 2010 6:06 pm
- Location: Costa Mesa, California
- x 24
Re: C interface as core feature
-
- Gnoblar
- Posts: 15
- Joined: Mon Oct 12, 2009 12:15 am
Re: C interface as core feature
- Houdini
-
- Ogre Magi
- Posts: 1255
- Joined: Sat Dec 25, 2010 2:55 pm
- Location: Macedonia
- x 81
Re: C interface as core feature
Do you need help? What have you tried?
- xavier
---------------------
HkOgre - a Havok Integration for OGRE | Simple SSAO | My Blog | My YouTube | My DeviantArt
-
- OGRE Team Member
- Posts: 4304
- Joined: Mon Feb 04, 2008 2:02 pm
- Location: Germany
- x 136
Re: C interface as core feature
Don't know what to do in your spare time? Help the Ogre wiki grow! Or squash a bug...
-
- Kobold
- Posts: 33
- Joined: Tue Nov 04, 2008 10:57 pm
- x 5
Re: C interface as core feature
I made some quick n dirty efforts to write a (non-pure) C-compatible wrapper for Ogre, so I can interop Ogre with golang.
See post here: http://www.ogre3d.org/forums/viewtopic.php?f=1&t=71944
I'd hate to reinvent the wheel. I'm no expert C programmer, but if there is anything I can do to keep the ball rolling, let me know. Thanks to you guys for getting this going. I'll play with what's in the repo and see if it's better than what I hacked up (it probably is).
Some questions I mentioned in that other thread:
- 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...
https://github.com/galaktor/gogre3d
llcoi - Low level C Ogre3D Interface
https://bitbucket.org/galaktor/llcoi
-
- Ogre Magi
- Posts: 1255
- Joined: Sat Dec 25, 2010 2:55 pm
- Location: Macedonia
- x 81
Re: C interface as core feature
- does it compile to a single dll?
- Yes - 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
- OGRE only. There's an optional OIS alternative for input (for the test program) which is Allegro, but it's entirely optional, and the wrapper itself only needs OGRE. - can I link to it using just ogre_interface.h? that would be very convenient
- Yes, ois_interface.h is optional for using OIS for input. - is it being used/maintained at all? Last checkin was March 2011...
- It's achieved it's goal from what I can see: provide a basic C wrapper for OGRE. You can easily extend and modify this to fit your needs. (If it doesn't already.)
Do you need help? What have you tried?
- xavier
---------------------
HkOgre - a Havok Integration for OGRE | Simple SSAO | My Blog | My YouTube | My DeviantArt
-
- Kobold
- Posts: 33
- Joined: Tue Nov 04, 2008 10:57 pm
- x 5
Re: C interface as core feature
I'll give it a spin soon.
The SWIG interface looks interesting, too.
https://github.com/galaktor/gogre3d
llcoi - Low level C Ogre3D Interface
https://bitbucket.org/galaktor/llcoi
-
- Kobold
- Posts: 33
- Joined: Tue Nov 04, 2008 10:57 pm
- x 5
Re: C interface as core feature
Should be fairly trivial to do now that the bulk is there.
https://github.com/galaktor/gogre3d
llcoi - Low level C Ogre3D Interface
https://bitbucket.org/galaktor/llcoi
-
- OGRE Retired Team Member
- Posts: 2903
- Joined: Thu Jan 18, 2007 2:48 pm
- x 58
Re: C interface as core feature
Besides, for the most part I don't see much of a disadvantage in keeping it in a separate repository.
-
- Kobold
- Posts: 33
- Joined: Tue Nov 04, 2008 10:57 pm
- x 5
Re: C interface as core feature
Currently it comes pretty much for free (it's already there and seems to work, according to some more recent posts in this thread). Letting it drift away would be a shame. And maybe it could morph into a more comprehensive C API for Ogre at some stage. The ground work seems solid.
Don't get me wrong, I appreciate that you guys are loaded with work and I'm grateful for Ogre as it is - but this appears to me as a relatively tiny bit of work compared to the very ambitious tasks on the roadmap.
https://github.com/galaktor/gogre3d
llcoi - Low level C Ogre3D Interface
https://bitbucket.org/galaktor/llcoi
-
- OGRE Retired Team Member
- Posts: 2903
- Joined: Thu Jan 18, 2007 2:48 pm
- x 58
Re: C interface as core feature
Given that personally I don't care for C at all, I'm really not looking forward to maintaining a C wrapper in that way, so for me at least it would be a burden. I'd much rather leave it in the capable hands of people actually interested in the wrapper.
Of course, we can happily endorse it officially if a group of people steps forward to maintain it. Links on the Ogre page etc., whatever you need.
-
- Gnoll
- Posts: 653
- Joined: Thu May 11, 2006 9:12 pm
- Location: Bavaria
- x 36
Re: C interface as core feature
ARTIFEX TERRA 3D - Artist-friendly, free and easy WYSIWYG realtime outdoor scene Editor & Painter
New loader now with Ogre::Terrain support: Addons for Artifex on SourceForge
MOC - Minimal Ogre Collision & Mousepicking
Simple TerrainMaterialGenerator for the use of standard Ogre material with Ogre::Terrain
Support me on Patreon
-
- Kobold
- Posts: 28
- Joined: Sat Jul 04, 2009 4:01 am
- Location: United States
- x 2
Re: C interface as core feature
I actually got D2 to cover a rather extensive amount of Ogre via my fork of the LLCOI code - the D2 wrapper is here, and my LLCOI fork is here. There's also a Bullet wrapper for C and D2 if you're feeling adventurousNauk wrote:Great stuff, love the idea D2 and Ogre going to work without big headache soon ++ for the effort Jacmoe! Not sure if that has been posted yet and/or it makes sense at all, but not long ago I had a thought about rewriting the automated Mogre wrapper to do exactly that.
That said, I haven't had much time lately to work on it. It's also only fair to note that I've found that using a C++ library via a C wrapper has one insanely annoying downside, in that if the C++ library throws an exception, you're toast, as the entire program will crash. This isn't so much Ogre's fault (or for that matter, any other library) but just that C doesn't play well with C++ exceptions - Boost.Python suffers from the same issue, as does LuaBind if I recall correctly.
-
- Gnoll
- Posts: 653
- Joined: Thu May 11, 2006 9:12 pm
- Location: Bavaria
- x 36
Re: C interface as core feature
Awesome Offtopic, may I ask what tool chain you are using? - *Edit* Nevermind that question, I just read back and saw the post a bit further up.voyvf wrote:I actually got D2 to cover a rather extensive amount of Ogre via my fork of the LLCOI code - the D2 wrapper is here, and my LLCOI fork is here. There's also a Bullet wrapper for C and D2 if you're feeling adventurousNauk wrote:Great stuff, love the idea D2 and Ogre going to work without big headache soon ++ for the effort Jacmoe! Not sure if that has been posted yet and/or it makes sense at all, but not long ago I had a thought about rewriting the automated Mogre wrapper to do exactly that.
That said, I haven't had much time lately to work on it. It's also only fair to note that I've found that using a C++ library via a C wrapper has one insanely annoying downside, in that if the C++ library throws an exception, you're toast, as the entire program will crash. This isn't so much Ogre's fault (or for that matter, any other library) but just that C doesn't play well with C++ exceptions - Boost.Python suffers from the same issue, as does LuaBind if I recall correctly.
ARTIFEX TERRA 3D - Artist-friendly, free and easy WYSIWYG realtime outdoor scene Editor & Painter
New loader now with Ogre::Terrain support: Addons for Artifex on SourceForge
MOC - Minimal Ogre Collision & Mousepicking
Simple TerrainMaterialGenerator for the use of standard Ogre material with Ogre::Terrain
Support me on Patreon
-
- OGRE Retired Moderator
- Posts: 20570
- Joined: Thu Jan 22, 2004 10:13 am
- Location: Denmark
- x 179
Re: C interface as core feature
I think I want to take the Python powered C wrapper generator for a spin to see how it can help in producing a working set of C files.
At least before carrying on.
This project needs some loving care.
The main reasons for this project would be to generate C bindings for other languages, like Python, Lua, Lisp.
My stack of things to do is not currently in need of a C interface, but will soon (read: in 6 months time).
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
-
- OGRE Retired Moderator
- Posts: 20570
- Joined: Thu Jan 22, 2004 10:13 am
- Location: Denmark
- x 179
Re: C interface as core feature
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
-
- OGRE Retired Moderator
- Posts: 20570
- Joined: Thu Jan 22, 2004 10:13 am
- Location: Denmark
- x 179
Re: C interface as core feature
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
-
- Kobold
- Posts: 33
- Joined: Tue Nov 04, 2008 10:57 pm
- x 5
Re: C interface as core feature
https://bitbucket.org/galaktor/llcoi/src
https://github.com/galaktor/gogre3d
llcoi - Low level C Ogre3D Interface
https://bitbucket.org/galaktor/llcoi
-
- OGRE Retired Moderator
- Posts: 20570
- Joined: Thu Jan 22, 2004 10:13 am
- Location: Denmark
- x 179
Re: C interface as core feature
Add me to the project if you like - you beat me to moving the project to Bitbucket.
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
-
- Kobold
- Posts: 33
- Joined: Tue Nov 04, 2008 10:57 pm
- x 5
Re: C interface as core feature
I made you an admin on the project. Didn't mean to "beat you" though, just need to make changes and I prefer to do them in a collaborative/public manner. It's still your work, and it's helping me a lot.
Open source rocks.
Have a look at my (fairly minor) changes when you get a chance.
https://github.com/galaktor/gogre3d
llcoi - Low level C Ogre3D Interface
https://bitbucket.org/galaktor/llcoi
-
- Kobold
- Posts: 33
- Joined: Tue Nov 04, 2008 10:57 pm
- x 5
Re: C interface as core feature
I integrated voyvf's repo into mine: https://bitbucket.org/galaktor/llcoi
The CMake build is probably broken (I compile using g++, without CMake), but otherwise it looks to be working fine and is quite extensive (thanks to Jeremy's work).
I'll continue to sanitize it a bit, there are quite a lot of inconsitencies at the moment (i.e. naming of functions, usage of handles/singletons, forward declarations etc).
https://github.com/galaktor/gogre3d
llcoi - Low level C Ogre3D Interface
https://bitbucket.org/galaktor/llcoi
-
- OGRE Retired Moderator
- Posts: 20570
- Joined: Thu Jan 22, 2004 10:13 am
- Location: Denmark
- x 179
Re: C interface as core feature
Structs and function pointers would be one possible improvement, I think, for some things:
camera.rotate, etc.
I'll see about fixing the CMake build script when I get some time.
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
-
- Kobold
- Posts: 33
- Joined: Tue Nov 04, 2008 10:57 pm
- x 5
Re: C interface as core feature
I was thinking the same wrt pseudo-classes using structs and func ptrs. I want to get what's there into a cleaner state and tag a 0.1 version, first.
If you could look at CMake that would be great - somehow me and CMake don't get along very well.
https://github.com/galaktor/gogre3d
llcoi - Low level C Ogre3D Interface
https://bitbucket.org/galaktor/llcoi