Searching for a quicker rect commandArchives Forums/BlitzPlus Programming/Searching for a quicker rect command
I'm developping a sprite editor for amstrad cpc in B+.
As i use two canvas, one for drawing operations, and one for the real view, i use the "rect" command in two loops (x and y) to Refresh the sprites into the two canvas.
All the data's of the sprite are in an array.
My problem is that a 48*96pixels sprites is too slow.
Does someone has ideas to optimise my Refresh function ?
| Any draw command like plot, rect, and line will be slow. Maybe you could use sprites to render your sprites, like pre-rendering a bunch of different colored 48x96 squares, then using the DrawImage command. That would certainly be faster than using Rect. |
| Thanks a lot, i'll try that |
| btw you dont have to use 2 canvases 1 is enough|
when you use CanvasBuffer() it sets the buffer to the backbuffer of the canvas you still have to use FlipCanvas()
[Draw your stuff]
;stuff is invisible until now!!
flipcanvas canvas;render evrything visible
;now evrything gets visible
and with what happened with my computer i think 2 canvases when you only need 1 is very slow
| B+ should be able to draw rects all around the screen without a glitch. |