Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I started writing a shader for my iOS app and instead of starting from scratch i used this tutorial here: http://www.raywenderlich.com/3664/opengl-es-2-0-for-iphone-tutorial

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: http://d1xzuxjlafny7l.cloudfront.net/downloads/HelloOpenGL.zip

share|improve this question

1 Answer 1

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

 
discard

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.