_hPBuffer(NULL),
_hPreviousDC(0),
_hPreviousContext(0),
+#elif defined( __APPLE__ )
#else
_pDisplay(NULL),
_hGLContext(NULL),
_pbufferAttribs.push_back(WGL_PBUFFER_LARGEST_ARB);
_pbufferAttribs.push_back(true);
+#elif defined( __APPLE__ )
#else
_pbufferAttribs.push_back(GLX_RENDER_TYPE_SGIX);
_pbufferAttribs.push_back(GLX_RGBA_BIT_SGIX);
fprintf(stderr, "\n");
#endif
+#elif defined( __APPLE__ )
#else // !_WIN32
_pDisplay = glXGetCurrentDisplay();
GLXContext context = glXGetCurrentContext();
_wglGetLastError();
return false;
}
+#elif defined( __APPLE__ )
#else
_hPreviousContext = glXGetCurrentContext();
_hPreviousDrawable = glXGetCurrentDrawable();
_wglGetLastError();
return false;
}
+#elif defined( __APPLE__ )
#else
if (False == glXMakeCurrent(_pDisplay,
_hPreviousDrawable, _hPreviousContext))
_iNumStencilBits = 0;
if (_bIsTexture)
- glDeleteTextures(1, &_iTextureID);
+ glDeleteTextures(1, (const GLuint*)&_iTextureID);
if (_bIsDepthTexture)
{
// [Redge]
if (!_bHasARBDepthTexture) delete[] _pPoorDepthTexture;
// [/Redge]
- glDeleteTextures(1, &_iDepthTextureID);
+ glDeleteTextures(1, (const GLuint*)&_iDepthTextureID);
}
#ifdef _WIN32
_hPBuffer = 0;
return true;
}
+#elif defined( __APPLE__ )
#else
if ( _hPBuffer )
{
_pbufferAttribs.push_back(WGL_PBUFFER_LARGEST_ARB);
_pbufferAttribs.push_back(true);
+#elif defined( __APPLE__ )
#else
_pbufferAttribs.push_back(GLX_RENDER_TYPE_SGIX);
_pbufferAttribs.push_back(GLX_RGBA_BIT_SGIX);
// Do same basic work as _Invalidate, but don't reset all our flags
if (_bIsTexture)
- glDeleteTextures(1, &_iTextureID);
+ glDeleteTextures(1, (const GLuint*)&_iTextureID);
if (_bIsDepthTexture)
- glDeleteTextures(1, &_iDepthTextureID);
+ glDeleteTextures(1, (const GLuint*)&_iDepthTextureID);
#ifdef _WIN32
if ( _hPBuffer )
{
_hPBuffer = 0;
return true;
}
+#elif defined( __APPLE__ )
#else
if ( _hPBuffer )
{
_hPreviousContext = wglGetCurrentContext();
if (NULL == _hPreviousContext)
_wglGetLastError();
+#elif defined( __APPLE__ )
#else
_hPreviousContext = glXGetCurrentContext();
_hPreviousDrawable = glXGetCurrentDrawable();
_wglGetLastError();
return false;
}
+#elif defined( __APPLE__ )
#else
if (False == glXMakeCurrent(_pDisplay, _hPreviousDrawable,
_hPreviousContext))
_hPreviousContext = current->_hPreviousContext;
if (NULL == _hPreviousContext)
_wglGetLastError();
+#elif defined( __APPLE__ )
#else
_hPreviousContext = current->_hPreviousContext;
_hPreviousDrawable = current->_hPreviousDrawable;
pfAttribs.push_back(bitVec[1]);
pfAttribs.push_back(WGL_BLUE_BITS_ARB);
pfAttribs.push_back(bitVec[2]);
+#elif defined( __APPLE__ )
+ pfAttribs.push_back(AGL_RED_SIZE);
+ pfAttribs.push_back(bitVec[0]);
+ pfAttribs.push_back(AGL_GREEN_SIZE);
+ pfAttribs.push_back(bitVec[1]);
+ pfAttribs.push_back(AGL_BLUE_SIZE);
+ pfAttribs.push_back(bitVec[2]);
#else
-# ifndef sgi
pfAttribs.push_back(GLX_RED_SIZE);
pfAttribs.push_back(bitVec[0]);
pfAttribs.push_back(GLX_GREEN_SIZE);
pfAttribs.push_back(bitVec[1]);
pfAttribs.push_back(GLX_BLUE_SIZE);
pfAttribs.push_back(bitVec[2]);
-# endif
#endif
- _iNumComponents += 3;
+ _iNumComponents += 3;
continue;
}
else if (kv.first == "rgb")
pfAttribs.push_back(bitVec[2]);
pfAttribs.push_back(WGL_ALPHA_BITS_ARB);
pfAttribs.push_back(bitVec[3]);
+#elif defined( __APPLE__ )
+ pfAttribs.push_back(AGL_RED_SIZE);
+ pfAttribs.push_back(bitVec[0]);
+ pfAttribs.push_back(AGL_GREEN_SIZE);
+ pfAttribs.push_back(bitVec[1]);
+ pfAttribs.push_back(AGL_BLUE_SIZE);
+ pfAttribs.push_back(bitVec[2]);
+ pfAttribs.push_back(AGL_ALPHA_SIZE);
+ pfAttribs.push_back(bitVec[3]);
#else
-# ifndef sgi
pfAttribs.push_back(GLX_RED_SIZE);
pfAttribs.push_back(bitVec[0]);
pfAttribs.push_back(GLX_GREEN_SIZE);
pfAttribs.push_back(bitVec[2]);
pfAttribs.push_back(GLX_ALPHA_SIZE);
pfAttribs.push_back(bitVec[3]);
-# endif
#endif
- _iNumComponents = 4;
+ _iNumComponents = 4;
continue;
}
else if (kv.first == "rgba")
#ifdef _WIN32
pfAttribs.push_back(WGL_RED_BITS_ARB);
pfAttribs.push_back(bitVec[0]);
+#elif defined( __APPLE__ )
+ pfAttribs.push_back(AGL_RED_SIZE);
+ pfAttribs.push_back(bitVec[0]);
#else
pfAttribs.push_back(GLX_RED_SIZE);
pfAttribs.push_back(bitVec[0]);
pfAttribs.push_back(bitVec[0]);
pfAttribs.push_back(WGL_GREEN_BITS_ARB);
pfAttribs.push_back(bitVec[1]);
+#elif defined( __APPLE__ )
+ pfAttribs.push_back(AGL_RED_SIZE);
+ pfAttribs.push_back(bitVec[0]);
+ pfAttribs.push_back(AGL_GREEN_SIZE);
+ pfAttribs.push_back(bitVec[1]);
#else
pfAttribs.push_back(GLX_RED_SIZE);
pfAttribs.push_back(bitVec[0]);
bHasStencil = true;
#ifdef _WIN32
pfAttribs.push_back(WGL_STENCIL_BITS_ARB);
+#elif defined( __APPLE__ )
+ pfAttribs.push_back(AGL_STENCIL_SIZE);
#else
pfAttribs.push_back(GLX_STENCIL_SIZE);
#endif
pfAttribs.push_back(1);
pfAttribs.push_back(WGL_SAMPLES_ARB);
pfAttribs.push_back(strtol(kv.second.c_str(), 0, 10));
+#elif defined( __APPLE__ )
+ pfAttribs.push_back(AGL_SAMPLE_BUFFERS_ARB);
+ pfAttribs.push_back(1);
+ pfAttribs.push_back(AGL_SAMPLES_ARB);
+ pfAttribs.push_back(strtol(kv.second.c_str(), 0, 10));
#else
pfAttribs.push_back(GL_SAMPLE_BUFFERS_ARB);
pfAttribs.push_back(1);
#ifdef _WIN32
pfAttribs.push_back(WGL_DOUBLE_BUFFER_ARB);
pfAttribs.push_back(true);
+#elif defined( __APPLE__ )
+ pfAttribs.push_back(AGL_DOUBLEBUFFER);
+ pfAttribs.push_back(True);
#else
pfAttribs.push_back(GL_DOUBLEBUFFER);
pfAttribs.push_back(True);
{
#ifdef _WIN32
pfAttribs.push_back(WGL_AUX_BUFFERS_ARB);
+#elif defined( __APPLE__ )
+ pfAttribs.push_back(AGL_AUX_BUFFERS);
#else
pfAttribs.push_back(GL_AUX_BUFFERS);
#endif
#ifdef _WIN32
pfAttribs.push_back(WGL_DEPTH_BITS_ARB);
+#elif defined( __APPLE__ )
+ pfAttribs.push_back(AGL_DEPTH_SIZE);
#else
pfAttribs.push_back(GLX_DEPTH_SIZE);
#endif
#ifdef _WIN32
pfAttribs.push_back(WGL_STENCIL_BITS_ARB);
pfAttribs.push_back(0);
+#elif defined( __APPLE__ )
+ pfAttribs.push_back(AGL_STENCIL_SIZE);
+ pfAttribs.push_back(0);
#else
pfAttribs.push_back(GLX_STENCIL_SIZE);
pfAttribs.push_back(0);
#elif defined(DEBUG) || defined(_DEBUG)
printf("RenderTexture Error: Render to Texture not "
- "supported in Linux\n");
+ "supported in Linux or MacOS\n");
#endif
}
pfAttribs.push_back(WGL_PIXEL_TYPE_ARB);
pfAttribs.push_back(WGL_TYPE_RGBA_FLOAT_ATI);
}
+#elif defined( __APPLE__ )
#else
if (GL_NV_float_buffer)
{
#elif defined(DEBUG) || defined(_DEBUG)
fprintf(stderr,
"RenderTexture Error: Render to Texture not supported in "
- "Linux\n");
+ "Linux or MacOS\ n");
#endif
}
}
#elif defined(DEBUG) || defined(_DEBUG)
printf("RenderTexture Error: Render to Texture not supported in "
- "Linux\n");
+ "Linux or MacOS\n");
#endif
}
}
}
SetLastError(0);
}
+#elif defined( __APPLE__ )
#else
if (!GLX_SGIX_pbuffer)
{
if (_bIsTexture)
{
- glGenTextures(1, &_iTextureID);
+ glGenTextures(1, (GLuint*)&_iTextureID);
glBindTexture(_iTextureTarget, _iTextureID);
// Use clamp to edge as the default texture wrap mode for all tex
if (_bIsDepthTexture)
{
- glGenTextures(1, &_iDepthTextureID);
+ glGenTextures(1, (GLuint*)&_iDepthTextureID);
glBindTexture(_iTextureTarget, _iDepthTextureID);
// Use clamp to edge as the default texture wrap mode for all tex
_wglGetLastError();
return false;
}
+#elif defined( __APPLE__ )
#else
if (false == glXMakeCurrent(_pDisplay, _hPBuffer, _hGLContext))
{
_hPBuffer(NULL),
_hPreviousDC(0),
_hPreviousContext(0),
+#elif defined( __APPLE__ )
#else
_pDisplay(NULL),
_hGLContext(NULL),
_pbufferAttribs.push_back(WGL_PBUFFER_LARGEST_ARB);
_pbufferAttribs.push_back(true);
+#elif defined( __APPLE__ )
#else
_pixelFormatAttribs.push_back(GLX_RENDER_TYPE_SGIX);
_pixelFormatAttribs.push_back(GLX_RGBA_BIT_SGIX);