Open mkraljt opened 4 years ago
There isn't. In OpenGL there are framebuffer objects, but I think that exposing those for general use might be a long way off.
How I wrote Tron in Pygame Zero isn't exactly how I would write it with hardware accelerated graphics. I'd just keep creating line segments and trust that it will remain fast.
Could in theory open up for people to write to pygame surfaces and upload to texture: https://github.com/moderngl/moderngl-window/blob/master/examples/advanced/pygame2.py
That could be an awesome or a terrible a idea depending on how you see it.
Yes for the Tron game, it worked well with line segments.
And looks like you are adding tile-maps for 1.4, which was the other use I was anticipating for pygame surface
Yes, I think this is a good idea. This would allow people to migrate from Pygame and immediately get the benefit of things like post-processing effects.
Via @einarf
https://github.com/moderngl/moderngl-window/blob/master/examples/advanced/pygame2.py
Works with alpha just using pygame.Surface(self.pg_res, flags=pygame.SRCALPHA) I get 4 bytes width height in pg_screen.get_view('1')
And looks like you are adding tile-maps for 1.4, which was the other use I was anticipating for pygame surface
@mkraljt Tile maps are now available on master
if you'd like to try them: https://wasabi2d.readthedocs.io/en/latest/tile_maps.html
@robertpfeiffer's original article explains it better than the code linked above: https://blubberquark.tumblr.com/post/185013752945/using-moderngl-for-post-processing-shaders-with
pygamezero examples use pygame Surface to render and test/set pixels, eg Tron example.
How do you render a pygame Surface in Wasabi2D? Or is there an alternative for Surface use-cases in pygamezero examples?