Minib3d c#?

BlitzMax Forums/MiniB3D Module/Minib3d c#?

BLaBZ(Posted 2012) [#1]
Has anyone ported minib3d to c#?!

If not how difficult would it be?


ima747(Posted 2012) [#2]
Not to my knowledge.

That would depend on your skill with C#, general understanding on C++ (if you're porting from iMiniB3D, probably easier since it's atleast all in C++ syntax instead of a mix of C and blitzmax) and some other factors (such as does it support the OpenGL 1.x command set or only 2.0+, how's it's GLU support, how much experience do you have debugging type inconsistencies, etc.).

I ported the majority of it to Java for Android as my first foray into Java, but that was stupid and I wouldn't recommend anyone else do the same :0) It primarily consisted of copying the code from iMiniB3D, pasting it into the Java IDE, and then fixing every single syntax error one at a time. There's a few shortcuts like replacing all "->" occurances with just ".", and Java supports the same comment syntax as C so the commends didn't cause any massive headaches. I also cut out huge swaths of the Engine I didn't need with the plan of porting them later (thought I haven't had the time). I would assume porting it to C# would be similar as I think the Syntax is largely compatible with C/C++. You may run into some problems with the lower level functionality as there may be overlapping type definitions, or types that have the same name but different functionality like "vector". Also, the OpenGL implementation, assuming it's a compatible command set, might take inputs in different forms, this was a big headache in java and resulted in some ugly conversions for the sake of time and due to my lack of familiarity with OpenGL and Java.


simonh(Posted 2012) [#3]
Adam Redwood has converted minib3d to Monkey, which in turn converts it to C#. It would be with OpenGL calls however, which I'm not sure would be much use.


Yasha(Posted 2012) [#4]
I converted about 95% of the code to C#, but didn't understand the OpenGL in the "complicated bits" enough to actually make it work.

You're welcome to it if you want it (I tried to keep it line-for-line to avoid the need for extra annotation), but what I took from the experience is that a rewrite would be a much better idea. Porting code is a PITA.