Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
kaixiong opened this issue Jan 20, 2023 · 2 comments
Open

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

kaixiong opened this issue Jan 20, 2023 · 2 comments

Comments

@kaixiong
Copy link
Member

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.

@hartwork
Copy link
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.

@kaixiong
Copy link
Member Author

kaixiong commented Jan 21, 2025

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.

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

No branches or pull requests

2 participants