Issue #36 resolved

sdl2.ext.RenderContext -> sdl2.ext.Renderer

anatoly techtonik
created an issue

It looks like sdl2.ext.RenderContext is the same type of object as sdl2.ext.SpriteRenderer and sdl2.ext.TextureSpriteRenderer. Why it is not named just sdl2.ext.Renderer for consistency?

Comments (8)

  1. Marcus von Appen repo owner

    They are not the same type of object.

    The RenderContext provides the low-level functionality of drawing onto a target, while the SpriteRenderer, SoftwareSpriteRenderer and TextureSpriteRenderer

    • only take care of Sprite objects
    • are higher-level System implementations for a COP design
  2. anatoly techtonik reporter

    Yes, but the basic API is Renderer API, not RendererContext API. I'd rename those *Renderers to SpriteComponent which is subclass of Renderer. Because System call are not connected to Renderer API.

  3. anatoly techtonik reporter

    I mean that I needed just a plain helper for working with SDL2 Renderer and I was confused to see RenderContext instead. SpriteRenderer and friends are clearly superior to RenderContext, but they are too far from SDL2 renderer concept, no?

  4. Marcus von Appen repo owner
    • changed status to open

    Issue #39 seems to go into a somewhat similar direction. The names are not clear enough (d'oh).

    To be more precise I would think that the following naming scheme might fit better, then (as you suggested):

    sdl2.ext.RenderContext --> sdl2.ext.Renderer

    sdl2.ext.SoftwareSpriteRenderer --> sdl2.ext.SoftwareSpriteRenderSystem

    sdl2.ext.TextureSpriteRenderer --> sdl2.ext.TextureSpriteRenderSystem

  5. anatoly techtonik reporter

    Looks perfect. I would simplify it even more:

    sdl2.ext.SoftwareSpriteRenderer --> sdl2.ext.SoftwareSprite (RenderSystem) sdl2.ext.TextureSpriteRenderer --> sdl2.ext.TextureSprite (RenderSystem)

    And (RenderSystem) is the common parent class and interface.

  6. Marcus von Appen repo owner
    • fixed issue #36 and #39: the different render classes of sdl2.ext.sprite were renamed
    • the sdl2.ext.RenderContext class was renamed to sdl2.ext.Renderer to be consistent with with SDL2's naming scheme
    • sdl2.ext.SpriteRenderer was renamed to sdl2.ext.SpriteRenderSystem
    • sdl2.ext.SoftwareSpriteRenderer was renamed to sdl2.ext.SoftwareSpriteRenderSystem
    • sdl2.ext.TextureSpriteRenderer was renamed to sdl2.ext.TextureSpriteRenderSystem

    → <<cset d7246b14e4c6>>

  7. Log in to comment