aboutsummaryrefslogtreecommitdiffstats
path: root/src/api
diff options
context:
space:
mode:
authortomaka <pierre.krieger1708@gmail.com>2015-06-16 11:03:23 +0200
committertomaka <pierre.krieger1708@gmail.com>2015-06-16 11:03:23 +0200
commiteb73c2514eefae08a5f1850ce7ee7178b903c4cf (patch)
treeae044dcd6ed5d702510f750575dc1bf48bbba7c4 /src/api
parente48c853b9c7a617bf8ba5f31b5fb2088c90c0ee7 (diff)
parenta8fef35dbf320448ba53af77bd8025be5022d9f4 (diff)
downloadglutin-eb73c2514eefae08a5f1850ce7ee7178b903c4cf.tar.gz
glutin-eb73c2514eefae08a5f1850ce7ee7178b903c4cf.zip
Merge pull request #485 from fkaa/cocoa-crash-and-burn
Make legacy functions crash on osx core contexts
Diffstat (limited to 'src/api')
-rw-r--r--src/api/cocoa/mod.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/api/cocoa/mod.rs b/src/api/cocoa/mod.rs
index 877aba7..ba5710d 100644
--- a/src/api/cocoa/mod.rs
+++ b/src/api/cocoa/mod.rs
@@ -17,6 +17,10 @@ use native_monitor::NativeMonitorId;
use objc::runtime::{Class, Object, Sel, BOOL, YES, NO};
use objc::declare::ClassDecl;
+use cgl;
+use cgl::{CGLEnable, kCGLCECrashOnRemovedFunctions, CGLSetParameter, kCGLCPSurfaceOpacity};
+use cgl::CGLContextObj as CGL_CGLContextObj;
+
use cocoa::base::{id, nil};
use cocoa::foundation::{NSAutoreleasePool, NSDate, NSDefaultRunLoopMode, NSPoint, NSRect, NSSize,
NSString, NSUInteger};
@@ -572,6 +576,8 @@ impl Window {
let value = if builder.vsync { 1 } else { 0 };
cxt.setValues_forParameter_(&value, NSOpenGLContextParameter::NSOpenGLCPSwapInterval);
+ CGLEnable(cxt.CGLContextObj(), kCGLCECrashOnRemovedFunctions);
+
Ok((cxt, pf))
} else {
Err(CreationError::NotSupported)