Always load "opengl32.dll" from application directory if it exists

This commit is contained in:
Cacodemon345
2025-07-07 17:44:47 +06:00
parent 4238b1fb02
commit 1b735084a4
2 changed files with 26 additions and 0 deletions

View File

@@ -177,14 +177,28 @@ do_stop(void)
#endif
}
extern bool acp_utf8;
void
plat_get_exe_name(char *s, int size)
{
#ifdef Q_OS_WINDOWS
wchar_t *temp;
if (acp_utf8)
GetModuleFileNameA(NULL, s, size);
else {
temp = (wchar_t*)calloc(size, sizeof(wchar_t));
GetModuleFileNameW(NULL, temp, size);
c16stombs(s, (uint16_t*)temp, size);
free(temp);
}
#else
QByteArray exepath_temp = QCoreApplication::applicationDirPath().toLocal8Bit();
memcpy(s, exepath_temp.data(), std::min((qsizetype) exepath_temp.size(), (qsizetype) size));
path_slash(s);
#endif
}
uint32_t