[Lazarus] Fast drawing to canvas

Reimar Grabowski reimgrab at web.de
Fri Feb 10 19:21:58 CET 2012


On Fri, 10 Feb 2012 17:11:21 +0100 (CET)
dhkblaszyk at zeelandnet.nl wrote:

> I was talking about glDrawPixels (CPU) and glBindTexture (GPU). The latter
> being much faster of course.
glDrawPixels should be avoided as much as possible.
Btw. glBindTexture is not really comparable to glDrawPixels, glTex(Sub)ImageXD is the comparable function with the sub one mostly being faster even if you update a complete texture.


> Yes, I'm playing movie clips. But playing back images from a video codec
> is besides the point.
If you say so, but that is exactly what you are doing.

> I have implemented my own "simple" raw image codec
> (filecache.pas) that reads pixels from disk. My problems lie with the
> playback of video. It has proven to be very difficult to playback video
> (on Mac) with an acceptable speed. Full HD images are played back @ 11fps
> wich is just too slow.
The fastest way should be using OpenGL. But not some naive implementation like it seems to be the case with the OpenGL tests performed by followers of this thread.
The magic words are PBO and texture streaming. This approach reads the data directly into a buffer on the graphics card which you use as texture to display your images. You can even read the data in an other thread than the OpenGL one. Only the reading of the data is performed on the CPU and the data will go from disk straight to VRAM.

hih
R.




More information about the Lazarus mailing list