[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: Re: [pygame] pygame.surfarray.pixels2d does not work with OpenGL?



Pygame depends on the libpng library to read PNG files. I don't know if the image format can be set. Even so, would libpng be fast enough for movies? Movies are handled separately. A new _movie module uses ffmpeg for decoding. Unfortunately it is still in development, currently not working with X11 on Debian squeeze.
 
Lenard Lindstrom
 
On Nov 4, 2011, Florian Krause <siebenhundertzehn@xxxxxxxxx> wrote:
I am afraid blitting takes as long as tostring(). This is problematic
for decoding and presenting (for example) fullscreen movies in OpenGL.

On 11/3/11, Lenard Lindstrom <len-l@xxxxxxxxx> wrote:
> You could create an empty surface with RGBA order, then blit to it:
>

[snip]
>
>
> Nov 2, 2011 05:28:17 AM, pygame-users@xxxxxxxx wrote:
>>

[snip]
>> Is there any way to have a 32 bit source alpha surface
>> have pixels in that order?
[snip]
>>
>> On Tue, Nov 1, 2011 at 10:14 PM, Lenard Lindstrom wrote:
>> > Hi,
>> >
>> > Function tostring unmaps each pixel into an RGBA sequence, with the R
>> > byte
>> > lowest. Function pixels2d returns a view of the actual surface memory. A
>> > 32
>> > bit source alpha surface need not, and probably does not, have pixels in
>> > an
>> > RGBA order.
>> >
>> > Lenard Lindstrom
>> >
>> > On Oct 31, 2011, Florian Krause wrote:
>> >
>> > Hi everyone,
>> >
>> > can anyone tell me what I am doing wrong here?
>> > Please have a look at the attached example code.
>> >
>> > When using pygame,image.tostring for getting the pixel values to
>> > transform them into a texture, everything works well (see the
>> > outcommented part with WORKS).
>> >
>> > However, when I replace this part with pygame.surfarray.pixels2d, then
>> > the resulting texture seems broken for some reason.
>> >
>> > Does anyone have an idea what is going on here?
>> >