1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-11-28 08:48:48 +02:00

Capture SDL log

* just a stub for now
This commit is contained in:
AlexVinS 2015-06-22 22:19:32 +03:00
parent cc669b0ae7
commit f58148cd94

View File

@ -180,6 +180,18 @@ static void prog_help(const po::options_description &opts)
// printf(" -v, --version display version information and exit\n");
}
static void SDLLogCallback(void* userdata,
int category,
SDL_LogPriority priority,
const char* message)
{
//todo: convert SDL log priority to vcmi log priority
//todo: make separate log domain for SDL
logGlobal->debugStream() << "SDL(category " << category << "; priority " <<priority <<") "<<message;
}
#ifdef VCMI_APPLE
void OSX_checkForUpdates();
#endif
@ -339,6 +351,8 @@ int main(int argc, char** argv)
GH.mainFPSmng->init(); //(!)init here AFTER SDL_Init() while using SDL for FPS management
atexit(SDL_Quit);
SDL_LogSetOutputFunction(&SDLLogCallback, nullptr);
int driversCount = SDL_GetNumRenderDrivers();
std::string preferredDriverName = video["driver"].String();