Skip to content

SDL2 video ideas, revisited #1932

Open
Open
@Mega-JC

Description

@Mega-JC

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 and Image get_width(), get_height(), and get_size() methods like surfaces
    • Reasoning: Hard to document, potentially confusing
  • Remove readonly attributes from Window, Texture and Renderer
  • Rename Renderer.present() to .flip() / .update()
  • Create API for supporting multiple windows in pygame.display
  • Change Renderer.fill_rect() to impersonate Surface.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 for Texture objects
    • Reasoning: A unified system for drawing that works for both Surface and Texture. SDL_RenderGeometry() (SDL 2.0.18) might come in handy.
    • Other ideas:
      • A dedicated drawing module for Textures, using either SDL_RenderGeometry() or SDL2_gfx, called e.g. gpudraw , given the complexity of pygame.draw and plans for merging gfxdraw into it
  • Eliminate Image objects, add Texture.subtexture
  • Add compatibility for drawing Surface unto Renderer
    • Reasoning: By e.g. making a streaming Texture the size of the Renderer, 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.
  • pygame.transform compatibility for Texture objects

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions