]> git.saurik.com Git - wxWidgets.git/blobdiff - src/osx/core/glgrab.cpp
adding magnification API into the wxWindow classes for best retina support
[wxWidgets.git] / src / osx / core / glgrab.cpp
index ccb2ff76ad51cc6b99e182d2a8fe64fe01fa8d0b..669f2ba6c4bc0b4ccb91e0ffaf2e51840590559c 100644 (file)
  OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+#include "wx/wxprec.h"
+
+#if wxOSX_USE_COCOA_OR_CARBON
+
 #import <CoreFoundation/CoreFoundation.h>
 #import <ApplicationServices/ApplicationServices.h>
 #import <OpenGL/OpenGL.h>
 #import <OpenGL/gl.h>
 
+#include "wx/osx/core/private.h"
 #include "wx/osx/private/glgrab.h"
 
 extern CGColorSpaceRef wxMacGetGenericRGBColorSpace();
@@ -110,7 +115,6 @@ CGImageRef grabViaOpenGL(CGDirectDisplayID display, CGRect srcRect)
     void * data;
     long bytewidth;
     GLint width, height;
-    long bytes;
 
     CGLContextObj    glContextObj;
     CGLPixelFormatObj pixelFormatObj ;
@@ -152,7 +156,6 @@ CGImageRef grabViaOpenGL(CGDirectDisplayID display, CGRect srcRect)
 
     bytewidth = width * 4; // Assume 4 bytes/pixel for now
     bytewidth = (bytewidth + 3) & ~3; // Align to 4 bytes
-    bytes = bytewidth * height; // width * height
 
     /* Build bitmap context */
     data = malloc(height * bytewidth);
@@ -212,3 +215,4 @@ CGImageRef grabViaOpenGL(CGDirectDisplayID display, CGRect srcRect)
     return image;
 }
 
+#endif