writepixelfast
BlitzPlus Forums/BlitzPlus Programming/writepixelfast
| ||
Graphics 800,600,32 Plot 0,0 b=ReadPixel (0,0) LockBuffer FrontBuffer() time=MilliSecs() For x = 0 To 799 For y =0 To 599 WritePixelFast x,y,b Next Next time= MilliSecs()-time UnlockBuffer FrontBuffer() Color 9,9,9 Text 0,0,time WaitKey why does the above code give a time of 55 milliseconds on a friend's 450mhz PC while my 3ghz PC returns a time of 63 milliseconds? |
| ||
Probably because it's more dependent on the gfx card than the CPU. What card does your friend hae? |
| ||
If you comment out the WritePixelFast command you will see the time drop to about 7. This means that nearly 90% of the time is used by the graphics card. Your code really tests how fast the card does 2d drawing on single pixels. Modern graphics cards are optimized to excel in other areas. And if you thought that was slow try again with ReadPixelFast. |
| ||
He has a Voodoo2, I have a MOBILITY RADEON 9000 128MB! |
| ||
Incidentally I thought writepixelfast was a processor thing. |