From a303759e4c2362a99f13a6b04bb80f30fe7550fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Branimir=20Karad=C5=BEi=C4=87?= Date: Wed, 18 Nov 2015 23:42:35 -0800 Subject: [PATCH] Fixed GL Remotery. --- 3rdparty/remotery/lib/Remotery.c | 12 ++++++------ src/bgfx.cpp | 2 +- src/bgfx_p.h | 1 + 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/3rdparty/remotery/lib/Remotery.c b/3rdparty/remotery/lib/Remotery.c index 89afd567..c25f6940 100644 --- a/3rdparty/remotery/lib/Remotery.c +++ b/3rdparty/remotery/lib/Remotery.c @@ -5330,7 +5330,7 @@ RMT_API void _rmt_EndD3D11Sample(void) #ifndef APIENTRY # if defined(__MINGW32__) || defined(__CYGWIN__) # define APIENTRY __stdcall -# elif (_MSC_VER >= 800) || defined(_STDCALL_SUPPORTED) || defined(__BORLANDC__) +# elif (defined(_MSC_VER) && (_MSC_VER >= 800)) || defined(_STDCALL_SUPPORTED) || defined(__BORLANDC__) # define APIENTRY __stdcall # else # define APIENTRY @@ -5369,7 +5369,7 @@ typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTI64VPROC) (GLuint id, GLenum pname typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTUI64VPROC) (GLuint id, GLenum pname, GLuint64* params); typedef void (GLAPIENTRY * PFNGLQUERYCOUNTERPROC) (GLuint id, GLenum target); -GLAPI GLenum GLAPIENTRY glGetError(void); +GLAPI GLenum GLAPIENTRY glGetError(void) { return 0; } #define GL_NO_ERROR 0 #define GL_QUERY_RESULT 0x8866 @@ -5389,7 +5389,7 @@ GLAPI GLenum GLAPIENTRY glGetError(void); #elif defined(__native_client__) # define rmtGetProcAddress(name) NULL /* TODO */ #else /* __linux */ -extern void* glXGetProcAddressARB(const GLubyte*); +extern "C" void* glXGetProcAddressARB(const GLubyte*); # define rmtGetProcAddress(name) (*glXGetProcAddressARB)(name) #endif @@ -5591,7 +5591,7 @@ static rmtBool OpenGLTimestamp_GetData(OpenGLTimestamp* stamp, rmtU64* out_start typedef struct OpenGLSample { // IS-A inheritance relationship - Sample Sample; + Sample m_sample; OpenGLTimestamp* timestamp; @@ -5604,8 +5604,8 @@ static rmtError OpenGLSample_Constructor(OpenGLSample* sample) // Chain to sample constructor Sample_Constructor((Sample*)sample); - sample->Sample.type = SampleType_OpenGL; - sample->Sample.size_bytes = sizeof(OpenGLSample); + sample->m_sample.type = SampleType_OpenGL; + sample->m_sample.size_bytes = sizeof(OpenGLSample); sample->timestamp = NULL; return RMT_ERROR_NONE; diff --git a/src/bgfx.cpp b/src/bgfx.cpp index 2f4e35dd..5c3f213b 100644 --- a/src/bgfx.cpp +++ b/src/bgfx.cpp @@ -14,7 +14,7 @@ #if BGFX_CONFIG_PROFILER_REMOTERY_BUILD_LIB # define RMT_USE_D3D11 BGFX_CONFIG_RENDERER_DIRECT3D11 -# define RMT_USE_OPENGL 0 +# define RMT_USE_OPENGL BGFX_CONFIG_RENDERER_OPENGL # include #endif // BGFX_CONFIG_PROFILER_REMOTERY_BUILD_LIB diff --git a/src/bgfx_p.h b/src/bgfx_p.h index b10f16d7..c876b684 100644 --- a/src/bgfx_p.h +++ b/src/bgfx_p.h @@ -60,6 +60,7 @@ # elif BGFX_CONFIG_PROFILER_REMOTERY # define RMT_ENABLED BGFX_CONFIG_PROFILER_REMOTERY # define RMT_USE_D3D11 BGFX_CONFIG_RENDERER_DIRECT3D11 +# define RMT_USE_OPENGL BGFX_CONFIG_RENDERER_OPENGL # include # define BGFX_PROFILER_SCOPE(_group, _name, _color) rmt_ScopedCPUSample(_group##_##_name) # define BGFX_PROFILER_BEGIN(_group, _name, _color) rmt_BeginCPUSample(_group##_##_name)