Discussions about the BBC BASIC language, with particular reference to BB4W and BBCSDL
9 posts • Page 1 of 1
Of course you can do it (remember the rotating objects in Xmas Demo II for example, or the old rotating playing cards demos?) but - at least until the 2D graphics library that I suggested gets written - the method is entirely different for BB4W and BBCSDL, and you don't say which you are using!
OK. In the absence of the proposed 2D library you will have no choice but to use a conditional test, typically of INKEY$(-256), to discover what platform it is (BB4W or BBCSDL) and execute the appropriate platform-specific code.
How important is performance (i.e. speed) to your application? Do you need support for an 'alpha channel' (e.g. a sprite with transparent regions)? Do you need scaling as well as rotation? Depending on the answers I may be able to throw together a quick-and-dirty 2D library which will allow you to make progress. The BBCSDL code is no problem - I have that - but I don't currently have functionally-equivalent BB4W code and it would have to be cobbled-together.
Leaving me to guess whether you need support for an alpha channel. This is crucial, because if you don't you can use the PlgBlt API, but if you do it's going to need a much more complicated solution (such as assembler code). As you haven't answered, there's nothing I can do. Sorry.
In that case it shouldn't need anything complicated like assembler code: you could use SYS "PlgBlt" in the BB4W case and SYS "SDL_RenderCopyEx" in the BBCSDL case. Both can do rotation and scaling, but PlgBlt has no alpha (transparency) capability. Do you still need me to help with that, or is it within your skillset?