Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Vertex Arrays and VPs



Hi all, I'm using the well know VP VertexAttribArray functions without VERTEX_ARRAY_RANGE and I'm facing some strange behaviour. My program every time I run it will or won't render at all randomly. I mean for example that 1 every 4 times I run the program it renders everything correctly, but the other runs wont. I'm sure its because the arrays since you just need not to render the arrays and the "normal" GL commands run correctly.

VertexPrograms::Enable(1); // Enable VP and load program 1
FragmentPrograms::Enable(0); // Same for FP


glEnableVertexAttribArrayARB(0);
glEnableVertexAttribArrayARB(1);
glEnableVertexAttribArrayARB(2);
glEnableVertexAttribArrayARB(8);
glEnableClientState(GL_ELEMENT_ARRAY_APPLE);


glVertexAttribPointerARB(0, 3, GL_FLOAT, GL_FALSE, 56, &model->vertexArray[0].v);
glVertexAttribPointerARB(1, 4, GL_FLOAT, GL_FALSE, 56, &model->vertexArray[0].f);
glVertexAttribPointerARB(2, 3, GL_FLOAT, GL_FALSE, 56, &model->vertexArray[0].n);
glVertexAttribPointerARB(8, 2, GL_FLOAT, GL_FALSE, 56, &model->vertexArray[0].t);


glElementPointerAPPLE(GL_UNSIGNED_INT, model->faces.Get());
glDrawElementArrayAPPLE(GL_TRIANGLES, 0, model->faces.Size());


glDisableClientState(GL_ELEMENT_ARRAY_APPLE);
glDisableVertexAttribArrayARB(0);
glDisableVertexAttribArrayARB(1);
glDisableVertexAttribArrayARB(2);
glDisableVertexAttribArrayARB(8);


FragmentPrograms::Disable();
VertexPrograms::Disable();


A similar piece of code was working well ages ago on win32. I just can't isolate the problem, is something missing?? Something im not taking account on MacOSX?

Thanks very much,

Oscar Blasco
email@hidden
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Mac-opengl mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/mac-opengl/email@hidden

This email sent to email@hidden



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.