mirror of
https://github.com/tildearrow/furnace.git
synced 2024-11-17 10:05:11 +00:00
try CoInitializeEx on Windows
This commit is contained in:
parent
38f4b75b12
commit
6ccd2e222b
1 changed files with 13 additions and 0 deletions
13
src/main.cpp
13
src/main.cpp
|
@ -30,6 +30,7 @@
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
#define WIN32_LEAN_AND_MEAN
|
#define WIN32_LEAN_AND_MEAN
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
#include <combaseapi.h>
|
||||||
#include <shellapi.h>
|
#include <shellapi.h>
|
||||||
#else
|
#else
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
@ -243,6 +244,12 @@ void initParams() {
|
||||||
// TODO: add crash log
|
// TODO: add crash log
|
||||||
int main(int argc, char** argv) {
|
int main(int argc, char** argv) {
|
||||||
initLog();
|
initLog();
|
||||||
|
#ifdef _WIN32
|
||||||
|
HRESULT coResult=CoInitializeEx(NULL,COINIT_MULTITHREADED);
|
||||||
|
if (coResult!=S_OK) {
|
||||||
|
logE("CoInitializeEx failed!");
|
||||||
|
}
|
||||||
|
#endif
|
||||||
#if !(defined(__APPLE__) || defined(_WIN32) || defined(ANDROID))
|
#if !(defined(__APPLE__) || defined(_WIN32) || defined(ANDROID))
|
||||||
// workaround for Wayland HiDPI issue
|
// workaround for Wayland HiDPI issue
|
||||||
if (getenv("SDL_VIDEODRIVER")==NULL) {
|
if (getenv("SDL_VIDEODRIVER")==NULL) {
|
||||||
|
@ -446,6 +453,12 @@ int main(int argc, char** argv) {
|
||||||
|
|
||||||
logI("stopping engine.");
|
logI("stopping engine.");
|
||||||
e.quit();
|
e.quit();
|
||||||
|
|
||||||
|
#ifdef _WIN32
|
||||||
|
if (coResult==S_OK || coResult==S_FALSE) {
|
||||||
|
CoUninitialize();
|
||||||
|
}
|
||||||
|
#endif
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue