Codechange: refactor the Windows-only DllLoader in a cross-platform LibraryLoader (#11751)
This commit is contained in:
@@ -22,6 +22,7 @@
|
||||
#include "../window_gui.h"
|
||||
#include "../window_func.h"
|
||||
#include "../framerate_type.h"
|
||||
#include "../library_loader.h"
|
||||
#include "win32_v.h"
|
||||
#include <windows.h>
|
||||
#include <imm.h>
|
||||
@@ -976,11 +977,11 @@ float VideoDriver_Win32Base::GetDPIScale()
|
||||
static bool init_done = false;
|
||||
if (!init_done) {
|
||||
init_done = true;
|
||||
static DllLoader _user32(L"user32.dll");
|
||||
static DllLoader _shcore(L"shcore.dll");
|
||||
_GetDpiForWindow = _user32.GetProcAddress("GetDpiForWindow");
|
||||
_GetDpiForSystem = _user32.GetProcAddress("GetDpiForSystem");
|
||||
_GetDpiForMonitor = _shcore.GetProcAddress("GetDpiForMonitor");
|
||||
static LibraryLoader _user32("user32.dll");
|
||||
static LibraryLoader _shcore("shcore.dll");
|
||||
_GetDpiForWindow = _user32.GetFunction("GetDpiForWindow");
|
||||
_GetDpiForSystem = _user32.GetFunction("GetDpiForSystem");
|
||||
_GetDpiForMonitor = _shcore.GetFunction("GetDpiForMonitor");
|
||||
}
|
||||
|
||||
UINT cur_dpi = 0;
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
#include "video_driver.hpp"
|
||||
#include <mutex>
|
||||
#include <condition_variable>
|
||||
#include <windows.h>
|
||||
|
||||
/** Base class for Windows video drivers. */
|
||||
class VideoDriver_Win32Base : public VideoDriver {
|
||||
|
||||
Reference in New Issue
Block a user