-
Notifications
You must be signed in to change notification settings - Fork 439
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
Multi-window support in Sdl2Application and GlfwApplication #168
Draft
mosra
wants to merge
9
commits into
master
Choose a base branch
from
multiwindow
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.
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
This was referenced Aug 20, 2016
mosra
changed the title
[WIP] Multi-window support in Sdl2Application
Multi-window support in Sdl2Application and GlfwApplication
Apr 29, 2023
The Configuration class is defined on the Windowless*Context already, which means it's available at the point where the constructor is defined and thus there's no need for such workarounds anymore.
This is just documentation-facing, instead of documenting an overload as having a default-constructed argument simply show just one constructor with a default value. Also simplify the wording. They either create an OpenGL context or not (or not implicitly).
Used to be silently ignored in some places, silently discarded in some other and probably causing an error elsewhere. Better be strict instead.
So don't bother building the correct mask of it.
Mostly just code motion and related documentation updates because Doxygen is such a crap that it can link to functions defined in a base class but not types! FFS. No actual multi-window support yet, that'll be in the next commits to avoid this noise obscuring them. TODO: Sdl2Window instead? TODO: unsure about certain APIs, whether they should be per-window or not - contextless / gl / vulkan? - mouse warp? - ...?
Instead of per-window. It's just too complicated to allow some windows with GL context, some with Vulkan, some with neither and some with both. For now at least.
TODO: some of this (the configuration DPI scaling/policy) should go to the previos commit i guess?
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #168 +/- ##
==========================================
- Coverage 82.25% 82.25% -0.01%
==========================================
Files 566 566
Lines 43967 43966 -1
==========================================
- Hits 36167 36166 -1
Misses 7800 7800 ☔ View full report in Codecov by Sentry. |
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.
Work-in-progress implementation of #124, option 3.
There's no backwards-incompatible change, except for
Configuration::WindowFlag::Contextless
and related flags, which are now application-global as supporting some windows with GL, some with Vulkan and some with nothing at all seems like a very rare use case that'd add a lot of implementation pain.A new
Sdl2ApplicationWindow
class allows you to create another window for your application. Just creating the instance pops up a new window and all events that happen on it are transferred to events in that window.Things left to do:
Sdl2Window
is probably a better name thanSdl2ApplicationWindow
SDL_WINDOWEVENT_CLOSE
for closing the window itself -- there's a conflict between leaving window lifetime management in users hands and "the close button just working", currently clicking the close button does nothingcloseEvent()
which implicitly deletes the window but leaves the instance alive, which will make it no longer respond to events, and then the user is responsible for deleting the instance?_windows[i]
have to check for_windows[i]->_window
too, the Application destructor also needs to verify not just that the SDL windows are deleted but that the Window wrapper instances are gone too so they don't access the Application after ... hmm but what if SDL would then reuse window IDs??windowID
for multi-gesture events? -- https://discourse.libsdl.org/t/how-to-get-the-origin-window-of-a-touch-event/19499/10, "impossible", move the event handler back to the app and document thatdrawEvent()
, i.e. accessing the default framebuffer outside of it has unspecified behaviorviewportEvent()
? andtickEvent()
? or not that oneswapBuffers()
only for the main one solve this?ApplicationWindow
typedefWindowEvent
to allow tracking this? Currently this all falls back toanyEvent()
.Sdl2ApplicationWindow
instead ofSdl2Application
where appropriate