[.net] Cg Bindings for .NET

Started by
4 comments, last by Sophic Delusion 18 years, 5 months ago
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
-- Sophic Delusion
Advertisement
I'm certainly interested... the ExoEngine actually had a Cg wrapper for .NET but it only worked with OpenGL / csgl (now tao)... if this works with OpenGL and DirectX then I would be very interested.

Thanks
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]
-- Sophic Delusion
Well, here they are. Enjoy! I'll keep uploading my work in this area as it progresses, if any are interested.

Cg Bindings for .NET
-- Sophic Delusion
The Tao project has Cg bindings that work with OpenGL.
Tao Project
SDL.NET http://cs-sdl.sourceforge.netTao.Sdlhttp://mono-project.com/Tao
Oh whoops... I uploaded that thing without the D3D and GL bindings I had for it. Oops... Well, it'll be there.
-- Sophic Delusion

This topic is closed to new replies.

Advertisement