Is it possible to draw a textured triangle in CocosSharp? (not sprite-based... custom triangles, for example for drawing a (2d) mesh)
I've been searching for some time (I'm a total n00b in CocosSharp (and Cocos XNA, MonoGame...) world!), but I've always come to an dead end:
I understand that Cocos-2D is all about sprites, but drawing a textured custom shape is often needed as well (not to mention meshes in Cocos-3D CocosSharp).
Is there any chance that CCDrawManager will become public? (That would enable the possibility of drawing textured triangles, I suppose?) (Accessing CCDrawManager using reflection is not really a good option.)
Any other suggestions on how to draw a simple shape/triangle with (multiple) texture(s) in CocosSharp?
Posts
Hey Alex
We have tried to keep as much of the underlying platform interface tucked away because of the PCL implementation. glDrawArrays will not be accessible to you since it is OpenGL only and would not be cross platform and MonoGame does not surface anything for that.
What exactly are you needing access to so that we can take a look at surfacing a usable interface.
I'm looking for a way to draw textured triangles. I guess that would be possible by somehow utilizing CCDrawManager.DrawPrimitives(), to feed it with a triangle-list (CCPrimitiveBatch?).
I'm new to CocosSharp, so I'm not sure what/where the most appropriate interface would be to accomplish that. Would it be possible to extend CCDrawingPrimitives to support textures? (and a batch of PrimitiveType.TriangleList as input)
Alex
No way to really modify the DrawPrimitives as that is not it's purpose. We will need to look into something else.
I have set up a feature request issue here
or
Thank you for bringing this to our attention. Let's see what we can come up with.
Great, I'm looking forward to it, thanks!
I hope that the interface will support multi-texturing & most common OpenGL blending modes.
Alex
See here
You will have to compile from source or wait for next release.