Richard Russell wrote: ↑Thu 12 Mar 2026, 09:21
But generally alignment
within structures matters, just as it does in 32-bits. Moving to 64-bits doesn't alter the requirement to align structure members, but of course that alignment will typically be different (commonly 8 bytes rather than 4).
I found the issue, and it was indeed one of alignment. I had expected that the DXGI_MODE_DESC structure would need to be padded to a multiple of 8 bytes, but it turns out that with the particular structure packing method used in this case it
doesn't, so you must
remove the Padding% member I added.
But of course now, with the DXGI_MODE_DESC structure no longer a multiple of 8-bytes long, this throws out the alignment of the subsequent members of the DXGI_SWAP_CHAIN_DESC structure. So you must
insert 4 bytes of padding
before the OutputWindow%% member to restore it.
With those two changes (in effect one change: moving
Padding% from one place to another) it works consistently here. I'm not too sure why it worked for me the other day, but I'm sure it did.
The unfortunate thing is that without carefully studying the header files uses by Microsoft you don't know what packing option was used by the C compiler, so you don't know exactly what you need to do in BBC BASIC to match it.