SGCT master (487fac4)
Simple Graphics Cluster Toolkit
Loading...
Searching...
No Matches
correctionmesh.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__CORRECTION_MESH__H__
10#define __SGCT__CORRECTION_MESH__H__
11
12#include <sgct/sgctexports.h>
13
14#include <filesystem>
15#include <optional>
16
17namespace sgct {
18
19namespace correction { struct Buffer; }
20class BaseViewport;
21
26class SGCT_EXPORT CorrectionMesh {
27public:
41 void loadMesh(const std::filesystem::path& path, BaseViewport& parent,
42 bool needsMaskGeometry = false, bool textureRenderMode = false);
43
47 void renderQuadMesh() const;
48
52 void renderWarpMesh() const;
53
57 void renderMaskMesh() const;
58
59private:
60 struct CorrectionMeshGeometry {
61 CorrectionMeshGeometry(const correction::Buffer& buffer);
62 CorrectionMeshGeometry(CorrectionMeshGeometry&&) noexcept;
63 ~CorrectionMeshGeometry();
64
65 CorrectionMeshGeometry& operator=(CorrectionMeshGeometry&&) noexcept = default;
66
67 void render() const;
68
69 unsigned int vao = 0;
70 unsigned int vbo = 0;
71 unsigned int ibo = 0;
72 unsigned int nVertices = 0;
73 unsigned int nIndices = 0;
74 unsigned int type = 0x0005; // = GL_TRIANGLE_STRIP;
75 };
76
77 std::optional<CorrectionMeshGeometry> _quadGeometry;
78 std::optional<CorrectionMeshGeometry> _warpGeometry;
79 std::optional<CorrectionMeshGeometry> _maskGeometry;
80};
81
82} // namespace sgct
83
84#endif // __SGCT__CORRECTION_MESH__H__
This class holds and manages viewportdata and calculates frustums.
Definition baseviewport.h:27
Helper class for reading and rendering a correction mesh.
Definition correctionmesh.h:26
void renderQuadMesh() const
Render the final mesh where for mapping the frame buffer to the screen.
void loadMesh(const std::filesystem::path &path, BaseViewport &parent, bool needsMaskGeometry=false, bool textureRenderMode=false)
This function finds a suitable parser for warping meshes and loads them.
void renderWarpMesh() const
Render the final mesh where for mapping the frame buffer to the screen.
void renderMaskMesh() const
Render the final mesh where for mapping the frame buffer to the screen.
Definition buffer.h:16
Definition actions.h:16
Definition buffer.h:18