From 43943415bbc020631136c1a56d073eb147910a66 Mon Sep 17 00:00:00 2001 From: Mike Gorchak Date: Fri, 5 Jun 2009 07:30:51 +0000 Subject: [PATCH] QNX quirk has been added, QNX OpenGL ES implementation is broken regarding support of textures with packed pixel formats. --- src/video/SDL_renderer_gles.c | 36 +++++++++++++++++++++-------------- 1 file changed, 22 insertions(+), 14 deletions(-) diff --git a/src/video/SDL_renderer_gles.c b/src/video/SDL_renderer_gles.c index da04091b7..ce903e6e3 100644 --- a/src/video/SDL_renderer_gles.c +++ b/src/video/SDL_renderer_gles.c @@ -30,25 +30,24 @@ #include "SDL_rect_c.h" #include "SDL_yuv_sw_c.h" -#if defined(SDL_VIDEO_DRIVER_QNXGF) || defined(SDL_VIDEO_DRIVER_PHOTON) - -/* Empty function stub to get OpenGL ES 1.0 support without */ -/* OpenGL ES extension GL_OES_draw_texture_supported */ -GL_API void GL_APIENTRY -glDrawTexiOES(GLint x, GLint y, GLint z, GLint width, GLint height) -{ - return; -} - +#if defined(__QNXNTO__) +/* Include QNX system header to check QNX version later */ +#include #endif /* __QNXNTO__ */ -#if SDL_VIDEO_DRIVER_PANDORA +#if defined(SDL_VIDEO_DRIVER_QNXGF) || \ + defined(SDL_VIDEO_DRIVER_PHOTON) || \ + defined(SDL_VIDEO_DRIVER_PANDORA) + +/* Empty function stub to get OpenGL ES 1.x support without */ +/* OpenGL ES extension GL_OES_draw_texture supported */ GL_API void GL_APIENTRY glDrawTexiOES(GLint x, GLint y, GLint z, GLint width, GLint height) { return; } -#endif /* SDL_VIDEO_DRIVER_PANDORA */ + +#endif /* QNXGF || PHOTON || PANDORA */ /* OpenGL ES 1.1 renderer implementation, based on the OpenGL renderer */ @@ -262,10 +261,19 @@ GLES_CreateRenderer(SDL_Window * window, Uint32 flags) renderer->window = window->id; renderer->driverdata = data; - renderer->info.flags = (SDL_RENDERER_PRESENTDISCARD | SDL_RENDERER_ACCELERATED); +#if defined(__QNXNTO__) +#if _NTO_VERSION<=641 + /* QNX's OpenGL ES implementation is broken regarding */ + /* packed textures support, affected versions 6.3.2, 6.4.0, 6.4.1 */ + renderer->info.num_texture_formats=2; + renderer->info.texture_formats[0]=SDL_PIXELFORMAT_ABGR8888; + renderer->info.texture_formats[1]=SDL_PIXELFORMAT_BGR24; +#endif /* _NTO_VERSION */ +#endif /* __QNXNTO__ */ + if (GLES_LoadFunctions(data) < 0) { GLES_DestroyRenderer(renderer); return NULL; @@ -403,7 +411,7 @@ GLES_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture) type = GL_UNSIGNED_SHORT_4_4_4_4; break; default: - SDL_SetError("Unsupported texture format"); + SDL_SetError("Unsupported by OpenGL ES texture format"); return -1; }