summaryrefslogtreecommitdiff
path: root/indra/llwindow/llwindowsdl.cpp
diff options
context:
space:
mode:
authorErik Kundiman <erik@megapahit.org>2023-09-10 18:47:16 +0800
committerErik Kundiman <erik@megapahit.org>2023-09-10 18:47:16 +0800
commit03dafac6321ea637a232f9501adaca53fd2e6522 (patch)
tree5aaf98ea4da94329ecc81055af98ea52166d4cee /indra/llwindow/llwindowsdl.cpp
parenta4543cf3cd41a466599de61f02e6d3b3d09700c4 (diff)
SDL window overrides all window pure virtual funcs
including the new getAvailableVRAMMegabytes. The "override" word must be explicitly stated now.
Diffstat (limited to 'indra/llwindow/llwindowsdl.cpp')
-rw-r--r--indra/llwindow/llwindowsdl.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/indra/llwindow/llwindowsdl.cpp b/indra/llwindow/llwindowsdl.cpp
index e3af20c090..00a467b5be 100644
--- a/indra/llwindow/llwindowsdl.cpp
+++ b/indra/llwindow/llwindowsdl.cpp
@@ -1197,6 +1197,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.