Advertisement Jump to content
Sign in to follow this  

OpenGL Custom C# bindings for vertex arrays

This topic is 4961 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi all, I am using TAO framework to create my OpenGL 3D engine, but I have a *little* problem with my custom binding to gl*Pointer functions... since I'm using Sharp3D library structures to store Vertices/Normals/TexCoord/Color data, I thought about creating a binding for this kind of data, avoiding pinning or else... but something is wrong, since even if my vertices are drawn correctly, normals and texture coords are not correct at all... copying data into a double[] and using gl*Pointer functions in the TAO binding, shows a correct result, so data is correct, but OpenGL receives messed up data... Just to add more, Vector*F and ColorF structures (the ones used in Sharp3D library) have a serial layout (I downloaded and rebuilt sources to make me sure about it)... I'll provide a snippet from my render cycle, and my bindings... hope someone could enlight me :( BINDINGS:
public static extern void glVertexPointer(int size, int type, int
stride, Vector3F[] vertices);

public static extern void glTexCoordPointer(int size, int type, int
stride, Vector2F[] coords);

public static extern void glColorPointer(int size, int type, int
stride, ColorF[] colors);

public static extern void glNormalPointer(int type, int stride,
Vector3F[] normals); 

public virtual void Render()




Thnx in advance for every help :P

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!