-
-
Notifications
You must be signed in to change notification settings - Fork 168
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
API proposal: publicizing Window #2603
Comments
I agree with We could probably make good use of 'undocumented' code for dubious flag features that are currently in SDL2 but may or may not be in SDL3, but if it is straight up not working at all yet then let's pop up a There is already a Window Example, but I agree it should be revamped once the code has stabilised to it's final location.
In what sense? I see this in the SDL3 docs: https://wiki.libsdl.org/SDL3/SDL_SetWindowFullscreenMode which implies you can still set a 'native fullscreen' or a 'desktop fullscreen' mode for a window. I'm not sure there is a good reason for a programmer to interop between windows created by |
Oh, I didn't know about that. What I was referring to is that the flag SDL_WINDOW_FULLSCREEN_DESKTOP for window creation has been removed.
I'm happy you bring this up, I think this will be a pain to support, it'll just keep getting bug reports in increasingly strange situations and contributors will keep adding more code to patch it up (I expect). It's redundant now that you can use get_surface() and flip() on Window. I think the way forward would be to undocument it and start it raising a deprecation warning. |
I've done an audit of all the SDL symbols used in Window.c for SDL3 compatibility, using the current state of SDL3's README-migration.
|
We decided to push this out of 2.4.0 (#2627) in order to maintain a nice end of year release for 2.4.0. I'm happy that we've made significant progress on Window in the last two weeks and I hope we can gain enough confidence to call it a public API in the next release. |
We need to put more thought into the API before making this public. It's not too late to be doing this, as the window API is experimental, and I don't expect to change too much stuff that are already implemented in So, the idea is: the current Why do this? From a user perspective it immediately makes the distinction clear between different kinds of window reducing any confusion or misunderstanding. If I have an instance of a "hardware window" the surface/flip methods won't be defined in the first place. Any editors and code analysis tools will therefore immediately alert a user if they try to call a surface/flip as they code, so they don't have to deal with an error at runtime. From a developer perspective, it also probably simplifies our implementation as we wouldn't have heavy conditional branching and error checking like Quoting @Starbuck5 comment, that I like the idea of
Breaking changes (affecting experimental API)The newly added Related stuffRelated issue: #2625 |
#2659 added opengl to |
Window supportI wanted to do an audit of what we have ported right now, since I'm worried about other module APIs that use window stuff, like in event/key/mouse. Functions found by searching include/_.h in SDL2 for "SDL_Window _". Functions that take Windows:
Functions that return Windows:
|
The There is still room for more polish, additions and stuff but that can come in future releases. I am just gonna leave this issue open to track the further enhancements that can be done here |
I'd like to turn
_sdl2.video.Window
into a public API in 2.4.0Firstly, where should it live? I see two contenders.
pygame.display.Window
pygame.window.Window
(like pygame.surface.Surface, primarily advertised as pygame.Window)Yunline has successfully convinced me it should live at pygame.window.Window. If you disagree, this is the issue to speak out on.
Steps to making this thing public:
The text was updated successfully, but these errors were encountered: