Carna Version 3.3.3
Loading...
Searching...
No Matches
ShaderProgram.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2010 - 2015 Leonid Kostrykin
3 *
4 * Chair of Medical Engineering (mediTEC)
5 * RWTH Aachen University
6 * Pauwelsstr. 20
7 * 52074 Aachen
8 * Germany
9 *
10 */
11
12#ifndef SHADERPROGRAM_H_6014714286
13#define SHADERPROGRAM_H_6014714286
14
22#include <Carna/base/math.h>
24#include <stack>
25
26namespace Carna
27{
28
29namespace base
30{
31
32
33
34// ----------------------------------------------------------------------------------
35// ShaderProgram
36// ----------------------------------------------------------------------------------
37
47class CARNA_LIB ShaderProgram
48{
49
51
53
54public:
55
56 // ------------------------------------------------------------------------------
57 // ShaderProgram :: Factory
58 // ------------------------------------------------------------------------------
59
66 class Factory
67 {
68
70
71 struct Details;
72 const std::unique_ptr< Details > pimpl;
73
74 public:
75
80
85
90 void setVertexShader ( const Shader& shader );
91
96 void setGeometryShader( const Shader& shader );
97
102 void setFragmentShader( const Shader& shader );
103
112
113 }; // ShaderProgram :: Factory
114
115 // ------------------------------------------------------------------------------
116
120 virtual ~ShaderProgram();
121
125 const unsigned int id;
126
127private:
128
132 void checkErrors() const;
133
134}; // ShaderProgram
135
136
137
138} // namespace Carna :: base
139
140} // namespace Carna
141
142#endif // SHADERPROGRAM_H_6014714286
Represents an association.
Definition Association.h:45
Creates OpenGL shader program.
void setVertexShader(const Shader &shader)
Uses shader as vertex shader.
void setFragmentShader(const Shader &shader)
Uses shader as fragment shader.
ShaderProgram * create() const
Creates new OpenGL shader program.
void setGeometryShader(const Shader &shader)
Uses shader as geometry shader.
Factory()
Prepares creation of new shader program.
Maintains an OpenGL shader program. Realizes the RAII-idiom.
virtual ~ShaderProgram()
Deletes the maintained OpenGL shader program.
const unsigned int id
Holds the shader program ID.
Maintains an OpenGL shader object. Realizes the RAII-idiom.
Definition Shader.h:48
Defines Carna::base::math namespace and CARNA_FOR_VECTOR3UI.
#define NON_COPYABLE
Features class it is placed in as non-copyable.