A brand new game
for Windows, Linux, Mac, HTML5, 3DS Homebrew and more
12th January, 2018
I started work on Draw-To-Buffer today, and managed to get a couple of basic functions into place.
Create buffer of X/Y size, Clear buffer, Fill buffer with X Colour, Draw a line to the buffer, and then the most important one.
"Draw Tile from spritesheet onto Buffer"
I know that doesn't appear to be a magical image, above, but it's drawing about 100 tiles every frame to a 1024x1024 buffer, then drawing the buffer to the screen, without dropping any frames.
Maps and other tilemap buffer based things should be much easier to achieve in future.
There's a slight mis-match in that the tile drawing routine is based on Top-Left co-ordinates, whilst sprites work based on MidHandle co-ordinates, but that can hopefully be fixed.
Additionally, tiles can only be drawn as-is, since they're copied directly from memory location to the other. eg, no alpha, scaling, rotation or anything of that sort.
But it's better to have the functionality than not, and I'm sure that as I learn more, I can add on some more interesting additions to the function.
For now, though, it'll do.
... Assuming I ever bother to use it!!