diff options
| author | Erik Kundiman <erik@megapahit.org> | 2026-09-01 18:35:23 +0800 |
|---|---|---|
| committer | Erik Kundiman <erik@megapahit.org> | 2026-09-04 21:58:53 +0800 |
| commit | 00bb3bb6f07660bd914d29a1389342bb3060d254 (patch) | |
| tree | 431f574922494d2201718f13085f17bc6bd7fb42 /indra/llappearanceutility/llbakingwindow.cpp | |
| parent | a8636720129952c10cf49ab80da21bf8b340b96c (diff) | |
| parent | 4ef9f8f14b35ed388c294d53767a0dca0e890924 (diff) | |
Merge remote-tracking branch 'secondlife/release/26.4' into 26.4
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(); +} |
