DirectWrite support #28

Merged
IoI_xD merged 13 commits from directwrite into master 2026-07-18 11:39:53 +09:00
Showing only changes of commit fbc2679fc3 - Show all commits

Sure we'll dynload CoInitialize
Some checks are pending
pyrite-dev/milsko/pipeline/head Build started...

IoIxD 2026-07-17 19:36:17 -07:00

View file

@ -532,6 +532,20 @@ static CustomTextRenderer* CustomTextRenderer_Create(IDWriteFactory6* write_fact
int MWFL_DWSetup(void) {
HRESULT hr;
HANDLE ole32lib;
/* CoInitialize, to my knowledge, is avaliable on every Windows version we actually support. But as of writing, CI fails because a specific mingw won't link to it by default. I'm not gonna waste my time chancing that it will properly link to ole32 either. */
HRESULT (*CoInitialize)(LPVOID pvReserved);
ole32lib = LoadLibrary("Ole32.dll");
if(!ole32lib) {
printf("ole32lib not found, cannot use DirectWrite\n");
return 1;
}
CoInitialize = (HRESULT (*)(LPVOID pvReserved))GetProcAddress(ole32lib, "CoInitialize");
if(!CoInitialize) {
printf("CoInitialize not found, cannot use DirectWrite\n");
return 1;
}
CoInitialize(NULL);