comparison test/testdraw2.c @ 5143:e743b9c3f6d6

Making the API simpler, the blend modes are "none, blend, add" and are supported by all renderers.
author Sam Lantinga <slouken@libsdl.org>
date Mon, 31 Jan 2011 23:23:57 -0800
parents 27ab20a36eba
children ad50b3db78bd
comparison
equal deleted inserted replaced
5142:57851a238c8f 5143:e743b9c3f6d6
188 if (SDL_strcasecmp(argv[i], "--blend") == 0) { 188 if (SDL_strcasecmp(argv[i], "--blend") == 0) {
189 if (argv[i + 1]) { 189 if (argv[i + 1]) {
190 if (SDL_strcasecmp(argv[i + 1], "none") == 0) { 190 if (SDL_strcasecmp(argv[i + 1], "none") == 0) {
191 blendMode = SDL_BLENDMODE_NONE; 191 blendMode = SDL_BLENDMODE_NONE;
192 consumed = 2; 192 consumed = 2;
193 } else if (SDL_strcasecmp(argv[i + 1], "mask") == 0) {
194 blendMode = SDL_BLENDMODE_MASK;
195 consumed = 2;
196 } else if (SDL_strcasecmp(argv[i + 1], "blend") == 0) { 193 } else if (SDL_strcasecmp(argv[i + 1], "blend") == 0) {
197 blendMode = SDL_BLENDMODE_BLEND; 194 blendMode = SDL_BLENDMODE_BLEND;
198 consumed = 2; 195 consumed = 2;
199 } else if (SDL_strcasecmp(argv[i + 1], "add") == 0) { 196 } else if (SDL_strcasecmp(argv[i + 1], "add") == 0) {
200 blendMode = SDL_BLENDMODE_ADD; 197 blendMode = SDL_BLENDMODE_ADD;
201 consumed = 2;
202 } else if (SDL_strcasecmp(argv[i + 1], "mod") == 0) {
203 blendMode = SDL_BLENDMODE_MOD;
204 consumed = 2; 198 consumed = 2;
205 } 199 }
206 } 200 }
207 } else if (SDL_strcasecmp(argv[i], "--cyclecolor") == 0) { 201 } else if (SDL_strcasecmp(argv[i], "--cyclecolor") == 0) {
208 cycle_color = SDL_TRUE; 202 cycle_color = SDL_TRUE;
215 consumed = 1; 209 consumed = 1;
216 } 210 }
217 } 211 }
218 if (consumed < 0) { 212 if (consumed < 0) {
219 fprintf(stderr, 213 fprintf(stderr,
220 "Usage: %s %s [--blend none|mask|blend|add|mod] [--cyclecolor] [--cyclealpha]\n", 214 "Usage: %s %s [--blend none|blend|add] [--cyclecolor] [--cyclealpha]\n",
221 argv[0], CommonUsage(state)); 215 argv[0], CommonUsage(state));
222 return 1; 216 return 1;
223 } 217 }
224 i += consumed; 218 i += consumed;
225 } 219 }