Mailing Lists: Apple Mailing Lists

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

Re: Possible glDrawElements Bug



Does it repro with other video cards?
Are you using any extensions (i.e. VAR)?
"Funky changing results" plus glDrawElements could mean that you are modifying the verts in memory before OpenGL has a chance to access them. With VAR on, OpenGL doesn't make a copy of the elements; it's your job to make sure they stick around until the draw has completed. (You can know whether the draw is done or not by adding fences, or glFlush can be used as a last resort.)



On Mar 25, 2005, at 12:37 PM, Brian Barnes wrote:

OS 10.3.8, G4 450, 1 Gig, ATI Radeon 8500

If I use this code:

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

I get funky, changing results. But if I replace the single line with this code:

	unsigned int *el;

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

Am I just doing something stupid? If I send the elements one by one, it works right. If I send them in a group, they are corrupted. Is this a known problem?

[>] 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

_______________________________________________ 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
References: 
 >Possible glDrawElements Bug (From: Brian Barnes <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.