From 8ba2b388769e245ec1b49b7d6d4b0372d684ff86 Mon Sep 17 00:00:00 2001 From: Don Kjer Date: Thu, 13 Sep 2012 10:25:48 +0000 Subject: Fleshed out target_link_libraries dependencies between libraries. Appearance utility now reads avatar_lad.xml during stubbed out params processing. --- indra/llwindow/CMakeLists.txt | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'indra/llwindow') diff --git a/indra/llwindow/CMakeLists.txt b/indra/llwindow/CMakeLists.txt index 341bddfffd..652d5cae5a 100644 --- a/indra/llwindow/CMakeLists.txt +++ b/indra/llwindow/CMakeLists.txt @@ -64,6 +64,13 @@ set(viewer_HEADER_FILES # Sort by high-level to low-level if (LINUX AND VIEWER) set(llwindow_LINK_LIBRARIES + ${LLCOMMON_LIBRARIES} + ${LLIMAGE_LIBRARIES} + ${LLMATH_LIBRARIES} + ${LLRENDER_LIBRARIES} + ${LLVFS_LIBRARIES} + ${LLWINDOW_LIBRARIES} + ${LLXML_LIBRARIES} ${UI_LIBRARIES} # for GTK ${SDL_LIBRARY} fontconfig # For FCInit and other FC* functions. @@ -160,7 +167,8 @@ endif (SERVER AND NOT WINDOWS AND NOT DARWIN) if (llwindow_HEADER_FILES) list(APPEND llwindow_SOURCE_FILES ${llwindow_HEADER_FILES}) endif (llwindow_HEADER_FILES) - list(APPEND viewer_SOURCE_FILES ${viewer_HEADER_FILES}) + +list(APPEND viewer_SOURCE_FILES ${viewer_HEADER_FILES}) if (VIEWER) add_library (llwindow -- cgit v1.2.3 From 49caededb4bf5beb8b87ebee034c1d969968af4d Mon Sep 17 00:00:00 2001 From: Nyx Linden Date: Wed, 19 Sep 2012 17:05:56 +0000 Subject: BUILDFIX: enabling the building of the viewer/appearance backend with headless mesa --- indra/llwindow/CMakeLists.txt | 9 +++++---- indra/llwindow/llwindow.cpp | 2 ++ indra/llwindow/llwindowmesaheadless.h | 1 + 3 files changed, 8 insertions(+), 4 deletions(-) (limited to 'indra/llwindow') diff --git a/indra/llwindow/CMakeLists.txt b/indra/llwindow/CMakeLists.txt index 652d5cae5a..4db58be776 100644 --- a/indra/llwindow/CMakeLists.txt +++ b/indra/llwindow/CMakeLists.txt @@ -140,18 +140,19 @@ endif (SOLARIS) set_source_files_properties(${llwindow_HEADER_FILES} PROPERTIES HEADER_FILE_ONLY TRUE) -if (SERVER AND NOT WINDOWS AND NOT DARWIN) +if ((SERVER OR BAKING) AND NOT WINDOWS AND NOT DARWIN) set(server_SOURCE_FILES llwindowmesaheadless.cpp + llmousehandler.cpp ) set(server_HEADER_FILES llwindowmesaheadless.h + llmousehandler.h ) copy_server_sources( llwindow ) - set_source_files_properties( ${server_SOURCE_FILES} PROPERTIES @@ -161,8 +162,8 @@ if (SERVER AND NOT WINDOWS AND NOT DARWIN) ${llwindow_SOURCE_FILES} ${server_SOURCE_FILES} ) - target_link_libraries (llwindowheadless ${llwindow_LINK_LIBRARIES}) -endif (SERVER AND NOT WINDOWS AND NOT DARWIN) + target_link_libraries (llwindowheadless ${llwindow_LINK_LIBRARIES} OSMesa16 dl) +endif ((SERVER OR BAKING) AND NOT WINDOWS AND NOT DARWIN) if (llwindow_HEADER_FILES) list(APPEND llwindow_SOURCE_FILES ${llwindow_HEADER_FILES}) diff --git a/indra/llwindow/llwindow.cpp b/indra/llwindow/llwindow.cpp index 5b7424acbb..d83278d875 100644 --- a/indra/llwindow/llwindow.cpp +++ b/indra/llwindow/llwindow.cpp @@ -256,6 +256,8 @@ std::vector LLWindow::getDynamicFallbackFontList() return LLWindowWin32::getDynamicFallbackFontList(); #elif LL_DARWIN return LLWindowMacOSX::getDynamicFallbackFontList(); +#elif LL_MESA_HEADLESS + return std::vector(); #elif LL_SDL return LLWindowSDL::getDynamicFallbackFontList(); #else diff --git a/indra/llwindow/llwindowmesaheadless.h b/indra/llwindow/llwindowmesaheadless.h index 8f70aee4f6..bc8e25ec44 100644 --- a/indra/llwindow/llwindowmesaheadless.h +++ b/indra/llwindow/llwindowmesaheadless.h @@ -51,6 +51,7 @@ public: /*virtual*/ BOOL getSize(LLCoordWindow *size) {return FALSE;}; /*virtual*/ BOOL setPosition(LLCoordScreen position) {return FALSE;}; /*virtual*/ BOOL setSizeImpl(LLCoordScreen size) {return FALSE;}; + /*virtual*/ BOOL setSizeImpl(LLCoordWindow size) {return FALSE;}; /*virtual*/ BOOL switchContext(BOOL fullscreen, const LLCoordScreen &size, BOOL disable_vsync, const LLCoordScreen * const posp = NULL) {return FALSE;}; /*virtual*/ BOOL setCursorPosition(LLCoordWindow position) {return FALSE;}; /*virtual*/ BOOL getCursorPosition(LLCoordWindow *position) {return FALSE;}; -- cgit v1.2.3 From d3924200b6b8817461c0f10f87a643005466d4af Mon Sep 17 00:00:00 2001 From: Don Kjer Date: Sun, 23 Sep 2012 03:06:11 +0000 Subject: Removing unused gHeadlessClient code from viewer --- indra/llwindow/llwindow.cpp | 34 ++++++++++++--------------------- indra/llwindow/llwindow.h | 1 - indra/llwindow/llwindowheadless.cpp | 2 +- indra/llwindow/llwindowheadless.h | 2 +- indra/llwindow/llwindowmacosx.cpp | 3 +-- indra/llwindow/llwindowmacosx.h | 2 +- indra/llwindow/llwindowmesaheadless.cpp | 29 +++++++++++++--------------- indra/llwindow/llwindowmesaheadless.h | 2 +- indra/llwindow/llwindowsdl.cpp | 3 +-- indra/llwindow/llwindowsdl.h | 2 +- indra/llwindow/llwindowwin32.cpp | 2 +- indra/llwindow/llwindowwin32.h | 2 +- 12 files changed, 34 insertions(+), 50 deletions(-) (limited to 'indra/llwindow') diff --git a/indra/llwindow/llwindow.cpp b/indra/llwindow/llwindow.cpp index d83278d875..9e4ad310c7 100644 --- a/indra/llwindow/llwindow.cpp +++ b/indra/llwindow/llwindow.cpp @@ -388,38 +388,28 @@ LLWindow* LLWindowManager::createWindow( BOOL fullscreen, BOOL clearBg, BOOL disable_vsync, - BOOL use_gl, BOOL ignore_pixel_depth, U32 fsaa_samples) { LLWindow* new_window; - if (use_gl) - { #if LL_MESA_HEADLESS - new_window = new LLWindowMesaHeadless(callbacks, - title, name, x, y, width, height, flags, - fullscreen, clearBg, disable_vsync, use_gl, ignore_pixel_depth); + new_window = new LLWindowMesaHeadless(callbacks, + title, name, x, y, width, height, flags, + fullscreen, clearBg, disable_vsync, ignore_pixel_depth); #elif LL_SDL - new_window = new LLWindowSDL(callbacks, - title, x, y, width, height, flags, - fullscreen, clearBg, disable_vsync, use_gl, ignore_pixel_depth, fsaa_samples); + new_window = new LLWindowSDL(callbacks, + title, x, y, width, height, flags, + fullscreen, clearBg, disable_vsync, ignore_pixel_depth, fsaa_samples); #elif LL_WINDOWS - new_window = new LLWindowWin32(callbacks, - title, name, x, y, width, height, flags, - fullscreen, clearBg, disable_vsync, use_gl, ignore_pixel_depth, fsaa_samples); + new_window = new LLWindowWin32(callbacks, + title, name, x, y, width, height, flags, + fullscreen, clearBg, disable_vsync, ignore_pixel_depth, fsaa_samples); #elif LL_DARWIN - new_window = new LLWindowMacOSX(callbacks, - title, name, x, y, width, height, flags, - fullscreen, clearBg, disable_vsync, use_gl, ignore_pixel_depth, fsaa_samples); + new_window = new LLWindowMacOSX(callbacks, + title, name, x, y, width, height, flags, + fullscreen, clearBg, disable_vsync, ignore_pixel_depth, fsaa_samples); #endif - } - else - { - new_window = new LLWindowHeadless(callbacks, - title, name, x, y, width, height, flags, - fullscreen, clearBg, disable_vsync, use_gl, ignore_pixel_depth); - } if (FALSE == new_window->isValid()) { diff --git a/indra/llwindow/llwindow.h b/indra/llwindow/llwindow.h index 4da87f4e06..e92b0fd387 100644 --- a/indra/llwindow/llwindow.h +++ b/indra/llwindow/llwindow.h @@ -265,7 +265,6 @@ public: BOOL fullscreen = FALSE, BOOL clearBg = FALSE, BOOL disable_vsync = TRUE, - BOOL use_gl = TRUE, BOOL ignore_pixel_depth = FALSE, U32 fsaa_samples = 0); static BOOL destroyWindow(LLWindow* window); diff --git a/indra/llwindow/llwindowheadless.cpp b/indra/llwindow/llwindowheadless.cpp index e6e6bc67ff..dbdb40f5b9 100644 --- a/indra/llwindow/llwindowheadless.cpp +++ b/indra/llwindow/llwindowheadless.cpp @@ -35,7 +35,7 @@ // LLWindowHeadless::LLWindowHeadless(LLWindowCallbacks* callbacks, const std::string& title, const std::string& name, S32 x, S32 y, S32 width, S32 height, U32 flags, BOOL fullscreen, BOOL clear_background, - BOOL disable_vsync, BOOL use_gl, BOOL ignore_pixel_depth) + BOOL disable_vsync, BOOL ignore_pixel_depth) : LLWindow(callbacks, fullscreen, flags) { // Initialize a headless keyboard. diff --git a/indra/llwindow/llwindowheadless.h b/indra/llwindow/llwindowheadless.h index 1f767f4c97..72f9684ca3 100644 --- a/indra/llwindow/llwindowheadless.h +++ b/indra/llwindow/llwindowheadless.h @@ -96,7 +96,7 @@ public: S32 x, S32 y, S32 width, S32 height, U32 flags, BOOL fullscreen, BOOL clear_background, - BOOL disable_vsync, BOOL use_gl, BOOL ignore_pixel_depth); + BOOL disable_vsync, BOOL ignore_pixel_depth); virtual ~LLWindowHeadless(); private: diff --git a/indra/llwindow/llwindowmacosx.cpp b/indra/llwindow/llwindowmacosx.cpp index 97637c937f..413a9df616 100644 --- a/indra/llwindow/llwindowmacosx.cpp +++ b/indra/llwindow/llwindowmacosx.cpp @@ -210,7 +210,7 @@ LLWindowMacOSX::LLWindowMacOSX(LLWindowCallbacks* callbacks, const std::string& title, const std::string& name, S32 x, S32 y, S32 width, S32 height, U32 flags, BOOL fullscreen, BOOL clearBg, - BOOL disable_vsync, BOOL use_gl, + BOOL disable_vsync, BOOL ignore_pixel_depth, U32 fsaa_samples) : LLWindow(NULL, fullscreen, flags) @@ -228,7 +228,6 @@ LLWindowMacOSX::LLWindowMacOSX(LLWindowCallbacks* callbacks, gKeyboard = new LLKeyboardMacOSX(); gKeyboard->setCallbacks(callbacks); - // Ignore use_gl for now, only used for drones on PC mWindow = NULL; mContext = NULL; mPixelFormat = NULL; diff --git a/indra/llwindow/llwindowmacosx.h b/indra/llwindow/llwindowmacosx.h index 52ba8b3bf3..4484787a4e 100644 --- a/indra/llwindow/llwindowmacosx.h +++ b/indra/llwindow/llwindowmacosx.h @@ -122,7 +122,7 @@ public: protected: LLWindowMacOSX(LLWindowCallbacks* callbacks, const std::string& title, const std::string& name, int x, int y, int width, int height, U32 flags, - BOOL fullscreen, BOOL clearBg, BOOL disable_vsync, BOOL use_gl, + BOOL fullscreen, BOOL clearBg, BOOL disable_vsync, BOOL ignore_pixel_depth, U32 fsaa_samples); ~LLWindowMacOSX(); diff --git a/indra/llwindow/llwindowmesaheadless.cpp b/indra/llwindow/llwindowmesaheadless.cpp index 11c22ac94e..2b668d3fc4 100644 --- a/indra/llwindow/llwindowmesaheadless.cpp +++ b/indra/llwindow/llwindowmesaheadless.cpp @@ -41,28 +41,25 @@ U16 *gMesaBuffer = NULL; LLWindowMesaHeadless::LLWindowMesaHeadless(LLWindowCallbacks* callbacks, const std::string& title, const std::string& name, S32 x, S32 y, S32 width, S32 height, U32 flags, BOOL fullscreen, BOOL clearBg, - BOOL disable_vsync, BOOL use_gl, BOOL ignore_pixel_depth) + BOOL disable_vsync, BOOL ignore_pixel_depth) : LLWindow(callbacks, fullscreen, flags) { - if (use_gl) - { - llinfos << "MESA Init" << llendl; - mMesaContext = OSMesaCreateContextExt( GL_RGBA, 32, 0, 0, NULL ); - - /* Allocate the image buffer */ - mMesaBuffer = new unsigned char [width * height * 4 * MESA_CHANNEL_SIZE]; - llassert(mMesaBuffer); + llinfos << "MESA Init" << llendl; + mMesaContext = OSMesaCreateContextExt( GL_RGBA, 32, 0, 0, NULL ); - gMesaBuffer = (U16*)mMesaBuffer; + /* Allocate the image buffer */ + mMesaBuffer = new unsigned char [width * height * 4 * MESA_CHANNEL_SIZE]; + llassert(mMesaBuffer); - /* Bind the buffer to the context and make it current */ - if (!OSMesaMakeCurrent( mMesaContext, mMesaBuffer, MESA_CHANNEL_TYPE, width, height )) - { - llerrs << "MESA: OSMesaMakeCurrent failed!" << llendl; - } + gMesaBuffer = (U16*)mMesaBuffer; - llverify(gGLManager.initGL()); + /* Bind the buffer to the context and make it current */ + if (!OSMesaMakeCurrent( mMesaContext, mMesaBuffer, MESA_CHANNEL_TYPE, width, height )) + { + llerrs << "MESA: OSMesaMakeCurrent failed!" << llendl; } + + llverify(gGLManager.initGL()); } diff --git a/indra/llwindow/llwindowmesaheadless.h b/indra/llwindow/llwindowmesaheadless.h index bc8e25ec44..c8d2bf2824 100644 --- a/indra/llwindow/llwindowmesaheadless.h +++ b/indra/llwindow/llwindowmesaheadless.h @@ -98,7 +98,7 @@ public: LLWindowMesaHeadless(LLWindowCallbacks* callbacks, const std::string& title, const std::string& name, S32 x, S32 y, S32 width, S32 height, U32 flags, BOOL fullscreen, BOOL clearBg, - BOOL disable_vsync, BOOL use_gl, BOOL ignore_pixel_depth); + BOOL disable_vsync, BOOL ignore_pixel_depth); ~LLWindowMesaHeadless(); private: diff --git a/indra/llwindow/llwindowsdl.cpp b/indra/llwindow/llwindowsdl.cpp index 3bf4a48cb6..de731df228 100644 --- a/indra/llwindow/llwindowsdl.cpp +++ b/indra/llwindow/llwindowsdl.cpp @@ -186,7 +186,7 @@ LLWindowSDL::LLWindowSDL(LLWindowCallbacks* callbacks, const std::string& title, S32 x, S32 y, S32 width, S32 height, U32 flags, BOOL fullscreen, BOOL clearBg, - BOOL disable_vsync, BOOL use_gl, + BOOL disable_vsync, BOOL ignore_pixel_depth, U32 fsaa_samples) : LLWindow(callbacks, fullscreen, flags), Lock_Display(NULL), @@ -197,7 +197,6 @@ LLWindowSDL::LLWindowSDL(LLWindowCallbacks* callbacks, gKeyboard->setCallbacks(callbacks); // Note that we can't set up key-repeat until after SDL has init'd video - // Ignore use_gl for now, only used for drones on PC mWindow = NULL; mNeedsResize = FALSE; mOverrideAspectRatio = 0.f; diff --git a/indra/llwindow/llwindowsdl.h b/indra/llwindow/llwindowsdl.h index 4e2a269ea3..91ba73a0ac 100644 --- a/indra/llwindow/llwindowsdl.h +++ b/indra/llwindow/llwindowsdl.h @@ -147,7 +147,7 @@ public: protected: LLWindowSDL(LLWindowCallbacks* callbacks, const std::string& title, int x, int y, int width, int height, U32 flags, - BOOL fullscreen, BOOL clearBg, BOOL disable_vsync, BOOL use_gl, + BOOL fullscreen, BOOL clearBg, BOOL disable_vsync, BOOL ignore_pixel_depth, U32 fsaa_samples); ~LLWindowSDL(); diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp index 9a4dd41c4e..639ffb9d56 100644 --- a/indra/llwindow/llwindowwin32.cpp +++ b/indra/llwindow/llwindowwin32.cpp @@ -362,7 +362,7 @@ LLWindowWin32::LLWindowWin32(LLWindowCallbacks* callbacks, const std::string& title, const std::string& name, S32 x, S32 y, S32 width, S32 height, U32 flags, BOOL fullscreen, BOOL clearBg, - BOOL disable_vsync, BOOL use_gl, + BOOL disable_vsync, BOOL ignore_pixel_depth, U32 fsaa_samples) : LLWindow(callbacks, fullscreen, flags) diff --git a/indra/llwindow/llwindowwin32.h b/indra/llwindow/llwindowwin32.h index 54c9ac4d4d..aa7e2289bb 100644 --- a/indra/llwindow/llwindowwin32.h +++ b/indra/llwindow/llwindowwin32.h @@ -118,7 +118,7 @@ public: protected: LLWindowWin32(LLWindowCallbacks* callbacks, const std::string& title, const std::string& name, int x, int y, int width, int height, U32 flags, - BOOL fullscreen, BOOL clearBg, BOOL disable_vsync, BOOL use_gl, + BOOL fullscreen, BOOL clearBg, BOOL disable_vsync, BOOL ignore_pixel_depth, U32 fsaa_samples); ~LLWindowWin32(); -- cgit v1.2.3 From c9ab9590aa1d44ea139b16e7ffcb1461d928bdd5 Mon Sep 17 00:00:00 2001 From: Don Kjer Date: Thu, 4 Oct 2012 03:12:48 +0000 Subject: Removing server-related cmake cruft. Fixing libGLU warnings on linux. --- indra/llwindow/CMakeLists.txt | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) (limited to 'indra/llwindow') diff --git a/indra/llwindow/CMakeLists.txt b/indra/llwindow/CMakeLists.txt index 4db58be776..5fef44f9cb 100644 --- a/indra/llwindow/CMakeLists.txt +++ b/indra/llwindow/CMakeLists.txt @@ -62,7 +62,7 @@ set(viewer_HEADER_FILES # Libraries on which this library depends, needed for Linux builds # Sort by high-level to low-level -if (LINUX AND VIEWER) +if (LINUX) set(llwindow_LINK_LIBRARIES ${LLCOMMON_LIBRARIES} ${LLIMAGE_LIBRARIES} @@ -75,7 +75,7 @@ if (LINUX AND VIEWER) ${SDL_LIBRARY} fontconfig # For FCInit and other FC* functions. ) -endif (LINUX AND VIEWER) +endif (LINUX) if (DARWIN) list(APPEND llwindow_SOURCE_FILES @@ -98,7 +98,7 @@ if (DARWIN) ) endif (DARWIN) -if (LINUX AND VIEWER) +if (LINUX) list(APPEND viewer_SOURCE_FILES llkeyboardsdl.cpp llwindowsdl.cpp @@ -107,7 +107,7 @@ if (LINUX AND VIEWER) llkeyboardsdl.h llwindowsdl.h ) -endif (LINUX AND VIEWER) +endif (LINUX) if (WINDOWS) list(APPEND llwindow_SOURCE_FILES @@ -171,11 +171,9 @@ endif (llwindow_HEADER_FILES) list(APPEND viewer_SOURCE_FILES ${viewer_HEADER_FILES}) -if (VIEWER) - add_library (llwindow - ${llwindow_SOURCE_FILES} - ${viewer_SOURCE_FILES} - ) - target_link_libraries (llwindow ${llwindow_LINK_LIBRARIES}) -endif (VIEWER) +add_library (llwindow + ${llwindow_SOURCE_FILES} + ${viewer_SOURCE_FILES} + ) +target_link_libraries (llwindow ${llwindow_LINK_LIBRARIES}) -- cgit v1.2.3 From 21df924a10c1c32f7fc28bb29b20dc2179863b24 Mon Sep 17 00:00:00 2001 From: Don Kjer Date: Thu, 4 Oct 2012 06:29:07 +0000 Subject: Building headless and non-headless libraries side-by-side, removing the need for the BAKING cmake setting. --- indra/llwindow/CMakeLists.txt | 47 ++++++++++++++++++++++++++++--------------- 1 file changed, 31 insertions(+), 16 deletions(-) (limited to 'indra/llwindow') diff --git a/indra/llwindow/CMakeLists.txt b/indra/llwindow/CMakeLists.txt index 5fef44f9cb..be74bbb541 100644 --- a/indra/llwindow/CMakeLists.txt +++ b/indra/llwindow/CMakeLists.txt @@ -38,6 +38,7 @@ set(llwindow_SOURCE_FILES llkeyboardheadless.cpp llwindowheadless.cpp llwindowcallbacks.cpp + llwindow.cpp ) set(llwindow_HEADER_FILES @@ -50,7 +51,6 @@ set(llwindow_HEADER_FILES ) set(viewer_SOURCE_FILES - llwindow.cpp llmousehandler.cpp ) @@ -75,6 +75,20 @@ if (LINUX) ${SDL_LIBRARY} fontconfig # For FCInit and other FC* functions. ) + + if (BUILD_HEADLESS) + set(llwindowheadless_LINK_LIBRARIES + ${LLCOMMON_LIBRARIES} + ${LLIMAGE_LIBRARIES} + ${LLMATH_LIBRARIES} + ${LLRENDER_HEADLESS_LIBRARIES} + ${LLVFS_LIBRARIES} + ${LLWINDOW_HEADLESS_LIBRARIES} + ${LLXML_LIBRARIES} + ${UI_LIBRARIES} # for GTK + fontconfig # For FCInit and other FC* functions. + ) + endif (BUILD_HEADLESS) endif (LINUX) if (DARWIN) @@ -140,30 +154,24 @@ endif (SOLARIS) set_source_files_properties(${llwindow_HEADER_FILES} PROPERTIES HEADER_FILE_ONLY TRUE) -if ((SERVER OR BAKING) AND NOT WINDOWS AND NOT DARWIN) - set(server_SOURCE_FILES +if (BUILD_HEADLESS) + set(llwindowheadless_SOURCE_FILES llwindowmesaheadless.cpp llmousehandler.cpp ) - set(server_HEADER_FILES + set(llwindowheadless_HEADER_FILES llwindowmesaheadless.h llmousehandler.h ) - copy_server_sources( - llwindow - ) - - set_source_files_properties( - ${server_SOURCE_FILES} - PROPERTIES - COMPILE_FLAGS "-DLL_MESA=1 -DLL_MESA_HEADLESS=1" - ) add_library (llwindowheadless ${llwindow_SOURCE_FILES} - ${server_SOURCE_FILES} + ${llwindowheadless_SOURCE_FILES} + ) + set_property(TARGET llwindowheadless + PROPERTY COMPILE_DEFINITIONS LL_MESA=1 LL_MESA_HEADLESS=1 ) - target_link_libraries (llwindowheadless ${llwindow_LINK_LIBRARIES} OSMesa16 dl) -endif ((SERVER OR BAKING) AND NOT WINDOWS AND NOT DARWIN) + target_link_libraries (llwindowheadless ${llwindowheadless_LINK_LIBRARIES} dl) +endif (BUILD_HEADLESS) if (llwindow_HEADER_FILES) list(APPEND llwindow_SOURCE_FILES ${llwindow_HEADER_FILES}) @@ -175,5 +183,12 @@ add_library (llwindow ${llwindow_SOURCE_FILES} ${viewer_SOURCE_FILES} ) + +if (SDL_FOUND) + set_property(TARGET llwindow + PROPERTY COMPILE_DEFINITIONS LL_SDL=1 + ) +endif (SDL_FOUND) + target_link_libraries (llwindow ${llwindow_LINK_LIBRARIES}) -- cgit v1.2.3 From e858c172fcdf9aaf736383964c781a0bf347c473 Mon Sep 17 00:00:00 2001 From: Don Kjer Date: Thu, 4 Oct 2012 22:00:24 +0000 Subject: Updating to newer build of tcmalloc/google perf tools. Removing X11 library dependencies from headless libraries --- indra/llwindow/CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) (limited to 'indra/llwindow') diff --git a/indra/llwindow/CMakeLists.txt b/indra/llwindow/CMakeLists.txt index be74bbb541..908ed9e2c5 100644 --- a/indra/llwindow/CMakeLists.txt +++ b/indra/llwindow/CMakeLists.txt @@ -85,7 +85,6 @@ if (LINUX) ${LLVFS_LIBRARIES} ${LLWINDOW_HEADLESS_LIBRARIES} ${LLXML_LIBRARIES} - ${UI_LIBRARIES} # for GTK fontconfig # For FCInit and other FC* functions. ) endif (BUILD_HEADLESS) -- cgit v1.2.3 From c06c35609c6683731eaea283468f6b32af18fea2 Mon Sep 17 00:00:00 2001 From: Don Kjer Date: Thu, 11 Oct 2012 00:09:04 +0000 Subject: Updating linux build to gcc4.6 --- indra/llwindow/CMakeLists.txt | 4 ++++ indra/llwindow/GL/glh_extensions.h | 4 ++-- indra/llwindow/llwindowsdl.cpp | 10 +++++----- 3 files changed, 11 insertions(+), 7 deletions(-) (limited to 'indra/llwindow') diff --git a/indra/llwindow/CMakeLists.txt b/indra/llwindow/CMakeLists.txt index 908ed9e2c5..4610b7a234 100644 --- a/indra/llwindow/CMakeLists.txt +++ b/indra/llwindow/CMakeLists.txt @@ -32,6 +32,10 @@ include_directories( ${LLXML_INCLUDE_DIRS} ${DIRECTX_INCLUDE_DIR} ) +include_directories(SYSTEM + ${LLCOMMON_SYSTEM_INCLUDE_DIRS} + ${LLXML_SYSTEM_INCLUDE_DIRS} + ) set(llwindow_SOURCE_FILES llkeyboard.cpp diff --git a/indra/llwindow/GL/glh_extensions.h b/indra/llwindow/GL/glh_extensions.h index d89d85930b..554cb1731f 100644 --- a/indra/llwindow/GL/glh_extensions.h +++ b/indra/llwindow/GL/glh_extensions.h @@ -113,7 +113,7 @@ static const char* EatNonWhiteSpace(const char *str) int glh_init_extensions(const char *origReqExts) { // Length of requested extensions string - unsigned reqExtsLen; + //unsigned reqExtsLen; char *reqExts; // Ptr for individual extensions within reqExts char *reqExt; @@ -155,8 +155,8 @@ int glh_init_extensions(const char *origReqExts) return TRUE; } reqExts = strdup(origReqExts); - reqExtsLen = (S32)strlen(reqExts); /* + reqExtsLen = (S32)strlen(reqExts); if (NULL == gGLHExts.mUnsupportedExts) { gGLHExts.mUnsupportedExts = (char*)malloc(reqExtsLen + 1); diff --git a/indra/llwindow/llwindowsdl.cpp b/indra/llwindow/llwindowsdl.cpp index de731df228..c7b141d7c1 100644 --- a/indra/llwindow/llwindowsdl.cpp +++ b/indra/llwindow/llwindowsdl.cpp @@ -1643,24 +1643,24 @@ void check_vm_bloat() const long long significant_vm_difference = 250 * 1024*1024; const long long significant_rss_difference = 50 * 1024*1024; - ssize_t res; size_t dummy; char *ptr; - for (int i=0; i<22; ++i) // parse past the values we don't want + size_t delim_result = 0; + for (int i=0; i<22 && delim_result > -1; ++i) // parse past the values we don't want { ptr = NULL; - res = getdelim(&ptr, &dummy, ' ', fp); + delim_result = getdelim(&ptr, &dummy, ' ', fp); free(ptr); } // 23rd space-delimited entry is vsize ptr = NULL; - res = getdelim(&ptr, &dummy, ' ', fp); + delim_result = getdelim(&ptr, &dummy, ' ', fp); llassert(ptr); long long this_vm_size = atoll(ptr); free(ptr); // 24th space-delimited entry is RSS ptr = NULL; - res = getdelim(&ptr, &dummy, ' ', fp); + delim_result = getdelim(&ptr, &dummy, ' ', fp); llassert(ptr); long long this_rss_size = getpagesize() * atoll(ptr); free(ptr); -- cgit v1.2.3 From cc5f8686feee4efea124d582b99990dd987e1e98 Mon Sep 17 00:00:00 2001 From: Don Kjer Date: Mon, 15 Oct 2012 17:36:51 +0000 Subject: Speeding up cmake configuration, especially on linux. Re-arranged llrender/llwindow cmake source a bit --- indra/llwindow/CMakeLists.txt | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'indra/llwindow') diff --git a/indra/llwindow/CMakeLists.txt b/indra/llwindow/CMakeLists.txt index 4610b7a234..ad010164eb 100644 --- a/indra/llwindow/CMakeLists.txt +++ b/indra/llwindow/CMakeLists.txt @@ -80,6 +80,15 @@ if (LINUX) fontconfig # For FCInit and other FC* functions. ) + list(APPEND viewer_SOURCE_FILES + llkeyboardsdl.cpp + llwindowsdl.cpp + ) + list(APPEND viewer_HEADER_FILES + llkeyboardsdl.h + llwindowsdl.h + ) + if (BUILD_HEADLESS) set(llwindowheadless_LINK_LIBRARIES ${LLCOMMON_LIBRARIES} @@ -92,6 +101,7 @@ if (LINUX) fontconfig # For FCInit and other FC* functions. ) endif (BUILD_HEADLESS) + endif (LINUX) if (DARWIN) @@ -115,16 +125,6 @@ if (DARWIN) ) endif (DARWIN) -if (LINUX) - list(APPEND viewer_SOURCE_FILES - llkeyboardsdl.cpp - llwindowsdl.cpp - ) - list(APPEND viewer_HEADER_FILES - llkeyboardsdl.h - llwindowsdl.h - ) -endif (LINUX) if (WINDOWS) list(APPEND llwindow_SOURCE_FILES -- cgit v1.2.3 From 9ea6a96be9a5fda489d5e5ce28fc2df7c6f4c309 Mon Sep 17 00:00:00 2001 From: prep Date: Mon, 11 Mar 2013 17:29:05 -0400 Subject: LLWindow merge fixes for Mac --- indra/llwindow/llwindowmacosx.cpp | 3 ++- indra/llwindow/llwindowmacosx.h | 2 +- indra/llwindow/llwindowmesaheadless.cpp | 29 ++++++++++++++++------------- indra/llwindow/llwindowmesaheadless.h | 3 +-- indra/llwindow/llwindowsdl.cpp | 13 +++++++------ indra/llwindow/llwindowsdl.h | 2 +- 6 files changed, 28 insertions(+), 24 deletions(-) (limited to 'indra/llwindow') diff --git a/indra/llwindow/llwindowmacosx.cpp b/indra/llwindow/llwindowmacosx.cpp index 413a9df616..97637c937f 100644 --- a/indra/llwindow/llwindowmacosx.cpp +++ b/indra/llwindow/llwindowmacosx.cpp @@ -210,7 +210,7 @@ LLWindowMacOSX::LLWindowMacOSX(LLWindowCallbacks* callbacks, const std::string& title, const std::string& name, S32 x, S32 y, S32 width, S32 height, U32 flags, BOOL fullscreen, BOOL clearBg, - BOOL disable_vsync, + BOOL disable_vsync, BOOL use_gl, BOOL ignore_pixel_depth, U32 fsaa_samples) : LLWindow(NULL, fullscreen, flags) @@ -228,6 +228,7 @@ LLWindowMacOSX::LLWindowMacOSX(LLWindowCallbacks* callbacks, gKeyboard = new LLKeyboardMacOSX(); gKeyboard->setCallbacks(callbacks); + // Ignore use_gl for now, only used for drones on PC mWindow = NULL; mContext = NULL; mPixelFormat = NULL; diff --git a/indra/llwindow/llwindowmacosx.h b/indra/llwindow/llwindowmacosx.h index fcb738ed0f..af83b50097 100644 --- a/indra/llwindow/llwindowmacosx.h +++ b/indra/llwindow/llwindowmacosx.h @@ -122,7 +122,7 @@ public: protected: LLWindowMacOSX(LLWindowCallbacks* callbacks, const std::string& title, const std::string& name, int x, int y, int width, int height, U32 flags, - BOOL fullscreen, BOOL clearBg, BOOL disable_vsync, + BOOL fullscreen, BOOL clearBg, BOOL disable_vsync, BOOL use_gl, BOOL ignore_pixel_depth, U32 fsaa_samples); ~LLWindowMacOSX(); diff --git a/indra/llwindow/llwindowmesaheadless.cpp b/indra/llwindow/llwindowmesaheadless.cpp index 2b668d3fc4..11c22ac94e 100644 --- a/indra/llwindow/llwindowmesaheadless.cpp +++ b/indra/llwindow/llwindowmesaheadless.cpp @@ -41,25 +41,28 @@ U16 *gMesaBuffer = NULL; LLWindowMesaHeadless::LLWindowMesaHeadless(LLWindowCallbacks* callbacks, const std::string& title, const std::string& name, S32 x, S32 y, S32 width, S32 height, U32 flags, BOOL fullscreen, BOOL clearBg, - BOOL disable_vsync, BOOL ignore_pixel_depth) + BOOL disable_vsync, BOOL use_gl, BOOL ignore_pixel_depth) : LLWindow(callbacks, fullscreen, flags) { - llinfos << "MESA Init" << llendl; - mMesaContext = OSMesaCreateContextExt( GL_RGBA, 32, 0, 0, NULL ); + if (use_gl) + { + llinfos << "MESA Init" << llendl; + mMesaContext = OSMesaCreateContextExt( GL_RGBA, 32, 0, 0, NULL ); - /* Allocate the image buffer */ - mMesaBuffer = new unsigned char [width * height * 4 * MESA_CHANNEL_SIZE]; - llassert(mMesaBuffer); + /* Allocate the image buffer */ + mMesaBuffer = new unsigned char [width * height * 4 * MESA_CHANNEL_SIZE]; + llassert(mMesaBuffer); - gMesaBuffer = (U16*)mMesaBuffer; + gMesaBuffer = (U16*)mMesaBuffer; - /* Bind the buffer to the context and make it current */ - if (!OSMesaMakeCurrent( mMesaContext, mMesaBuffer, MESA_CHANNEL_TYPE, width, height )) - { - llerrs << "MESA: OSMesaMakeCurrent failed!" << llendl; - } + /* Bind the buffer to the context and make it current */ + if (!OSMesaMakeCurrent( mMesaContext, mMesaBuffer, MESA_CHANNEL_TYPE, width, height )) + { + llerrs << "MESA: OSMesaMakeCurrent failed!" << llendl; + } - llverify(gGLManager.initGL()); + llverify(gGLManager.initGL()); + } } diff --git a/indra/llwindow/llwindowmesaheadless.h b/indra/llwindow/llwindowmesaheadless.h index c8d2bf2824..8f70aee4f6 100644 --- a/indra/llwindow/llwindowmesaheadless.h +++ b/indra/llwindow/llwindowmesaheadless.h @@ -51,7 +51,6 @@ public: /*virtual*/ BOOL getSize(LLCoordWindow *size) {return FALSE;}; /*virtual*/ BOOL setPosition(LLCoordScreen position) {return FALSE;}; /*virtual*/ BOOL setSizeImpl(LLCoordScreen size) {return FALSE;}; - /*virtual*/ BOOL setSizeImpl(LLCoordWindow size) {return FALSE;}; /*virtual*/ BOOL switchContext(BOOL fullscreen, const LLCoordScreen &size, BOOL disable_vsync, const LLCoordScreen * const posp = NULL) {return FALSE;}; /*virtual*/ BOOL setCursorPosition(LLCoordWindow position) {return FALSE;}; /*virtual*/ BOOL getCursorPosition(LLCoordWindow *position) {return FALSE;}; @@ -98,7 +97,7 @@ public: LLWindowMesaHeadless(LLWindowCallbacks* callbacks, const std::string& title, const std::string& name, S32 x, S32 y, S32 width, S32 height, U32 flags, BOOL fullscreen, BOOL clearBg, - BOOL disable_vsync, BOOL ignore_pixel_depth); + BOOL disable_vsync, BOOL use_gl, BOOL ignore_pixel_depth); ~LLWindowMesaHeadless(); private: diff --git a/indra/llwindow/llwindowsdl.cpp b/indra/llwindow/llwindowsdl.cpp index 0d2e0f78c1..a15114cb9b 100644 --- a/indra/llwindow/llwindowsdl.cpp +++ b/indra/llwindow/llwindowsdl.cpp @@ -186,7 +186,7 @@ LLWindowSDL::LLWindowSDL(LLWindowCallbacks* callbacks, const std::string& title, S32 x, S32 y, S32 width, S32 height, U32 flags, BOOL fullscreen, BOOL clearBg, - BOOL disable_vsync, + BOOL disable_vsync, BOOL use_gl, BOOL ignore_pixel_depth, U32 fsaa_samples) : LLWindow(callbacks, fullscreen, flags), Lock_Display(NULL), @@ -197,6 +197,7 @@ LLWindowSDL::LLWindowSDL(LLWindowCallbacks* callbacks, gKeyboard->setCallbacks(callbacks); // Note that we can't set up key-repeat until after SDL has init'd video + // Ignore use_gl for now, only used for drones on PC mWindow = NULL; mNeedsResize = FALSE; mOverrideAspectRatio = 0.f; @@ -1643,24 +1644,24 @@ void check_vm_bloat() const long long significant_vm_difference = 250 * 1024*1024; const long long significant_rss_difference = 50 * 1024*1024; + ssize_t res; size_t dummy; char *ptr; - size_t delim_result = 0; - for (int i=0; i<22 && delim_result > -1; ++i) // parse past the values we don't want + for (int i=0; i<22; ++i) // parse past the values we don't want { ptr = NULL; - delim_result = getdelim(&ptr, &dummy, ' ', fp); + res = getdelim(&ptr, &dummy, ' ', fp); free(ptr); } // 23rd space-delimited entry is vsize ptr = NULL; - delim_result = getdelim(&ptr, &dummy, ' ', fp); + res = getdelim(&ptr, &dummy, ' ', fp); llassert(ptr); long long this_vm_size = atoll(ptr); free(ptr); // 24th space-delimited entry is RSS ptr = NULL; - delim_result = getdelim(&ptr, &dummy, ' ', fp); + res = getdelim(&ptr, &dummy, ' ', fp); llassert(ptr); long long this_rss_size = getpagesize() * atoll(ptr); free(ptr); diff --git a/indra/llwindow/llwindowsdl.h b/indra/llwindow/llwindowsdl.h index d430e3d83b..c5ce892a04 100644 --- a/indra/llwindow/llwindowsdl.h +++ b/indra/llwindow/llwindowsdl.h @@ -147,7 +147,7 @@ public: protected: LLWindowSDL(LLWindowCallbacks* callbacks, const std::string& title, int x, int y, int width, int height, U32 flags, - BOOL fullscreen, BOOL clearBg, BOOL disable_vsync, + BOOL fullscreen, BOOL clearBg, BOOL disable_vsync, BOOL use_gl, BOOL ignore_pixel_depth, U32 fsaa_samples); ~LLWindowSDL(); -- cgit v1.2.3 From cec50f8c142f4ff5f8358d9fa27884dd14f77eff Mon Sep 17 00:00:00 2001 From: Don Kjer Date: Wed, 13 Mar 2013 19:17:13 +0000 Subject: Fix for gcc 4.6 build failures on Linux in llwindowsdl.cpp --- indra/llwindow/llwindowsdl.cpp | 38 +++++++++++++++++++++++++++++++------- 1 file changed, 31 insertions(+), 7 deletions(-) (limited to 'indra/llwindow') diff --git a/indra/llwindow/llwindowsdl.cpp b/indra/llwindow/llwindowsdl.cpp index a15114cb9b..205466e936 100644 --- a/indra/llwindow/llwindowsdl.cpp +++ b/indra/llwindow/llwindowsdl.cpp @@ -1636,35 +1636,53 @@ void check_vm_bloat() { #if LL_LINUX // watch our own VM and RSS sizes, warn if we bloated rapidly - FILE *fp = fopen("/proc/self/stat", "r"); + static const std::string STATS_FILE = "/proc/self/stat"; + FILE *fp = fopen(STATS_FILE.c_str(), "r"); if (fp) { static long long last_vm_size = 0; static long long last_rss_size = 0; const long long significant_vm_difference = 250 * 1024*1024; const long long significant_rss_difference = 50 * 1024*1024; + long long this_vm_size = 0; + long long this_rss_size = 0; ssize_t res; size_t dummy; - char *ptr; + char *ptr = NULL; for (int i=0; i<22; ++i) // parse past the values we don't want { - ptr = NULL; res = getdelim(&ptr, &dummy, ' ', fp); + if (-1 == res) + { + llwarns << "Unable to parse " << STATS_FILE << llendl; + goto finally; + } free(ptr); + ptr = NULL; } // 23rd space-delimited entry is vsize - ptr = NULL; res = getdelim(&ptr, &dummy, ' ', fp); llassert(ptr); - long long this_vm_size = atoll(ptr); + if (-1 == res) + { + llwarns << "Unable to parse " << STATS_FILE << llendl; + goto finally; + } + this_vm_size = atoll(ptr); free(ptr); - // 24th space-delimited entry is RSS ptr = NULL; + // 24th space-delimited entry is RSS res = getdelim(&ptr, &dummy, ' ', fp); llassert(ptr); - long long this_rss_size = getpagesize() * atoll(ptr); + if (-1 == res) + { + llwarns << "Unable to parse " << STATS_FILE << llendl; + goto finally; + } + this_rss_size = getpagesize() * atoll(ptr); free(ptr); + ptr = NULL; llinfos << "VM SIZE IS NOW " << (this_vm_size/(1024*1024)) << " MB, RSS SIZE IS NOW " << (this_rss_size/(1024*1024)) << " MB" << llendl; @@ -1697,6 +1715,12 @@ void check_vm_bloat() last_rss_size = this_rss_size; last_vm_size = this_vm_size; +finally: + if (NULL != ptr) + { + free(ptr); + ptr = NULL; + } fclose(fp); } #endif // LL_LINUX -- cgit v1.2.3