Mailing Lists: Apple Mailing Lists

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

glDrawElements Bug -- Tracked down the cause



I noted this earlier:

-----------------------------------------

This produces funky glitchy results (with some vertexes way off).

glDrawElements(GL_TRIANGLES,(mdl->ntrig*3),GL_UNSIGNED_SHORT,mdl- >gl_element_list);

Using this instead (which is basically an unwrapped version) works fine.

	unsigned short *el;

	el=mdl->gl_element_list;
	
	glBegin(GL_TRIANGLES);
	
	for (i=0;i!=mdl->ntrig;i++) {
		glArrayElement(*el++);
		glArrayElement(*el++);
		glArrayElement(*el++);
	}
	
	glEnd();

--------------------------------

I found what causes it.  If you set up the vertex array with:

	glVertexPointer(3,GL_INT,0,......);

It works.  If you use:

	glVertexPointer(3,GL_FLOAT,0,....);

You get weird results.

I'm pretty sure this is a bug. I'm working up a work around, but if there is something silly I'm doing, I'd like to know :)

[>] Brian

_______________________________________________
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.