Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I started writing a shader for my iOS app and instead of starting from scratch i used this tutorial here:

I wrote an import function, first to import wavefront .obj models. My problem is that with I can't handle larger inputs (with a simple cube it was working). I realized that the indices array is an array of GLubyte values, which is unsigned char, so as a result i cant have more than 256 indexes. I modified it to GLuint, but then only get a blank screen.

What else needs to me modified?

p.s.: the source can be downloaded from here:

share|improve this question

glDrawElements accepts only GL_UNSIGNED_BYTE and GL_UNSIGNED_SHORT. Using GL_UNSIGNED_INT should give you an error. Are you checking errors with glGetError function?

share|improve this answer
not yet, but thanks for pointing that out. I'm still new in opengl ES. do you know if there's any already made shader with the bare basics that can handle more vertices/indices? – Zoltan Varadi Jul 31 '12 at 10:48
Shader doesn't care how many vertices you are submitting to it. Code will look the same if you are draw int 3, 10, 100 or 10000 vertices. – Mārtiņš Možeiko Jul 31 '12 at 16:28

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.