-
-
Notifications
You must be signed in to change notification settings - Fork 178
Add interface for _sdl2.video classes #3317
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Conversation
Hey, good to see you moving this forward, this is important for us to do! Some organizational things: Also, I would think these new files would live in the _sdl2 folder. I believe when Window was ported it went there first. |
I agree that they should live in one module. a good name would be |
Yea you are correct about the multiple modules, I will add it in a single module. Is there an example of that in the repo at this moment, I can probably do that with the multiple header files, but if we already have more elegant solution I would like to use it, probably call it pygame._renderer like damusss said. (EDIT: I guess I can do the same as it is done for geometry module) About _sdl2, I am pretty sure Window was added outside of it in the first commit https://github.com/pygame-community/pygame-ce/pull/2114/files#diff-3279c6977adb71e8d262e5974889267e57e33c5ef0d5c76a0146999fba0b40c6 |
813f384
to
3a83861
Compare
3a83861
to
363fa59
Compare
The code looks fine reading through, but I disagree with damus, this should be called pygame._render. "Render" is what SDL2 and SDL3 both call it. https://wiki.libsdl.org/SDL2/CategoryRender, https://wiki.libsdl.org/SDL3/CategoryRender |
Yea makes sense. Done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK! looks good.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought this was super big, instead just the interface (who could have guessed, reading the title?). LGTM, Thanks!
I imagined this as the first PR towards the goal of rewriting _sdl2.video stuff in C code. Since those classes are used in combination with each other, I wanted to add them all, so then for example when I will write the implementation for Renderer, I can do it without any compilation errors where I am missing the declaration for Texture. At this moment, this code itself doesn't do anything, you can write
for example, and you get
as the output. But that is everything that has been implemented. Also, I didn't include
_render
in pygame.init, so you need to manually import it, otherwise it won't work, so at the moment, this module is basically hidden, just so it doesn't break anything