comparison src/video/qnxgf/SDL_gf_pixelfmt.c @ 3087:0b6f51c29267

Date: Wed, 4 Mar 2009 15:38:22 +0200 From: "Mike Gorchak" Subject: Re: About QNX support in SDL 1.3 Here is another batch of patches. 1) Makefile.in - added SDL_opengles.h header as header to install. 2) configure.in - Added special define to detect Common Lite OpenGL ES library in case if Common library is not installed. Added check for clock_gettime in libc (in QNX it is in libc). 3) SDL_config.h.in - Added SDL_VIDEO_RENDER_OPENGL_ES and SDL_VIDEO_OPENGL_ES declarations for configure script autodetection. 4) SDL_opengles.h - Added GL_API definition if it is not defined. Added extension GL_OES_draw_texture because OpenGL ES Renderer uses it without declaration. Added GL_OES_vertex_buffer_object extension, which is supported under QNX OpenGL ES. Added GL_OES_single_precision extension. 5) To the test directory I've added building OpenGL ES test applications through the autotools suite. Was support for iPhone IDE building only.
author Sam Lantinga <slouken@libsdl.org>
date Wed, 04 Mar 2009 15:10:47 +0000
parents
children cad1aefa2ed9
comparison
equal deleted inserted replaced
3086:0102ed19c21a 3087:0b6f51c29267
1 /*
2 SDL - Simple DirectMedia Layer
3 Copyright (C) 1997-2009 Sam Lantinga
4
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
9
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
14
15 You should have received a copy of the GNU Lesser General Public
16 License along with this library; if not, write to the Free Software
17 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18
19 Sam Lantinga
20 slouken@libsdl.org
21 */
22
23 #include "SDL_config.h"
24 #include "SDL_gf_pixelfmt.h"
25
26 gf_format_t qnxgf_sdl_to_gf_pixelformat(uint32_t pixelfmt)
27 {
28 switch(pixelfmt)
29 {
30 case SDL_PIXELFORMAT_INDEX8:
31 {
32 return GF_FORMAT_PAL8;
33 }
34 break;
35 case SDL_PIXELFORMAT_ARGB1555:
36 {
37 return GF_FORMAT_PACK_ARGB1555;
38 }
39 break;
40 case SDL_PIXELFORMAT_ABGR1555:
41 {
42 return GF_FORMAT_PACK_ARGB1555;
43 }
44 break;
45 case SDL_PIXELFORMAT_RGB565:
46 {
47 return GF_FORMAT_PACK_RGB565;
48 }
49 break;
50 case SDL_PIXELFORMAT_RGB888:
51 {
52 return GF_FORMAT_BGR888;
53 }
54 break;
55 case SDL_PIXELFORMAT_BGRA8888:
56 {
57 return GF_FORMAT_BGRA8888;
58 }
59 break;
60 case SDL_PIXELFORMAT_ARGB8888:
61 {
62 return GF_FORMAT_ARGB8888;
63 }
64 break;
65 case SDL_PIXELFORMAT_YV12:
66 {
67 return GF_FORMAT_PLANAR_YUV_YV12;
68 }
69 break;
70 case SDL_PIXELFORMAT_YUY2:
71 {
72 return GF_FORMAT_PACK_YUV_YUY2;
73 }
74 break;
75 case SDL_PIXELFORMAT_UYVY:
76 {
77 return GF_FORMAT_PACK_YUV_UYVY;
78 }
79 break;
80 case SDL_PIXELFORMAT_YVYU:
81 {
82 return GF_FORMAT_PACK_YUV_YVYU;
83 }
84 break;
85 }
86
87 return GF_FORMAT_INVALID;
88 }
89
90 uint32_t qnxgf_gf_to_sdl_pixelformat(gf_format_t pixelfmt)
91 {
92 switch(pixelfmt)
93 {
94 case GF_FORMAT_PAL8:
95 {
96 return SDL_PIXELFORMAT_INDEX8;
97 }
98 break;
99 case GF_FORMAT_PKLE_ARGB1555:
100 {
101 return SDL_PIXELFORMAT_ARGB1555;
102 }
103 break;
104 case GF_FORMAT_PACK_ARGB1555:
105 {
106 return SDL_PIXELFORMAT_ARGB1555;
107 }
108 break;
109 case GF_FORMAT_PKBE_ARGB1555:
110 {
111 return SDL_PIXELFORMAT_ABGR1555;
112 }
113 break;
114 case GF_FORMAT_PKBE_RGB565:
115 {
116 return SDL_PIXELFORMAT_RGB565;
117 }
118 break;
119 case GF_FORMAT_PKLE_RGB565:
120 {
121 return SDL_PIXELFORMAT_RGB565;
122 }
123 break;
124 case GF_FORMAT_PACK_RGB565:
125 {
126 return SDL_PIXELFORMAT_RGB565;
127 }
128 break;
129 case GF_FORMAT_BGR888:
130 {
131 return SDL_PIXELFORMAT_RGB888;
132 }
133 break;
134 case GF_FORMAT_BGRA8888:
135 {
136 return SDL_PIXELFORMAT_BGRA8888;
137 }
138 break;
139 case GF_FORMAT_ARGB8888:
140 {
141 return SDL_PIXELFORMAT_ARGB8888;
142 }
143 break;
144
145 case GF_FORMAT_PLANAR_YUV_YV12:
146 {
147 return SDL_PIXELFORMAT_YV12;
148 }
149 break;
150 case GF_FORMAT_PACK_YUV_YUY2:
151 {
152 return SDL_PIXELFORMAT_YUY2;
153 }
154 break;
155 case GF_FORMAT_PACK_YUV_UYVY:
156 {
157 return SDL_PIXELFORMAT_UYVY;
158 }
159 break;
160 case GF_FORMAT_PACK_YUV_YVYU:
161 {
162 return SDL_PIXELFORMAT_YVYU;
163 }
164 break;
165 }
166
167 return SDL_PIXELFORMAT_UNKNOWN;
168 }