Ric wrote: ↑Tue 06 Jan 2026, 19:14
the first program i have run that has not specifically been written for BBCSDL has thrown up this fault: "Number too big"
This issue is explicitly called out in the
Differences between BB4W and BBCSDL document, which says this: "
64-bit editions of BBCSDL... require that your BASIC program be compatible with 64-bit addresses. This means using 64-bit integer variables (%% suffix) or variant variables (no suffix) whenever they may contain an address or pointer".
2. @hwnd% is not the coerrect system variable in BBCSDL
That is almost certainly true, but fortunately there's an easy fix: call
SDL_GetWindowWMInfo() to obtain the native Windows window handle.
1. BBCSDL cant run D3D
I simply don't know the answer to that for sure, I've never tried it; you're breaking new ground here! One thing that will definitely be necessary is using *REFRESH OFF before attempting to access D3D, so there's no conflict.
Reasons to be hopeful that it
may work are as follows:
- SDL itself can definitely use Direct3D. indeed it's the default back-end renderer when SDL2 is running in Windows.
- I have successfully switched between two different versions of OpenGL, so switching to D3D may not be fundamentally any different.
Reasons to fear that it
might not work:
- BBCSDL uses OpenGL, it may be that running both OpenGL and Direct3D from the same process might break something.
- The way you are running Direct3D may accidentally rely on some feature specific to BBC BASIC for Windows.
Even if it doesn't work, all is not lost. There are still possible ways forward:
- Convert your BASIC program to run in OpenGL. If it largely uses custom shader code this might not be too difficult because shader language is very similar between different 3D back-ends.
- Build (from the source at GitHub) a custom version of BBCSDL which uses the Direct3D backend rather than OpenGL. That ought to be easier than it might sound at first, because SDL2 fully supports Direct3D.
Converting your program to OpenGL would of course potentially have the major benefit of making it compatible with MacOS, Linux (including Raspberry Pi), Android, iOS and running in a browser - hugely increasing its potential market and user base.