aboutsummaryrefslogtreecommitdiffstats
path: root/pugl/pugl_osx.m
diff options
context:
space:
mode:
Diffstat (limited to 'pugl/pugl_osx.m')
-rw-r--r--pugl/pugl_osx.m14
1 files changed, 8 insertions, 6 deletions
diff --git a/pugl/pugl_osx.m b/pugl/pugl_osx.m
index 2f4a0e9..b3b6bae 100644
--- a/pugl/pugl_osx.m
+++ b/pugl/pugl_osx.m
@@ -216,7 +216,7 @@ getModifiers(unsigned modifierFlags)
@end
-struct PuglPlatformDataImpl {
+struct PuglInternalsImpl {
PuglOpenGLView* view;
NSModalSession session;
id window;
@@ -229,14 +229,16 @@ puglCreate(PuglNativeWindow parent,
int height,
bool resizable)
{
- PuglView* view = (PuglView*)calloc(1, sizeof(PuglView));
+ PuglView* view = (PuglView*)calloc(1, sizeof(PuglView));
+ PuglInternals* impl = (PuglInternals*)calloc(1, sizeof(PuglInternals));
+ if (!view || !impl) {
+ return NULL;
+ }
+
+ view->impl = impl;
view->width = width;
view->height = height;
- view->impl = (PuglPlatformData*)calloc(1, sizeof(PuglPlatformData));
-
- PuglPlatformData* impl = view->impl;
-
[NSAutoreleasePool new];
[NSApplication sharedApplication];
[NSApp setActivationPolicy:NSApplicationActivationPolicyRegular];