Skip to content

Commit b444069

Browse files
committed
gfxlib: fix sf.net #898: fbc win gfxlib DirectX driver
- failed to initialize on 64-bit - due to incorrect construction of DIDATAFORMAT for keyboard device (cherry picked from commit 1977ec2)
1 parent 56f4944 commit b444069

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

changelog.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ Version 1.07.1
4949
- makefile: under MSYS2 (and friends), TARGET_ARCH is now identified from shell's default target architecture instead of shell's host architecture
5050
- sf.net #904; gcc backend: pass '-Wno-format' to prevent format string errors in gcc 9.x (enabled by default with -Wall)
5151
- sf.net #910: cast(string, variable) can cause fbc to segfault (infinite recursion), due to misplaced const & non-const casting
52+
- sf.net #898: fbc win gfxlib DirectX driver failed to initialize on 64-bit, due to incorrect construction of DIDATAFORMAT for keyboard device (macko17)
5253

5354

5455
Version 1.07.0

src/gfxlib2/win32/gfx_driver_ddraw.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,9 @@ typedef HRESULT (WINAPI *DIRECTDRAWENUMERATEEX)(LPDDENUMCALLBACKEX lpCallback,LP
7575
#endif
7676

7777
static DIOBJECTDATAFORMAT __c_rgodfDIKeyboard[256];
78-
static const DIDATAFORMAT __c_dfDIKeyboard = { 24, 16, 0x2, 256, 256, __c_rgodfDIKeyboard };
78+
static const DIDATAFORMAT __c_dfDIKeyboard = { sizeof(__c_dfDIKeyboard), sizeof(*__c_rgodfDIKeyboard),
79+
DIDF_RELAXIS, 256,
80+
ARRAYSIZE(__c_rgodfDIKeyboard), __c_rgodfDIKeyboard };
7981
static HMODULE dd_library;
8082
static HMODULE di_library;
8183
static LPDIRECTDRAW2 lpDD = NULL;

0 commit comments

Comments
 (0)