Changed: fix client crash from opengl changes + fix compiling error because of moved client_default.cfg

fix_opengl_on_mac
Riasan 5 years ago
parent d0fdfe175d
commit d130a7f826

@ -177,9 +177,16 @@ IF(WITH_STATIC)
ENDIF() ENDIF()
# under Linux and OS X, recent libxml2 versions are linked against libicu # under Linux and OS X, recent libxml2 versions are linked against libicu
FIND_PACKAGE(Icu) # FIND_PACKAGE(Icu)
IF(ICU_LIBRARIES) FIND_LIBRARY(ICU_LIBRARY icuuc)
SET(LIBXML2_LIBRARIES ${LIBXML2_LIBRARIES} ${ICU_LIBRARIES} ${ICU_DATA_LIBRARIES}) IF(ICU_LIBRARY)
FIND_LIBRARY(ICU_DATA_LIBRARY icudata)
IF(ICU_LIBRARY)
MESSAGE(STATUS "ICU UC was found: ${ICU_LIBRARY}")
ELSE()
MESSAGE(STATUS "ICU UC was NOT found")
ENDIF()
SET(LIBXML2_LIBRARIES ${LIBXML2_LIBRARIES} ${ICU_DATA_LIBRARY} ${ICU_LIBRARY})
ENDIF() ENDIF()
ENDIF() ENDIF()

@ -1584,6 +1584,12 @@ void registerGlExtensions(CGlExtensions &ext)
{ {
H_AUTO_OGL(registerGlExtensions); H_AUTO_OGL(registerGlExtensions);
CGLContextObj ctx = CGLGetCurrentContext();
if (ctx == NULL)
{
nlerror("No OpenGL context set");
}
// OpenGL 1.2 ?? // OpenGL 1.2 ??
const char *nglVersion = (const char *)glGetString (GL_VERSION); const char *nglVersion = (const char *)glGetString (GL_VERSION);

@ -1072,6 +1072,9 @@ bool CDriverGL::setDisplay(nlWindow wnd, const GfxMode &mode, bool show, bool re
[_ctx flushBuffer]; [_ctx flushBuffer];
[_glView display]; [_glView display];
// Set context as thread context
CGLSetCurrentContext((CGLContextObj)[_ctx CGLContextObj]);
_EventEmitter.init(this, _glView, _DestroyWindow); _EventEmitter.init(this, _glView, _DestroyWindow);
#elif defined(NL_OS_UNIX) #elif defined(NL_OS_UNIX)

@ -8,7 +8,7 @@ IF(WITH_RYZOM_CLIENT)
ADD_SUBDIRECTORY(unix) ADD_SUBDIRECTORY(unix)
ENDIF() ENDIF()
INSTALL(FILES client_default.cfg DESTINATION ${RYZOM_ETC_PREFIX}) #INSTALL(FILES client_default.cfg DESTINATION ${RYZOM_ETC_PREFIX})
IF(WITH_RYZOM_PATCH) IF(WITH_RYZOM_PATCH)
IF(APPLE) IF(APPLE)

@ -82,7 +82,7 @@ IF(WITH_RYZOM_CLIENT)
ADD_CUSTOM_COMMAND(TARGET ryzom_client PRE_BUILD COMMAND mkdir -p ${RYZOM_RESOURCES_DIR}) ADD_CUSTOM_COMMAND(TARGET ryzom_client PRE_BUILD COMMAND mkdir -p ${RYZOM_RESOURCES_DIR})
ADD_CUSTOM_COMMAND(TARGET ryzom_client POST_BUILD COMMAND cp ARGS -p ${MAC_RESOURCES_DIR}/PkgInfo ${RYZOM_CONTENTS_DIR}) ADD_CUSTOM_COMMAND(TARGET ryzom_client POST_BUILD COMMAND cp ARGS -p ${MAC_RESOURCES_DIR}/PkgInfo ${RYZOM_CONTENTS_DIR})
ADD_CUSTOM_COMMAND(TARGET ryzom_client POST_BUILD COMMAND cp ARGS -p ${MAC_RESOURCES_DIR}/ryzom.icns ${RYZOM_RESOURCES_DIR}) ADD_CUSTOM_COMMAND(TARGET ryzom_client POST_BUILD COMMAND cp ARGS -p ${MAC_RESOURCES_DIR}/ryzom.icns ${RYZOM_RESOURCES_DIR})
ADD_CUSTOM_COMMAND(TARGET ryzom_client POST_BUILD COMMAND cp ARGS -p ${CMAKE_SOURCE_DIR}/ryzom/client/client_default.cfg ${RYZOM_RESOURCES_DIR}) #ADD_CUSTOM_COMMAND(TARGET ryzom_client POST_BUILD COMMAND cp ARGS -p ${CMAKE_SOURCE_DIR}/ryzom/client/client_default.cfg ${RYZOM_RESOURCES_DIR})
# remove any present installscript_osx.vdf before signing # remove any present installscript_osx.vdf before signing
ADD_CUSTOM_COMMAND(TARGET ryzom_client POST_BUILD COMMAND rm -f ${RYZOM_OUTPUT_DIR}/installscript_osx.vdf) ADD_CUSTOM_COMMAND(TARGET ryzom_client POST_BUILD COMMAND rm -f ${RYZOM_OUTPUT_DIR}/installscript_osx.vdf)

Loading…
Cancel
Save