Closed jiangbo closed 1 week ago
SetDisplayMode
requires DDSCL_EXCLUSIVE
to change the bit-depth of the display.
AFAIK, you should only call SetDisplayMode
from DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN
mode, it is not normally used in window mode (aka. DDSCL_NORMAL
). There may be other problems in your code, I haven't checked.
Should use 32-bit mode instead of 64-bit mode.
project: https://github.com/jiangbo/demo/tree/win32-panic, The whole code is only in main.zig. zig version: 0.13.0-dev.351+64ef45eb0
the IDirectDraw7_SetDisplayMode panic, and return 5.
error info:
update: the cpp code return S_OK, https://ziggit.dev/t/win32-setdisplaymode-api-return-a-error/4932/1