-
Notifications
You must be signed in to change notification settings - Fork 296
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
Add Sdl2 backend #1451
Open
TonalidadeHidrica
wants to merge
21
commits into
PistonDevelopers:master
Choose a base branch
from
TonalidadeHidrica:sdl2-backend
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Add Sdl2 backend #1451
TonalidadeHidrica
wants to merge
21
commits into
PistonDevelopers:master
from
TonalidadeHidrica:sdl2-backend
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Nice work! I'm happy you found the old PRs useful, and thank you for the mention :) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is the Take 3 of providing SDL2 backend for cornod.
I didn't use OpenGL
When it comes to using SDL2, there are a big choice: to use OpenGL or not to use. In the prior art,
cornod_gfx
etc) but used only the feature of "pure SDL2" (includingSDL2_gfx
).In this PR, I took the course of not using it, because I wanted to keep the dependencies minimal.
I checked that all the features of
DemoApp
works, but feel free to pointing out anything I am missing.Credits go to:
About Rust version
Since I could not find the information of MSRV, I developed
conrod_sdl2
crate with1.57.0
and Rust 2021 Edition. If I should use older ones, I would update the code.About the addition to the dependency
I added
thiserror
to minimize the boilerplates on error handling, andsmallvec
for a iterator-friendly container of up-to-two events. If this matters, let me know and I'll think the other way.Notes on graphics
When you run
all_sdl2
, you will see the thin diagonal lines as well as horizontal and vertical noize-like lines. These are probably due to overlapping extremely-thin transparent triangles. Unlike GL families, triangles in SDL seems not be cut out for forming complex polygons from many triangles. I think this is inevitable, as long as we use pure SDL2.