We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 1958 - Cocoa SwapWindow doesn't swap the specified window
Summary: Cocoa SwapWindow doesn't swap the specified window
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: video (show other bugs)
Version: HG 2.0
Hardware: All Mac OS X (All)
: P2 normal
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-07-11 12:41 UTC by Ryan C. Gordon
Modified: 2013-07-12 00:51 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ryan C. Gordon 2013-07-11 12:41:26 UTC
We have this in Cocoa_GL_SwapWindow()...

    /* FIXME: Do we need to get the context for the window? */
    [[NSOpenGLContext currentContext] flushBuffer];

...which means if the current GL context is not the one in (window), we swap a different one than requested.

Right now, we don't store information about which context is assigned to which window, and the OS doesn't give you a way to retrieve it from an NSView. We would have to track this per-window during SDL_GL_MakeCurrent() (and SDL_GL_CreateContext) calls.

--ryan.
Comment 1 Sam Lantinga 2013-07-12 00:51:39 UTC
Fixed!
http://hg.libsdl.org/SDL/rev/c50e165abfdf