Starting OpenGL ES

Member
Posts: 87
Joined: 2006.08
Post: #16
Have you enabled depth testing, and have a depth buffer?

glEnable(GL_DEPTH_TEST);

GLint depth_bits;
glGetIntegerv(GL_DEPTH_BITS, &depth_bits);
depth_bits should be >0.

If your code is derived from Apple's sample EAGLView, search for "USE_DEPTH_BUFFER" and set it to 1 to create a depth buffer.
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #17
Did you request a depth buffer and enable depth testing? Did you turn on back-face culling?
Quote this message in a reply
Apprentice
Posts: 19
Joined: 2006.11
Post: #18
Thanks for your help.

I managed to fix my problem, forgot to enable depth testing; however, it seems as if the back face of the triangle is missing. You can see this in the screenshots I posted, I thought they were caused by the same issue, but I guess not. It's as if it isn't being drawn.

EDIT: Stupid me, I fixed my problem. Was specifying the vertex count as 9, not 12.
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Starting with OpenGL, need some help wsc981 5 5,154 Jul 17, 2010 06:28 AM
Last Post: wsc981
  Starting with OpenGL ES techy 2 2,672 Dec 21, 2009 12:10 PM
Last Post: techy
  starting to work with openGL, need some help smartalco 1 2,538 Mar 26, 2007 08:21 PM
Last Post: arekkusu
  openGL questions before starting 3d engine code chopplebrains 16 7,390 Jan 15, 2003 01:42 PM
Last Post: henryj