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

Re: [pygame] OpenGL stretch of a pygame.Surface



Right now you are blitting tiles to a 640x480 surface, and then performing a transform on the whole surface and then blitting it to the display?

If this is the case, then try to only perform the scale operation when the resolution is changed (instead of once each frame) and see how that works. ÂI know you mentioned that the full screen blit operation seems to be the main bottleneck, but this should help too.





On Mon, Jul 28, 2014 at 7:32 AM, Sam Bull <sam.hacking@xxxxxxxx> wrote:
On lun, 2014-07-28 at 06:54 +0200, VertPingouin wrote:
> So I came up with the idea of an hardware opengl texture stretching
> instead of a dumb blit but I don't know how to achieve it.
>
> Anyone has already done this ?
>

You would just need to code the graphics in OpenGL without using
pygame.Surface and pygame.draw. First though, check you are using the
HWSURFACE flag, if you are running fullscreen, it's possible this might
provide the necessary speedup without going to OpenGL.

http://www.pygame.org/docs/ref/display.html#pygame.display.set_mode