| Summary: | Application needs to handle draw event on OS X | ||
|---|---|---|---|
| Product: | SDL | Reporter: | David <david> |
| Component: | video | Assignee: | Sam Lantinga <slouken> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | enhancement | ||
| Priority: | P2 | CC: | amaranth72, david, icculus, sdlbug |
| Version: | 2.0.3 | Keywords: | target-2.0.4, triage-2.0.4 |
| Hardware: | All | ||
| OS: | Mac OS X (All) | ||
| Attachments: |
Patch to add draw event
Updated patch using SDL_WINDOWEVENT_EXPOSED |
||
The existing SDL_WINDOWEVENT_EXPOSED window event should probably be used, rather than creating a whole new window event.. After reviewing the code more, I agree with you about using SLD_WINDOWEVENT_EXPOSED. I have attached a new patch using SDL_WINDOWEVENT_EXPOSED. Created attachment 1760 [details]
Updated patch using SDL_WINDOWEVENT_EXPOSED
Marking a large number of bugs with the "triage-2.0.4" keyword at once. Sorry if you got a lot of email from this. This is to help me sort through some bugs in regards to a 2.0.4 release. We may or may not fix this bug for 2.0.4, though! Related issue (or a duplicate of?): https://bugzilla.libsdl.org/show_bug.cgi?id=2066 *** Bug 2066 has been marked as a duplicate of this bug. *** (sorry if you get a lot of copies of this email, I'm marking several bugs at once) Marking bugs for the (mostly) final 2.0.4 TODO list. This means we're hoping to resolve this bug before 2.0.4 ships if possible. In a perfect world, the open bug count with the target-2.0.4 keyword is zero when we ship. (Note that closing a bug report as WONTFIX, INVALID or WORKSFORME might still happen.) --ryan. This is now fixed in https://hg.libsdl.org/SDL/rev/b381999d8944, thanks! --ryan. |
Created attachment 1757 [details] Patch to add draw event On OS X the OS will sometimes send a drawRect: event to the content view so that the window contents are redrawn. It is most noticeable during window resizing or full screen transitions. When the OS sends this event the application has to draw something or else the user will just see a the window background color (which is black for SDL). Under normal circumstances the application will not receive this event except during window operations. Usually the application will want to render an entire frame or the application should render into an offscreen frame buffer every frame and then blit the frame buffer whenever a draw event occurs. Attached is a patch that adds a new window event SDL_WINDOWEVENT_DRAW. It is best to handle this event in the event filter because the draw operation has to be synchronized with the OS screen drawing. This patch is not a breaking change because applications that ignore this event is will get the same behavior as before.