diff --git a/mk/macosx/CMakeLists.txt b/mk/macosx/CMakeLists.txt index 5e0ce1a9..cc0fd327 100644 --- a/mk/macosx/CMakeLists.txt +++ b/mk/macosx/CMakeLists.txt @@ -65,14 +65,14 @@ INSTALL(FILES #the SDL_LIBRARY is seen as a framework thus we need to remove the suffix... STRING(REGEX REPLACE ";.*" "" SDL_LIBRARY_DIR "${SDL_LIBRARY}") -INSTALL(DIRECTORY - ${OGG_LIBRARY} - ${XERCESC_LIBRARY} - ${VORBIS_LIBRARY} - ${SDL_LIBRARY_DIR} - ${PNG_LIBRARY} - DESTINATION ../Frameworks - ) +#INSTALL(DIRECTORY +# ${OGG_LIBRARY} +# ${XERCESC_LIBRARY} +# ${VORBIS_LIBRARY} +# ${SDL_LIBRARY_DIR} +# ${PNG_LIBRARY} + # DESTINATION ../Frameworks + # ) include (CPack) diff --git a/source/g3d_viewer/main.cpp b/source/g3d_viewer/main.cpp index 1e1147ce..fe47b3f1 100644 --- a/source/g3d_viewer/main.cpp +++ b/source/g3d_viewer/main.cpp @@ -1878,9 +1878,13 @@ GlCanvas::~GlCanvas() { } void GlCanvas::setCurrentGLContext() { +#ifndef __APPLE__ if(this->context) { this->SetCurrent(*this->context); } +#else + this->SetCurrent(); +#endif } // for the mousewheel diff --git a/source/glest_game/graphics/renderer.cpp b/source/glest_game/graphics/renderer.cpp index f07cf8e9..30030d62 100644 --- a/source/glest_game/graphics/renderer.cpp +++ b/source/glest_game/graphics/renderer.cpp @@ -2635,7 +2635,7 @@ VisibleQuadContainerVBOCache * Renderer::GetSurfaceVBOs(SurfaceData *cellData) { VisibleQuadContainerVBOCache vboCache; // Generate And Bind The Vertex Buffer - glGenBuffersARB( 1, &vboCache.m_nVBOVertices ); // Get A Valid Name + glGenBuffersARB( 1, (GLuint*)&vboCache.m_nVBOVertices ); // Get A Valid Name glBindBufferARB( GL_ARRAY_BUFFER_ARB, vboCache.m_nVBOVertices ); // Bind The Buffer // Load The Data glBufferDataARB( GL_ARRAY_BUFFER_ARB, sizeof(Vec3f) * cellData->bufferCount, vertices, GL_STATIC_DRAW_ARB ); @@ -2643,7 +2643,7 @@ VisibleQuadContainerVBOCache * Renderer::GetSurfaceVBOs(SurfaceData *cellData) { assertGl(); // Generate And Bind The Texture Coordinate Buffer - glGenBuffersARB( 1, &vboCache.m_nVBOFowTexCoords ); // Get A Valid Name + glGenBuffersARB( 1, (GLuint*)&vboCache.m_nVBOFowTexCoords ); // Get A Valid Name glBindBufferARB( GL_ARRAY_BUFFER_ARB, vboCache.m_nVBOFowTexCoords ); // Bind The Buffer // Load The Data glBufferDataARB( GL_ARRAY_BUFFER_ARB, sizeof(Vec2f) * cellData->bufferCount, texCoords, GL_STATIC_DRAW_ARB ); @@ -2651,7 +2651,7 @@ VisibleQuadContainerVBOCache * Renderer::GetSurfaceVBOs(SurfaceData *cellData) { assertGl(); // Generate And Bind The Texture Coordinate Buffer - glGenBuffersARB( 1, &vboCache.m_nVBOSurfaceTexCoords ); // Get A Valid Name + glGenBuffersARB( 1, (GLuint*)&vboCache.m_nVBOSurfaceTexCoords ); // Get A Valid Name glBindBufferARB( GL_ARRAY_BUFFER_ARB, vboCache.m_nVBOSurfaceTexCoords ); // Bind The Buffer // Load The Data glBufferDataARB( GL_ARRAY_BUFFER_ARB, sizeof(Vec2f) * cellData->bufferCount, texCoordsSurface, GL_STATIC_DRAW_ARB ); @@ -2659,7 +2659,7 @@ VisibleQuadContainerVBOCache * Renderer::GetSurfaceVBOs(SurfaceData *cellData) { assertGl(); // Generate And Bind The Normal Buffer - glGenBuffersARB( 1, &vboCache.m_nVBONormals ); // Get A Valid Name + glGenBuffersARB( 1, (GLuint*)&vboCache.m_nVBONormals ); // Get A Valid Name glBindBufferARB( GL_ARRAY_BUFFER_ARB, vboCache.m_nVBONormals ); // Bind The Buffer // Load The Data glBufferDataARB( GL_ARRAY_BUFFER_ARB, sizeof(Vec3f) * cellData->bufferCount, normals, GL_STATIC_DRAW_ARB ); @@ -2685,10 +2685,10 @@ void Renderer::ReleaseSurfaceVBOs() { VisibleQuadContainerVBOCache &item = iterFind->second; if(item.hasBuiltVBOs == true) { - glDeleteBuffersARB( 1, &item.m_nVBOVertices ); // Get A Valid Name - glDeleteBuffersARB( 1, &item.m_nVBOFowTexCoords ); // Get A Valid Name - glDeleteBuffersARB( 1, &item.m_nVBOSurfaceTexCoords ); // Get A Valid Name - glDeleteBuffersARB( 1, &item.m_nVBONormals ); // Get A Valid Name + glDeleteBuffersARB( 1, (GLuint*)&item.m_nVBOVertices ); // Get A Valid Name + glDeleteBuffersARB( 1, (GLuint*)&item.m_nVBOFowTexCoords ); // Get A Valid Name + glDeleteBuffersARB( 1, (GLuint*)&item.m_nVBOSurfaceTexCoords ); // Get A Valid Name + glDeleteBuffersARB( 1, (GLuint*)&item.m_nVBONormals ); // Get A Valid Name //glDeleteBuffersARB( 1, &item.m_nVBOIndexes ); // Get A Valid Name } } diff --git a/source/glest_map_editor/main.cpp b/source/glest_map_editor/main.cpp index 85476b41..69d2ecef 100644 --- a/source/glest_map_editor/main.cpp +++ b/source/glest_map_editor/main.cpp @@ -1367,9 +1367,13 @@ GlCanvas::~GlCanvas() { } void GlCanvas::setCurrentGLContext() { - if(this->context) { +#ifndef __APPLE__ + if(this->context) { this->SetCurrent(*this->context); } +#else + this->SetCurrent(); +#endif } void translateCoords(wxWindow *wnd, int &x, int &y) { diff --git a/source/shared_lib/include/platform/sdl/gl_wrap.h b/source/shared_lib/include/platform/sdl/gl_wrap.h index f3716c0b..806c9783 100644 --- a/source/shared_lib/include/platform/sdl/gl_wrap.h +++ b/source/shared_lib/include/platform/sdl/gl_wrap.h @@ -76,8 +76,14 @@ static DWORD charSet = DEFAULT_CHARSET; static int charSet = 1; #endif +#if defined(__APPLE__) +void inline createGlFontBitmaps(uint32 &base, const string &type, int size, int width, int charCount, FontMetrics &metrics) {} +void inline createGlFontOutlines(uint32 &base, const string &type, int width, float depth, int charCount, FontMetrics &metrics){} +#else void createGlFontBitmaps(uint32 &base, const string &type, int size, int width, int charCount, FontMetrics &metrics); void createGlFontOutlines(uint32 &base, const string &type, int width, float depth, int charCount, FontMetrics &metrics); +#endif + const char *getPlatformExtensions(const PlatformContextGl *pcgl); void* getGlProcAddress(const char *procName); diff --git a/source/shared_lib/sources/graphics/gl/font_gl.cpp b/source/shared_lib/sources/graphics/gl/font_gl.cpp index 313e3740..eff8e995 100644 --- a/source/shared_lib/sources/graphics/gl/font_gl.cpp +++ b/source/shared_lib/sources/graphics/gl/font_gl.cpp @@ -32,7 +32,7 @@ void Font2DGl::init() { handle= glGenLists(charCount); assertGl(); - createGlFontBitmaps(handle, type, size, width, charCount, metrics); + createGlFontBitmaps((Shared::Platform::uint32&)handle, type, size, width, charCount, metrics); assertGl(); } inited= true; @@ -60,7 +60,7 @@ void Font3DGl::init() { if(getTextHandler() == NULL) { assertGl(); handle= glGenLists(charCount); - createGlFontOutlines(handle, type, width, depth, charCount, metrics); + createGlFontOutlines((Shared::Platform::uint32&)handle, type, width, depth, charCount, metrics); assertGl(); } inited= true; diff --git a/source/shared_lib/sources/graphics/gl/font_textFTGL.cpp b/source/shared_lib/sources/graphics/gl/font_textFTGL.cpp index aa58e569..48a18b67 100644 --- a/source/shared_lib/sources/graphics/gl/font_textFTGL.cpp +++ b/source/shared_lib/sources/graphics/gl/font_textFTGL.cpp @@ -234,7 +234,6 @@ void TextFTGL::Render(const char* str, const int len) { if(len != 0) { //printf("FTGL Render [%s] facesize = %d\n",str,ftFont->FaceSize()); assertGl(); - ftFont->Render(str, len); //assertGl(); GLenum error = glGetError(); diff --git a/source/shared_lib/sources/graphics/gl/opengl.cpp b/source/shared_lib/sources/graphics/gl/opengl.cpp index 702ebfd8..a1fc7ece 100644 --- a/source/shared_lib/sources/graphics/gl/opengl.cpp +++ b/source/shared_lib/sources/graphics/gl/opengl.cpp @@ -139,31 +139,31 @@ const char *getGlPlatformExtensions() { int getGlMaxLights() { int i; - glGetIntegerv(GL_MAX_LIGHTS, &i); + glGetIntegerv(GL_MAX_LIGHTS, (GLint*)&i); return i; } int getGlMaxTextureSize() { int i; - glGetIntegerv(GL_MAX_TEXTURE_SIZE, &i); + glGetIntegerv(GL_MAX_TEXTURE_SIZE, (GLint*)&i); return i; } int getGlMaxTextureUnits() { int i; - glGetIntegerv(GL_MAX_TEXTURE_UNITS, &i); + glGetIntegerv(GL_MAX_TEXTURE_UNITS, (GLint*)&i); return i; } int getGlModelviewMatrixStackDepth() { int i; - glGetIntegerv(GL_MAX_MODELVIEW_STACK_DEPTH, &i); + glGetIntegerv(GL_MAX_MODELVIEW_STACK_DEPTH, (GLint*)&i); return i; } int getGlProjectionMatrixStackDepth() { int i; - glGetIntegerv(GL_MAX_PROJECTION_STACK_DEPTH, &i); + glGetIntegerv(GL_MAX_PROJECTION_STACK_DEPTH, (GLint*)&i); return i; } diff --git a/source/shared_lib/sources/graphics/gl/texture_gl.cpp b/source/shared_lib/sources/graphics/gl/texture_gl.cpp index 8d08798c..434792f3 100644 --- a/source/shared_lib/sources/graphics/gl/texture_gl.cpp +++ b/source/shared_lib/sources/graphics/gl/texture_gl.cpp @@ -340,7 +340,7 @@ static std::string getSupportCompressedTextureFormatString(int format) { static int getNumCompressedTextureFormats() { int numCompressedTextureFormats = 0; - glGetIntegerv(GL_NUM_COMPRESSED_TEXTURE_FORMATS, &numCompressedTextureFormats); + glGetIntegerv(GL_NUM_COMPRESSED_TEXTURE_FORMATS, (GLint*)&numCompressedTextureFormats); return numCompressedTextureFormats; } @@ -349,7 +349,7 @@ static std::vector getSupportCompressedTextureFormats() { int count = getNumCompressedTextureFormats(); if(count > 0) { int *formats = new int[count]; - glGetIntegerv(GL_COMPRESSED_TEXTURE_FORMATS,&formats[0]); + glGetIntegerv(GL_COMPRESSED_TEXTURE_FORMATS,(GLint*)&formats[0]); for(int i = 0; i < count; ++i) { result.push_back(formats[i]); diff --git a/source/shared_lib/sources/graphics/model.cpp b/source/shared_lib/sources/graphics/model.cpp index 50ae449e..8e9d7485 100644 --- a/source/shared_lib/sources/graphics/model.cpp +++ b/source/shared_lib/sources/graphics/model.cpp @@ -138,28 +138,28 @@ void Mesh::BuildVBOs() { //printf("In [%s::%s Line: %d] setting up a VBO...\n",__FILE__,__FUNCTION__,__LINE__); // Generate And Bind The Vertex Buffer - glGenBuffersARB( 1, &m_nVBOVertices ); // Get A Valid Name + glGenBuffersARB( 1,(GLuint*) &m_nVBOVertices ); // Get A Valid Name glBindBufferARB( GL_ARRAY_BUFFER_ARB, m_nVBOVertices ); // Bind The Buffer // Load The Data glBufferDataARB( GL_ARRAY_BUFFER_ARB, sizeof(Vec3f)*frameCount*vertexCount, getInterpolationData()->getVertices(), GL_STATIC_DRAW_ARB ); glBindBuffer(GL_ARRAY_BUFFER_ARB, 0); // Generate And Bind The Texture Coordinate Buffer - glGenBuffersARB( 1, &m_nVBOTexCoords ); // Get A Valid Name + glGenBuffersARB( 1, (GLuint*)&m_nVBOTexCoords ); // Get A Valid Name glBindBufferARB( GL_ARRAY_BUFFER_ARB, m_nVBOTexCoords ); // Bind The Buffer // Load The Data glBufferDataARB( GL_ARRAY_BUFFER_ARB, sizeof(Vec2f)*vertexCount, texCoords, GL_STATIC_DRAW_ARB ); glBindBuffer(GL_ARRAY_BUFFER_ARB, 0); // Generate And Bind The Normal Buffer - glGenBuffersARB( 1, &m_nVBONormals ); // Get A Valid Name + glGenBuffersARB( 1, (GLuint*)&m_nVBONormals ); // Get A Valid Name glBindBufferARB( GL_ARRAY_BUFFER_ARB, m_nVBONormals ); // Bind The Buffer // Load The Data glBufferDataARB( GL_ARRAY_BUFFER_ARB, sizeof(Vec3f)*frameCount*vertexCount, getInterpolationData()->getNormals(), GL_STATIC_DRAW_ARB ); glBindBuffer(GL_ARRAY_BUFFER_ARB, 0); // Generate And Bind The Index Buffer - glGenBuffersARB( 1, &m_nVBOIndexes ); // Get A Valid Name + glGenBuffersARB( 1, (GLuint*)&m_nVBOIndexes ); // Get A Valid Name glBindBufferARB( GL_ELEMENT_ARRAY_BUFFER_ARB, m_nVBOIndexes ); // Bind The Buffer // Load The Data glBufferDataARB( GL_ELEMENT_ARRAY_BUFFER_ARB, sizeof(uint32)*indexCount, indices, GL_STATIC_DRAW_ARB ); @@ -182,10 +182,10 @@ void Mesh::BuildVBOs() { void Mesh::ReleaseVBOs() { if(getVBOSupported() == true) { if(hasBuiltVBOs == true) { - glDeleteBuffersARB( 1, &m_nVBOVertices ); // Get A Valid Name - glDeleteBuffersARB( 1, &m_nVBOTexCoords ); // Get A Valid Name - glDeleteBuffersARB( 1, &m_nVBONormals ); // Get A Valid Name - glDeleteBuffersARB( 1, &m_nVBOIndexes ); // Get A Valid Name + glDeleteBuffersARB( 1, (GLuint*)&m_nVBOVertices ); // Get A Valid Name + glDeleteBuffersARB( 1, (GLuint*)&m_nVBOTexCoords ); // Get A Valid Name + glDeleteBuffersARB( 1, (GLuint*)&m_nVBONormals ); // Get A Valid Name + glDeleteBuffersARB( 1, (GLuint*)&m_nVBOIndexes ); // Get A Valid Name hasBuiltVBOs = false; } } diff --git a/source/shared_lib/sources/platform/common/platform_common.cpp b/source/shared_lib/sources/platform/common/platform_common.cpp index 0f2d92dd..555ebfb6 100644 --- a/source/shared_lib/sources/platform/common/platform_common.cpp +++ b/source/shared_lib/sources/platform/common/platform_common.cpp @@ -60,6 +60,10 @@ #include "utf8.h" #include "leak_dumper.h" +#ifdef __APPLE__ +#include +#endif + using namespace Shared::Platform; using namespace Shared::Util; using namespace std; diff --git a/source/shared_lib/sources/platform/macosx/gl_wrap.mm b/source/shared_lib/sources/platform/macosx/gl_wrap.mm index dd67672c..1ade5f30 100644 --- a/source/shared_lib/sources/platform/macosx/gl_wrap.mm +++ b/source/shared_lib/sources/platform/macosx/gl_wrap.mm @@ -18,7 +18,7 @@ #include "sdl_private.h" #include "noimpl.h" #include "util.h" -#include "window.h" +//#include "window.h" #include //#include #include "leak_dumper.h" diff --git a/source/shared_lib/sources/platform/miniupnpc/miniupnpc.c b/source/shared_lib/sources/platform/miniupnpc/miniupnpc.c index bd46a242..7ebed5fd 100644 --- a/source/shared_lib/sources/platform/miniupnpc/miniupnpc.c +++ b/source/shared_lib/sources/platform/miniupnpc/miniupnpc.c @@ -4,6 +4,11 @@ * copyright (c) 2005-2011 Thomas Bernard * This software is subjet to the conditions detailed in the * provided LICENSE file. */ + +#if defined(__APPLE__) +#define MACOSX 1 +#define _DARWIN_C_SOURCE 1 +#endif #define __EXTENSIONS__ 1 #if !defined(MACOSX) && !defined(__sun) #if !defined(_XOPEN_SOURCE) && !defined(__OpenBSD__) && !defined(__NetBSD__) diff --git a/source/shared_lib/sources/platform/unix/gl_wrap.cpp b/source/shared_lib/sources/platform/unix/gl_wrap.cpp index cdd86df7..a16ce701 100644 --- a/source/shared_lib/sources/platform/unix/gl_wrap.cpp +++ b/source/shared_lib/sources/platform/unix/gl_wrap.cpp @@ -31,7 +31,7 @@ namespace Shared { namespace Platform { // ====================================== // Global Fcs // ====================================== - +#if !defined(__APPLE__) void createGlFontBitmaps(uint32 &base, const string &type, int size, int width, int charCount, FontMetrics &metrics) { @@ -155,5 +155,6 @@ void createGlFontOutlines(uint32 &base, const string &type, int width, NOIMPL; } +#endif }}//end namespace