Well as the error message you posted is already thrown in the 3rd line of code, your texture is not even loaded and will thus not be repeated as well.

You should make sure that your texture is loaded correctly (or properly created by hand). So either the file is not found if you load the UIImage from disk, or while using CGContextCreateBitmap you missed something..

If you're sure that the image you pass to your setTextureImage function is valid, you probably should have a look at the docs.

Repeating the texture is easy as soon as it loads, setting WRAP_S and WRAP_T to GL_REPEAT as you already did for _S, and then assign texture coordinates that are bigger than 1, so e.g. a rectangle where the texture coordinates range from 0x0 to 2x2 will have the image 4 times on it.

The fact is that I don't find in the class GLKTextureLoader how to change WRAP_S and WRAP_T to GL_REPEAT.

It seems like there is a conflict if I use :

glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT );

Thanks again,

Fabrice

Well as the error message you posted is already thrown in the 3rd line of code, your texture is not even loaded and will thus not be repeated as well.

You should make sure that your texture is loaded correctly (or properly created by hand). So either the file is not found if you load the UIImage from disk, or while using CGContextCreateBitmap you missed something..

If you're sure that the image you pass to your setTextureImage function is valid, you probably should have a look at the docs.

Repeating the texture is easy as soon as it loads, setting WRAP_S and WRAP_T to GL_REPEAT as you already did for _S, and then assign texture coordinates that are bigger than 1, so e.g. a rectangle where the texture coordinates range from 0x0 to 2x2 will have the image 4 times on it.

a quick look trough gl.h states that error 0x0500 is GL_INVALID_ENUM.
It could be that texture.name is not a valid enum or the fact that your binding it after glTexParameterf.
Alternatively it could be because of quirks in openGL ES, but i don't think so.

a quick look trough gl.h states that error 0x0500 is GL_INVALID_ENUM.It could be that texture.name is not a valid enum or the fact that your binding it after glTexParameterf.Alternatively it could be because of quirks in openGL ES, but i don't think so.

Ah I just spotted that you're using glTexParameterf which indicates that you will pass a float (hence the f at the end) to the function as a parameter. But the parameter GL_REPEAT is an enum (or an int) and thus you should use glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);

Ah I just spotted that you're using glTexParameterf which indicates that you will pass a float (hence the f at the end) to the function as a parameter. But the parameter GL_REPEAT is an enum (or an int) and thus you should use glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);