synchronize opengl context access on osx between threads

This commit is contained in:
Palana 2013-12-31 18:46:19 +01:00
parent 843a092fae
commit b70df7607c

View File

@ -227,12 +227,14 @@ void gl_update(device_t device)
void device_entercontext(device_t device)
{
CGLLockContext([device->plat->context CGLContextObj]);
[device->plat->context makeCurrentContext];
}
void device_leavecontext(device_t device)
{
[NSOpenGLContext clearCurrentContext];
CGLUnlockContext([device->plat->context CGLContextObj]);
}
void device_load_swapchain(device_t device, swapchain_t swap)