src/video/SDL_renderer_gles.c
changeset 3163 a252014ce27d
parent 3161 494559cc723b
child 3165 7168651d5706
equal deleted inserted replaced
3162:dc1eb82ffdaa 3163:a252014ce27d
    28 #include "SDL_sysvideo.h"
    28 #include "SDL_sysvideo.h"
    29 #include "SDL_pixels_c.h"
    29 #include "SDL_pixels_c.h"
    30 #include "SDL_rect_c.h"
    30 #include "SDL_rect_c.h"
    31 #include "SDL_yuv_sw_c.h"
    31 #include "SDL_yuv_sw_c.h"
    32 
    32 
    33 #ifdef __QNXNTO__
    33 #if defined(SDL_VIDEO_DRIVER_QNXGF) || defined(SDL_VIDEO_DRIVER_PHOTON)
    34 
    34 
    35 /* Empty function stub to get OpenGL ES 1.0 support without  */
    35 /* Empty function stub to get OpenGL ES 1.0 support without  */
    36 /* OpenGL ES extension GL_OES_draw_texture_supported         */
    36 /* OpenGL ES extension GL_OES_draw_texture_supported         */
    37 GL_API void GL_APIENTRY
    37 GL_API void GL_APIENTRY
    38 glDrawTexiOES(GLint x, GLint y, GLint z, GLint width, GLint height)
    38 glDrawTexiOES(GLint x, GLint y, GLint z, GLint width, GLint height)
   108      (SDL_TEXTUREMODULATE_NONE | SDL_TEXTUREMODULATE_COLOR |
   108      (SDL_TEXTUREMODULATE_NONE | SDL_TEXTUREMODULATE_COLOR |
   109       SDL_TEXTUREMODULATE_ALPHA),
   109       SDL_TEXTUREMODULATE_ALPHA),
   110      (SDL_BLENDMODE_NONE | SDL_BLENDMODE_MASK |
   110      (SDL_BLENDMODE_NONE | SDL_BLENDMODE_MASK |
   111       SDL_BLENDMODE_BLEND | SDL_BLENDMODE_ADD | SDL_BLENDMODE_MOD),
   111       SDL_BLENDMODE_BLEND | SDL_BLENDMODE_ADD | SDL_BLENDMODE_MOD),
   112      (SDL_TEXTURESCALEMODE_NONE | SDL_TEXTURESCALEMODE_FAST |
   112      (SDL_TEXTURESCALEMODE_NONE | SDL_TEXTURESCALEMODE_FAST |
   113       SDL_TEXTURESCALEMODE_SLOW), 2,
   113       SDL_TEXTURESCALEMODE_SLOW), 5,
   114      {
   114      {
   115       /* OpenGL ES 1.x supported formats list */
   115       /* OpenGL ES 1.x supported formats list */
       
   116       SDL_PIXELFORMAT_ABGR4444,
       
   117       SDL_PIXELFORMAT_ABGR1555,
       
   118       SDL_PIXELFORMAT_BGR565,
   116       SDL_PIXELFORMAT_BGR24,
   119       SDL_PIXELFORMAT_BGR24,
   117       SDL_PIXELFORMAT_ABGR8888},
   120       SDL_PIXELFORMAT_ABGR8888},
   118      0,
   121      0,
   119      0}
   122      0}
   120 };
   123 };
   382     case SDL_PIXELFORMAT_ABGR8888:
   385     case SDL_PIXELFORMAT_ABGR8888:
   383         internalFormat = GL_RGBA;
   386         internalFormat = GL_RGBA;
   384         format = GL_RGBA;
   387         format = GL_RGBA;
   385         type = GL_UNSIGNED_BYTE;
   388         type = GL_UNSIGNED_BYTE;
   386         break;
   389         break;
   387         /*
   390     case SDL_PIXELFORMAT_BGR565:
   388            These formats would be supported if SDL had the necessary pixel formats
   391         internalFormat = GL_RGB;
   389            case SDL_PIXELFORMAT_BGR565:
   392         format = GL_RGB;
   390            internalFormat = GL_RGB;
   393         type = GL_UNSIGNED_SHORT_5_6_5;
   391            format = GL_RGB;
   394         break;
   392            type = GL_UNSIGNED_SHORT_5_6_5;
   395     case SDL_PIXELFORMAT_ABGR1555:
   393            break;                       
   396         internalFormat = GL_RGBA;
   394            case SDL_PIXELFORMAT_ABGR5551:
   397         format = GL_RGBA;
   395            internalFormat = GL_RGBA;
   398         type = GL_UNSIGNED_SHORT_5_5_5_1;
   396            format = GL_RGBA;
   399         break;
   397            type = GL_UNSIGNED_SHORT_5_5_5_1;
   400     case SDL_PIXELFORMAT_ABGR4444:
   398            break;
   401         internalFormat = GL_RGBA;
   399            case SDL_PIXELFORMAT_ABGR4444:
   402         format = GL_RGBA;
   400            internalFormat = GL_RGBA;
   403         type = GL_UNSIGNED_SHORT_4_4_4_4;
   401            format = GL_RGBA;
   404         break;
   402            type = GL_UNSIGNED_SHORT_4_4_4_4;
       
   403            break;
       
   404          */
       
   405     default:
   405     default:
   406         SDL_SetError("Unsupported texture format");
   406         SDL_SetError("Unsupported texture format");
   407         return -1;
   407         return -1;
   408     }
   408     }
   409 
   409