teichgraf's picture

Extend OpenTK


Is it okay to extend the Vector* / Box2d structs and post a SVN patch here? I need some functionality , which I would like to implement directly and contribute to the project.


Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
the Fiddler's picture

Feel free to extend Vector*! Patches always welcome.

Regarding Box2, I'm starting to think this struct might have been a bad idea on my part. System.Drawing.Rectangle and Region cover the same things (more or less) - take a look there first, to see if they cover what you need?

Also, may I ask what kind for a rough idea of the functionality you need? The reason I'm asking is that I've been slowly merging a patch by JTalton, which adds several juicy bits to Vector* and Matrix*.

teichgraf's picture

Indeed I am using Rectangle instead of Box2 at the moment, because it offers a more extensive interface. But I want to avoid a using of System.Drawing in code where OpenTK.Math is used (which offers Box2) to keep it straight. So I would like to extend the interface of Box2 a little. It's also OK if you drop the Box2 struct.

For Vector2 I need:

public static Vector2 One = new Vector2(1, 1);
public Vector2 RightNormal();
public Vector2 LeftNormal();

It is not that much at the moment. But I wrote some vector arithmetic classes / structs a while ago and maybe I could extend OpenTK.Math with my functionality.
But If you say, that JTalton's patches covers the above three methods / properties, I will wait until you finished.

teichgraf's picture

I just checked out the repository (trunk) from sourceforge. Is there a way to build the project files for Visual Studio 2008?

the Fiddler's picture

Yes, open cmd and head to the Build/ folder. Then type "Bulid.exe vs" to generate a VS solution.

georgwaechter's picture


i also plan to contribute additional Vector* patches, for example for methods that Vector3d has, but Vector3 not .... i will post more details later


the Fiddler's picture

The single precision versions will get all the features double precision versions have. I'm slowly merging differences back and forth.

teichgraf's picture

I read in the instructions.txt about "Bulid.exe vs", but it builts a Visual Studio 2005 solution, which needs to be converted to 2008. Thanks for the info, but I was asking if it is possible to build Visual Studio 2008 project files directly.

Should I wait with my patches until you finished merging the current patches?

the Fiddler's picture

No, it's not possible (not supported by Prebuild).

No, build your patches (I'm working on OpenAL right now, so they won't conflict).

teichgraf's picture

When the patch is finished, how should I deliver it? Post a topic or through sourceforge?

the Fiddler's picture

Just attach it to this topic.