annotate src/video/photon/SDL_photon_pixelfmt.c @ 3443:7f477a22dff5

Trying to figure out why the OpenGL tests are failing...
author Sam Lantinga <slouken@libsdl.org>
date Wed, 18 Nov 2009 06:15:44 +0000
parents f96615051c8c
children f7b03b6838cb
rev   line source
3108
aa1897bee1e9 Continue working on QNX Photon with OpenGL ES support
Mike Gorchak <lestat@i.com.ua>
parents:
diff changeset
1 /*
aa1897bee1e9 Continue working on QNX Photon with OpenGL ES support
Mike Gorchak <lestat@i.com.ua>
parents:
diff changeset
2 SDL - Simple DirectMedia Layer
aa1897bee1e9 Continue working on QNX Photon with OpenGL ES support
Mike Gorchak <lestat@i.com.ua>
parents:
diff changeset
3 Copyright (C) 1997-2009 Sam Lantinga
aa1897bee1e9 Continue working on QNX Photon with OpenGL ES support
Mike Gorchak <lestat@i.com.ua>
parents:
diff changeset
4
aa1897bee1e9 Continue working on QNX Photon with OpenGL ES support
Mike Gorchak <lestat@i.com.ua>
parents:
diff changeset
5 This library is free software; you can redistribute it and/or
aa1897bee1e9 Continue working on QNX Photon with OpenGL ES support
Mike Gorchak <lestat@i.com.ua>
parents:
diff changeset
6 modify it under the terms of the GNU Lesser General Public
aa1897bee1e9 Continue working on QNX Photon with OpenGL ES support
Mike Gorchak <lestat@i.com.ua>
parents:
diff changeset
7 License as published by the Free Software Foundation; either
aa1897bee1e9 Continue working on QNX Photon with OpenGL ES support
Mike Gorchak <lestat@i.com.ua>
parents:
diff changeset
8 version 2.1 of the License, or (at your option) any later version.
aa1897bee1e9 Continue working on QNX Photon with OpenGL ES support
Mike Gorchak <lestat@i.com.ua>
parents:
diff changeset
9
aa1897bee1e9 Continue working on QNX Photon with OpenGL ES support
Mike Gorchak <lestat@i.com.ua>
parents:
diff changeset
10 This library is distributed in the hope that it will be useful,
aa1897bee1e9 Continue working on QNX Photon with OpenGL ES support
Mike Gorchak <lestat@i.com.ua>
parents:
diff changeset
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
aa1897bee1e9 Continue working on QNX Photon with OpenGL ES support
Mike Gorchak <lestat@i.com.ua>
parents:
diff changeset
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
aa1897bee1e9 Continue working on QNX Photon with OpenGL ES support
Mike Gorchak <lestat@i.com.ua>
parents:
diff changeset
13 Lesser General Public License for more details.
aa1897bee1e9 Continue working on QNX Photon with OpenGL ES support
Mike Gorchak <lestat@i.com.ua>
parents:
diff changeset
14
aa1897bee1e9 Continue working on QNX Photon with OpenGL ES support
Mike Gorchak <lestat@i.com.ua>
parents:
diff changeset
15 You should have received a copy of the GNU Lesser General Public
aa1897bee1e9 Continue working on QNX Photon with OpenGL ES support
Mike Gorchak <lestat@i.com.ua>
parents:
diff changeset
16 License along with this library; if not, write to the Free Software
aa1897bee1e9 Continue working on QNX Photon with OpenGL ES support
Mike Gorchak <lestat@i.com.ua>
parents:
diff changeset
17 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
aa1897bee1e9 Continue working on QNX Photon with OpenGL ES support
Mike Gorchak <lestat@i.com.ua>
parents:
diff changeset
18
aa1897bee1e9 Continue working on QNX Photon with OpenGL ES support
Mike Gorchak <lestat@i.com.ua>
parents:
diff changeset
19 Sam Lantinga
aa1897bee1e9 Continue working on QNX Photon with OpenGL ES support
Mike Gorchak <lestat@i.com.ua>
parents:
diff changeset
20 slouken@libsdl.org
aa1897bee1e9 Continue working on QNX Photon with OpenGL ES support
Mike Gorchak <lestat@i.com.ua>
parents:
diff changeset
21
aa1897bee1e9 Continue working on QNX Photon with OpenGL ES support
Mike Gorchak <lestat@i.com.ua>
parents:
diff changeset
22 QNX Photon GUI SDL driver
aa1897bee1e9 Continue working on QNX Photon with OpenGL ES support
Mike Gorchak <lestat@i.com.ua>
parents:
diff changeset
23 Copyright (C) 2009 Mike Gorchak
aa1897bee1e9 Continue working on QNX Photon with OpenGL ES support
Mike Gorchak <lestat@i.com.ua>
parents:
diff changeset
24 (mike@malva.ua, lestat@i.com.ua)
aa1897bee1e9 Continue working on QNX Photon with OpenGL ES support
Mike Gorchak <lestat@i.com.ua>
parents:
diff changeset
25 */
aa1897bee1e9 Continue working on QNX Photon with OpenGL ES support
Mike Gorchak <lestat@i.com.ua>
parents:
diff changeset
26
aa1897bee1e9 Continue working on QNX Photon with OpenGL ES support
Mike Gorchak <lestat@i.com.ua>
parents:
diff changeset
27 #include "SDL_photon_pixelfmt.h"
aa1897bee1e9 Continue working on QNX Photon with OpenGL ES support
Mike Gorchak <lestat@i.com.ua>
parents:
diff changeset
28
3139
Sam Lantinga <slouken@libsdl.org>
parents: 3108
diff changeset
29 uint32_t
Sam Lantinga <slouken@libsdl.org>
parents: 3108
diff changeset
30 photon_bits_to_sdl_pixelformat(uint32_t pixelfmt)
3108
aa1897bee1e9 Continue working on QNX Photon with OpenGL ES support
Mike Gorchak <lestat@i.com.ua>
parents:
diff changeset
31 {
3139
Sam Lantinga <slouken@libsdl.org>
parents: 3108
diff changeset
32 switch (pixelfmt) {
Sam Lantinga <slouken@libsdl.org>
parents: 3108
diff changeset
33 case 8:
Sam Lantinga <slouken@libsdl.org>
parents: 3108
diff changeset
34 {
Sam Lantinga <slouken@libsdl.org>
parents: 3108
diff changeset
35 return SDL_PIXELFORMAT_INDEX8;
Sam Lantinga <slouken@libsdl.org>
parents: 3108
diff changeset
36 }
Sam Lantinga <slouken@libsdl.org>
parents: 3108
diff changeset
37 break;
Sam Lantinga <slouken@libsdl.org>
parents: 3108
diff changeset
38 case 15:
Sam Lantinga <slouken@libsdl.org>
parents: 3108
diff changeset
39 {
Sam Lantinga <slouken@libsdl.org>
parents: 3108
diff changeset
40 return SDL_PIXELFORMAT_ARGB1555;
Sam Lantinga <slouken@libsdl.org>
parents: 3108
diff changeset
41 }
Sam Lantinga <slouken@libsdl.org>
parents: 3108
diff changeset
42 break;
Sam Lantinga <slouken@libsdl.org>
parents: 3108
diff changeset
43 case 16:
Sam Lantinga <slouken@libsdl.org>
parents: 3108
diff changeset
44 {
Sam Lantinga <slouken@libsdl.org>
parents: 3108
diff changeset
45 return SDL_PIXELFORMAT_RGB565;
Sam Lantinga <slouken@libsdl.org>
parents: 3108
diff changeset
46 }
Sam Lantinga <slouken@libsdl.org>
parents: 3108
diff changeset
47 break;
Sam Lantinga <slouken@libsdl.org>
parents: 3108
diff changeset
48 case 24:
Sam Lantinga <slouken@libsdl.org>
parents: 3108
diff changeset
49 {
Sam Lantinga <slouken@libsdl.org>
parents: 3108
diff changeset
50 return SDL_PIXELFORMAT_RGB888;
Sam Lantinga <slouken@libsdl.org>
parents: 3108
diff changeset
51 }
Sam Lantinga <slouken@libsdl.org>
parents: 3108
diff changeset
52 break;
Sam Lantinga <slouken@libsdl.org>
parents: 3108
diff changeset
53 case 32:
Sam Lantinga <slouken@libsdl.org>
parents: 3108
diff changeset
54 {
Sam Lantinga <slouken@libsdl.org>
parents: 3108
diff changeset
55 return SDL_PIXELFORMAT_ARGB8888;
Sam Lantinga <slouken@libsdl.org>
parents: 3108
diff changeset
56 }
Sam Lantinga <slouken@libsdl.org>
parents: 3108
diff changeset
57 break;
Sam Lantinga <slouken@libsdl.org>
parents: 3108
diff changeset
58 }
3108
aa1897bee1e9 Continue working on QNX Photon with OpenGL ES support
Mike Gorchak <lestat@i.com.ua>
parents:
diff changeset
59 }
aa1897bee1e9 Continue working on QNX Photon with OpenGL ES support
Mike Gorchak <lestat@i.com.ua>
parents:
diff changeset
60
3139
Sam Lantinga <slouken@libsdl.org>
parents: 3108
diff changeset
61 uint32_t
Sam Lantinga <slouken@libsdl.org>
parents: 3108
diff changeset
62 photon_sdl_to_bits_pixelformat(uint32_t pixelfmt)
3108
aa1897bee1e9 Continue working on QNX Photon with OpenGL ES support
Mike Gorchak <lestat@i.com.ua>
parents:
diff changeset
63 {
3139
Sam Lantinga <slouken@libsdl.org>
parents: 3108
diff changeset
64 switch (pixelfmt) {
Sam Lantinga <slouken@libsdl.org>
parents: 3108
diff changeset
65 case SDL_PIXELFORMAT_INDEX8:
Sam Lantinga <slouken@libsdl.org>
parents: 3108
diff changeset
66 {
Sam Lantinga <slouken@libsdl.org>
parents: 3108
diff changeset
67 return 8;
Sam Lantinga <slouken@libsdl.org>
parents: 3108
diff changeset
68 }
Sam Lantinga <slouken@libsdl.org>
parents: 3108
diff changeset
69 break;
Sam Lantinga <slouken@libsdl.org>
parents: 3108
diff changeset
70 case SDL_PIXELFORMAT_ARGB1555:
Sam Lantinga <slouken@libsdl.org>
parents: 3108
diff changeset
71 {
Sam Lantinga <slouken@libsdl.org>
parents: 3108
diff changeset
72 return 15;
Sam Lantinga <slouken@libsdl.org>
parents: 3108
diff changeset
73 }
Sam Lantinga <slouken@libsdl.org>
parents: 3108
diff changeset
74 break;
3185
44d5474c2c8a Continue working on QNX GF and Photon support.
Mike Gorchak <lestat@i.com.ua>
parents: 3139
diff changeset
75 case SDL_PIXELFORMAT_RGB555:
44d5474c2c8a Continue working on QNX GF and Photon support.
Mike Gorchak <lestat@i.com.ua>
parents: 3139
diff changeset
76 {
44d5474c2c8a Continue working on QNX GF and Photon support.
Mike Gorchak <lestat@i.com.ua>
parents: 3139
diff changeset
77 return 15;
44d5474c2c8a Continue working on QNX GF and Photon support.
Mike Gorchak <lestat@i.com.ua>
parents: 3139
diff changeset
78 }
44d5474c2c8a Continue working on QNX GF and Photon support.
Mike Gorchak <lestat@i.com.ua>
parents: 3139
diff changeset
79 break;
3139
Sam Lantinga <slouken@libsdl.org>
parents: 3108
diff changeset
80 case SDL_PIXELFORMAT_ABGR1555:
Sam Lantinga <slouken@libsdl.org>
parents: 3108
diff changeset
81 {
Sam Lantinga <slouken@libsdl.org>
parents: 3108
diff changeset
82 return 15;
Sam Lantinga <slouken@libsdl.org>
parents: 3108
diff changeset
83 }
Sam Lantinga <slouken@libsdl.org>
parents: 3108
diff changeset
84 break;
Sam Lantinga <slouken@libsdl.org>
parents: 3108
diff changeset
85 case SDL_PIXELFORMAT_RGB565:
Sam Lantinga <slouken@libsdl.org>
parents: 3108
diff changeset
86 {
Sam Lantinga <slouken@libsdl.org>
parents: 3108
diff changeset
87 return 16;
Sam Lantinga <slouken@libsdl.org>
parents: 3108
diff changeset
88 }
Sam Lantinga <slouken@libsdl.org>
parents: 3108
diff changeset
89 break;
3185
44d5474c2c8a Continue working on QNX GF and Photon support.
Mike Gorchak <lestat@i.com.ua>
parents: 3139
diff changeset
90 case SDL_PIXELFORMAT_RGB24:
44d5474c2c8a Continue working on QNX GF and Photon support.
Mike Gorchak <lestat@i.com.ua>
parents: 3139
diff changeset
91 {
44d5474c2c8a Continue working on QNX GF and Photon support.
Mike Gorchak <lestat@i.com.ua>
parents: 3139
diff changeset
92 return 24;
44d5474c2c8a Continue working on QNX GF and Photon support.
Mike Gorchak <lestat@i.com.ua>
parents: 3139
diff changeset
93 }
44d5474c2c8a Continue working on QNX GF and Photon support.
Mike Gorchak <lestat@i.com.ua>
parents: 3139
diff changeset
94 break;
3139
Sam Lantinga <slouken@libsdl.org>
parents: 3108
diff changeset
95 case SDL_PIXELFORMAT_RGB888:
Sam Lantinga <slouken@libsdl.org>
parents: 3108
diff changeset
96 {
3185
44d5474c2c8a Continue working on QNX GF and Photon support.
Mike Gorchak <lestat@i.com.ua>
parents: 3139
diff changeset
97 return 32;
3139
Sam Lantinga <slouken@libsdl.org>
parents: 3108
diff changeset
98 }
Sam Lantinga <slouken@libsdl.org>
parents: 3108
diff changeset
99 break;
Sam Lantinga <slouken@libsdl.org>
parents: 3108
diff changeset
100 case SDL_PIXELFORMAT_BGRA8888:
Sam Lantinga <slouken@libsdl.org>
parents: 3108
diff changeset
101 {
Sam Lantinga <slouken@libsdl.org>
parents: 3108
diff changeset
102 return 32;
Sam Lantinga <slouken@libsdl.org>
parents: 3108
diff changeset
103 }
Sam Lantinga <slouken@libsdl.org>
parents: 3108
diff changeset
104 break;
Sam Lantinga <slouken@libsdl.org>
parents: 3108
diff changeset
105 case SDL_PIXELFORMAT_ARGB8888:
Sam Lantinga <slouken@libsdl.org>
parents: 3108
diff changeset
106 {
Sam Lantinga <slouken@libsdl.org>
parents: 3108
diff changeset
107 return 32;
Sam Lantinga <slouken@libsdl.org>
parents: 3108
diff changeset
108 }
Sam Lantinga <slouken@libsdl.org>
parents: 3108
diff changeset
109 break;
Sam Lantinga <slouken@libsdl.org>
parents: 3108
diff changeset
110 case SDL_PIXELFORMAT_YV12:
Sam Lantinga <slouken@libsdl.org>
parents: 3108
diff changeset
111 {
Sam Lantinga <slouken@libsdl.org>
parents: 3108
diff changeset
112 return 8;
Sam Lantinga <slouken@libsdl.org>
parents: 3108
diff changeset
113 }
Sam Lantinga <slouken@libsdl.org>
parents: 3108
diff changeset
114 break;
Sam Lantinga <slouken@libsdl.org>
parents: 3108
diff changeset
115 case SDL_PIXELFORMAT_YUY2:
Sam Lantinga <slouken@libsdl.org>
parents: 3108
diff changeset
116 {
Sam Lantinga <slouken@libsdl.org>
parents: 3108
diff changeset
117 return 16;
Sam Lantinga <slouken@libsdl.org>
parents: 3108
diff changeset
118 }
Sam Lantinga <slouken@libsdl.org>
parents: 3108
diff changeset
119 break;
Sam Lantinga <slouken@libsdl.org>
parents: 3108
diff changeset
120 case SDL_PIXELFORMAT_UYVY:
Sam Lantinga <slouken@libsdl.org>
parents: 3108
diff changeset
121 {
Sam Lantinga <slouken@libsdl.org>
parents: 3108
diff changeset
122 return 16;
Sam Lantinga <slouken@libsdl.org>
parents: 3108
diff changeset
123 }
Sam Lantinga <slouken@libsdl.org>
parents: 3108
diff changeset
124 break;
Sam Lantinga <slouken@libsdl.org>
parents: 3108
diff changeset
125 case SDL_PIXELFORMAT_YVYU:
Sam Lantinga <slouken@libsdl.org>
parents: 3108
diff changeset
126 {
Sam Lantinga <slouken@libsdl.org>
parents: 3108
diff changeset
127 return 16;
Sam Lantinga <slouken@libsdl.org>
parents: 3108
diff changeset
128 }
Sam Lantinga <slouken@libsdl.org>
parents: 3108
diff changeset
129 break;
Sam Lantinga <slouken@libsdl.org>
parents: 3108
diff changeset
130 }
3108
aa1897bee1e9 Continue working on QNX Photon with OpenGL ES support
Mike Gorchak <lestat@i.com.ua>
parents:
diff changeset
131
3139
Sam Lantinga <slouken@libsdl.org>
parents: 3108
diff changeset
132 return 0;
3108
aa1897bee1e9 Continue working on QNX Photon with OpenGL ES support
Mike Gorchak <lestat@i.com.ua>
parents:
diff changeset
133 }
aa1897bee1e9 Continue working on QNX Photon with OpenGL ES support
Mike Gorchak <lestat@i.com.ua>
parents:
diff changeset
134
3139
Sam Lantinga <slouken@libsdl.org>
parents: 3108
diff changeset
135 uint32_t
Sam Lantinga <slouken@libsdl.org>
parents: 3108
diff changeset
136 photon_image_to_sdl_pixelformat(uint32_t pixelfmt)
3108
aa1897bee1e9 Continue working on QNX Photon with OpenGL ES support
Mike Gorchak <lestat@i.com.ua>
parents:
diff changeset
137 {
3139
Sam Lantinga <slouken@libsdl.org>
parents: 3108
diff changeset
138 switch (pixelfmt) {
Sam Lantinga <slouken@libsdl.org>
parents: 3108
diff changeset
139 case Pg_IMAGE_PALETTE_BYTE:
Sam Lantinga <slouken@libsdl.org>
parents: 3108
diff changeset
140 {
Sam Lantinga <slouken@libsdl.org>
parents: 3108
diff changeset
141 return SDL_PIXELFORMAT_INDEX8;
Sam Lantinga <slouken@libsdl.org>
parents: 3108
diff changeset
142 }
Sam Lantinga <slouken@libsdl.org>
parents: 3108
diff changeset
143 break;
Sam Lantinga <slouken@libsdl.org>
parents: 3108
diff changeset
144 case Pg_IMAGE_DIRECT_8888:
Sam Lantinga <slouken@libsdl.org>
parents: 3108
diff changeset
145 {
3185
44d5474c2c8a Continue working on QNX GF and Photon support.
Mike Gorchak <lestat@i.com.ua>
parents: 3139
diff changeset
146 return SDL_PIXELFORMAT_ARGB8888;
3139
Sam Lantinga <slouken@libsdl.org>
parents: 3108
diff changeset
147 }
Sam Lantinga <slouken@libsdl.org>
parents: 3108
diff changeset
148 break;
Sam Lantinga <slouken@libsdl.org>
parents: 3108
diff changeset
149 case Pg_IMAGE_DIRECT_888:
Sam Lantinga <slouken@libsdl.org>
parents: 3108
diff changeset
150 {
3185
44d5474c2c8a Continue working on QNX GF and Photon support.
Mike Gorchak <lestat@i.com.ua>
parents: 3139
diff changeset
151 return SDL_PIXELFORMAT_RGB24;
3139
Sam Lantinga <slouken@libsdl.org>
parents: 3108
diff changeset
152 }
Sam Lantinga <slouken@libsdl.org>
parents: 3108
diff changeset
153 break;
Sam Lantinga <slouken@libsdl.org>
parents: 3108
diff changeset
154 case Pg_IMAGE_DIRECT_565:
Sam Lantinga <slouken@libsdl.org>
parents: 3108
diff changeset
155 {
Sam Lantinga <slouken@libsdl.org>
parents: 3108
diff changeset
156 return SDL_PIXELFORMAT_RGB565;
Sam Lantinga <slouken@libsdl.org>
parents: 3108
diff changeset
157 }
Sam Lantinga <slouken@libsdl.org>
parents: 3108
diff changeset
158 break;
Sam Lantinga <slouken@libsdl.org>
parents: 3108
diff changeset
159 case Pg_IMAGE_DIRECT_555:
Sam Lantinga <slouken@libsdl.org>
parents: 3108
diff changeset
160 {
Sam Lantinga <slouken@libsdl.org>
parents: 3108
diff changeset
161 return SDL_PIXELFORMAT_RGB555;
Sam Lantinga <slouken@libsdl.org>
parents: 3108
diff changeset
162 }
Sam Lantinga <slouken@libsdl.org>
parents: 3108
diff changeset
163 break;
Sam Lantinga <slouken@libsdl.org>
parents: 3108
diff changeset
164 case Pg_IMAGE_DIRECT_1555:
Sam Lantinga <slouken@libsdl.org>
parents: 3108
diff changeset
165 {
Sam Lantinga <slouken@libsdl.org>
parents: 3108
diff changeset
166 return SDL_PIXELFORMAT_ARGB1555;
Sam Lantinga <slouken@libsdl.org>
parents: 3108
diff changeset
167 }
Sam Lantinga <slouken@libsdl.org>
parents: 3108
diff changeset
168 break;
Sam Lantinga <slouken@libsdl.org>
parents: 3108
diff changeset
169 }
3108
aa1897bee1e9 Continue working on QNX Photon with OpenGL ES support
Mike Gorchak <lestat@i.com.ua>
parents:
diff changeset
170
3139
Sam Lantinga <slouken@libsdl.org>
parents: 3108
diff changeset
171 return 0;
3108
aa1897bee1e9 Continue working on QNX Photon with OpenGL ES support
Mike Gorchak <lestat@i.com.ua>
parents:
diff changeset
172 }
aa1897bee1e9 Continue working on QNX Photon with OpenGL ES support
Mike Gorchak <lestat@i.com.ua>
parents:
diff changeset
173
3139
Sam Lantinga <slouken@libsdl.org>
parents: 3108
diff changeset
174 uint32_t
Sam Lantinga <slouken@libsdl.org>
parents: 3108
diff changeset
175 photon_sdl_to_image_pixelformat(uint32_t pixelfmt)
3108
aa1897bee1e9 Continue working on QNX Photon with OpenGL ES support
Mike Gorchak <lestat@i.com.ua>
parents:
diff changeset
176 {
3139
Sam Lantinga <slouken@libsdl.org>
parents: 3108
diff changeset
177 switch (pixelfmt) {
Sam Lantinga <slouken@libsdl.org>
parents: 3108
diff changeset
178 case SDL_PIXELFORMAT_INDEX8:
Sam Lantinga <slouken@libsdl.org>
parents: 3108
diff changeset
179 {
Sam Lantinga <slouken@libsdl.org>
parents: 3108
diff changeset
180 return Pg_IMAGE_PALETTE_BYTE;
Sam Lantinga <slouken@libsdl.org>
parents: 3108
diff changeset
181 }
Sam Lantinga <slouken@libsdl.org>
parents: 3108
diff changeset
182 break;
3185
44d5474c2c8a Continue working on QNX GF and Photon support.
Mike Gorchak <lestat@i.com.ua>
parents: 3139
diff changeset
183 case SDL_PIXELFORMAT_ARGB8888:
3139
Sam Lantinga <slouken@libsdl.org>
parents: 3108
diff changeset
184 {
Sam Lantinga <slouken@libsdl.org>
parents: 3108
diff changeset
185 return Pg_IMAGE_DIRECT_8888;
Sam Lantinga <slouken@libsdl.org>
parents: 3108
diff changeset
186 }
Sam Lantinga <slouken@libsdl.org>
parents: 3108
diff changeset
187 break;
3399
f96615051c8c Working on fullscreen video modes support
Mike Gorchak <lestat@i.com.ua>
parents: 3185
diff changeset
188 case SDL_PIXELFORMAT_RGB888:
f96615051c8c Working on fullscreen video modes support
Mike Gorchak <lestat@i.com.ua>
parents: 3185
diff changeset
189 {
f96615051c8c Working on fullscreen video modes support
Mike Gorchak <lestat@i.com.ua>
parents: 3185
diff changeset
190 return Pg_IMAGE_DIRECT_8888;
f96615051c8c Working on fullscreen video modes support
Mike Gorchak <lestat@i.com.ua>
parents: 3185
diff changeset
191 }
f96615051c8c Working on fullscreen video modes support
Mike Gorchak <lestat@i.com.ua>
parents: 3185
diff changeset
192 break;
3185
44d5474c2c8a Continue working on QNX GF and Photon support.
Mike Gorchak <lestat@i.com.ua>
parents: 3139
diff changeset
193 case SDL_PIXELFORMAT_RGB24:
3139
Sam Lantinga <slouken@libsdl.org>
parents: 3108
diff changeset
194 {
Sam Lantinga <slouken@libsdl.org>
parents: 3108
diff changeset
195 return Pg_IMAGE_DIRECT_888;
Sam Lantinga <slouken@libsdl.org>
parents: 3108
diff changeset
196 }
Sam Lantinga <slouken@libsdl.org>
parents: 3108
diff changeset
197 break;
Sam Lantinga <slouken@libsdl.org>
parents: 3108
diff changeset
198 case SDL_PIXELFORMAT_RGB565:
Sam Lantinga <slouken@libsdl.org>
parents: 3108
diff changeset
199 {
Sam Lantinga <slouken@libsdl.org>
parents: 3108
diff changeset
200 return Pg_IMAGE_DIRECT_565;
Sam Lantinga <slouken@libsdl.org>
parents: 3108
diff changeset
201 }
Sam Lantinga <slouken@libsdl.org>
parents: 3108
diff changeset
202 break;
Sam Lantinga <slouken@libsdl.org>
parents: 3108
diff changeset
203 case SDL_PIXELFORMAT_ARGB1555:
Sam Lantinga <slouken@libsdl.org>
parents: 3108
diff changeset
204 {
Sam Lantinga <slouken@libsdl.org>
parents: 3108
diff changeset
205 return Pg_IMAGE_DIRECT_1555;
Sam Lantinga <slouken@libsdl.org>
parents: 3108
diff changeset
206 }
Sam Lantinga <slouken@libsdl.org>
parents: 3108
diff changeset
207 break;
3185
44d5474c2c8a Continue working on QNX GF and Photon support.
Mike Gorchak <lestat@i.com.ua>
parents: 3139
diff changeset
208 case SDL_PIXELFORMAT_RGB555:
44d5474c2c8a Continue working on QNX GF and Photon support.
Mike Gorchak <lestat@i.com.ua>
parents: 3139
diff changeset
209 {
44d5474c2c8a Continue working on QNX GF and Photon support.
Mike Gorchak <lestat@i.com.ua>
parents: 3139
diff changeset
210 return Pg_IMAGE_DIRECT_555;
44d5474c2c8a Continue working on QNX GF and Photon support.
Mike Gorchak <lestat@i.com.ua>
parents: 3139
diff changeset
211 }
44d5474c2c8a Continue working on QNX GF and Photon support.
Mike Gorchak <lestat@i.com.ua>
parents: 3139
diff changeset
212 break;
3139
Sam Lantinga <slouken@libsdl.org>
parents: 3108
diff changeset
213 }
3108
aa1897bee1e9 Continue working on QNX Photon with OpenGL ES support
Mike Gorchak <lestat@i.com.ua>
parents:
diff changeset
214
3139
Sam Lantinga <slouken@libsdl.org>
parents: 3108
diff changeset
215 return 0;
3108
aa1897bee1e9 Continue working on QNX Photon with OpenGL ES support
Mike Gorchak <lestat@i.com.ua>
parents:
diff changeset
216 }
aa1897bee1e9 Continue working on QNX Photon with OpenGL ES support
Mike Gorchak <lestat@i.com.ua>
parents:
diff changeset
217
aa1897bee1e9 Continue working on QNX Photon with OpenGL ES support
Mike Gorchak <lestat@i.com.ua>
parents:
diff changeset
218 /* vi: set ts=4 sw=4 expandtab: */