Fast pixelwriting Userlib?

BlitzPlus Forums/BlitzPlus Programming/Fast pixelwriting Userlib?

JulianM(Posted 2008) [#1]
Hi,

is there any userlib that acts like Writepixelfast but is faster?

Thank you for your help,
JM


Beaker(Posted 2008) [#2]
Have you tried pixel buffers:
LockedPixels


JulianM(Posted 2008) [#3]
Thanks,

but is there any good tutorial about this (LockedPixels)? It seems to be really complicated.


Beaker(Posted 2008) [#4]
This might help:
B+ fast pixel functions made easy!


JulianM(Posted 2008) [#5]
Thank you,

but my program isn't faster with those commands.

Perhaps the main problem isn't the pixel drawing.

Btw: Why is Rect that fast when painting the whole screen white?
I mean it takes less than 0.5 ms. With Lockedpixels and a For-Loop it takes about 11ms.


andy_mc(Posted 2008) [#6]
What is your program trying to do?

I think rect sends a complete instruction to the graphics card to draw a rectangle, instead of sending one pixel at a time like a for-loop does.


Beaker(Posted 2008) [#7]
You shouldn't use that code I linked to directly, but as a tutorial about how to get things working. That code just makes things easy, but isn't the fastest way to go about it. You should at least unroll/unwrap some of the functions, particularly FastWritePixelFormat1-4 and FastReadPixelFormat1-4. Also format checking should be done once only outside all loops (see FastWritePixel/FastReadPixel).

A DLL will still be faster of course.