Skip to main content
gamedev.net
🔒 Locked

gl*Pointer, like glVertexPointer and glColorPointer passing in array problems.

Started by chbfiv 0 replies 400+ views
Original Post
chbfiv
chbfiv
Im going to keep this simple for you, so I might get a reply, I hope! Simple use of glVertexArray static GLint vertices[] = {25, 25, 100, 325, 175, 25, 175, 325, 250, 25, 325, 325}; glVertexPointer (2, GL_INT, 0, vertices); thats nice and all, but I want to use structs for my vetexs, im using this one. typedef struct{ GLfloat x,y,z; } t_vertex; //fill an array t_vertex vlist[3] = {-30,-30,0, 30,-30,0, -30,30,0}; //this wil not work because its not a simple array, its a stuct. Also, it would be a 2D array now, but it will need to look 1D for this function. Any ideas on how to do this? glVertexPointer (3, GL_FLOAT, 0, vlist);
-BourkeIV
chbfiv
chbfiv
Whats funny is that it worked all a long. sigh*, I was Enabling the ClientState for vertex arrays after my glMainLoop=/
-BourkeIV

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.