JNGL
Shader.hpp
Go to the documentation of this file.
1 // Copyright 2018-2021 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 
23  Shader(const char* source, Type, const char* gles20Source = nullptr);
24 
30  Shader(const std::istream& source, Type);
31 
32  ~Shader();
33  Shader(const Shader&) = delete;
34  Shader(Shader&&) = delete;
35  Shader& operator=(const Shader&) = delete;
36  Shader& operator=(Shader&&) = delete;
37 
38 private:
39  struct Impl;
41 
42  friend class ShaderProgram;
43 };
44 
45 } // namespace jngl
Linked vertex and fragment shaders.
Fragment or vertex GLSL shader.
Definition: Shader.hpp:12
Type
Type of a Shader. To link a ShaderProgram, one shader of each type is needed.
Definition: Shader.hpp:15
Shader(const char *source, Type, const char *gles20Source=nullptr)
Creates a vertex or fragment shader by compiling it.
Shader(const std::istream &source, Type)
This is an overloaded member function, provided for convenience. It differs from the above function o...
JNGL's main namespace.
Definition: App.hpp:10