]> git.cworth.org Git - apitrace/blobdiff - glws_cocoa.mm
Add "apitrace diff-images" command
[apitrace] / glws_cocoa.mm
index a35dcf506370d0d8215305572897b9576f8694ee..315c6bca591ef742898e00f265a7839835be7261 100644 (file)
@@ -104,7 +104,9 @@ public:
 
     void
     resize(int w, int h) {
-        Drawable::resize(w, h);
+        if (w == width && h == height) {
+            return;
+        }
 
         [window setContentSize:NSMakeSize(w, h)];
 
@@ -114,13 +116,18 @@ public:
             [currentContext setView:[window contentView]];
             [currentContext makeCurrentContext];
         }
+
+        Drawable::resize(w, h);
     }
 
     void show(void) {
-        if (!visible) {
-            // TODO
-            Drawable::show();
+        if (visible) {
+            return;
         }
+
+        // TODO
+
+        Drawable::show();
     }
 
     void swapBuffers(void) {
@@ -197,12 +204,16 @@ createDrawable(const Visual *visual, int width, int height)
 }
 
 Context *
-createContext(const Visual *visual, Context *shareContext)
+createContext(const Visual *visual, Context *shareContext, Profile profile)
 {
     NSOpenGLPixelFormat *pixelFormat = dynamic_cast<const CocoaVisual *>(visual)->pixelFormat;
     NSOpenGLContext *share_context = nil;
     NSOpenGLContext *context;
 
+    if (profile != PROFILE_COMPAT) {
+        return nil;
+    }
+
     if (shareContext) {
         share_context = dynamic_cast<CocoaContext*>(shareContext)->context;
     }