MRPT
2.0.4
mrpt
opengl
DefaultShaders.h
Go to the documentation of this file.
1
/* +------------------------------------------------------------------------+
2
| Mobile Robot Programming Toolkit (MRPT) |
3
| https://www.mrpt.org/ |
4
| |
5
| Copyright (c) 2005-2020, Individual contributors, see AUTHORS file |
6
| See: https://www.mrpt.org/Authors - All rights reserved. |
7
| Released under BSD License. See: https://www.mrpt.org/License |
8
+------------------------------------------------------------------------+ */
9
#pragma once
10
11
#include <
mrpt/opengl/CRenderizable.h
>
12
#include <
mrpt/opengl/Shader.h
>
13
#include <cstdint>
14
15
namespace
mrpt::opengl
16
{
17
// Note: do not use a enum-class to allow easy conversion from names to values:
18
// It's preferred to left the entities that are more likely to be transparent
19
// (triangles) at the end (higher IDs), so they get rendered last and
20
// transparency works better. Within each shader, objects are also sorted by
21
// inverse eye-distance for this reason.
22
struct
DefaultShaderID
23
{
24
static
constexpr
shader_id_t
POINTS
= 0;
25
static
constexpr
shader_id_t
WIREFRAME
= 1;
26
static
constexpr
shader_id_t
TEXT
= 2;
27
static
constexpr
shader_id_t
TRIANGLES
= 3;
28
static
constexpr
shader_id_t
TEXTURED_TRIANGLES
= 4;
29
};
30
31
/** Loads a set of OpenGL Vertex+Fragment shaders from the default library
32
* available in mrpt::opengl.
33
*
34
* \sa CRenderizable
35
* \ingroup mrpt_opengl_grp
36
*/
37
Program::Ptr
LoadDefaultShader
(
const
shader_id_t
id
);
38
39
}
// namespace mrpt::opengl
mrpt::opengl::LoadDefaultShader
Program::Ptr LoadDefaultShader(const shader_id_t id)
Loads a set of OpenGL Vertex+Fragment shaders from the default library available in mrpt::opengl.
Definition:
DefaultShaders.cpp:20
mrpt::opengl::shader_id_t
uint8_t shader_id_t
Type for IDs of shaders.
Definition:
Shader.h:23
mrpt::opengl::DefaultShaderID::TEXTURED_TRIANGLES
static constexpr shader_id_t TEXTURED_TRIANGLES
Definition:
DefaultShaders.h:28
mrpt::opengl::DefaultShaderID::TEXT
static constexpr shader_id_t TEXT
Definition:
DefaultShaders.h:26
mrpt::opengl::DefaultShaderID
Definition:
DefaultShaders.h:23
mrpt::opengl::Program::Ptr
std::shared_ptr< Program > Ptr
Definition:
Shader.h:83
Shader.h
mrpt::opengl::DefaultShaderID::WIREFRAME
static constexpr shader_id_t WIREFRAME
Definition:
DefaultShaders.h:25
mrpt::opengl::DefaultShaderID::TRIANGLES
static constexpr shader_id_t TRIANGLES
Definition:
DefaultShaders.h:27
CRenderizable.h
mrpt::opengl
The namespace for 3D scene representation and rendering.
Definition:
CGlCanvasBase.h:14
mrpt::opengl::DefaultShaderID::POINTS
static constexpr shader_id_t POINTS
Definition:
DefaultShaders.h:24
Page generated by
Doxygen 1.8.18
for MRPT 2.0.4 at Thu Sep 24 07:14:18 UTC 2020