When I use glTranslatef I have warning
Implicit declaration of function ‘glTranslatef’ is invalid in C99
If I build & run I have “EXC_BAD_ACCESS”
How I can resolve this problem?
When I use glTranslatef I have warning Implicit declaration of function ‘glTranslatef’ is invalid
Share
It looks that
you haven’t imported required headers. You need following headers to be included if you want to develop OpenGL ES 1.0 application:
Don’t forget to add frameworks:
OpenGLES.frameworkandQuartzCore.framework.Edit:
In OpenGL ES 2.0 you don’t have any of the matrix operations available in 1.0 such as
glTranslatef,glRotatef,glFustrumand many more. It’s not easy to implement them by yourself but this is the price that you need to pay if you want programmable pipeline. In great short: you need to write your own functions to represent and manipulate 4×4 matrices: multiple them, multiply by vectors, create rotation, translation and scale matrices, you need also function to create projection matrix like fustrum. After that you need to declare uniforms in your vertex shaders to passprojectionandmodelviewmatrices. Then you need to multiply them to apply transform and projection to a vertex:There’s a great book that will teach you how to use ES1 and ES2 on iPhone – iPhone 3d Programming. If you don’t have time, stick to an ES1. It’s ok if you don’t need programmable pipeline. But in my opinion this is worth learning.