fix mac osx build

This commit is contained in:
Erwin Coumans
2018-02-21 08:16:00 -08:00
parent 3a019be57e
commit 9288ea9c6a
3 changed files with 10 additions and 9 deletions

View File

@@ -101,6 +101,7 @@ ELSE(WIN32)
find_library(COCOA NAMES Cocoa) find_library(COCOA NAMES Cocoa)
MESSAGE(${COCOA}) MESSAGE(${COCOA})
link_libraries(${COCOA} ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY}) link_libraries(${COCOA} ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY})
INCLUDE_DIRECTORIES( ${BULLET_PHYSICS_SOURCE_DIR}/examples/ThirdPartyLibs/glad )
ELSE(APPLE) ELSE(APPLE)
ADD_DEFINITIONS("-DGLEW_INIT_OPENGL11_FUNCTIONS=1") ADD_DEFINITIONS("-DGLEW_INIT_OPENGL11_FUNCTIONS=1")
ADD_DEFINITIONS("-DGLEW_STATIC") ADD_DEFINITIONS("-DGLEW_STATIC")

View File

@@ -3,6 +3,7 @@ INCLUDE_DIRECTORIES(
.. ..
../ThirdPartyLibs ../ThirdPartyLibs
../../src ../../src
../ThirdPartyLibs/glad
) )
FILE(GLOB OpenGLWindow_HDRS "*.h" ) FILE(GLOB OpenGLWindow_HDRS "*.h" )
@@ -30,7 +31,7 @@ IF (WIN32)
ENDIF(WIN32) ENDIF(WIN32)
IF (APPLE) IF (APPLE)
SET(OpenGLWindow_SRCS ${OpenGLWindowMac_CPP} ${OpenGLWindowMacObjC_CPP} ${OpenGLWindowCommon_CPP} ) SET(OpenGLWindow_SRCS ${OpenGLWindowMac_CPP} ${BULLET_PHYSICS_SOURCE_DIR}/examples/ThirdPartyLibs/glad/glad.c ${OpenGLWindowMacObjC_CPP} ${OpenGLWindowCommon_CPP} )
ENDIF(APPLE) ENDIF(APPLE)
#no Linux detection? #no Linux detection?

View File

@@ -2,6 +2,7 @@
#ifdef BT_USE_CUSTOM_PROFILER #ifdef BT_USE_CUSTOM_PROFILER
#endif #endif
//========= Copyright Valve Corporation ============// //========= Copyright Valve Corporation ============//
#include "../OpenGLWindow/SimpleOpenGL3App.h" #include "../OpenGLWindow/SimpleOpenGL3App.h"
@@ -19,6 +20,12 @@
#include "BulletCollision/CollisionShapes/btCollisionShape.h" #include "BulletCollision/CollisionShapes/btCollisionShape.h"
#include "BulletDynamics/Dynamics/btDiscreteDynamicsWorld.h" #include "BulletDynamics/Dynamics/btDiscreteDynamicsWorld.h"
#define GL_DO_NOT_WARN_IF_MULTI_GL_VERSION_HEADERS_INCLUDED
#import <Cocoa/Cocoa.h>
#include "LinearMath/btIDebugDraw.h" #include "LinearMath/btIDebugDraw.h"
int gSharedMemoryKey = -1; int gSharedMemoryKey = -1;
int gDebugDrawFlags = 0; int gDebugDrawFlags = 0;
@@ -525,14 +532,6 @@ bool CMainApplication::BInit()
} }
glewExperimental = GL_TRUE;
GLenum nGlewError = glewInit();
if (nGlewError != GLEW_OK)
{
printf( "%s - Error initializing GLEW! %s\n", __FUNCTION__, glewGetErrorString( nGlewError ) );
return false;
}
glGetError(); // to clear the error caused deep in GLEW
if ( SDL_GL_SetSwapInterval( m_bVblank ? 1 : 0 ) < 0 ) if ( SDL_GL_SetSwapInterval( m_bVblank ? 1 : 0 ) < 0 )
{ {