02-26-2023, 05:51 AM
Stick your code in a routine (rather than embedding it); this will allow you to easily experiment with different solutions.
I forgot to say that, when moving a visible XOred line, you just XOR it again to restore the original line. Then perform an XOR at the new position.
This means there is no need to "remember what is under the line"
Putting it in a routine means that your code is still simple to read as it will just be one call.
The overhead should be minimal as you are probably only going to be accessing about 1000 pixels per pixel row (2 accesses per pixel - one read, one write)
On windows there are techniques for accessing pixels on a raster basis (this is faster) but as you need a generic mechanism for different platforms, I suggest you access the pixels individually
This is only a possible suggestion - you know your code and any limitations due to the different drawing mechanisms.
Geoff
I forgot to say that, when moving a visible XOred line, you just XOR it again to restore the original line. Then perform an XOR at the new position.
This means there is no need to "remember what is under the line"
Putting it in a routine means that your code is still simple to read as it will just be one call.
The overhead should be minimal as you are probably only going to be accessing about 1000 pixels per pixel row (2 accesses per pixel - one read, one write)
On windows there are techniques for accessing pixels on a raster basis (this is faster) but as you need a generic mechanism for different platforms, I suggest you access the pixels individually
This is only a possible suggestion - you know your code and any limitations due to the different drawing mechanisms.
Geoff
Samsung Galaxy Tab A6