mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-11-28 18:45:54 -05:00
Cleanup.
This commit is contained in:
parent
f436f79c10
commit
32ca63bd93
3 changed files with 11 additions and 4 deletions
|
@ -10,10 +10,15 @@
|
||||||
|
|
||||||
#include "entry.h"
|
#include "entry.h"
|
||||||
|
|
||||||
#if !defined(ENTRY_CONFIG_USE_SDL) && \
|
#ifndef ENTRY_CONFIG_USE_SDL
|
||||||
!defined(ENTRY_CONFIG_USE_NATIVE)
|
|
||||||
# define ENTRY_CONFIG_USE_SDL 0
|
# 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
|
# define ENTRY_CONFIG_USE_NATIVE 1
|
||||||
|
#else
|
||||||
|
# define ENTRY_CONFIG_USE_NATIVE 0
|
||||||
#endif // ...
|
#endif // ...
|
||||||
|
|
||||||
#if !defined(ENTRY_DEFAULT_WIDTH) && !defined(ENTRY_DEFAULT_HEIGHT)
|
#if !defined(ENTRY_DEFAULT_WIDTH) && !defined(ENTRY_DEFAULT_HEIGHT)
|
||||||
|
|
|
@ -232,7 +232,6 @@ namespace entry
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SDL_WINDOWEVENT_CLOSE:
|
case SDL_WINDOWEVENT_CLOSE:
|
||||||
DBG("SDL_WINDOWEVENT_CLOSE");
|
|
||||||
m_eventQueue.postExitEvent();
|
m_eventQueue.postExitEvent();
|
||||||
exit = true;
|
exit = true;
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -48,6 +48,8 @@ namespace bgfx
|
||||||
};
|
};
|
||||||
|
|
||||||
NSOpenGLPixelFormat* pixelFormat = [[NSOpenGLPixelFormat alloc] initWithAttributes:pixelFormatAttributes];
|
NSOpenGLPixelFormat* pixelFormat = [[NSOpenGLPixelFormat alloc] initWithAttributes:pixelFormatAttributes];
|
||||||
|
BGFX_FATAL(NULL != pixelFormat, Fatal::UnableToInitialize, "Failed to initialize pixel format.");
|
||||||
|
|
||||||
NSRect glViewRect = [[nsWindow contentView] bounds];
|
NSRect glViewRect = [[nsWindow contentView] bounds];
|
||||||
NSOpenGLView* glView = [[NSOpenGLView alloc] initWithFrame:glViewRect pixelFormat:pixelFormat];
|
NSOpenGLView* glView = [[NSOpenGLView alloc] initWithFrame:glViewRect pixelFormat:pixelFormat];
|
||||||
|
|
||||||
|
@ -55,6 +57,7 @@ namespace bgfx
|
||||||
[nsWindow setContentView:glView];
|
[nsWindow setContentView:glView];
|
||||||
|
|
||||||
NSOpenGLContext* glContext = [glView openGLContext];
|
NSOpenGLContext* glContext = [glView openGLContext];
|
||||||
|
BGFX_FATAL(NULL != glContext, Fatal::UnableToInitialize, "Failed to initialize GL context.");
|
||||||
|
|
||||||
[glContext makeCurrentContext];
|
[glContext makeCurrentContext];
|
||||||
GLint interval = 0;
|
GLint interval = 0;
|
||||||
|
@ -62,7 +65,7 @@ namespace bgfx
|
||||||
|
|
||||||
m_view = glView;
|
m_view = glView;
|
||||||
m_context = glContext;
|
m_context = glContext;
|
||||||
|
|
||||||
import();
|
import();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue