diff options
| author | Eugene Mutavchi <emutavchi@productengine.com> | 2010-03-05 21:36:41 +0200 |
|---|---|---|
| committer | Eugene Mutavchi <emutavchi@productengine.com> | 2010-03-05 21:36:41 +0200 |
| commit | 48fd4c8d14172ab9780d88bf204d1e4e56f2004e (patch) | |
| tree | 845586ccfd49e52fc8f0099ecc5d550ce7f13edf /indra/llwindow/llwindowsdl.cpp | |
| parent | a174a4ff3db22a40fe0259dab260321b20108fb7 (diff) | |
Working on major bug EXT-4820([NUX] Viewer dimensions on first-run) - moved LLDisplayInfo to llwindow, implemented getting the width/height of screen for mac os and linux.
--HG--
branch : product-engine
Diffstat (limited to 'indra/llwindow/llwindowsdl.cpp')
| -rw-r--r-- | indra/llwindow/llwindowsdl.cpp | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/indra/llwindow/llwindowsdl.cpp b/indra/llwindow/llwindowsdl.cpp index 1f705f9e60..fe0ada5b09 100644 --- a/indra/llwindow/llwindowsdl.cpp +++ b/indra/llwindow/llwindowsdl.cpp @@ -187,6 +187,47 @@ Display* LLWindowSDL::get_SDL_Display(void) } #endif // LL_X11 +// static +S32 LLWindowSDL::getDisplayWidth() +{ +#if LL_GTK + if (LLWindowSDL::ll_try_gtk_init()) + { + return gdk_screen_width(); + } +#endif // LL_GTK + +#if LL_X11 + Display *display = XOpenDisplay(NULL); + int screen_num = DefaultScreen(display); + S32 width = DisplayWidth(display, screen_num); + XCloseDisplay(display); + return width; +#endif //LL_X11 + + return 1024; +} + +// static +S32 LLWindowSDL::getDisplayHeight() +{ +#if LL_GTK + if (LLWindowSDL::ll_try_gtk_init()) + { + return gdk_screen_height(); + } +#endif // LL_GTK + +#if LL_X11 + Display *display = XOpenDisplay(NULL); + int screen_num = DefaultScreen(display); + S32 height = DisplayHeight(display, screen_num); + XCloseDisplay(display); + return height; +#endif //LL_X11 + + return 768; +} LLWindowSDL::LLWindowSDL(LLWindowCallbacks* callbacks, const std::string& title, S32 x, S32 y, S32 width, |
