Mercurial > sdl-ios-xcode
comparison src/video/SDL_renderer_gles.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 | 3abf0b9cafad |
children | 604077962776 |
comparison
equal
deleted
inserted
replaced
4927:d716dff4b13e | 4929:aa8888658021 |
---|---|
110 SDL_RENDERER_PRESENTVSYNC | SDL_RENDERER_ACCELERATED), | 110 SDL_RENDERER_PRESENTVSYNC | SDL_RENDERER_ACCELERATED), |
111 (SDL_TEXTUREMODULATE_NONE | SDL_TEXTUREMODULATE_COLOR | | 111 (SDL_TEXTUREMODULATE_NONE | SDL_TEXTUREMODULATE_COLOR | |
112 SDL_TEXTUREMODULATE_ALPHA), | 112 SDL_TEXTUREMODULATE_ALPHA), |
113 (SDL_BLENDMODE_NONE | SDL_BLENDMODE_MASK | | 113 (SDL_BLENDMODE_NONE | SDL_BLENDMODE_MASK | |
114 SDL_BLENDMODE_BLEND | SDL_BLENDMODE_ADD | SDL_BLENDMODE_MOD), | 114 SDL_BLENDMODE_BLEND | SDL_BLENDMODE_ADD | SDL_BLENDMODE_MOD), |
115 (SDL_TEXTURESCALEMODE_NONE | SDL_TEXTURESCALEMODE_FAST | | 115 (SDL_SCALEMODE_NONE | SDL_SCALEMODE_FAST | SDL_SCALEMODE_SLOW), 5, |
116 SDL_TEXTURESCALEMODE_SLOW), 5, | |
117 { | 116 { |
118 /* OpenGL ES 1.x supported formats list */ | 117 /* OpenGL ES 1.x supported formats list */ |
119 SDL_PIXELFORMAT_ABGR4444, | 118 SDL_PIXELFORMAT_ABGR4444, |
120 SDL_PIXELFORMAT_ABGR1555, | 119 SDL_PIXELFORMAT_ABGR1555, |
121 SDL_PIXELFORMAT_BGR565, | 120 SDL_PIXELFORMAT_BGR565, |
531 | 530 |
532 static int | 531 static int |
533 GLES_SetTextureScaleMode(SDL_Renderer * renderer, SDL_Texture * texture) | 532 GLES_SetTextureScaleMode(SDL_Renderer * renderer, SDL_Texture * texture) |
534 { | 533 { |
535 switch (texture->scaleMode) { | 534 switch (texture->scaleMode) { |
536 case SDL_TEXTURESCALEMODE_NONE: | 535 case SDL_SCALEMODE_NONE: |
537 case SDL_TEXTURESCALEMODE_FAST: | 536 case SDL_SCALEMODE_FAST: |
538 case SDL_TEXTURESCALEMODE_SLOW: | 537 case SDL_SCALEMODE_SLOW: |
539 return 0; | 538 return 0; |
540 case SDL_TEXTURESCALEMODE_BEST: | 539 case SDL_SCALEMODE_BEST: |
541 SDL_Unsupported(); | 540 SDL_Unsupported(); |
542 texture->scaleMode = SDL_TEXTURESCALEMODE_SLOW; | 541 texture->scaleMode = SDL_SCALEMODE_SLOW; |
543 return -1; | 542 return -1; |
544 default: | 543 default: |
545 SDL_Unsupported(); | 544 SDL_Unsupported(); |
546 texture->scaleMode = SDL_TEXTURESCALEMODE_NONE; | 545 texture->scaleMode = SDL_SCALEMODE_NONE; |
547 return -1; | 546 return -1; |
548 } | 547 } |
549 } | 548 } |
550 | 549 |
551 static int | 550 static int |
857 } | 856 } |
858 | 857 |
859 GLES_SetBlendMode(data, texture->blendMode, 0); | 858 GLES_SetBlendMode(data, texture->blendMode, 0); |
860 | 859 |
861 switch (texture->scaleMode) { | 860 switch (texture->scaleMode) { |
862 case SDL_TEXTURESCALEMODE_NONE: | 861 case SDL_SCALEMODE_NONE: |
863 case SDL_TEXTURESCALEMODE_FAST: | 862 case SDL_SCALEMODE_FAST: |
864 data->glTexParameteri(texturedata->type, GL_TEXTURE_MIN_FILTER, | 863 data->glTexParameteri(texturedata->type, GL_TEXTURE_MIN_FILTER, |
865 GL_NEAREST); | 864 GL_NEAREST); |
866 data->glTexParameteri(texturedata->type, GL_TEXTURE_MAG_FILTER, | 865 data->glTexParameteri(texturedata->type, GL_TEXTURE_MAG_FILTER, |
867 GL_NEAREST); | 866 GL_NEAREST); |
868 break; | 867 break; |
869 case SDL_TEXTURESCALEMODE_SLOW: | 868 case SDL_SCALEMODE_SLOW: |
870 case SDL_TEXTURESCALEMODE_BEST: | 869 case SDL_SCALEMODE_BEST: |
871 data->glTexParameteri(texturedata->type, GL_TEXTURE_MIN_FILTER, | 870 data->glTexParameteri(texturedata->type, GL_TEXTURE_MIN_FILTER, |
872 GL_LINEAR); | 871 GL_LINEAR); |
873 data->glTexParameteri(texturedata->type, GL_TEXTURE_MAG_FILTER, | 872 data->glTexParameteri(texturedata->type, GL_TEXTURE_MAG_FILTER, |
874 GL_LINEAR); | 873 GL_LINEAR); |
875 break; | 874 break; |