comparison src/video/SDL_renderer_gl.c @ 2778:38dfc890ee6b

Preliminary support for YUV textures
author Sam Lantinga <slouken@libsdl.org>
date Sat, 22 Nov 2008 06:59:22 +0000
parents 91e601d9df8b
children 7af8c4ad427e
comparison
equal deleted inserted replaced
2777:6f260584df22 2778:38dfc890ee6b
31 #include "SDL_yuv_sw_c.h" 31 #include "SDL_yuv_sw_c.h"
32 32
33 #ifdef __MACOSX__ 33 #ifdef __MACOSX__
34 #include <OpenGL/OpenGL.h> 34 #include <OpenGL/OpenGL.h>
35 #endif 35 #endif
36
36 37
37 /* OpenGL renderer implementation */ 38 /* OpenGL renderer implementation */
38 39
39 /* Details on optimizing the texture path on Mac OS X: 40 /* Details on optimizing the texture path on Mac OS X:
40 http://developer.apple.com/documentation/GraphicsImaging/Conceptual/OpenGL-MacProgGuide/opengl_texturedata/chapter_10_section_2.html 41 http://developer.apple.com/documentation/GraphicsImaging/Conceptual/OpenGL-MacProgGuide/opengl_texturedata/chapter_10_section_2.html
110 SDL_PIXELFORMAT_BGR24, 111 SDL_PIXELFORMAT_BGR24,
111 SDL_PIXELFORMAT_RGB888, 112 SDL_PIXELFORMAT_RGB888,
112 SDL_PIXELFORMAT_BGR888, 113 SDL_PIXELFORMAT_BGR888,
113 SDL_PIXELFORMAT_ARGB8888, 114 SDL_PIXELFORMAT_ARGB8888,
114 SDL_PIXELFORMAT_ABGR8888, 115 SDL_PIXELFORMAT_ABGR8888,
115 SDL_PIXELFORMAT_ARGB2101010}, 116 SDL_PIXELFORMAT_ARGB2101010,
117 SDL_PIXELFORMAT_UYVY},
116 0, 118 0,
117 0} 119 0}
118 }; 120 };
119 121
120 typedef struct 122 typedef struct
499 break; 501 break;
500 case SDL_PIXELFORMAT_ARGB2101010: 502 case SDL_PIXELFORMAT_ARGB2101010:
501 internalFormat = GL_RGB10_A2; 503 internalFormat = GL_RGB10_A2;
502 format = GL_BGRA; 504 format = GL_BGRA;
503 type = GL_UNSIGNED_INT_2_10_10_10_REV; 505 type = GL_UNSIGNED_INT_2_10_10_10_REV;
506 break;
507 case SDL_PIXELFORMAT_UYVY:
508 // if (renderdata->GL_MESA_ycbcr_texture) {
509 // internalFormat = 3;
510 // format = GL_YCBCR_MESA;
511 // type = GL_UNSIGNED_SHORT_8_8_MESA;
512 // } else if (renderdata->GL_APPLE_ycbcr_422) {
513 internalFormat = GL_RGB8;
514 format = GL_YCBCR_422_APPLE;
515 type = GL_UNSIGNED_SHORT_8_8_APPLE;
516 // } else {
517 // SDL_SetError("Unsupported texture format");
518 // return -1;
519 // }
504 break; 520 break;
505 default: 521 default:
506 SDL_SetError("Unsupported texture format"); 522 SDL_SetError("Unsupported texture format");
507 return -1; 523 return -1;
508 } 524 }