iDevGames Forums
glVertexPointer Problem - Printable Version

+- iDevGames Forums (http://www.idevgames.com/forums)
+-- Forum: Development Zone (/forum-3.html)
+--- Forum: Graphics & Audio Programming (/forum-9.html)
+--- Thread: glVertexPointer Problem (/thread-2426.html)



glVertexPointer Problem - Graphic Ace - Sep 3, 2008 08:57 AM

I am trying to create a Structured Object to hold the info for the pointer but can't seem to get it to work right here is the structure

struct vec3D { GLfloat x,y,z; }; typedef struct vec3D the3DVector;
struct triAngle { the3DVector point[3]; GLint type; }theObj[Array Number];


When I take out ( GLint type ) it works but when i try to use it it doesn't work am i missing something or can this type of struture not work?


glVertexPointer Problem - OneSadCookie - Sep 3, 2008 02:50 PM

that structure can't work because there's not the same distance between each vertex.


glVertexPointer Problem - Graphic Ace - Sep 4, 2008 12:38 AM

I was hoping I was wrong about that because I only wanted to point to the Points of the object an not the Points & type (i.e obj[0]->point,obj[1]->point an so on)
is there any way I can create a Obj that has 3Points An a Data Type?


glVertexPointer Problem - kelvin - Sep 4, 2008 03:27 AM

You can stick the type in a union within the struct. This way, as long as your vector size is wider, you can skip that part of the struct by drawing indices instead. However, it's a big fat waste of gpu memory and you're better off tightly packing your verts anyway.

I recommend just keeping a pointer to the offset of your vertex data in your triangle or object struct.


glVertexPointer Problem - Graphic Ace - Sep 4, 2008 04:47 AM

Thanks for the Tips & advice but fortunately I have found a new & Better way to create a object with a data type thanks for the help