Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
QNX quirk has been added, QNX OpenGL ES implementation is broken rega…
Browse files Browse the repository at this point in the history
…rding support of textures with packed pixel formats.
  • Loading branch information
llmike committed Jun 5, 2009
1 parent cbee37e commit 4394341
Showing 1 changed file with 22 additions and 14 deletions.
36 changes: 22 additions & 14 deletions src/video/SDL_renderer_gles.c
Expand Up @@ -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 <sys/neutrino.h>
#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 */

Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}

Expand Down

0 comments on commit 4394341

Please sign in to comment.