*LOAD

Here you can talk about anything related to BBC BASIC, not covered in another category
Richard Russell
Posts: 540
Joined: Tue 18 Jun 2024, 09:32

Re: *LOAD

Post by Richard Russell »

Ric wrote: Thu 08 Jan 2026, 08:02 simple( to you) things like getting the ASM to work with not just P% and getting the window handle from the structure you posted etc.....
These are (or at least should be) all documented, so are "simple" to the extent that you just need to look them up! For example the replacement of P% with ]^P% for 64-bit assembler code is documented in section 9f of the Differences between BB4W and BBCSDL document. Accessing a structure member is documented in the main Help manual.

Admittedly you may need to look further afield to find information which is not BBC BASIC specific. For example to recover the native window handle you need to refer to the documentation for the SDL_GetWindowWMinfo() function and converting 32-bit assembler code to 64-bit requires a knowledge of the 64-bit Windows ABI.

Inevitably you are breaking new ground here - it's highly unlikely that anybody else will have attempted to run Direct3D in BBCSDL - so there will be a need to research beyond what is documented in the BBC BASIC manuals etc. Although you can post here and wait for me or somebody else to link to the relevant web site, it would be quicker for you to do your own research. An AI chatbot will often find things.
Richard Russell
Posts: 540
Joined: Tue 18 Jun 2024, 09:32

Re: *LOAD

Post by Richard Russell »

Richard Russell wrote: Wed 07 Jan 2026, 22:48 I've now had a reply at the SDL forum explaining what I did wrong, although not why it crashed which does indeed seem to be an SDL2 bug.
For the record, the relevant environment variable is SDL_RENDER_DRIVER. So to run the 64-bit edition (only) of BBC BASIC for SDL 2.0 using the Direct3D rather than OpenGL backend do the following at a Windows command prompt:

Code: Select all

set SDL_RENDER_DRIVER=direct3d
bbcsdl
Alternatively for Direct3D 11 or 12:

Code: Select all

set SDL_RENDER_DRIVER=direct3d11 (or direct3d12)
bbcsdl
You can of course put these commands into a batch file, for example in order to run it from a desktop shortcut.

Features of BBCSDL which rely on the OpenGL backend will of course not work in this configuration. These include the GCOL 1/2/3 'logical' plotting modes (OR, AND, XOR), 3D rendering using the supplied ogllib and webgllib libraries, and shader programming using the shaderlib library. But everything else should run in a virtually identical fashion.

Don't expect this to work with the 32-bit version of BBCSDL, it will most likely crash.