mirror of
https://github.com/reactos/wine.git
synced 2024-11-25 04:39:45 +00:00
winemac: Don't defer attaching OpenGL context to view if it is backed by a window device.
This fixes a problem with certain OpenGL programs which create a context very briefly before destroying it, like while handling WM_PAINT.
This commit is contained in:
parent
fd00c806bf
commit
89a4e5a6d1
@ -21,6 +21,7 @@
|
||||
#import "cocoa_opengl.h"
|
||||
|
||||
#include "macdrv_cocoa.h"
|
||||
#include "cocoa_app.h"
|
||||
|
||||
|
||||
@interface WineOpenGLContext ()
|
||||
@ -97,8 +98,21 @@ void macdrv_make_context_current(macdrv_opengl_context c, macdrv_view v)
|
||||
context.needsUpdate = FALSE;
|
||||
if (view)
|
||||
{
|
||||
__block BOOL windowHasDevice;
|
||||
|
||||
macdrv_add_view_opengl_context(v, c);
|
||||
[context setLatentView:view];
|
||||
|
||||
OnMainThread(^{
|
||||
windowHasDevice = [[view window] windowNumber] > 0;
|
||||
});
|
||||
if (windowHasDevice)
|
||||
{
|
||||
[context setView:view];
|
||||
[context setLatentView:nil];
|
||||
}
|
||||
else
|
||||
[context setLatentView:view];
|
||||
|
||||
[context makeCurrentContext];
|
||||
}
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user