diff --git a/SDL/SDLGLGraphicsContext.cpp b/SDL/SDLGLGraphicsContext.cpp index 598bbd1ac8..54756b7367 100644 --- a/SDL/SDLGLGraphicsContext.cpp +++ b/SDL/SDLGLGraphicsContext.cpp @@ -51,13 +51,13 @@ int CheckEGLErrors(const char *file, int line) { case EGL_BAD_NATIVE_WINDOW: errortext = "EGL_BAD_NATIVE_WINDOW"; break; default: errortext = "unknown"; break; } - printf( "ERROR: EGL Error %s detected in file %s at line %d (0x%X)\n", errortext, file, line, error ); + fprintf( stderr, "ERROR: EGL Error %s detected in file %s at line %d (0x%X)\n", errortext, file, line, error ); return 1; } #define EGL_ERROR(str, check) { \ if (check) CheckEGLErrors( __FILE__, __LINE__ ); \ - printf("EGL ERROR: " str "\n"); \ + fprintf(stderr, "EGL ERROR: " str "\n"); \ return 1; \ } @@ -91,7 +91,7 @@ static int8_t EGL_Open(SDL_Window *window) { SDL_SysWMinfo sysInfo{}; SDL_VERSION(&sysInfo.version); if (!SDL_GetWindowWMInfo(window, &sysInfo)) { - printf("ERROR: Unable to retrieve native window handle\n"); + fprintf(stderr, "ERROR: Unable to retrieve native window handle\n"); g_Display = (EGLNativeDisplayType)XOpenDisplay(nullptr); g_XDisplayOpen = g_Display != nullptr; if (!g_XDisplayOpen) @@ -394,9 +394,9 @@ int SDLGLGraphicsContext::Init(SDL_Window *&window, int x, int y, int w, int h, #ifdef USING_EGL if (EGL_Open(window) != 0) { - printf("EGL_Open() failed\n"); + fprintf(stderr, "EGL_Open() failed\n"); } else if (EGL_Init(window) != 0) { - printf("EGL_Init() failed\n"); + fprintf(stderr, "EGL_Init() failed\n"); } else { useEGLSwap = true; } @@ -411,7 +411,7 @@ int SDLGLGraphicsContext::Init(SDL_Window *&window, int x, int y, int w, int h, GLenum glew_err = glewInit(); // glx is not required, igore. if (glew_err != GLEW_OK && glew_err != GLEW_ERROR_NO_GLX_DISPLAY) { - printf("Failed to initialize glew!\n"); + fprintf(stderr, "Failed to initialize glew!\n"); return 1; } // Unfortunately, glew will generate an invalid enum error, ignore. @@ -419,9 +419,9 @@ int SDLGLGraphicsContext::Init(SDL_Window *&window, int x, int y, int w, int h, glGetError(); if (GLEW_VERSION_2_0) { - printf("OpenGL 2.0 or higher.\n"); + fprintf(stderr, "OpenGL 2.0 or higher.\n"); } else { - printf("Sorry, this program requires OpenGL 2.0.\n"); + fprintf(stderr, "Sorry, this program requires OpenGL 2.0.\n"); return 1; } #endif diff --git a/SDL/SDLMain.cpp b/SDL/SDLMain.cpp index 91413b9cfc..252bc3c747 100644 --- a/SDL/SDLMain.cpp +++ b/SDL/SDLMain.cpp @@ -233,7 +233,7 @@ void System_Toast(std::string_view text) { std::wstring str = ConvertUTF8ToWString(text); MessageBox(0, str.c_str(), L"Toast!", MB_ICONINFORMATION); #else - fprintf(stderr, "%*.s", (int)text.length(), text.data()); + fprintf(stderr, "%*.s", (int)text.length(), text.data()); #endif } @@ -1029,7 +1029,7 @@ static void ProcessSDLEvent(SDL_Window *window, const SDL_Event &event, InputSta #ifdef _DEBUG if (k == SDLK_F7) { - printf("f7 pressed - rebooting emuthread\n"); + fprintf("f7 pressed - rebooting emuthread\n"); g_rebootEmuThread = true; } #endif @@ -1394,8 +1394,8 @@ static int printUsage(const char *progname) fprintf(dst, " --pause-menu-exit change \"Exit to menu\" in pause menu to \"Exit\"\n"); fprintf(dst, " --escape-exit escape key exits the application\n"); fprintf(dst, " --gamesettings go directly to settings\n"); - fprintf(dst, " --touchscreentest go directly to the touchscreentest screen\n"); - fprintf(dst, " --appendconfig=FILE merge config FILE into the current configuration\n"); + fprintf(dst, " --touchscreentest go directly to the touchscreentest screen\n"); + fprintf(dst, " --appendconfig=FILE merge config FILE into the current configuration\n"); return 0; } @@ -1471,7 +1471,7 @@ int main(int argc, char *argv[]) { Uint32 mode = 0; for (int i = 1; i < argc; i++) { - if (!strcmp(argv[i],"--fullscreen")) { + if (!strcmp(argv[i], "--fullscreen")) { mode |= SDL_WINDOW_FULLSCREEN_DESKTOP; g_Config.iForceFullScreen = 1; } else if (set_xres == -2) @@ -1482,19 +1482,19 @@ int main(int argc, char *argv[]) { set_dpi = parseFloat(argv[i]); else if (set_scale == -2) set_scale = parseFloat(argv[i]); - else if (!strcmp(argv[i],"--xres")) + else if (!strcmp(argv[i], "--xres")) set_xres = -2; - else if (!strcmp(argv[i],"--yres")) + else if (!strcmp(argv[i], "--yres")) set_yres = -2; - else if (!strcmp(argv[i],"--dpi")) + else if (!strcmp(argv[i], "--dpi")) set_dpi = -2; - else if (!strcmp(argv[i],"--scale")) + else if (!strcmp(argv[i], "--scale")) set_scale = -2; - else if (!strcmp(argv[i],"--ipad")) + else if (!strcmp(argv[i], "--ipad")) set_ipad = true; - else if (!strcmp(argv[i],"--portrait")) + else if (!strcmp(argv[i], "--portrait")) portrait = true; - else if (!strncmp(argv[i],"--graphics=", strlen("--graphics="))) { + else if (!strncmp(argv[i], "--graphics=", strlen("--graphics="))) { const char *restOfOption = argv[i] + strlen("--graphics="); double val=-1.0; // Yes, floating point. if (!strcmp(restOfOption, "vulkan")) {