MeshLib C++ Docs
Loading...
Searching...
No Matches
MRGLStaticHolder.h
Go to the documentation of this file.
1#pragma once
2#include "MRRenderHelpers.h"
3#include "MRMesh/MRLog.h"
4#include <array>
5
6namespace MR
7{
10
14class MRVIEWER_CLASS GLStaticHolder
15{
16public:
17 typedef unsigned int GLuint;
54
56 MRVIEWER_API static GLuint getShaderId( ShaderType type );
57
59 MRVIEWER_API static void freeShader( ShaderType type );
60
62 MRVIEWER_API static void freeAllShaders();
63
65 MRVIEWER_API static RenderObjectBuffer& getStaticGLBuffer();
66
69
72
75
76private:
79
80 static GLStaticHolder& instance_();
81
82 void createShader_( ShaderType type );
83
84 std::array<GLuint, size_t( Count )> shadersIds_;
85
87 std::shared_ptr<spdlog::logger> logger_;
88
89 RenderObjectBuffer glBuffer_;
90};
91}
Definition MRGLStaticHolder.h:15
provides shared buffer for loading different types of data to GL memory
Definition MRRenderHelpers.h:67
ShaderType
Definition MRGLStaticHolder.h:19
static MRVIEWER_API ShaderType getTransparentMeshShader(TransparencyMode m)
Returns the shader to render transparent mesh in the given mode.
static MRVIEWER_API void freeShader(ShaderType type)
Free shader from GL.
static MRVIEWER_API RenderObjectBuffer & getStaticGLBuffer()
Memory buffer for objects that about to be loaded to GPU, shared among different data types.
static MRVIEWER_API ShaderType getTransparentPointsShader(TransparencyMode m)
Returns the shader to render transparent points in the given mode.
unsigned int GLuint
Definition MRGLStaticHolder.h:17
static MRVIEWER_API ShaderType getTransparentLinesShader(TransparencyMode m)
Returns the shader to render transparent lines in the given mode.
static MRVIEWER_API void freeAllShaders()
Free all shaders from GL.
static MRVIEWER_API GLuint getShaderId(ShaderType type)
Creates shader if it is not and return valid id.
@ Picker
Definition MRGLStaticHolder.h:21
@ Mesh
Definition MRGLStaticHolder.h:20
@ Volume
Definition MRGLStaticHolder.h:50
@ Points
Definition MRGLStaticHolder.h:26
@ DepthPeelMesh
Definition MRGLStaticHolder.h:24
@ DepthPeelPoints
Definition MRGLStaticHolder.h:28
@ LinesPicker
Definition MRGLStaticHolder.h:32
@ AlphaSortMesh
only for non corner-based mode
Definition MRGLStaticHolder.h:23
@ ViewportBorder
Definition MRGLStaticHolder.h:44
@ Labels
Definition MRGLStaticHolder.h:38
@ SimpleOverlayQuad
Definition MRGLStaticHolder.h:47
@ AdditionalQuad
special shader for old intel gpu (Intel HD 4000)
Definition MRGLStaticHolder.h:43
@ ShadowOverlayQuad
Definition MRGLStaticHolder.h:46
@ AdditionalPointsNoOffset
Definition MRGLStaticHolder.h:42
@ VolumePicker
Definition MRGLStaticHolder.h:51
@ MeshDesktopPicker
Definition MRGLStaticHolder.h:22
@ AdditionalPoints
Definition MRGLStaticHolder.h:41
@ AlphaSortLines
Definition MRGLStaticHolder.h:35
@ DepthPeelLines
Definition MRGLStaticHolder.h:36
@ DepthOverlayQuad
Definition MRGLStaticHolder.h:48
@ LinesJoint
Definition MRGLStaticHolder.h:31
@ AlphaSortPoints
Definition MRGLStaticHolder.h:27
@ AdditionalLines
Definition MRGLStaticHolder.h:40
@ LinesJointPicker
Definition MRGLStaticHolder.h:33
@ AlphaSortOverlayQuad
Definition MRGLStaticHolder.h:45
@ Lines
Definition MRGLStaticHolder.h:30
only for bindings generation
Definition MRCameraOrientationPlugin.h:8
struct to determine transparent rendering mode
Definition MRRenderModelParameters.h:13