diff options
author | ruslantproductengine <ruslantproductengine@lindenlab.com> | 2017-10-26 18:33:08 +0300 |
---|---|---|
committer | ruslantproductengine <ruslantproductengine@lindenlab.com> | 2017-10-26 18:33:08 +0300 |
commit | 325c076d094140fddf11cb291ca45c8a1426f442 (patch) | |
tree | c1f4d170bb1d5301b1214d947eb97a34c20c385b /indra/llrender | |
parent | c969932a1593ef94326afce4e3ab746969cd6e57 (diff) |
MAINT-7213 Shared media (media as a texture) unusable with transparent mesh
New outline selection around mesh objects.
Diffstat (limited to 'indra/llrender')
-rw-r--r-- | indra/llrender/CMakeLists.txt | 2 | ||||
-rw-r--r-- | indra/llrender/llgl.h | 17 | ||||
-rw-r--r-- | indra/llrender/llglcommonfunc.cpp | 37 | ||||
-rw-r--r-- | indra/llrender/llglcommonfunc.h | 30 |
4 files changed, 86 insertions, 0 deletions
diff --git a/indra/llrender/CMakeLists.txt b/indra/llrender/CMakeLists.txt index 331f988382..07a0d8c402 100644 --- a/indra/llrender/CMakeLists.txt +++ b/indra/llrender/CMakeLists.txt @@ -51,6 +51,7 @@ set(llrender_SOURCE_FILES lltexture.cpp lluiimage.cpp llvertexbuffer.cpp + llglcommonfunc.cpp ) set(llrender_HEADER_FILES @@ -78,6 +79,7 @@ set(llrender_HEADER_FILES lltexture.h lluiimage.h llvertexbuffer.h + llglcommonfunc.h ) set_source_files_properties(${llrender_HEADER_FILES} diff --git a/indra/llrender/llgl.h b/indra/llrender/llgl.h index aa98b3f6bc..4c4302d05b 100644 --- a/indra/llrender/llgl.h +++ b/indra/llrender/llgl.h @@ -256,6 +256,9 @@ void clear_glerror(); if the existing GL state does not match the expected GL state. */ + +#include "boost/function.hpp" + class LLGLState { public: @@ -297,6 +300,20 @@ public: LLGLEnableAlphaReject(bool enable); }; +// Enable with functor +class LLGLEnableFunc : LLGLState +{ +public: + LLGLEnableFunc(LLGLenum state, bool enable, boost::function<void()> func) + : LLGLState(state, enable) + { + if (enable) + { + func(); + } + } +}; + /// TODO: Being deprecated. class LLGLEnable : public LLGLState { diff --git a/indra/llrender/llglcommonfunc.cpp b/indra/llrender/llglcommonfunc.cpp new file mode 100644 index 0000000000..e9ec28927f --- /dev/null +++ b/indra/llrender/llglcommonfunc.cpp @@ -0,0 +1,37 @@ +/** +* @file llglcommonfunc.cpp +* @brief Implementation of the LLGLCommonFunc. +* +* $LicenseInfo:firstyear=2001&license=viewerlgpl$ +* Second Life Viewer Source Code +* Copyright (C) 2010, 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$ +*/ + +#include "llglheaders.h" +#include "llglcommonfunc.h" + +namespace LLGLCommonFunc +{ + void selected_stencil_test() + { + glStencilFunc(GL_ALWAYS, 2, 0xffff); + glStencilOp(GL_KEEP, GL_KEEP, GL_REPLACE); + } +} diff --git a/indra/llrender/llglcommonfunc.h b/indra/llrender/llglcommonfunc.h new file mode 100644 index 0000000000..f1f8ff7bc4 --- /dev/null +++ b/indra/llrender/llglcommonfunc.h @@ -0,0 +1,30 @@ +/** +* @file llphoenixfunc.h +* @brief File include common opengl code snippets +* +* $LicenseInfo:firstyear=2003&license=viewerlgpl$ +* Second Life Viewer Source Code +* Copyright (C) 2010, 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$ +*/ + +namespace LLGLCommonFunc +{ + void selected_stencil_test(); +} |