summaryrefslogtreecommitdiff
path: root/indra/llwindow/llwindowsdl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llwindow/llwindowsdl.cpp')
-rw-r--r--indra/llwindow/llwindowsdl.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/indra/llwindow/llwindowsdl.cpp b/indra/llwindow/llwindowsdl.cpp
index 5626707e70..7f70c2ae5f 100644
--- a/indra/llwindow/llwindowsdl.cpp
+++ b/indra/llwindow/llwindowsdl.cpp
@@ -503,6 +503,12 @@ BOOL LLWindowSDL::createContext(int x, int y, int width, int height, int bits, B
int sdlflags = SDL_WINDOW_OPENGL | SDL_WINDOW_RESIZABLE;// | SDL_ANYFORMAT;
+#if LL_DARWIN
+ SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 4);
+ SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1);
+ SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_CORE);
+#endif
+
SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
if (mFSAASamples > 0)
@@ -1201,6 +1207,12 @@ F32 LLWindowSDL::getPixelAspectRatio()
return pixel_aspect;
}
+U32 LLWindowSDL::getAvailableVRAMMegabytes()
+{
+ static const U32 mb = 1024*1024;
+ static const U32 total_factor = 2;
+ return gGLManager.mVRAM - (LLImageGL::getTextureBytesAllocated() * total_factor/mb);
+}
// This is to support 'temporarily windowed' mode so that
// dialogs are still usable in fullscreen.