diff --git a/examples/common/entry/entry_p.h b/examples/common/entry/entry_p.h index 48154b8a..140e7d15 100644 --- a/examples/common/entry/entry_p.h +++ b/examples/common/entry/entry_p.h @@ -10,10 +10,15 @@ #include "entry.h" -#if !defined(ENTRY_CONFIG_USE_SDL) && \ - !defined(ENTRY_CONFIG_USE_NATIVE) +#ifndef ENTRY_CONFIG_USE_SDL # define ENTRY_CONFIG_USE_SDL 0 +#endif // ENTRY_CONFIG_USE_SDL + +#if !ENTRY_CONFIG_USE_SDL && \ + !defined(ENTRY_CONFIG_USE_NATIVE) # define ENTRY_CONFIG_USE_NATIVE 1 +#else +# define ENTRY_CONFIG_USE_NATIVE 0 #endif // ... #if !defined(ENTRY_DEFAULT_WIDTH) && !defined(ENTRY_DEFAULT_HEIGHT) diff --git a/examples/common/entry/entry_sdl.cpp b/examples/common/entry/entry_sdl.cpp index 9af0418c..f053a1cf 100644 --- a/examples/common/entry/entry_sdl.cpp +++ b/examples/common/entry/entry_sdl.cpp @@ -232,7 +232,6 @@ namespace entry break; case SDL_WINDOWEVENT_CLOSE: - DBG("SDL_WINDOWEVENT_CLOSE"); m_eventQueue.postExitEvent(); exit = true; break; diff --git a/src/glcontext_nsgl.mm b/src/glcontext_nsgl.mm index 00001f4a..969d625c 100644 --- a/src/glcontext_nsgl.mm +++ b/src/glcontext_nsgl.mm @@ -48,6 +48,8 @@ namespace bgfx }; NSOpenGLPixelFormat* pixelFormat = [[NSOpenGLPixelFormat alloc] initWithAttributes:pixelFormatAttributes]; + BGFX_FATAL(NULL != pixelFormat, Fatal::UnableToInitialize, "Failed to initialize pixel format."); + NSRect glViewRect = [[nsWindow contentView] bounds]; NSOpenGLView* glView = [[NSOpenGLView alloc] initWithFrame:glViewRect pixelFormat:pixelFormat]; @@ -55,6 +57,7 @@ namespace bgfx [nsWindow setContentView:glView]; NSOpenGLContext* glContext = [glView openGLContext]; + BGFX_FATAL(NULL != glContext, Fatal::UnableToInitialize, "Failed to initialize GL context."); [glContext makeCurrentContext]; GLint interval = 0; @@ -62,7 +65,7 @@ namespace bgfx m_view = glView; m_context = glContext; - + import(); }