]> OCCT Git - occt.git/commitdiff
0032423: Coding Rules - NSOpenGLContext deprecation warnings during compilation for...
authorkgv <kgv@opencascade.com>
Fri, 10 Sep 2021 18:45:03 +0000 (21:45 +0300)
committersmoskvin <smoskvin@opencascade.com>
Wed, 15 Sep 2021 17:07:05 +0000 (20:07 +0300)
The warning has been suppressed for building TKOpenGl.

src/Aspect/Aspect_RenderingContext.hxx
src/OpenGl/OpenGl_Window_1.mm

index 112c6feb82037d428d1a833cc70e12bf357d52e0..7e4633878b74c08d9295db1101a6c1950f79f060 100644 (file)
@@ -22,6 +22,8 @@
 #ifndef _Aspect_RenderingContext_HeaderFile
 #define _Aspect_RenderingContext_HeaderFile
 
+#include <Standard_Macro.hxx>
+
 #if defined(__APPLE__) && !defined(HAVE_XLIB)
   #import <TargetConditionals.h>
   #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
index 93e0470ac60085120873b3af920ef1f9dcfd5cef..49108d4f2b76ce9cbed2ee15f2badb5fe6a6a102 100644 (file)
@@ -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