Sign in to follow this  
Sophic Delusion

[.net] Cg Bindings for .NET

Recommended Posts

Hey everyone, I was bored last night so I decided to do the grunt work of importing the entire Cg runtime to .NET. I figure this might be at least semi-useful for those interested, I'll upload as soon as I get home from school

Share this post


Link to post
Share on other sites
Well I only did the imports for the core runtime but the DX and GL functions should only take an hour or so to import. Let me just note I don't have a means to test them yet for full interoperability, as there may be issues with the ones that take pointers to arrays, etc. But my main intent was to do the grunt work to import all the functions, structs, etc. for everyone. I'll put them up at 5:30 tonight.

I just wanted to note also one of my reasons for doing this. I had originally planned to use Tao for my Cg bindings, but after looking at it there are a few things missing. For one, it's made for Mono, so there are no security exceptions on the DllImports. Another thing, it is somewhat incomplete, with a few major functions left out (cgGetLastError, etc.) I've placed empty XML documentation tags above all of the imports and types and I plan to fill them in when I have the time.

However, my main endeavor right now is to get the native bindings done for Cg as well as FmodEx. Yes, I know FmodEx comes with Cg bindings, but they aren't documented and since they aren't readily compiled into a class library I figured I'd clean it up and write my own implementation based on them.

Oh btw, don't trust the Cg Runtime Reference! Some of the function documentation is incorrect. I had used it as my main source for writing the function imports, but once I found the discrepencies almost by accident I have since come to rely on cg.h and its accompanying headers themselves for writing the imports.

But yeah, anyway, I feel bad for posting this before I actually release my code, but don't fear, I will release it tonight!

[Edited by - Sophic Delusion on November 11, 2005 1:16:29 PM]

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this