JNGL
Shader.hpp
Go to the documentation of this file.
1 // Copyright 2018-2020 Jan Niklas Hasse <[email protected]>
2 // For conditions of distribution and use, see copyright notice in LICENSE.txt
4 #pragma once
5 
6 #include <memory>
7 
9 namespace jngl {
10 
12 class Shader {
13 public:
15  enum class Type {
16  VERTEX,
17  FRAGMENT,
18  };
19 
22  Shader(const char* source, Type);
23 
29  Shader(const std::istream& source, Type);
30 
31  ~Shader();
32  Shader(const Shader&) = delete;
33  Shader(Shader&&) = delete;
34  Shader& operator=(const Shader&) = delete;
35  Shader& operator=(Shader&&) = delete;
36 
37 private:
38  struct Impl;
40 
41  friend class ShaderProgram;
42 };
43 
44 } // namespace jngl
jngl::Shader::Shader
Shader(const std::istream &source, Type)
This is an overloaded member function, provided for convenience. It differs from the above function o...
jngl::Shader::Shader
Shader(const char *source, Type)
Creates a vertex or fragment shader by compiling it.
jngl::Shader::Type
Type
Type of a Shader. To link a ShaderProgram, one shader of each type is needed.
Definition: Shader.hpp:15
jngl::Shader
Fragment or vertex GLSL shader.
Definition: Shader.hpp:12
jngl
JNGL's main namespace.
Definition: App.hpp:9
memory
std::istream
std::unique_ptr< Impl >
jngl::ShaderProgram
Linked vertex and fragment shaders.
Definition: ShaderProgram.hpp:17