From 95754ea480991d1ccc6bbfc423aca316585cdce4 Mon Sep 17 00:00:00 2001 From: jsancho Date: Tue, 8 Sep 2009 15:56:44 +0000 Subject: [PATCH] --- gacela_draw.lisp | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/gacela_draw.lisp b/gacela_draw.lisp index 521093b..1629847 100644 --- a/gacela_draw.lisp +++ b/gacela_draw.lisp @@ -141,4 +141,20 @@ (cond (zrot (glRotatef zrot 0 0 1)))) (defun enable (&key textures) - (cond (textures (glEnable GL_TEXTURE_2D)))) \ No newline at end of file + (cond (textures (glEnable GL_TEXTURE_2D)))) + +#if SDL_BYTEORDER == SDL_LIL_ENDIAN + if (surface -> format -> BytesPerPixel == 3){ + mode = GL_BGR ; + } + else if (surface -> format -> BytesPerPixel == 4){ + mode = GL_BGRA ; + } +#else + if (surface -> format -> BytesPerPixel == 3){ + mode = GL_RGB ; + } + else if (surface -> format -> BytesPerPixel == 4){ + mode = GL_RGBA ; + } +#endif -- 2.39.5