Open
Description
This GH issue aims to both port and superseed pygame/pygame#2691 , to help bring the _sdl2.video
API to a stage that allows for straightforward porting to C, as proposed in #1929 , and a proper adoption in pygame.
The idea here is to have a list of actionable ideas in a checklist, which can either be branched out into separate issues or can be linked to a PR. The list can also be expanded by repository admins if necessary.
None of these ideas are final, and discussion around them is encouraged.
- Give
Texture
andImage
get_width()
,get_height()
, andget_size()
methods like surfaces- Reasoning: Hard to document, potentially confusing
- Remove readonly attributes from
Window
,Texture
andRenderer
- Rename
Renderer.present()
to.flip()
/.update()
- Create API for supporting multiple windows in
pygame.display
- Change
Renderer.fill_rect()
to impersonateSurface.fill()
- Change
Renderer.draw_*
methods to take in a color directly- Reasoning: The current “C like” set color flag then draw system is uncommon in pygame.
-
pygame.draw
compatibility forTexture
objects- Reasoning: A unified system for drawing that works for both
Surface
andTexture
.SDL_RenderGeometry()
(SDL 2.0.18) might come in handy. - Other ideas:
- A dedicated drawing module for
Textures
, using eitherSDL_RenderGeometry()
orSDL2_gfx
, called e.g.gpudraw
, given the complexity ofpygame.draw
and plans for merginggfxdraw
into it
- A dedicated drawing module for
- Reasoning: A unified system for drawing that works for both
- Eliminate
Image
objects, addTexture.subtexture
- Add compatibility for drawing
Surface
untoRenderer
- Reasoning: By e.g. making a streaming
Texture
the size of theRenderer
, and putting surface data into there before drawing it onto the Renderer, we could save people the trouble of adding a conversion step for dynamic surfaces like Text rendered every frame, as some things are always going to be Surfaces.
- Reasoning: By e.g. making a streaming
-
pygame.transform
compatibility forTexture
objects