X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fvideo%2Fgl_texture.cpp;h=283967309148d91c32b4aa7d8449b3eda91bf1cc;hb=7a0031e8f250c852743709ab06ecafe1896eefbe;hp=413d0ce247127014cfa631be5dc8b9380fd1f26a;hpb=fea3446f05e1e7673607b835c269d3e8d1929ab3;p=supertux.git diff --git a/src/video/gl_texture.cpp b/src/video/gl_texture.cpp index 413d0ce24..283967309 100644 --- a/src/video/gl_texture.cpp +++ b/src/video/gl_texture.cpp @@ -110,7 +110,14 @@ namespace GL glBindTexture(GL_TEXTURE_2D, handle); glPixelStorei(GL_UNPACK_ALIGNMENT, 1); +#ifdef GL_UNPACK_ROW_LENGTH glPixelStorei(GL_UNPACK_ROW_LENGTH, convert->pitch/convert->format->BytesPerPixel); +#else + /* OpenGL ES doesn't support UNPACK_ROW_LENGTH, let's hope SDL didn't add + * padding bytes, otherwise we need some extra code here... */ + assert(convert->pitch == texture_width * convert->format->BytesPerPixel); +#endif + if(SDL_MUSTLOCK(convert)) { SDL_LockSurface(convert); @@ -144,8 +151,11 @@ namespace GL { glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); +#ifdef GL_CLAMP + /* OpenGL ES doesn't support it */ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP); +#endif assert_gl("set texture params"); }