diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 2dd4bbaef4..ca228c247e 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1040,7 +1040,6 @@ set (PCH_SOURCES gl/stereo3d/gl_stereo3d.cpp gl/stereo3d/gl_stereo_cvars.cpp gl/stereo3d/gl_stereo_leftright.cpp - gl/stereo3d/scoped_view_shifter.cpp gl/stereo3d/gl_anaglyph.cpp gl/stereo3d/gl_quadstereo.cpp gl/stereo3d/gl_sidebyside3d.cpp diff --git a/src/gl/scene/gl_scene.cpp b/src/gl/scene/gl_scene.cpp index d4aea27681..1461fd94d0 100644 --- a/src/gl/scene/gl_scene.cpp +++ b/src/gl/scene/gl_scene.cpp @@ -670,7 +670,7 @@ sector_t * GLSceneDrawer::RenderViewpoint (AActor * camera, IntRect * bounds, fl SetViewAngle(r_viewpoint.Angles.Yaw); // Stereo mode specific viewpoint adjustment - temporarily shifts global ViewPos eye->GetViewShift(GLRenderer->mAngles.Yaw.Degrees, viewShift); - s3d::ScopedViewShifter viewShifter(viewShift); + ScopedViewShifter viewShifter(r_viewpoint.Pos, viewShift); SetViewMatrix(r_viewpoint.Pos.X, r_viewpoint.Pos.Y, r_viewpoint.Pos.Z, false, false); gl_RenderState.ApplyMatrices(); diff --git a/src/gl/stereo3d/scoped_view_shifter.cpp b/src/gl/stereo3d/scoped_view_shifter.cpp deleted file mode 100644 index ac2b89a278..0000000000 --- a/src/gl/stereo3d/scoped_view_shifter.cpp +++ /dev/null @@ -1,48 +0,0 @@ -// -//--------------------------------------------------------------------------- -// -// Copyright(C) 2015 Christopher Bruns -// All rights reserved. -// -// This program 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, either version 3 of the License, or -// (at your option) any later version. -// -// This program 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 program. If not, see http://www.gnu.org/licenses/ -// -//-------------------------------------------------------------------------- -// -/* -** scoped_view_shifter.cpp -** Stack-scoped class for temporarily changing camera viewpoint -** Used for stereoscopic 3D. -** -*/ - -#include "scoped_view_shifter.h" -#include "r_utility.h" - -namespace s3d { - -ScopedViewShifter::ScopedViewShifter(float dxyz[3]) // in meters -{ - // save original values - cachedView = r_viewpoint.Pos; - // modify values - r_viewpoint.Pos += DVector3(dxyz[0], dxyz[1], dxyz[2]); -} - -ScopedViewShifter::~ScopedViewShifter() -{ - // restore original values - r_viewpoint.Pos = cachedView; -} - -} \ No newline at end of file diff --git a/src/gl/stereo3d/scoped_view_shifter.h b/src/gl/stereo3d/scoped_view_shifter.h index bac7f2daca..9e80a28adf 100644 --- a/src/gl/stereo3d/scoped_view_shifter.h +++ b/src/gl/stereo3d/scoped_view_shifter.h @@ -32,21 +32,31 @@ #include "basictypes.h" #include "vectors.h" -namespace s3d { +/** + * Temporarily shift + */ +class ScopedViewShifter +{ +public: + ScopedViewShifter(DVector3 &var, float dxyz[3]) // in meters + { + // save original values + mVar = &var; + cachedView = var; + // modify values + var += DVector3(dxyz[0], dxyz[1], dxyz[2]); + } + + ~ScopedViewShifter() + { + // restore original values + *mVar = cachedView; + } - /** - * Temporarily shift - */ - class ScopedViewShifter - { - public: - ScopedViewShifter(float dxyz[3]); // in meters - ~ScopedViewShifter(); +private: + DVector3 *mVar; + DVector3 cachedView; +}; - private: - DVector3 cachedView; - }; - -} /* namespace s3d */ #endif // GL_STEREO3D_SCOPED_VIEW_SHIFTER_H_ diff --git a/src/hwrenderer/data/renderqueue.h b/src/hwrenderer/data/renderqueue.h new file mode 100644 index 0000000000..69e67b990a --- /dev/null +++ b/src/hwrenderer/data/renderqueue.h @@ -0,0 +1,33 @@ +#pragma once + +#include +#include "tflags.h" + +// A render queue is what contains all render commands. +// On Vulkan there can be several of them so this interface is needed to allow for the needed parallelism. +// On OpenGL the render state is global so all this will do is to translate the system independent calls into OpenGL API calls. + +enum class ColormaskBits +{ + RED = 1, + GREEN = 2, + BLUE = 4, + ALPHA = 8 +}; + +typedef TFlags Colormask; + +class IRenderQueue +{ + Colormask mColorMask; + + + Colormask GetColorMask() const + { + return mColorMask; + } + + void SetColorMask(Colormask mask) = 0; + + +};