From c0ec1d5114693c4053f091882af8b675a18606d8 Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Sun, 2 Nov 2014 15:56:22 +0200 Subject: [PATCH] Fixed color channels displacement on Big Endian targets --- src/cocoa/i_backend_cocoa.mm | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/cocoa/i_backend_cocoa.mm b/src/cocoa/i_backend_cocoa.mm index 873b34c032..594f7fca64 100644 --- a/src/cocoa/i_backend_cocoa.mm +++ b/src/cocoa/i_backend_cocoa.mm @@ -1750,7 +1750,13 @@ int SDL_Flip(SDL_Surface* screen) const int width = screen->w; const int height = screen->h; - + +#ifdef __LITTLE_ENDIAN__ + static const GLenum format = GL_RGBA; +#else // __BIG_ENDIAN__ + static const GLenum format = GL_ABGR_EXT; +#endif // __LITTLE_ENDIAN__ + glTexImage2D(GL_TEXTURE_RECTANGLE_ARB, 0, GL_RGBA8, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, screen->pixels);