src/video/SDL_renderer_gles.c
changeset 3165 7168651d5706
parent 3163 a252014ce27d
child 3169 f294338ca6eb
     1.1 --- a/src/video/SDL_renderer_gles.c	Thu Jun 04 21:00:45 2009 +0000
     1.2 +++ b/src/video/SDL_renderer_gles.c	Fri Jun 05 07:30:51 2009 +0000
     1.3 @@ -30,25 +30,24 @@
     1.4  #include "SDL_rect_c.h"
     1.5  #include "SDL_yuv_sw_c.h"
     1.6  
     1.7 -#if defined(SDL_VIDEO_DRIVER_QNXGF) || defined(SDL_VIDEO_DRIVER_PHOTON)
     1.8 +#if defined(__QNXNTO__)
     1.9 +/* Include QNX system header to check QNX version later */
    1.10 +#include <sys/neutrino.h>
    1.11 +#endif /* __QNXNTO__ */
    1.12  
    1.13 -/* Empty function stub to get OpenGL ES 1.0 support without  */
    1.14 -/* OpenGL ES extension GL_OES_draw_texture_supported         */
    1.15 +#if defined(SDL_VIDEO_DRIVER_QNXGF)  ||  \
    1.16 +    defined(SDL_VIDEO_DRIVER_PHOTON) ||  \
    1.17 +    defined(SDL_VIDEO_DRIVER_PANDORA)
    1.18 +
    1.19 +/* Empty function stub to get OpenGL ES 1.x support without  */
    1.20 +/* OpenGL ES extension GL_OES_draw_texture supported         */
    1.21  GL_API void GL_APIENTRY
    1.22  glDrawTexiOES(GLint x, GLint y, GLint z, GLint width, GLint height)
    1.23  {
    1.24      return;
    1.25  }
    1.26  
    1.27 -#endif /* __QNXNTO__ */
    1.28 -
    1.29 -#if SDL_VIDEO_DRIVER_PANDORA
    1.30 -GL_API void GL_APIENTRY
    1.31 -glDrawTexiOES(GLint x, GLint y, GLint z, GLint width, GLint height)
    1.32 -{
    1.33 -    return;
    1.34 -}
    1.35 -#endif /* SDL_VIDEO_DRIVER_PANDORA */
    1.36 +#endif /* QNXGF || PHOTON || PANDORA */
    1.37  
    1.38  /* OpenGL ES 1.1 renderer implementation, based on the OpenGL renderer */
    1.39  
    1.40 @@ -262,10 +261,19 @@
    1.41      renderer->window = window->id;
    1.42      renderer->driverdata = data;
    1.43  
    1.44 -
    1.45      renderer->info.flags =
    1.46          (SDL_RENDERER_PRESENTDISCARD | SDL_RENDERER_ACCELERATED);
    1.47  
    1.48 +#if defined(__QNXNTO__)
    1.49 +#if _NTO_VERSION<=641
    1.50 +    /* QNX's OpenGL ES implementation is broken regarding             */
    1.51 +    /* packed textures support, affected versions 6.3.2, 6.4.0, 6.4.1 */
    1.52 +    renderer->info.num_texture_formats=2;
    1.53 +    renderer->info.texture_formats[0]=SDL_PIXELFORMAT_ABGR8888;
    1.54 +    renderer->info.texture_formats[1]=SDL_PIXELFORMAT_BGR24;
    1.55 +#endif /* _NTO_VERSION */
    1.56 +#endif /* __QNXNTO__ */
    1.57 +
    1.58      if (GLES_LoadFunctions(data) < 0) {
    1.59          GLES_DestroyRenderer(renderer);
    1.60          return NULL;
    1.61 @@ -403,7 +411,7 @@
    1.62          type = GL_UNSIGNED_SHORT_4_4_4_4;
    1.63          break;
    1.64      default:
    1.65 -        SDL_SetError("Unsupported texture format");
    1.66 +        SDL_SetError("Unsupported by OpenGL ES texture format");
    1.67          return -1;
    1.68      }
    1.69