mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-04-21 14:55:39 +00:00
Remove newlines from log messages
This commit is contained in:
committed by
Sam Lantinga
parent
17625e20df
commit
718034f5fa
@@ -203,9 +203,9 @@ static void LogSwapInterval(void)
|
||||
{
|
||||
int interval = 0;
|
||||
if (SDL_GL_GetSwapInterval(&interval)) {
|
||||
SDL_Log("Swap Interval : %d\n", interval);
|
||||
SDL_Log("Swap Interval : %d", interval);
|
||||
} else {
|
||||
SDL_Log("Swap Interval : %d error: %s\n", interval, SDL_GetError());
|
||||
SDL_Log("Swap Interval : %d error: %s", interval, SDL_GetError());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -282,13 +282,13 @@ int main(int argc, char *argv[])
|
||||
/* Create OpenGL context */
|
||||
context = SDL_GL_CreateContext(state->windows[0]);
|
||||
if (!context) {
|
||||
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "SDL_GL_CreateContext(): %s\n", SDL_GetError());
|
||||
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "SDL_GL_CreateContext(): %s", SDL_GetError());
|
||||
quit(2);
|
||||
}
|
||||
|
||||
/* Important: call this *after* creating the context */
|
||||
if (!LoadContext(&ctx)) {
|
||||
SDL_Log("Could not load GL functions\n");
|
||||
SDL_Log("Could not load GL functions");
|
||||
quit(2);
|
||||
return 0;
|
||||
}
|
||||
@@ -298,68 +298,68 @@ int main(int argc, char *argv[])
|
||||
|
||||
mode = SDL_GetCurrentDisplayMode(SDL_GetPrimaryDisplay());
|
||||
if (mode) {
|
||||
SDL_Log("Screen BPP : %d\n", SDL_BITSPERPIXEL(mode->format));
|
||||
SDL_Log("Screen BPP : %d", SDL_BITSPERPIXEL(mode->format));
|
||||
}
|
||||
|
||||
LogSwapInterval();
|
||||
|
||||
SDL_GetWindowSize(state->windows[0], &dw, &dh);
|
||||
SDL_Log("Window Size : %d,%d\n", dw, dh);
|
||||
SDL_Log("Window Size : %d,%d", dw, dh);
|
||||
SDL_GetWindowSizeInPixels(state->windows[0], &dw, &dh);
|
||||
SDL_Log("Draw Size : %d,%d\n", dw, dh);
|
||||
SDL_Log("\n");
|
||||
SDL_Log("Vendor : %s\n", ctx.glGetString(GL_VENDOR));
|
||||
SDL_Log("Renderer : %s\n", ctx.glGetString(GL_RENDERER));
|
||||
SDL_Log("Version : %s\n", ctx.glGetString(GL_VERSION));
|
||||
SDL_Log("Extensions : %s\n", ctx.glGetString(GL_EXTENSIONS));
|
||||
SDL_Log("\n");
|
||||
SDL_Log("Draw Size : %d,%d", dw, dh);
|
||||
SDL_Log("%s", "");
|
||||
SDL_Log("Vendor : %s", ctx.glGetString(GL_VENDOR));
|
||||
SDL_Log("Renderer : %s", ctx.glGetString(GL_RENDERER));
|
||||
SDL_Log("Version : %s", ctx.glGetString(GL_VERSION));
|
||||
SDL_Log("Extensions : %s", ctx.glGetString(GL_EXTENSIONS));
|
||||
SDL_Log("%s", "");
|
||||
|
||||
if (SDL_GL_GetAttribute(SDL_GL_RED_SIZE, &value)) {
|
||||
SDL_Log("SDL_GL_RED_SIZE: requested %d, got %d\n", 5, value);
|
||||
SDL_Log("SDL_GL_RED_SIZE: requested %d, got %d", 5, value);
|
||||
} else {
|
||||
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Failed to get SDL_GL_RED_SIZE: %s\n", SDL_GetError());
|
||||
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Failed to get SDL_GL_RED_SIZE: %s", SDL_GetError());
|
||||
}
|
||||
if (SDL_GL_GetAttribute(SDL_GL_GREEN_SIZE, &value)) {
|
||||
SDL_Log("SDL_GL_GREEN_SIZE: requested %d, got %d\n", 5, value);
|
||||
SDL_Log("SDL_GL_GREEN_SIZE: requested %d, got %d", 5, value);
|
||||
} else {
|
||||
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Failed to get SDL_GL_GREEN_SIZE: %s\n", SDL_GetError());
|
||||
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Failed to get SDL_GL_GREEN_SIZE: %s", SDL_GetError());
|
||||
}
|
||||
if (SDL_GL_GetAttribute(SDL_GL_BLUE_SIZE, &value)) {
|
||||
SDL_Log("SDL_GL_BLUE_SIZE: requested %d, got %d\n", 5, value);
|
||||
SDL_Log("SDL_GL_BLUE_SIZE: requested %d, got %d", 5, value);
|
||||
} else {
|
||||
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Failed to get SDL_GL_BLUE_SIZE: %s\n", SDL_GetError());
|
||||
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Failed to get SDL_GL_BLUE_SIZE: %s", SDL_GetError());
|
||||
}
|
||||
if (SDL_GL_GetAttribute(SDL_GL_DEPTH_SIZE, &value)) {
|
||||
SDL_Log("SDL_GL_DEPTH_SIZE: requested %d, got %d\n", 16, value);
|
||||
SDL_Log("SDL_GL_DEPTH_SIZE: requested %d, got %d", 16, value);
|
||||
} else {
|
||||
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Failed to get SDL_GL_DEPTH_SIZE: %s\n", SDL_GetError());
|
||||
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Failed to get SDL_GL_DEPTH_SIZE: %s", SDL_GetError());
|
||||
}
|
||||
if (SDL_GL_GetAttribute(SDL_GL_CONTEXT_RELEASE_BEHAVIOR, &value)) {
|
||||
SDL_Log("SDL_GL_CONTEXT_RELEASE_BEHAVIOR: requested %d, got %d\n", 0, value);
|
||||
SDL_Log("SDL_GL_CONTEXT_RELEASE_BEHAVIOR: requested %d, got %d", 0, value);
|
||||
} else {
|
||||
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Failed to get SDL_GL_CONTEXT_RELEASE_BEHAVIOR: %s\n", SDL_GetError());
|
||||
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Failed to get SDL_GL_CONTEXT_RELEASE_BEHAVIOR: %s", SDL_GetError());
|
||||
}
|
||||
if (fsaa) {
|
||||
if (SDL_GL_GetAttribute(SDL_GL_MULTISAMPLEBUFFERS, &value)) {
|
||||
SDL_Log("SDL_GL_MULTISAMPLEBUFFERS: requested 1, got %d\n", value);
|
||||
SDL_Log("SDL_GL_MULTISAMPLEBUFFERS: requested 1, got %d", value);
|
||||
} else {
|
||||
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Failed to get SDL_GL_MULTISAMPLEBUFFERS: %s\n",
|
||||
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Failed to get SDL_GL_MULTISAMPLEBUFFERS: %s",
|
||||
SDL_GetError());
|
||||
}
|
||||
if (SDL_GL_GetAttribute(SDL_GL_MULTISAMPLESAMPLES, &value)) {
|
||||
SDL_Log("SDL_GL_MULTISAMPLESAMPLES: requested %d, got %d\n", fsaa,
|
||||
SDL_Log("SDL_GL_MULTISAMPLESAMPLES: requested %d, got %d", fsaa,
|
||||
value);
|
||||
} else {
|
||||
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Failed to get SDL_GL_MULTISAMPLESAMPLES: %s\n",
|
||||
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Failed to get SDL_GL_MULTISAMPLESAMPLES: %s",
|
||||
SDL_GetError());
|
||||
}
|
||||
}
|
||||
if (accel >= 0) {
|
||||
if (SDL_GL_GetAttribute(SDL_GL_ACCELERATED_VISUAL, &value)) {
|
||||
SDL_Log("SDL_GL_ACCELERATED_VISUAL: requested %d, got %d\n", accel,
|
||||
SDL_Log("SDL_GL_ACCELERATED_VISUAL: requested %d, got %d", accel,
|
||||
value);
|
||||
} else {
|
||||
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Failed to get SDL_GL_ACCELERATED_VISUAL: %s\n",
|
||||
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Failed to get SDL_GL_ACCELERATED_VISUAL: %s",
|
||||
SDL_GetError());
|
||||
}
|
||||
}
|
||||
@@ -398,7 +398,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
if (update_swap_interval) {
|
||||
SDL_Log("Swap interval to be set to %d\n", swap_interval);
|
||||
SDL_Log("Swap interval to be set to %d", swap_interval);
|
||||
}
|
||||
|
||||
for (i = 0; i < state->num_windows; ++i) {
|
||||
@@ -428,7 +428,7 @@ int main(int argc, char *argv[])
|
||||
/* Print out some timing information */
|
||||
now = SDL_GetTicks();
|
||||
if (now > then) {
|
||||
SDL_Log("%2.2f frames per second\n",
|
||||
SDL_Log("%2.2f frames per second",
|
||||
((double)frames * 1000) / (now - then));
|
||||
}
|
||||
quit(0);
|
||||
@@ -439,7 +439,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "No OpenGL support on this system\n");
|
||||
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "No OpenGL support on this system");
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user