From 10674ad181c487aa21e7e09bc97e1625ccadfc67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Branimir=20Karad=C5=BEi=C4=87?= Date: Fri, 13 Nov 2015 08:18:21 -0800 Subject: [PATCH] OSX: Fixed query counter crash. --- src/renderer_gl.h | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/src/renderer_gl.h b/src/renderer_gl.h index 06bceb2e..e43f2e91 100644 --- a/src/renderer_gl.h +++ b/src/renderer_gl.h @@ -1235,9 +1235,12 @@ namespace bgfx { namespace gl } Frame& frame = m_frame[m_control.m_current]; - GL_CHECK(glQueryCounter(frame.m_begin - , GL_TIMESTAMP - ) ); + if (!BX_ENABLED(BX_PLATFORM_OSX) ) + { + GL_CHECK(glQueryCounter(frame.m_begin + , GL_TIMESTAMP + ) ); + } GL_CHECK(glBeginQuery(GL_TIME_ELAPSED , frame.m_elapsed @@ -1264,10 +1267,17 @@ namespace bgfx { namespace gl if (available) { - GL_CHECK(glGetQueryObjectui64v(frame.m_begin - , GL_QUERY_RESULT - , &m_begin - ) ); + if (!BX_ENABLED(BX_PLATFORM_OSX) ) + { + GL_CHECK(glGetQueryObjectui64v(frame.m_begin + , GL_QUERY_RESULT + , &m_begin + ) ); + } + else + { + m_begin = 0; + } GL_CHECK(glGetQueryObjectui64v(frame.m_elapsed , GL_QUERY_RESULT