SDL_GetRendererInfo crash
问题 the following program runs until SDL_GetRendererInfo is called (in function RenderInit()), and then stops working before SDL_GetError can do anything. replacing global_renderer with a null SDL_Renderer pointer doesn't cause a crash and the expected sdl error is gotten. #include <iostream> #include <list> #include "SDL.h" using namespace std; //global variables: bool run = true; // whether or not the program should be running int global_window_width = 50; //width of window in tiles int global