SGCT master (487fac4)
Simple Graphics Cluster Toolkit
Loading...
Searching...
No Matches
viewport.h
Go to the documentation of this file.
1/*****************************************************************************************
2 * SGCT *
3 * Simple Graphics Cluster Toolkit *
4 * *
5 * Copyright (c) 2012-2026 *
6 * For conditions of distribution and use, see copyright notice in LICENSE.md *
7 ****************************************************************************************/
8
9#ifndef __SGCT__VIEWPORT__H__
10#define __SGCT__VIEWPORT__H__
11
12#include <sgct/sgctexports.h>
13#include <sgct/baseviewport.h>
14
15#include <sgct/correctionmesh.h>
16#include <sgct/window.h>
17#include <cstdint>
18#include <filesystem>
19#include <memory>
20
21namespace sgct {
22
23namespace config { struct Viewport; }
25
29class SGCT_EXPORT Viewport final : public BaseViewport {
30public:
31 Viewport(const config::Viewport& viewport, const Window& parent);
32 ~Viewport() override;
33
34 void initialize(vec2 size, bool hasStereo, unsigned int internalFormat,
35 uint8_t samples);
36
37 void loadData();
38
39 void calculateFrustum(FrustumMode mode, float nearClip, float farClip) override;
40
41 void renderQuadMesh() const;
42 void renderWarpMesh() const;
43 void renderMaskMesh() const;
44
45 bool hasOverlayTexture() const;
46 bool hasBlendMaskTexture() const;
48 bool hasSubViewports() const;
49 bool isTracked() const;
50 unsigned int overlayTextureIndex() const;
51 unsigned int blendMaskTextureIndex() const;
52 unsigned int blackLevelMaskTextureIndex() const;
54
55private:
56 CorrectionMesh _mesh;
57 std::filesystem::path _overlayFilename;
58 std::filesystem::path _blendMaskFilename;
59 std::filesystem::path _blackLevelMaskFilename;
60 std::filesystem::path _meshFilename;
61 bool _isTracked;
62 bool _useTextureMappedProjection = false;
63 unsigned int _overlayTextureIndex = 0;
64 unsigned int _blendMaskTextureIndex = 0;
65 unsigned int _blackLevelMaskTextureIndex = 0;
66
67 std::unique_ptr<NonLinearProjection> _nonLinearProjection;
68};
69
70} // namespace sgct
71
72#endif // __SGCT__VIEWPORT__H__
BaseViewport(const Window &parent, FrustumMode eye=FrustumMode::Mono)
const vec2 & size() const
Helper class for reading and rendering a correction mesh.
Definition correctionmesh.h:26
Base class for non-linear projections.
Definition nonlinearprojection.h:27
void renderMaskMesh() const
bool isTracked() const
~Viewport() override
Viewport(const config::Viewport &viewport, const Window &parent)
unsigned int blendMaskTextureIndex() const
void initialize(vec2 size, bool hasStereo, unsigned int internalFormat, uint8_t samples)
unsigned int blackLevelMaskTextureIndex() const
void renderWarpMesh() const
unsigned int overlayTextureIndex() const
bool hasBlendMaskTexture() const
bool hasOverlayTexture() const
bool hasSubViewports() const
NonLinearProjection * nonLinearProjection() const
bool hasBlackLevelMaskTexture() const
void renderQuadMesh() const
void calculateFrustum(FrustumMode mode, float nearClip, float farClip) override
Definition window.h:46
Definition clustermanager.h:22
Definition actions.h:16
FrustumMode
Definition definitions.h:23
Definition config.h:295
Definition math.h:47