Skip to content

Update lv-tool and examples to use SDL 2 #193

Open

Description

@kaixiong

SDL 2.0 is mature and has been released for close to 10 years now. It is time to port lv-tool to it.

It is not backwards compatible. Migration guide is available here. The window and graphics API changes are fairly substantial. Reworking lv-tool's SDL display driver (which maps closely to SDL 1.2's API) will take some effort.

Activity

  1. hartwork commented on Jan 20, 2023

    @hartwork
    Member
    • I hope the key constansts have not changed from SDL 1 to SDL 2 because we have a copy of SDL 1 values in here
    • My mini demo at https://github.com/hartwork/sdl_video_demo was done with this upgrade in mind and could be of interest. It allows seeing SDL 1 and 2 code side by side for the same thing. Rather close to libvisual examples.
  2. kaixiong commented on Jan 21, 2025

    @kaixiong
    MemberAuthor

    Quick update: I tried porting lv-tool to SDL 2.0 about a year or so ago but ran into an annoying impedance mismatch between Bin's handling of rendering targets (Video objects) and SDL2's software rasterisation API.

    Basically, SDL2 requires the caller to map and unmap the pixel buffer for each draw call and there is no nice way to make it work with the existing Bin implementation without involving an unnecessary full screen/window copy for each frame. I also didn't understand Bin enough to adapt it.

    Fast forward to now, I've just managed to almost completely re-implement Bin (some minor work still needed to preserve the existing semantics and to handle GL actors). Endless actor cycling and morphs now work flawlessly without crashing now. So I expect to be able to get to this port as the next step.

  3. kaixiong commented on Jan 24, 2025

    @kaixiong
    MemberAuthor

    SDL 3 has been released.

  4. kblaschke commented on Nov 3, 2025

    @kblaschke

    In addition to the above, SDL 1 also creates GL contexts in some way that they aren't compatible with anything using Core profile 3.0 or higher. That's easy to test: if RenderDoc can't capture it, it's too old.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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