Merge pull request #16 from dartvader316/use-bi-rgb-for-bitmap

use BI_RGB for bitmap and fix _WIN32
This commit is contained in:
Serge Zaitsev
2023-03-30 08:34:48 +02:00
committed by GitHub

View File

@ -178,7 +178,7 @@ static LRESULT CALLBACK fenster_wndproc(HWND hwnd, UINT msg, WPARAM wParam,
HDC memdc = CreateCompatibleDC(hdc);
HBITMAP hbmp = CreateCompatibleBitmap(hdc, f->width, f->height);
HBITMAP oldbmp = SelectObject(memdc, hbmp);
BITMAPINFO bi = {{sizeof(bi), f->width, -f->height, 1, 32, BI_BITFIELDS}};
BITMAPINFO bi = {{sizeof(bi), f->width, -f->height, 1, 32, BI_RGB}};
bi.bmiColors[0].rgbRed = 0xff;
bi.bmiColors[1].rgbGreen = 0xff;
bi.bmiColors[2].rgbBlue = 0xff;
@ -306,7 +306,7 @@ FENSTER_API int fenster_loop(struct fenster *f) {
}
#endif
#ifdef WIN32
#ifdef _WIN32
FENSTER_API void fenster_sleep(int64_t ms) { Sleep(ms); }
FENSTER_API int64_t fenster_time() {
LARGE_INTEGER freq, count;