update SDL3 from 3.2.20 to 3.4.2

This commit is contained in:
Sven Balzer
2026-04-01 18:25:03 +02:00
parent 1daf4d79f1
commit 05b19704f8
1626 changed files with 124218 additions and 191491 deletions
+34 -5
View File
@@ -1,5 +1,5 @@
/*
Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
@@ -104,6 +104,7 @@ int main(int argc, char *argv[])
int i;
int frames;
Uint64 then, now;
SDL_ScaleMode scale_mode = SDL_SCALEMODE_PIXELART;
/* Initialize test framework */
state = SDLTest_CommonCreateState(argv, SDL_INIT_VIDEO);
@@ -112,8 +113,34 @@ int main(int argc, char *argv[])
}
/* Parse commandline */
if (!SDLTest_CommonDefaultArgs(state, argc, argv)) {
return 1;
for (i = 1; i < argc;) {
int consumed;
consumed = SDLTest_CommonArg(state, i);
if (consumed == 0) {
consumed = -1;
if (SDL_strcasecmp(argv[i], "--nearest") == 0) {
scale_mode = SDL_SCALEMODE_NEAREST;
consumed = 1;
} else if (SDL_strcasecmp(argv[i], "--linear") == 0) {
scale_mode = SDL_SCALEMODE_LINEAR;
consumed = 1;
} else if (SDL_strcasecmp(argv[i], "--pixelart") == 0) {
scale_mode = SDL_SCALEMODE_PIXELART;
consumed = 1;
}
}
if (consumed < 0) {
static const char *options[] = {
"[--nearest]",
"[--linear]",
"[--pixelart]",
NULL
};
SDLTest_CommonLogUsage(state, argv[0], options);
return 1;
}
i += consumed;
}
if (!SDLTest_CommonInit(state)) {
@@ -126,12 +153,14 @@ int main(int argc, char *argv[])
drawstate->window = state->windows[i];
drawstate->renderer = state->renderers[i];
drawstate->sprite = LoadTexture(drawstate->renderer, "icon.bmp", true, NULL, NULL);
drawstate->background = LoadTexture(drawstate->renderer, "sample.bmp", false, NULL, NULL);
drawstate->sprite = LoadTexture(drawstate->renderer, "icon.png", true);
drawstate->background = LoadTexture(drawstate->renderer, "sample.png", false);
if (!drawstate->sprite || !drawstate->background) {
quit(2);
}
SDL_GetTextureSize(drawstate->sprite, &drawstate->sprite_rect.w, &drawstate->sprite_rect.h);
SDL_SetTextureScaleMode(drawstate->background, scale_mode);
SDL_SetTextureScaleMode(drawstate->sprite, scale_mode);
drawstate->scale_direction = 1;
}