JNGL
Public Types | Public Member Functions | Friends | List of all members
Shader Class Reference

Fragment or vertex GLSL shader. More...

#include <jngl/Shader.hpp>

Public Types

enum  Type { VERTEX, FRAGMENT }
 Type of a Shader. To link a ShaderProgram, one shader of each type is needed.
 

Public Member Functions

 Shader (const char *source, Type)
 Creates a vertex or fragment shader by compiling it. More...
 
 Shader (const std::istream &source, Type)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More...
 
 Shader (const Shader &)=delete
 
 Shader (Shader &&)=delete
 
Shaderoperator= (const Shader &)=delete
 
Shaderoperator= (Shader &&)=delete
 

Friends

class ShaderProgram
 

Detailed Description

Fragment or vertex GLSL shader.

Definition at line 12 of file Shader.hpp.

Constructor & Destructor Documentation

◆ Shader() [1/2]

Shader ( const char *  source,
Type   
)

Creates a vertex or fragment shader by compiling it.

Parameters
sourceSource code using either GLSL v3.30 or GLSL ES v3.00.

◆ Shader() [2/2]

Shader ( const std::istream source,
Type   
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

jngl::Shader foo(jngl::readAsset("foo.frag"), jngl::Shader::Type::FRAGMENT);

The documentation for this class was generated from the following file:
jngl::Shader
Fragment or vertex GLSL shader.
Definition: Shader.hpp:12
jngl::readAsset
std::stringstream readAsset(const std::string &filename)
Returns a stringstream containing the whole file. This will read from the .apk on Android.