update SDL3 to latest commit

This commit is contained in:
Sasha Szpakowski
2024-10-06 20:30:44 -03:00
parent 1b0fdc338b
commit 9e5eb1b018
1426 changed files with 242456 additions and 103496 deletions
+14 -30
View File
@@ -95,7 +95,7 @@ quit(int rc)
if (context) {
for (i = 0; i < state->num_windows; i++) {
if (context[i]) {
SDL_GL_DeleteContext(context[i]);
SDL_GL_DestroyContext(context[i]);
}
}
@@ -329,7 +329,6 @@ static void loop(void)
{
SDL_Event event;
int i;
int status;
/* Check for events */
++frames;
@@ -337,7 +336,7 @@ static void loop(void)
switch (event.type) {
case SDL_EVENT_KEY_DOWN:
{
const int sym = event.key.keysym.sym;
const int sym = event.key.key;
if (sym == SDLK_TAB) {
SDL_Log("Tab");
@@ -363,8 +362,7 @@ static void loop(void)
for (i = 0; i < state->num_windows; ++i) {
if (event.window.windowID == SDL_GetWindowID(state->windows[i])) {
int w, h;
status = SDL_GL_MakeCurrent(state->windows[i], context[i]);
if (status) {
if (!SDL_GL_MakeCurrent(state->windows[i], context[i])) {
SDL_Log("SDL_GL_MakeCurrent(): %s\n", SDL_GetError());
break;
}
@@ -415,8 +413,7 @@ static void loop(void)
if (!done) {
for (i = 0; i < state->num_windows; ++i) {
status = SDL_GL_MakeCurrent(state->windows[i], context[i]);
if (status) {
if (!SDL_GL_MakeCurrent(state->windows[i], context[i])) {
SDL_Log("SDL_GL_MakeCurrent(): %s\n", SDL_GetError());
/* Continue for next window */
@@ -440,7 +437,6 @@ int main(int argc, char *argv[])
int i;
const SDL_DisplayMode *mode;
Uint64 then, now;
int status;
shader_data *data;
char *path = NULL;
@@ -600,16 +596,12 @@ int main(int argc, char *argv[])
TTF_CloseFont(font);
TTF_Quit();
#endif
g_surf_sdf = SDL_ConvertSurfaceFormat(tmp, SDL_PIXELFORMAT_ABGR8888);
g_surf_sdf = SDL_ConvertSurface(tmp, SDL_PIXELFORMAT_ABGR8888);
SDL_SetSurfaceBlendMode(g_surf_sdf, SDL_BLENDMODE_BLEND);
}
if (state->render_flags & SDL_RENDERER_PRESENTVSYNC) {
SDL_GL_SetSwapInterval(1);
} else {
SDL_GL_SetSwapInterval(0);
}
SDL_GL_SetSwapInterval(state->render_vsync);
mode = SDL_GetCurrentDisplayMode(SDL_GetPrimaryDisplay());
if (mode) {
@@ -622,44 +614,38 @@ int main(int argc, char *argv[])
SDL_Log("Extensions : %s\n", ctx.glGetString(GL_EXTENSIONS));
SDL_Log("\n");
status = SDL_GL_GetAttribute(SDL_GL_RED_SIZE, &value);
if (!status) {
if (SDL_GL_GetAttribute(SDL_GL_RED_SIZE, &value)) {
SDL_Log("SDL_GL_RED_SIZE: requested %d, got %d\n", 5, value);
} else {
SDL_Log("Failed to get SDL_GL_RED_SIZE: %s\n",
SDL_GetError());
}
status = SDL_GL_GetAttribute(SDL_GL_GREEN_SIZE, &value);
if (!status) {
if (SDL_GL_GetAttribute(SDL_GL_GREEN_SIZE, &value)) {
SDL_Log("SDL_GL_GREEN_SIZE: requested %d, got %d\n", 5, value);
} else {
SDL_Log("Failed to get SDL_GL_GREEN_SIZE: %s\n",
SDL_GetError());
}
status = SDL_GL_GetAttribute(SDL_GL_BLUE_SIZE, &value);
if (!status) {
if (SDL_GL_GetAttribute(SDL_GL_BLUE_SIZE, &value)) {
SDL_Log("SDL_GL_BLUE_SIZE: requested %d, got %d\n", 5, value);
} else {
SDL_Log("Failed to get SDL_GL_BLUE_SIZE: %s\n",
SDL_GetError());
}
status = SDL_GL_GetAttribute(SDL_GL_DEPTH_SIZE, &value);
if (!status) {
if (SDL_GL_GetAttribute(SDL_GL_DEPTH_SIZE, &value)) {
SDL_Log("SDL_GL_DEPTH_SIZE: requested %d, got %d\n", depth, value);
} else {
SDL_Log("Failed to get SDL_GL_DEPTH_SIZE: %s\n",
SDL_GetError());
}
if (fsaa) {
status = SDL_GL_GetAttribute(SDL_GL_MULTISAMPLEBUFFERS, &value);
if (!status) {
if (SDL_GL_GetAttribute(SDL_GL_MULTISAMPLEBUFFERS, &value)) {
SDL_Log("SDL_GL_MULTISAMPLEBUFFERS: requested 1, got %d\n", value);
} else {
SDL_Log("Failed to get SDL_GL_MULTISAMPLEBUFFERS: %s\n",
SDL_GetError());
}
status = SDL_GL_GetAttribute(SDL_GL_MULTISAMPLESAMPLES, &value);
if (!status) {
if (SDL_GL_GetAttribute(SDL_GL_MULTISAMPLESAMPLES, &value)) {
SDL_Log("SDL_GL_MULTISAMPLESAMPLES: requested %d, got %d\n", fsaa,
value);
} else {
@@ -668,8 +654,7 @@ int main(int argc, char *argv[])
}
}
if (accel) {
status = SDL_GL_GetAttribute(SDL_GL_ACCELERATED_VISUAL, &value);
if (!status) {
if (SDL_GL_GetAttribute(SDL_GL_ACCELERATED_VISUAL, &value)) {
SDL_Log("SDL_GL_ACCELERATED_VISUAL: requested 1, got %d\n", value);
} else {
SDL_Log("Failed to get SDL_GL_ACCELERATED_VISUAL: %s\n",
@@ -683,8 +668,7 @@ int main(int argc, char *argv[])
for (i = 0; i < state->num_windows; ++i) {
int w, h;
status = SDL_GL_MakeCurrent(state->windows[i], context[i]);
if (status) {
if (!SDL_GL_MakeCurrent(state->windows[i], context[i])) {
SDL_Log("SDL_GL_MakeCurrent(): %s\n", SDL_GetError());
/* Continue for next window */