comparison src/video/SDL_renderer_gl.c @ 4929:aa8888658021

Use the enumerated type for blend and scale mode instead of int Renamed SDL_TextureScaleMode to SDL_ScaleMode
author Sam Lantinga <slouken@libsdl.org>
date Sun, 12 Dec 2010 15:19:05 -0800
parents f205711f73d5
children 397e748d901a
comparison
equal deleted inserted replaced
4927:d716dff4b13e 4929:aa8888658021
124 SDL_RENDERER_PRESENTVSYNC | SDL_RENDERER_ACCELERATED), 124 SDL_RENDERER_PRESENTVSYNC | SDL_RENDERER_ACCELERATED),
125 (SDL_TEXTUREMODULATE_NONE | SDL_TEXTUREMODULATE_COLOR | 125 (SDL_TEXTUREMODULATE_NONE | SDL_TEXTUREMODULATE_COLOR |
126 SDL_TEXTUREMODULATE_ALPHA), 126 SDL_TEXTUREMODULATE_ALPHA),
127 (SDL_BLENDMODE_NONE | SDL_BLENDMODE_MASK | 127 (SDL_BLENDMODE_NONE | SDL_BLENDMODE_MASK |
128 SDL_BLENDMODE_BLEND | SDL_BLENDMODE_ADD | SDL_BLENDMODE_MOD), 128 SDL_BLENDMODE_BLEND | SDL_BLENDMODE_ADD | SDL_BLENDMODE_MOD),
129 (SDL_TEXTURESCALEMODE_NONE | SDL_TEXTURESCALEMODE_FAST | 129 (SDL_SCALEMODE_NONE | SDL_SCALEMODE_FAST | SDL_SCALEMODE_SLOW),
130 SDL_TEXTURESCALEMODE_SLOW),
131 15, 130 15,
132 { 131 {
133 SDL_PIXELFORMAT_INDEX1LSB, 132 SDL_PIXELFORMAT_INDEX1LSB,
134 SDL_PIXELFORMAT_INDEX1MSB, 133 SDL_PIXELFORMAT_INDEX1MSB,
135 SDL_PIXELFORMAT_INDEX8, 134 SDL_PIXELFORMAT_INDEX8,
1002 1001
1003 static int 1002 static int
1004 GL_SetTextureScaleMode(SDL_Renderer * renderer, SDL_Texture * texture) 1003 GL_SetTextureScaleMode(SDL_Renderer * renderer, SDL_Texture * texture)
1005 { 1004 {
1006 switch (texture->scaleMode) { 1005 switch (texture->scaleMode) {
1007 case SDL_TEXTURESCALEMODE_NONE: 1006 case SDL_SCALEMODE_NONE:
1008 case SDL_TEXTURESCALEMODE_FAST: 1007 case SDL_SCALEMODE_FAST:
1009 case SDL_TEXTURESCALEMODE_SLOW: 1008 case SDL_SCALEMODE_SLOW:
1010 return 0; 1009 return 0;
1011 case SDL_TEXTURESCALEMODE_BEST: 1010 case SDL_SCALEMODE_BEST:
1012 SDL_Unsupported(); 1011 SDL_Unsupported();
1013 texture->scaleMode = SDL_TEXTURESCALEMODE_SLOW; 1012 texture->scaleMode = SDL_SCALEMODE_SLOW;
1014 return -1; 1013 return -1;
1015 default: 1014 default:
1016 SDL_Unsupported(); 1015 SDL_Unsupported();
1017 texture->scaleMode = SDL_TEXTURESCALEMODE_NONE; 1016 texture->scaleMode = SDL_SCALEMODE_NONE;
1018 return -1; 1017 return -1;
1019 } 1018 }
1020 } 1019 }
1021 1020
1022 static int 1021 static int
1363 } 1362 }
1364 } 1363 }
1365 1364
1366 if (texture->scaleMode != data->scaleMode) { 1365 if (texture->scaleMode != data->scaleMode) {
1367 switch (texture->scaleMode) { 1366 switch (texture->scaleMode) {
1368 case SDL_TEXTURESCALEMODE_NONE: 1367 case SDL_SCALEMODE_NONE:
1369 case SDL_TEXTURESCALEMODE_FAST: 1368 case SDL_SCALEMODE_FAST:
1370 data->glTexParameteri(texturedata->type, GL_TEXTURE_MIN_FILTER, 1369 data->glTexParameteri(texturedata->type, GL_TEXTURE_MIN_FILTER,
1371 GL_NEAREST); 1370 GL_NEAREST);
1372 data->glTexParameteri(texturedata->type, GL_TEXTURE_MAG_FILTER, 1371 data->glTexParameteri(texturedata->type, GL_TEXTURE_MAG_FILTER,
1373 GL_NEAREST); 1372 GL_NEAREST);
1374 break; 1373 break;
1375 case SDL_TEXTURESCALEMODE_SLOW: 1374 case SDL_SCALEMODE_SLOW:
1376 case SDL_TEXTURESCALEMODE_BEST: 1375 case SDL_SCALEMODE_BEST:
1377 data->glTexParameteri(texturedata->type, GL_TEXTURE_MIN_FILTER, 1376 data->glTexParameteri(texturedata->type, GL_TEXTURE_MIN_FILTER,
1378 GL_LINEAR); 1377 GL_LINEAR);
1379 data->glTexParameteri(texturedata->type, GL_TEXTURE_MAG_FILTER, 1378 data->glTexParameteri(texturedata->type, GL_TEXTURE_MAG_FILTER,
1380 GL_LINEAR); 1379 GL_LINEAR);
1381 break; 1380 break;