AwDogsGo2Heaven
AwDogsGo2Heaven

Reputation: 972

Monotouch OpenGL Types And Cocos2d

I've been playing around with Monotouch recently, deciding if it will be good for my project. I need Cocos2d for it and was using the bindings found here: https://github.com/mono/monotouch-bindings

Everything is going ok so far, however I don't have access to the OpenGL types such as GLuint. Now I know technically this is just a typedef and an unsigned int. But I was wondering what is the best way to import these types. I was thinking OpenTK might have them but after importing it, I still couldn't find them. Can I just include the gl.h in my project? or is that not the right way?

Upvotes: 3

Views: 238

Answers (1)

poupou
poupou

Reputation: 43553

But I was wondering what is the best way to import these types.

MonoTouch (like MonoMac and Xamarin.Mac) bindings avoid redefining types that already exists in the .NET framework.

As such many types (in different iOS frameworks) are converted into the equivalent .NET types. That makes the values easier to share code between toolkits. That's important since C# is strongly typed (and type casting would be very ugly).

Now I know technically this is just a typedef and an unsigned int

Most 32bits unsigned integers types will be converted uint (in C# or really System.UInt32 .NET). That's what you should use (and likely what the bindings are using).

The most notable exception (for integral types) is when they are converted into enums (but their underlying type still remains the same size as the original).

Upvotes: 2

Related Questions