/**************************************************************************
*
- * Copyright 2011 Jose Fonseca
+ * Copyright 2011 VMware, Inc.
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
*
**************************************************************************/
+
+/**
+ * Minimal Cocoa integration.
+ *
+ * See also:
+ * - http://developer.apple.com/library/mac/#samplecode/CocoaGL/Introduction/Intro.html
+ * - http://developer.apple.com/library/mac/#samplecode/Cocoa_With_Carbon_or_CPP/Introduction/Intro.html
+ * - http://developer.apple.com/library/mac/#samplecode/glut/Introduction/Intro.html
+ * - http://developer.apple.com/library/mac/#samplecode/GLEssentials/Introduction/Intro.html
+ * - http://www.glfw.org/
+ */
+
+
#include <stdlib.h>
#include <iostream>
void
resize(int w, int h) {
- Drawable::resize(w, h);
+ if (w == width && h == height) {
+ return;
+ }
[window setContentSize:NSMakeSize(w, h)];
[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) {