diff --git a/src/Aspect/Aspect_RenderingContext.hxx b/src/Aspect/Aspect_RenderingContext.hxx index 112c6feb82..7e4633878b 100644 --- a/src/Aspect/Aspect_RenderingContext.hxx +++ b/src/Aspect/Aspect_RenderingContext.hxx @@ -22,6 +22,8 @@ #ifndef _Aspect_RenderingContext_HeaderFile #define _Aspect_RenderingContext_HeaderFile +#include + #if defined(__APPLE__) && !defined(HAVE_XLIB) #import #if defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE @@ -37,7 +39,9 @@ #else struct NSOpenGLContext; #endif + Standard_DISABLE_DEPRECATION_WARNINGS typedef NSOpenGLContext* Aspect_RenderingContext; + Standard_ENABLE_DEPRECATION_WARNINGS #endif #else typedef void* Aspect_RenderingContext; // GLXContext under UNIX diff --git a/src/OpenGl/OpenGl_Window_1.mm b/src/OpenGl/OpenGl_Window_1.mm index 93e0470ac6..49108d4f2b 100644 --- a/src/OpenGl/OpenGl_Window_1.mm +++ b/src/OpenGl/OpenGl_Window_1.mm @@ -216,7 +216,9 @@ OpenGl_Window::OpenGl_Window (const Handle(OpenGl_GraphicDriver)& theDriver, } NSView* aView = (NSView* )myPlatformWindow->NativeHandle(); + Standard_DISABLE_DEPRECATION_WARNINGS [aGLContext setView: aView]; + Standard_ENABLE_DEPRECATION_WARNINGS isCore = (aTryCore == 1); } @@ -273,7 +275,9 @@ void OpenGl_Window::Resize() #else // check backing store change (moving to another screen) NSOpenGLContext* aGLCtx = myGlContext->myGContext; + Standard_DISABLE_DEPRECATION_WARNINGS NSView* aView = [aGLCtx view]; + Standard_ENABLE_DEPRECATION_WARNINGS if (![aView respondsToSelector: @selector(convertSizeToBacking:)]) { return; @@ -353,7 +357,9 @@ void OpenGl_Window::Init() aDefFbo.Nullify(); #else NSOpenGLContext* aGLCtx = myGlContext->myGContext; +Standard_DISABLE_DEPRECATION_WARNINGS NSView* aView = [aGLCtx view]; +Standard_ENABLE_DEPRECATION_WARNINGS NSRect aBounds = [aView bounds]; // we should call this method each time when window is resized