Changeset View
Changeset View
Standalone View
Standalone View
source/lib/external_libraries/libsdl.cpp
/* Copyright (C) 2020 Wildfire Games. | /* Copyright (C) 2021 Wildfire Games. | ||||
* | * | ||||
* Permission is hereby granted, free of charge, to any person obtaining | * Permission is hereby granted, free of charge, to any person obtaining | ||||
* a copy of this software and associated documentation files (the | * a copy of this software and associated documentation files (the | ||||
* "Software"), to deal in the Software without restriction, including | * "Software"), to deal in the Software without restriction, including | ||||
* without limitation the rights to use, copy, modify, merge, publish, | * without limitation the rights to use, copy, modify, merge, publish, | ||||
* distribute, sublicense, and/or sell copies of the Software, and to | * distribute, sublicense, and/or sell copies of the Software, and to | ||||
* permit persons to whom the Software is furnished to do so, subject to | * permit persons to whom the Software is furnished to do so, subject to | ||||
* the following conditions: | * the following conditions: | ||||
Show All 13 Lines | |||||
#include "precompiled.h" | #include "precompiled.h" | ||||
#include "libsdl.h" | #include "libsdl.h" | ||||
#include "lib/debug.h" | #include "lib/debug.h" | ||||
#include <SDL_syswm.h> | #include <SDL_syswm.h> | ||||
#if defined(SDL_VIDEO_DRIVER_X11) && !CONFIG2_GLES | |||||
vladislavbelov: Empty line. | |||||
void* GetX11Display(SDL_Window* window) | |||||
{ | |||||
SDL_SysWMinfo wminfo; | |||||
SDL_VERSION(&wminfo.version); | |||||
const int ret = SDL_GetWindowWMInfo(window, &wminfo); | |||||
if (ret && wminfo.subsystem == SDL_SYSWM_X11) | |||||
{ | |||||
return reinterpret_cast<void*>(wminfo.info.x11.display); | |||||
} | |||||
return nullptr; | |||||
} | |||||
#endif | |||||
const char* GetSDLSubsystem(SDL_Window* window) | const char* GetSDLSubsystem(SDL_Window* window) | ||||
{ | { | ||||
SDL_SysWMinfo wminfo; | SDL_SysWMinfo wminfo; | ||||
// The info structure must be initialized with the SDL version. | // The info structure must be initialized with the SDL version. | ||||
SDL_VERSION(&wminfo.version); | SDL_VERSION(&wminfo.version); | ||||
if (!SDL_GetWindowWMInfo(window, &wminfo)) | if (!SDL_GetWindowWMInfo(window, &wminfo)) | ||||
{ | { | ||||
▲ Show 20 Lines • Show All 62 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator
Empty line.