SGCT master (487fac4)
Simple Graphics Cluster Toolkit
Loading...
Searching...
No Matches
cylindrical.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__CYLINDRICAL__H__
10#define __SGCT__CYLINDRICAL__H__
11
12#include <sgct/sgctexports.h>
14
15#include <sgct/math.h>
16#include <sgct/shaderprogram.h>
17
18namespace sgct {
19
20namespace config { struct CylindricalProjection; }
21class BaseViewport;
22class User;
23class Window;
24
25class SGCT_EXPORT CylindricalProjection final : public NonLinearProjection {
26public:
28 const Window& parent, User& user);
30
31 void render(const BaseViewport& viewport, FrustumMode mode) const override;
32
33 void renderCubemap(FrustumMode frustumMode) const override;
34
35 void update(const vec2& size) const override;
36
37 void setRotation(float rotation);
38 void setHeightOffset(float heightOffset);
39 void setRadius(float radius);
40
41private:
42 void initVBO() override;
43 void initViewports() override;
44 void initShaders() override;
45
46 float _rotation;
47 float _heightOffset;
48 float _radius;
49
50 struct {
51 ShaderProgram program;
52 int cubemap = -1;
53 int rotation = -1;
54 int heightOffset = -1;
55 } _shader;
56
57 unsigned int _vao = 0;
58 unsigned int _vbo = 0;
59};
60
61} // namespace sgct
62
63#endif // __SGCT__CYLINDRICAL__H__
This class holds and manages viewportdata and calculates frustums.
Definition baseviewport.h:27
void render(const BaseViewport &viewport, FrustumMode mode) const override
void setRadius(float radius)
void update(const vec2 &size) const override
void setRotation(float rotation)
void setHeightOffset(float heightOffset)
CylindricalProjection(const config::CylindricalProjection &config, const Window &parent, User &user)
void renderCubemap(FrustumMode frustumMode) const override
NonLinearProjection(const Window &parent)
Class for handling compiling, linking and using shader programs.
Definition shaderprogram.h:24
Helper class for setting user variables.
Definition user.h:24
Definition window.h:46
Definition clustermanager.h:22
Definition actions.h:16
FrustumMode
Definition definitions.h:23
Definition math.h:47