summaryrefslogtreecommitdiffstatshomepage
path: root/3rdparty/bgfx/src/glcontext_nsgl.mm
diff options
context:
space:
mode:
Diffstat (limited to '3rdparty/bgfx/src/glcontext_nsgl.mm')
-rw-r--r--3rdparty/bgfx/src/glcontext_nsgl.mm48
1 files changed, 24 insertions, 24 deletions
diff --git a/3rdparty/bgfx/src/glcontext_nsgl.mm b/3rdparty/bgfx/src/glcontext_nsgl.mm
index 50f35e42cd2..1bef5ca3122 100644
--- a/3rdparty/bgfx/src/glcontext_nsgl.mm
+++ b/3rdparty/bgfx/src/glcontext_nsgl.mm
@@ -1,5 +1,5 @@
/*
- * Copyright 2011-2016 Branimir Karadzic. All rights reserved.
+ * Copyright 2011-2017 Branimir Karadzic. All rights reserved.
* License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
*/
@@ -101,24 +101,24 @@ namespace bgfx { namespace gl
NSOpenGLView* glView = [[NSOpenGLView alloc] initWithFrame:glViewRect pixelFormat:pixelFormat];
[pixelFormat release];
- // GLFW creates a helper contentView that handles things like keyboard and drag and
- // drop events. We don't want to clobber that view if it exists. Instead we just
- // add ourselves as a subview and make the view resize automatically.
- NSView *contentView = [nsWindow contentView];
- if( contentView != nil )
- {
- [glView setAutoresizingMask:( NSViewHeightSizable |
- NSViewWidthSizable |
- NSViewMinXMargin |
- NSViewMaxXMargin |
- NSViewMinYMargin |
- NSViewMaxYMargin )];
- [contentView addSubview:glView];
- }
- else
- {
- [nsWindow setContentView:glView];
- }
+ // GLFW creates a helper contentView that handles things like keyboard and drag and
+ // drop events. We don't want to clobber that view if it exists. Instead we just
+ // add ourselves as a subview and make the view resize automatically.
+ NSView *contentView = [nsWindow contentView];
+ if (nil != contentView)
+ {
+ [glView setAutoresizingMask:( NSViewHeightSizable |
+ NSViewWidthSizable |
+ NSViewMinXMargin |
+ NSViewMaxXMargin |
+ NSViewMinYMargin |
+ NSViewMaxYMargin )];
+ [contentView addSubview:glView];
+ }
+ else
+ {
+ [nsWindow setContentView:glView];
+ }
NSOpenGLContext* glContext = [glView openGLContext];
BGFX_FATAL(NULL != glContext, Fatal::UnableToInitialize, "Failed to initialize GL context.");
@@ -127,11 +127,11 @@ namespace bgfx { namespace gl
GLint interval = 0;
[glContext setValues:&interval forParameter:NSOpenGLCPSwapInterval];
- // When initializing NSOpenGLView programatically (as we are), this sometimes doesn't
- // get hooked up properly (especially when there are existing window elements). This ensures
- // we are valid. Otherwise, you'll probably get a GL_INVALID_FRAMEBUFFER_OPERATION when
- // trying to glClear() for the first time.
- [glContext setView:glView];
+ // When initializing NSOpenGLView programatically (as we are), this sometimes doesn't
+ // get hooked up properly (especially when there are existing window elements). This ensures
+ // we are valid. Otherwise, you'll probably get a GL_INVALID_FRAMEBUFFER_OPERATION when
+ // trying to glClear() for the first time.
+ [glContext setView:glView];
m_view = glView;
m_context = glContext;