diff options
| author | Andrey Lihatskiy <alihatskiy@productengine.com> | 2025-11-19 21:05:46 +0200 |
|---|---|---|
| committer | Andrey Lihatskiy <alihatskiy@productengine.com> | 2025-11-19 21:05:46 +0200 |
| commit | 093d969eb97ca03dbf4ae5cd3a3c784f58613a32 (patch) | |
| tree | 916a65d49f2bfe6c12effba979bfa39417d6304a /indra/llappearanceutility/llbakingwindow.cpp | |
| parent | 7e09943d57ecf2d9b15249cbc19b4e2ec16f7bf3 (diff) | |
| parent | ae659adab6f8d1adf0224d12fb3b379251eaa501 (diff) | |
Merge branch 'develop-linux' into marchcat/slua-linux
# Conflicts:
# indra/newview/llfeaturemanager.cpp
# indra/newview/llstartup.cpp
Diffstat (limited to 'indra/llappearanceutility/llbakingwindow.cpp')
| -rw-r--r-- | indra/llappearanceutility/llbakingwindow.cpp | 94 |
1 files changed, 94 insertions, 0 deletions
diff --git a/indra/llappearanceutility/llbakingwindow.cpp b/indra/llappearanceutility/llbakingwindow.cpp new file mode 100644 index 0000000000..8799105932 --- /dev/null +++ b/indra/llappearanceutility/llbakingwindow.cpp @@ -0,0 +1,94 @@ +/** + * @file llbakingwindow.cpp + * @brief Implementation of LLBakingWindow class. + * + * $LicenseInfo:firstyear=2012&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2012, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +// linden includes +#include "linden_common.h" + +// project includes +#include "llappappearanceutility.h" +#include "llbakingshadermgr.h" +#include "llbakingwindow.h" +#include "llgl.h" +#include "llgltexture.h" +#include "llvertexbuffer.h" + +LLBakingWindow::LLBakingWindow(S32 width, S32 height) +{ + const S32 WINDOW_ORIGIN_X = 0; + const S32 WINDOW_ORIGIN_Y = 0; + const U32 FLAGS = 32; // *TODO: Why did mapserver use this? mFlags looks unused. + const bool NO_FULLSCREEN = false; + const bool NO_CLEAR_BG = false; + const bool NO_DISABLE_VSYNC = false; + const bool NO_IGNORE_PIXEL_DEPTH = false; + const bool USE_GL = true; + mWindow = LLWindowManager::createWindow(this, + "appearanceutility", "Appearance Utility", + WINDOW_ORIGIN_X, WINDOW_ORIGIN_Y, + width, height, + FLAGS, + NO_FULLSCREEN, + NO_CLEAR_BG, + NO_DISABLE_VSYNC, //gSavedSettings.getBOOL("DisableVerticalSync"), + USE_GL, // not headless + NO_IGNORE_PIXEL_DEPTH); //gIgnorePixelDepth = false + + if (nullptr == mWindow) + { + throw LLAppException(RV_UNABLE_TO_INIT_GL); + } + + LLVertexBuffer::initClass(mWindow); + + gGL.init(true); + + if (!LLBakingShaderMgr::sInitialized) + { //immediately initialize shaders + LLBakingShaderMgr::sInitialized = true; + LLBakingShaderMgr::instance()->setShaders(); + } + + LLImageGL::initClass(mWindow, LLGLTexture::MAX_GL_IMAGE_CATEGORY, true, false); + + // mWindow->show(); + // mWindow->bringToFront(); + // mWindow->focusClient(); + // mWindow->gatherInput(); +} + +LLBakingWindow::~LLBakingWindow() +{ + if (mWindow) + { + LLWindowManager::destroyWindow(mWindow); + } + mWindow = nullptr; +} + +void LLBakingWindow::swapBuffers() +{ + mWindow->swapBuffers(); +} |
