From 1623aee1e0d09ff69109a2a4229b5c495cd4a3b0 Mon Sep 17 00:00:00 2001 From: ehofman Date: Tue, 19 Aug 2003 08:25:16 +0000 Subject: [PATCH] MacOS X fixes --- simgear/scene/sky/clouds3d/SkyContext.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/simgear/scene/sky/clouds3d/SkyContext.cpp b/simgear/scene/sky/clouds3d/SkyContext.cpp index f0296ab8..dcd87a04 100644 --- a/simgear/scene/sky/clouds3d/SkyContext.cpp +++ b/simgear/scene/sky/clouds3d/SkyContext.cpp @@ -30,7 +30,11 @@ // #include GLUT_H -#ifndef WIN32 +#if defined (__APPLE__) +# include +#endif + +#if !defined (WIN32) && !defined(__APPLE__) #include #endif @@ -138,6 +142,8 @@ SkyMaterial* SkyContext::GetCurrentMaterial() { #ifdef WIN32 ContextMaterialIterator cmi = _currentMaterials.find(wglGetCurrentContext()); +#elif defined(__APPLE__) + ContextMaterialIterator cmi = _currentMaterials.find(CGLGetCurrentContext()); #else ContextMaterialIterator cmi = _currentMaterials.find(glXGetCurrentContext()); #endif @@ -166,6 +172,8 @@ SkyTextureState* SkyContext::GetCurrentTextureState() { #ifdef WIN32 ContextTextureStateIterator ctsi = _currentTextureState.find(wglGetCurrentContext()); +#elif defined(__APPLE__) + ContextTextureStateIterator ctsi = _currentTextureState.find(CGLGetCurrentContext()); #else ContextTextureStateIterator ctsi = _currentTextureState.find(glXGetCurrentContext()); #endif @@ -194,6 +202,8 @@ SKYRESULT SkyContext::AddCurrentGLContext() SkyMaterial *pCurrentMaterial = new SkyMaterial; #ifdef WIN32 _currentMaterials.insert(std::make_pair(wglGetCurrentContext(), pCurrentMaterial)); +#elif defined (__APPLE__) + _currentMaterials.insert(std::make_pair(CGLGetCurrentContext(), pCurrentMaterial)); #else _currentMaterials.insert(std::make_pair(glXGetCurrentContext(), pCurrentMaterial)); #endif @@ -201,6 +211,8 @@ SKYRESULT SkyContext::AddCurrentGLContext() SkyTextureState *pCurrentTS = new SkyTextureState; #ifdef WIN32 _currentTextureState.insert(std::make_pair(wglGetCurrentContext() , pCurrentTS)); +#elif defined (__APPLE__) + _currentTextureState.insert(std::make_pair(CGLGetCurrentContext() , pCurrentTS)); #else _currentTextureState.insert(std::make_pair(glXGetCurrentContext() , pCurrentTS)); #endif -- 2.39.2