[Lazarus] Fast drawing to canvas

dhkblaszyk at zeelandnet.nl dhkblaszyk at zeelandnet.nl
Fri Feb 10 17:11:21 CET 2012


> On Fri, 10 Feb 2012 11:34:20 +0100
> dhkblaszyk at zeelandnet.nl wrote:
>
>> properly. I have not used OpenGL but TImage instead. In other tests I
>> have never seen any actual speed improvements of OpenGL over a native
>> canvas, unless you create memory textures and can utilize the hardware
>> acceleration.
> What is the difference between a texture and a memory texture?
> I never heard the second term.

I was talking about glDrawPixels (CPU) and glBindTexture (GPU). The latter
being much faster of course.

>> The reason to stream directly form disk is that if I
>> would like to display a longer list of images I will not be able to
>> store them in memory. Say I have a movie clip @ 24fps for 60sec. This
>> would require (50%HD) 24 * 60 * 1.5 = 2GB of memory. What if I would
>> like to display 10min?
> Why are you displaying single images at all?
> It sounds a lot like you are playing movie clips, so why do you not use a
> suitable codec/container combination like xvid/avi, h.264/mpeg-4 or some
> other video format that fits your needs?

Yes, I'm playing movie clips. But playing back images from a video codec
is besides the point. 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. Creating memory caches will not help in this
situation because they will have to be so large (in the order of 1GB just
to playback 60sec) that the system will grind to a halt.

Regards, Darius





More information about the Lazarus mailing list