diff --git a/src/glcontext_nsgl.h b/src/glcontext_nsgl.h index e2b452594..169faa80a 100644 --- a/src/glcontext_nsgl.h +++ b/src/glcontext_nsgl.h @@ -10,6 +10,8 @@ namespace bgfx { + struct SwapChainGL; + struct GlContext { GlContext() @@ -20,7 +22,12 @@ namespace bgfx void create(uint32_t _width, uint32_t _height); void destroy(); void resize(uint32_t _width, uint32_t _height, bool _vsync); - void swap(); + + SwapChainGL* createSwapChain(void* _nwh); + void destorySwapChain(SwapChainGL* _swapChain); + void swap(SwapChainGL* _swapChain = NULL); + void makeCurrent(SwapChainGL* _swapChain = NULL); + void import(); bool isValid() const diff --git a/src/glcontext_nsgl.mm b/src/glcontext_nsgl.mm index 76f91fe44..f2da698c1 100644 --- a/src/glcontext_nsgl.mm +++ b/src/glcontext_nsgl.mm @@ -88,13 +88,29 @@ namespace bgfx [glContext setValues:&interval forParameter:NSOpenGLCPSwapInterval]; } - void GlContext::swap() + SwapChainGL* GlContext::createSwapChain(void* /*_nwh*/) { + BX_CHECK(false, "Shouldn't be called!"); + return NULL; + } + + void GlContext::destorySwapChain(SwapChainGL* /*_swapChain*/) + { + BX_CHECK(false, "Shouldn't be called!"); + } + + void GlContext::swap(SwapChainGL* _swapChain) + { + BX_CHECK(NULL == _swapChain, "Shouldn't be called!"); BX_UNUSED(_swapChain); NSOpenGLContext* glContext = (NSOpenGLContext*)m_context; [glContext makeCurrentContext]; [glContext flushBuffer]; } + void GlContext::makeCurrent(SwapChainGL* /*_swapChain*/) + { + } + void GlContext::import() { BX_TRACE("Import:");