LibCarna Version 3.4.0
Loading...
Searching...
No Matches
Shader.hpp
Go to the documentation of this file.
1/*
2 * Copyright (C) 2010 - 2016 Leonid Kostrykin
3 *
4 * Chair of Medical Engineering (mediTEC)
5 * RWTH Aachen University
6 * Pauwelsstr. 20
7 * 52074 Aachen
8 * Germany
9 *
10 *
11 * Copyright (C) 2021 - 2025 Leonid Kostrykin
12 *
13 */
14
15#ifndef SHADER_H_6014714286
16#define SHADER_H_6014714286
17
23#include <string>
24#include <LibCarna/LibCarna.hpp>
26
27namespace LibCarna
28{
29
30namespace base
31{
32
33
34
35// ----------------------------------------------------------------------------------
36// Shader
37// ----------------------------------------------------------------------------------
38
47class LIBCARNA Shader
48{
49
51
60 void release();
61
62public:
63
64 const static unsigned int TYPE_VERTEX_SHADER;
65 const static unsigned int TYPE_FRAGMENT_SHADER;
66 const static unsigned int TYPE_GEOMETRY_SHADER;
67
81 Shader( unsigned int type, const std::string& src );
82
87
91 const unsigned int id;
92
98 const unsigned int type;
99
100}; // Shader
101
102
103
104} // namespace LibCarna :: base
105
106} // namespace LibCarna
107
108#endif // SHADER_H_6014714286
Contains forward-declarations.
Represents an association.
Maintains an OpenGL shader object. Realizes the RAII-idiom.
Definition Shader.hpp:48
static const unsigned int TYPE_GEOMETRY_SHADER
Indicates shader object of GL_GEOMETRY_SHADER type.
Definition Shader.hpp:66
const unsigned int type
Holds the type of the maintained OpenGL shader object. This is TYPE_VERTEX_SHADER,...
Definition Shader.hpp:98
~Shader()
Deletes the maintained OpenGL shader object.
static const unsigned int TYPE_VERTEX_SHADER
Indicates shader object of GL_VERTEX_SHADER type.
Definition Shader.hpp:64
static const unsigned int TYPE_FRAGMENT_SHADER
Indicates shader object of GL_FRAGMENT_SHADER type.
Definition Shader.hpp:65
const unsigned int id
Identifies the maintained OpenGL shader object.
Definition Shader.hpp:91
Shader(unsigned int type, const std::string &src)
Compiles src and creates new OpenGL shader object of type.
Defines LibCarna::base::noncopyable and NON_COPYABLE.
#define NON_COPYABLE
Marks the class that it is placed in as non-copyable.