bkaradzic 11 роки тому
батько
коміт
96e07d3929
2 змінених файлів з 25 додано та 2 видалено
  1. 8 1
      src/glcontext_nsgl.h
  2. 17 1
      src/glcontext_nsgl.mm

+ 8 - 1
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

+ 17 - 1
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:");