From: jsancho Date: Tue, 8 Sep 2009 15:56:44 +0000 (+0000) Subject: (no commit message) X-Git-Url: https://git.jsancho.org/?a=commitdiff_plain;h=95754ea480991d1ccc6bbfc423aca316585cdce4;p=gacela.git --- 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