Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


OpenGL Help with arrays routines in OpenGL

This topic is 5271 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

Here is types code class gl_vert_coord { public: float x, y, z; }; class gl_color { public: float r, g, b; }; class gl_vertex { public: gl_vert_coord coord; gl_color color; }; class gl_quad { public: gl_vertex verteces[ 4 ]; }; Here is initialization code glEnableClientState( GL_VERTEX_ARRAY ); glEnableClientState( GL_COLOR_ARRAY ); glVertexPointer( 3, GL_FLOAT, sizeof( gl_color ), &quads[ 0 ].verteces[ 0 ].coord ); glColorPointer( 3, GL_FLOAT, sizeof( gl_vert_coord ), &quads[ 0 ].verteces[ 0 ].color ); Here is drawing code glDrawArrays( GL_QUADS, 0, 24 ); I am trying to draw a cube (simple) Used array is also used in simple drawing glBegin/glEnd functions. Simple drawing works well, but when I try to draw by means of glDrawArrays nothing is drawn. Help, it seems that there is no errors in code. P.S. It would be better if you give me a link with code about arrays drawing, which uses grouped arrays (arrays where not only vertex data is placed). Thanx a lot for your attention!!!

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!