Fast pixelwriting Userlib?

BlitzPlus Forums/BlitzPlus Programming/Fast pixelwriting Userlib?

Hi,

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

Thank you for your help,
JM

Have you tried pixel buffers:
LockedPixels

Thanks,

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

This might help:
B+ fast pixel functions made easy!

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.

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.

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.