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
+13 -31
View File
@@ -35,7 +35,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]);
}
}
@@ -50,7 +50,7 @@ quit(int rc)
}
static void
Render()
Render(void)
{
static GLubyte color[8][4] = { { 255, 0, 0, 0 },
{ 255, 0, 0, 255 },
@@ -104,7 +104,6 @@ int main(int argc, char *argv[])
const SDL_DisplayMode *mode;
SDL_Event event;
Uint32 then, now, frames;
int status;
/* Initialize parameters */
fsaa = 0;
@@ -116,9 +115,6 @@ int main(int argc, char *argv[])
return 1;
}
/* Enable standard application logging */
SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO);
for (i = 1; i < argc;) {
int consumed;
@@ -190,11 +186,7 @@ int main(int argc, char *argv[])
}
}
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) {
@@ -207,44 +199,38 @@ int main(int argc, char *argv[])
SDL_Log("Extensions : %s\n", 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_LogError(SDL_LOG_CATEGORY_APPLICATION, "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_LogError(SDL_LOG_CATEGORY_APPLICATION, "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_LogError(SDL_LOG_CATEGORY_APPLICATION, "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_LogError(SDL_LOG_CATEGORY_APPLICATION, "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_LogError(SDL_LOG_CATEGORY_APPLICATION, "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 {
@@ -253,8 +239,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_LogError(SDL_LOG_CATEGORY_APPLICATION, "Failed to get SDL_GL_ACCELERATED_VISUAL: %s\n",
@@ -266,8 +251,7 @@ int main(int argc, char *argv[])
for (i = 0; i < state->num_windows; ++i) {
float aspectAdjust;
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 */
@@ -297,8 +281,7 @@ int main(int argc, char *argv[])
if (event.type == SDL_EVENT_WINDOW_RESIZED) {
for (i = 0; i < state->num_windows; ++i) {
if (event.window.windowID == SDL_GetWindowID(state->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());
break;
}
@@ -317,8 +300,7 @@ int main(int argc, char *argv[])
if (state->windows[i] == NULL) {
continue;
}
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 */