Fixed SDL_ScaleMode values for consistency

main
Sam Lantinga 2023-02-03 13:23:02 -08:00
parent e5edce8e75
commit 14a4ce8b59
21 changed files with 70 additions and 47 deletions

View File

@ -2388,3 +2388,15 @@ SDL_DisplayMode e;
- SDL_RenderLogicalToWindow
+ SDL_RenderCoordinatesToWindow
(...)
@@
@@
- SDL_ScaleModeNearest
+ SDL_SCALEMODE_NEAREST
@@
@@
- SDL_ScaleModeLinear
+ SDL_SCALEMODE_LINEAR
@@
@@
- SDL_ScaleModeBest
+ SDL_SCALEMODE_BEST

View File

@ -649,6 +649,11 @@ The following functions have been removed:
* SDL_RenderSetIntegerScale() - this is now explicit with SDL_LOGICAL_PRESENTATION_INTEGER_SCALE
* SDL_RenderTargetSupported() - render targets are always supported
The following symbols have been renamed:
* SDL_ScaleModeBest => SDL_SCALEMODE_BEST
* SDL_ScaleModeLinear => SDL_SCALEMODE_LINEAR
* SDL_ScaleModeNearest => SDL_SCALEMODE_NEAREST
## SDL_rwops.h
The following symbols have been renamed:

View File

@ -371,6 +371,9 @@
#define SDL_RenderSetVSync SDL_SetRenderVSync
#define SDL_RenderSetViewport SDL_SetRenderViewport
#define SDL_RenderWindowToLogical SDL_RenderCoordinatesFromWindow
#define SDL_ScaleModeBest SDL_SCALEMODE_BEST
#define SDL_ScaleModeLinear SDL_SCALEMODE_LINEAR
#define SDL_ScaleModeNearest SDL_SCALEMODE_NEAREST
/* ##SDL_rwops.h */
#define RW_SEEK_CUR SDL_RW_SEEK_CUR
@ -757,6 +760,9 @@
#define SDL_RenderSetVSync SDL_RenderSetVSync_renamed_SDL_SetRenderVSync
#define SDL_RenderSetViewport SDL_RenderSetViewport_renamed_SDL_SetRenderViewport
#define SDL_RenderWindowToLogical SDL_RenderWindowToLogical_renamed_SDL_RenderCoordinatesFromWindow
#define SDL_ScaleModeBest SDL_ScaleModeBest_renamed_SDL_SCALEMODE_BEST
#define SDL_ScaleModeLinear SDL_ScaleModeLinear_renamed_SDL_SCALEMODE_LINEAR
#define SDL_ScaleModeNearest SDL_ScaleModeNearest_renamed_SDL_SCALEMODE_NEAREST
/* ##SDL_rwops.h */
#define RW_SEEK_CUR RW_SEEK_CUR_renamed_SDL_RW_SEEK_CUR

View File

@ -98,9 +98,9 @@ typedef struct SDL_Vertex
*/
typedef enum
{
SDL_ScaleModeNearest, /**< nearest pixel sampling */
SDL_ScaleModeLinear, /**< linear filtering */
SDL_ScaleModeBest /**< anisotropic filtering */
SDL_SCALEMODE_NEAREST, /**< nearest pixel sampling */
SDL_SCALEMODE_LINEAR, /**< linear filtering */
SDL_SCALEMODE_BEST /**< anisotropic filtering */
} SDL_ScaleMode;
/**

View File

@ -925,7 +925,7 @@ SDL_Renderer *SDL_CreateRenderer(SDL_Window *window, const char *name, Uint32 fl
SDL_SetRenderViewport(renderer, NULL);
SDL_SetRenderLogicalPresentation(renderer, 0, 0, SDL_LOGICAL_PRESENTATION_MATCH, SDL_ScaleModeLinear);
SDL_SetRenderLogicalPresentation(renderer, 0, 0, SDL_LOGICAL_PRESENTATION_MATCH, SDL_SCALEMODE_LINEAR);
SDL_AddEventWatch(SDL_RendererEventWatch, renderer);
@ -1106,11 +1106,11 @@ static SDL_ScaleMode SDL_GetScaleMode(void)
const char *hint = SDL_GetHint(SDL_HINT_RENDER_SCALE_QUALITY);
if (hint == NULL || SDL_strcasecmp(hint, "nearest") == 0) {
return SDL_ScaleModeNearest;
return SDL_SCALEMODE_NEAREST;
} else if (SDL_strcasecmp(hint, "linear") == 0) {
return SDL_ScaleModeLinear;
return SDL_SCALEMODE_LINEAR;
} else if (SDL_strcasecmp(hint, "best") == 0) {
return SDL_ScaleModeBest;
return SDL_SCALEMODE_BEST;
} else {
return (SDL_ScaleMode)SDL_atoi(hint);
}
@ -2231,7 +2231,7 @@ static int UpdateLogicalPresentation(SDL_Renderer *renderer)
return 0;
error:
SDL_SetRenderLogicalPresentation(renderer, 0, 0, SDL_LOGICAL_PRESENTATION_DISABLED, SDL_ScaleModeNearest);
SDL_SetRenderLogicalPresentation(renderer, 0, 0, SDL_LOGICAL_PRESENTATION_DISABLED, SDL_SCALEMODE_NEAREST);
return -1;
}
@ -2271,7 +2271,7 @@ int SDL_SetRenderLogicalPresentation(SDL_Renderer *renderer, int w, int h, SDL_R
return UpdateLogicalPresentation(renderer);
error:
SDL_SetRenderLogicalPresentation(renderer, 0, 0, SDL_LOGICAL_PRESENTATION_DISABLED, SDL_ScaleModeNearest);
SDL_SetRenderLogicalPresentation(renderer, 0, 0, SDL_LOGICAL_PRESENTATION_DISABLED, SDL_SCALEMODE_NEAREST);
return -1;
}

View File

@ -529,7 +529,7 @@ static int D3D_CreateTexture(SDL_Renderer *renderer, SDL_Texture *texture)
if (texturedata == NULL) {
return SDL_OutOfMemory();
}
texturedata->scaleMode = (texture->scaleMode == SDL_ScaleModeNearest) ? D3DTEXF_POINT : D3DTEXF_LINEAR;
texturedata->scaleMode = (texture->scaleMode == SDL_SCALEMODE_NEAREST) ? D3DTEXF_POINT : D3DTEXF_LINEAR;
texture->driverdata = texturedata;
@ -733,7 +733,7 @@ static void D3D_SetTextureScaleMode(SDL_Renderer *renderer, SDL_Texture *texture
return;
}
texturedata->scaleMode = (scaleMode == SDL_ScaleModeNearest) ? D3DTEXF_POINT : D3DTEXF_LINEAR;
texturedata->scaleMode = (scaleMode == SDL_SCALEMODE_NEAREST) ? D3DTEXF_POINT : D3DTEXF_LINEAR;
}
static int D3D_SetRenderTargetInternal(SDL_Renderer *renderer, SDL_Texture *texture)

View File

@ -1070,7 +1070,7 @@ static int D3D11_CreateTexture(SDL_Renderer *renderer, SDL_Texture *texture)
SDL_OutOfMemory();
return -1;
}
textureData->scaleMode = (texture->scaleMode == SDL_ScaleModeNearest) ? D3D11_FILTER_MIN_MAG_MIP_POINT : D3D11_FILTER_MIN_MAG_MIP_LINEAR;
textureData->scaleMode = (texture->scaleMode == SDL_SCALEMODE_NEAREST) ? D3D11_FILTER_MIN_MAG_MIP_POINT : D3D11_FILTER_MIN_MAG_MIP_LINEAR;
texture->driverdata = textureData;
@ -1546,7 +1546,7 @@ static void D3D11_SetTextureScaleMode(SDL_Renderer *renderer, SDL_Texture *textu
return;
}
textureData->scaleMode = (scaleMode == SDL_ScaleModeNearest) ? D3D11_FILTER_MIN_MAG_MIP_POINT : D3D11_FILTER_MIN_MAG_MIP_LINEAR;
textureData->scaleMode = (scaleMode == SDL_SCALEMODE_NEAREST) ? D3D11_FILTER_MIN_MAG_MIP_POINT : D3D11_FILTER_MIN_MAG_MIP_LINEAR;
}
static int D3D11_SetRenderTarget(SDL_Renderer *renderer, SDL_Texture *texture)

View File

@ -1432,7 +1432,7 @@ static int D3D12_CreateTexture(SDL_Renderer *renderer, SDL_Texture *texture)
SDL_OutOfMemory();
return -1;
}
textureData->scaleMode = (texture->scaleMode == SDL_ScaleModeNearest) ? D3D12_FILTER_MIN_MAG_MIP_POINT : D3D12_FILTER_MIN_MAG_MIP_LINEAR;
textureData->scaleMode = (texture->scaleMode == SDL_SCALEMODE_NEAREST) ? D3D12_FILTER_MIN_MAG_MIP_POINT : D3D12_FILTER_MIN_MAG_MIP_LINEAR;
texture->driverdata = textureData;
textureData->mainTextureFormat = textureFormat;
@ -2076,7 +2076,7 @@ static void D3D12_SetTextureScaleMode(SDL_Renderer *renderer, SDL_Texture *textu
return;
}
textureData->scaleMode = (scaleMode == SDL_ScaleModeNearest) ? D3D12_FILTER_MIN_MAG_MIP_POINT : D3D12_FILTER_MIN_MAG_MIP_LINEAR;
textureData->scaleMode = (scaleMode == SDL_SCALEMODE_NEAREST) ? D3D12_FILTER_MIN_MAG_MIP_POINT : D3D12_FILTER_MIN_MAG_MIP_LINEAR;
}
static int D3D12_SetRenderTarget(SDL_Renderer *renderer, SDL_Texture *texture)

View File

@ -621,7 +621,7 @@ METAL_CreateTexture(SDL_Renderer *renderer, SDL_Texture *texture)
}
#endif /* SDL_HAVE_YUV */
texturedata = [[METAL_TextureData alloc] init];
if (texture->scaleMode == SDL_ScaleModeNearest) {
if (texture->scaleMode == SDL_SCALEMODE_NEAREST) {
texturedata.mtlsampler = data.mtlsamplernearest;
} else {
texturedata.mtlsampler = data.mtlsamplerlinear;
@ -994,7 +994,7 @@ static void METAL_SetTextureScaleMode(SDL_Renderer *renderer, SDL_Texture *textu
METAL_RenderData *data = (__bridge METAL_RenderData *)renderer->driverdata;
METAL_TextureData *texturedata = (__bridge METAL_TextureData *)texture->driverdata;
if (scaleMode == SDL_ScaleModeNearest) {
if (scaleMode == SDL_SCALEMODE_NEAREST) {
texturedata.mtlsampler = data.mtlsamplernearest;
} else {
texturedata.mtlsampler = data.mtlsamplerlinear;

View File

@ -525,7 +525,7 @@ static int GL_CreateTexture(SDL_Renderer *renderer, SDL_Texture *texture)
data->format = format;
data->formattype = type;
scaleMode = (texture->scaleMode == SDL_ScaleModeNearest) ? GL_NEAREST : GL_LINEAR;
scaleMode = (texture->scaleMode == SDL_SCALEMODE_NEAREST) ? GL_NEAREST : GL_LINEAR;
renderdata->glEnable(textype);
renderdata->glBindTexture(textype, data->texture);
renderdata->glTexParameteri(textype, GL_TEXTURE_MIN_FILTER, scaleMode);
@ -840,7 +840,7 @@ static void GL_SetTextureScaleMode(SDL_Renderer *renderer, SDL_Texture *texture,
GL_RenderData *renderdata = (GL_RenderData *)renderer->driverdata;
const GLenum textype = renderdata->textype;
GL_TextureData *data = (GL_TextureData *)texture->driverdata;
GLenum glScaleMode = (scaleMode == SDL_ScaleModeNearest) ? GL_NEAREST : GL_LINEAR;
GLenum glScaleMode = (scaleMode == SDL_SCALEMODE_NEAREST) ? GL_NEAREST : GL_LINEAR;
renderdata->glBindTexture(textype, data->texture);
renderdata->glTexParameteri(textype, GL_TEXTURE_MIN_FILTER, glScaleMode);

View File

@ -1463,7 +1463,7 @@ static int GLES2_CreateTexture(SDL_Renderer *renderer, SDL_Texture *texture)
data->texture_u = 0;
data->texture_v = 0;
#endif
scaleMode = (texture->scaleMode == SDL_ScaleModeNearest) ? GL_NEAREST : GL_LINEAR;
scaleMode = (texture->scaleMode == SDL_SCALEMODE_NEAREST) ? GL_NEAREST : GL_LINEAR;
/* Allocate a blob for image renderdata */
if (texture->access == SDL_TEXTUREACCESS_STREAMING) {
@ -1824,7 +1824,7 @@ static void GLES2_SetTextureScaleMode(SDL_Renderer *renderer, SDL_Texture *textu
{
GLES2_RenderData *renderdata = (GLES2_RenderData *)renderer->driverdata;
GLES2_TextureData *data = (GLES2_TextureData *)texture->driverdata;
GLenum glScaleMode = (scaleMode == SDL_ScaleModeNearest) ? GL_NEAREST : GL_LINEAR;
GLenum glScaleMode = (scaleMode == SDL_SCALEMODE_NEAREST) ? GL_NEAREST : GL_LINEAR;
#if SDL_HAVE_YUV
if (data->yuv) {

View File

@ -177,7 +177,7 @@ static void PS2_SetTextureScaleMode(SDL_Renderer *renderer, SDL_Texture *texture
gskit scale mode is either GS_FILTER_NEAREST (good for tile-map)
or GS_FILTER_LINEAR (good for scaling)
*/
uint32_t gsKitScaleMode = (scaleMode == SDL_ScaleModeNearest
uint32_t gsKitScaleMode = (scaleMode == SDL_SCALEMODE_NEAREST
? GS_FILTER_NEAREST
: GS_FILTER_LINEAR);
ps2_texture->Filter = gsKitScaleMode;

View File

@ -542,7 +542,7 @@ static int TextureShouldSwizzle(PSP_TextureData *psp_texture, SDL_Texture *textu
static void TextureActivate(SDL_Texture *texture)
{
PSP_TextureData *psp_texture = (PSP_TextureData *)texture->driverdata;
int scaleMode = (texture->scaleMode == SDL_ScaleModeNearest) ? GU_NEAREST : GU_LINEAR;
int scaleMode = (texture->scaleMode == SDL_SCALEMODE_NEAREST) ? GU_NEAREST : GU_LINEAR;
/* Swizzling is useless with small textures. */
if (TextureShouldSwizzle(psp_texture, texture)) {

View File

@ -416,7 +416,7 @@ static int SW_RenderCopyEx(SDL_Renderer *renderer, SDL_Surface *surface, SDL_Tex
SDLgfx_rotozoomSurfaceSizeTrig(tmp_rect.w, tmp_rect.h, angle, center,
&rect_dest, &cangle, &sangle);
src_rotated = SDLgfx_rotateSurface(src_clone, angle,
(texture->scaleMode == SDL_ScaleModeNearest) ? 0 : 1, flip & SDL_FLIP_HORIZONTAL, flip & SDL_FLIP_VERTICAL,
(texture->scaleMode == SDL_SCALEMODE_NEAREST) ? 0 : 1, flip & SDL_FLIP_HORIZONTAL, flip & SDL_FLIP_VERTICAL,
&rect_dest, cangle, sangle, center);
if (src_rotated == NULL) {
retval = -1;

View File

@ -607,7 +607,7 @@ static void VITA_GXM_SetTextureScaleMode(SDL_Renderer *renderer, SDL_Texture *te
or SCE_GXM_TEXTURE_FILTER_LINEAR (good for scaling)
*/
int vitaScaleMode = (scaleMode == SDL_ScaleModeNearest
int vitaScaleMode = (scaleMode == SDL_SCALEMODE_NEAREST
? SCE_GXM_TEXTURE_FILTER_POINT
: SCE_GXM_TEXTURE_FILTER_LINEAR);
gxm_texture_set_filters(vita_texture->tex, vitaScaleMode, vitaScaleMode);

View File

@ -86,7 +86,7 @@ SDLTest_CommonCreateState(char **argv, Uint32 flags)
state->window_w = DEFAULT_WINDOW_WIDTH;
state->window_h = DEFAULT_WINDOW_HEIGHT;
state->logical_presentation = SDL_LOGICAL_PRESENTATION_MATCH;
state->logical_scale_mode = SDL_ScaleModeLinear;
state->logical_scale_mode = SDL_SCALEMODE_LINEAR;
state->num_windows = 1;
state->audiospec.freq = 22050;
state->audiospec.format = AUDIO_S16;
@ -440,15 +440,15 @@ int SDLTest_CommonArg(SDLTest_CommonState *state, int index)
return -1;
}
if (SDL_strcasecmp(argv[index], "nearest") == 0) {
state->logical_scale_mode = SDL_ScaleModeNearest;
state->logical_scale_mode = SDL_SCALEMODE_NEAREST;
return 2;
}
if (SDL_strcasecmp(argv[index], "linear") == 0) {
state->logical_scale_mode = SDL_ScaleModeLinear;
state->logical_scale_mode = SDL_SCALEMODE_LINEAR;
return 2;
}
if (SDL_strcasecmp(argv[index], "best") == 0) {
state->logical_scale_mode = SDL_ScaleModeBest;
state->logical_scale_mode = SDL_SCALEMODE_BEST;
return 2;
}
return -1;
@ -1001,13 +1001,13 @@ static void SDLTest_PrintLogicalPresentation(char *text, size_t maxlen, SDL_Rend
static void SDLTest_PrintScaleMode(char *text, size_t maxlen, SDL_ScaleMode scale_mode)
{
switch (scale_mode) {
case SDL_ScaleModeNearest:
case SDL_SCALEMODE_NEAREST:
SDL_snprintfcat(text, maxlen, "NEAREST");
break;
case SDL_ScaleModeLinear:
case SDL_SCALEMODE_LINEAR:
SDL_snprintfcat(text, maxlen, "LINEAR");
break;
case SDL_ScaleModeBest:
case SDL_SCALEMODE_BEST:
SDL_snprintfcat(text, maxlen, "BEST");
break;
default:

View File

@ -29,13 +29,13 @@ static int SDL_UpperSoftStretch(SDL_Surface *src, const SDL_Rect *srcrect, SDL_S
int SDL_SoftStretch(SDL_Surface *src, const SDL_Rect *srcrect,
SDL_Surface *dst, const SDL_Rect *dstrect)
{
return SDL_UpperSoftStretch(src, srcrect, dst, dstrect, SDL_ScaleModeNearest);
return SDL_UpperSoftStretch(src, srcrect, dst, dstrect, SDL_SCALEMODE_NEAREST);
}
int SDL_SoftStretchLinear(SDL_Surface *src, const SDL_Rect *srcrect,
SDL_Surface *dst, const SDL_Rect *dstrect)
{
return SDL_UpperSoftStretch(src, srcrect, dst, dstrect, SDL_ScaleModeLinear);
return SDL_UpperSoftStretch(src, srcrect, dst, dstrect, SDL_SCALEMODE_LINEAR);
}
static int SDL_UpperSoftStretch(SDL_Surface *src, const SDL_Rect *srcrect,
@ -51,7 +51,7 @@ static int SDL_UpperSoftStretch(SDL_Surface *src, const SDL_Rect *srcrect,
return SDL_SetError("Only works with same format surfaces");
}
if (scaleMode != SDL_ScaleModeNearest) {
if (scaleMode != SDL_SCALEMODE_NEAREST) {
if (src->format->BytesPerPixel != 4 || src->format->format == SDL_PIXELFORMAT_ARGB2101010) {
return SDL_SetError("Wrong format");
}
@ -114,7 +114,7 @@ static int SDL_UpperSoftStretch(SDL_Surface *src, const SDL_Rect *srcrect,
src_locked = 1;
}
if (scaleMode == SDL_ScaleModeNearest) {
if (scaleMode == SDL_SCALEMODE_NEAREST) {
ret = SDL_LowerSoftStretchNearest(src, srcrect, dst, dstrect);
} else {
ret = SDL_LowerSoftStretchLinear(src, srcrect, dst, dstrect);

View File

@ -759,7 +759,7 @@ int SDL_BlitSurface(SDL_Surface *src, const SDL_Rect *srcrect,
int SDL_BlitSurfaceScaled(SDL_Surface *src, const SDL_Rect *srcrect,
SDL_Surface *dst, SDL_Rect *dstrect)
{
return SDL_PrivateBlitSurfaceScaled(src, srcrect, dst, dstrect, SDL_ScaleModeNearest);
return SDL_PrivateBlitSurfaceScaled(src, srcrect, dst, dstrect, SDL_SCALEMODE_NEAREST);
}
int SDL_PrivateBlitSurfaceScaled(SDL_Surface *src, const SDL_Rect *srcrect,
@ -927,7 +927,7 @@ int SDL_PrivateBlitSurfaceScaled(SDL_Surface *src, const SDL_Rect *srcrect,
int SDL_BlitSurfaceUncheckedScaled(SDL_Surface *src, SDL_Rect *srcrect,
SDL_Surface *dst, SDL_Rect *dstrect)
{
return SDL_PrivateBlitSurfaceUncheckedScaled(src, srcrect, dst, dstrect, SDL_ScaleModeNearest);
return SDL_PrivateBlitSurfaceUncheckedScaled(src, srcrect, dst, dstrect, SDL_SCALEMODE_NEAREST);
}
int SDL_PrivateBlitSurfaceUncheckedScaled(SDL_Surface *src, SDL_Rect *srcrect,
@ -947,7 +947,7 @@ int SDL_PrivateBlitSurfaceUncheckedScaled(SDL_Surface *src, SDL_Rect *srcrect,
SDL_InvalidateMap(src->map);
}
if (scaleMode == SDL_ScaleModeNearest) {
if (scaleMode == SDL_SCALEMODE_NEAREST) {
if (!(src->map->info.flags & complex_copy_flags) &&
src->format->format == dst->format->format &&
!SDL_ISPIXELFORMAT_INDEXED(src->format->format)) {

View File

@ -368,7 +368,7 @@ WatchJoystick(SDL_Joystick *joystick)
/* scale for platforms that don't give you the window size you asked for. */
SDL_SetRenderLogicalPresentation(screen, SCREEN_WIDTH, SCREEN_HEIGHT,
SDL_LOGICAL_PRESENTATION_LETTERBOX,
SDL_ScaleModeLinear);
SDL_SCALEMODE_LINEAR);
/* Print info about the joystick we are watching */
name = SDL_GetJoystickName(joystick);

View File

@ -894,7 +894,7 @@ int render_testLogicalSize(void *arg)
SDLTest_AssertCheck(ret == 0, "Validate result from SDL_GetRendererOutputSize, expected: 0, got: %i", ret);
ret = SDL_SetRenderLogicalPresentation(renderer, w / factor, h / factor,
SDL_LOGICAL_PRESENTATION_LETTERBOX,
SDL_ScaleModeNearest);
SDL_SCALEMODE_NEAREST);
SDLTest_AssertCheck(ret == 0, "Validate result from SDL_SetRenderLogicalSize, expected: 0, got: %i", ret);
ret = SDL_SetRenderDrawColor(renderer, 0, 255, 0, SDL_ALPHA_OPAQUE);
SDLTest_AssertCheck(ret == 0, "Validate result from SDL_SetRenderDrawColor, expected: 0, got: %i", ret);
@ -907,7 +907,7 @@ int render_testLogicalSize(void *arg)
(void)SDL_RenderPresent(renderer);
ret = SDL_SetRenderLogicalPresentation(renderer, 0, 0,
SDL_LOGICAL_PRESENTATION_DISABLED,
SDL_ScaleModeNearest);
SDL_SCALEMODE_NEAREST);
SDLTest_AssertCheck(ret == 0, "Validate result from SDL_SetRenderLogicalSize, expected: 0, got: %i", ret);
/* Check to see if final image matches. */
@ -921,7 +921,7 @@ int render_testLogicalSize(void *arg)
SDLTest_AssertCheck(ret == 0, "Validate result from SDL_GetRendererOutputSize, expected: 0, got: %i", ret);
ret = SDL_SetRenderLogicalPresentation(renderer, w / factor, h / factor,
SDL_LOGICAL_PRESENTATION_LETTERBOX,
SDL_ScaleModeNearest);
SDL_SCALEMODE_NEAREST);
SDLTest_AssertCheck(ret == 0, "Validate result from SDL_SetRenderLogicalSize, expected: 0, got: %i", ret);
viewport.x = (TESTRENDER_SCREEN_W / 4) / factor;
viewport.y = (TESTRENDER_SCREEN_H / 4) / factor;
@ -938,7 +938,7 @@ int render_testLogicalSize(void *arg)
(void)SDL_RenderPresent(renderer);
ret = SDL_SetRenderLogicalPresentation(renderer, 0, 0,
SDL_LOGICAL_PRESENTATION_DISABLED,
SDL_ScaleModeNearest);
SDL_SCALEMODE_NEAREST);
SDLTest_AssertCheck(ret == 0, "Validate result from SDL_SetRenderLogicalSize, expected: 0, got: %i", ret);
/* Check to see if final image matches. */
@ -969,7 +969,7 @@ int render_testLogicalSize(void *arg)
w - 2 * (TESTRENDER_SCREEN_W / 4),
h,
SDL_LOGICAL_PRESENTATION_LETTERBOX,
SDL_ScaleModeLinear);
SDL_SCALEMODE_LINEAR);
SDLTest_AssertCheck(ret == 0, "Validate result from SDL_SetRenderLogicalSize, expected: 0, got: %i", ret);
ret = SDL_SetRenderDrawColor(renderer, 0, 255, 0, SDL_ALPHA_OPAQUE);
SDLTest_AssertCheck(ret == 0, "Validate result from SDL_SetRenderDrawColor, expected: 0, got: %i", ret);
@ -978,7 +978,7 @@ int render_testLogicalSize(void *arg)
(void)SDL_RenderPresent(renderer);
ret = SDL_SetRenderLogicalPresentation(renderer, 0, 0,
SDL_LOGICAL_PRESENTATION_DISABLED,
SDL_ScaleModeNearest);
SDL_SCALEMODE_NEAREST);
SDLTest_AssertCheck(ret == 0, "Validate result from SDL_SetRenderLogicalSize, expected: 0, got: %i", ret);
/* Check to see if final image matches. */

View File

@ -913,7 +913,7 @@ int main(int argc, char *argv[])
/* scale for platforms that don't give you the window size you asked for. */
SDL_SetRenderLogicalPresentation(screen, SCREEN_WIDTH, SCREEN_HEIGHT,
SDL_LOGICAL_PRESENTATION_LETTERBOX,
SDL_ScaleModeLinear);
SDL_SCALEMODE_LINEAR);
background_front = LoadTexture(screen, "gamepadmap.bmp", SDL_FALSE, NULL, NULL);
background_back = LoadTexture(screen, "gamepadmap_back.bmp", SDL_FALSE, NULL, NULL);