Vigilante Game Framework  1.0.0.8
A 2D/3D C++ Game Framework using SFML.
Public Member Functions | Protected Attributes | List of all members
V3DShader Class Reference

Base class for rendering 3D shaders. More...

#include <V3DShader.h>

Inheritance diagram for V3DShader:
V3DLightShader

Public Member Functions

void Bind () const
 Bind texture to the current scene.
 
void LoadFromFile (const sf::String &vertexFile, const sf::String &geometryFile, const sf::String &fragmentFile)
 
void LoadFromFile (const sf::String &vertexFile, const sf::String &fragmentFile)
 
void LoadFromFile (const sf::String &filename, ShaderType type)
 
void LoadFromMemory (const std::string &vertexShader, const std::string &geometryShader, const std::string &fragmentShader)
 
void LoadFromMemory (const std::string &vertexShader, const std::string &fragmentShader)
 
void LoadFromMemory (const std::string &shader, ShaderType type)
 
void SetAttribute (V3DVertexAttribute Attribute, const std::string &name)
 
virtual void UpdateUniform (UniformType type, void *data)
 
GLuint GetProgram ()
 
GLuint GetShader (ShaderType type)
 
GLuint GetUniform (UniformType type)
 
void SetCamera (V3DCamera *camera)
 
virtual void Update ()
 Update the shader.
 

Protected Attributes

V3DCameracam
 Reference pointer for current V3DCamera.
 

Detailed Description

Base class for rendering 3D shaders.

Member Function Documentation

◆ GetProgram()

GLuint V3DShader::GetProgram ( )
Returns
The shader program ID.

◆ GetShader()

GLuint V3DShader::GetShader ( ShaderType  type)
Parameters
typeThe Shader Type.
Returns
The shader ID.

◆ GetUniform()

GLuint V3DShader::GetUniform ( UniformType  type)
Parameters
typeThe Uniform type.
Returns
The uniform ID.

◆ LoadFromFile() [1/3]

void V3DShader::LoadFromFile ( const sf::String &  vertexFile,
const sf::String &  geometryFile,
const sf::String &  fragmentFile 
)

Loads shader from a file.

Parameters
vertexFileThe file path and name of the vertex file.
geometryFileThe file path and name of the geometry file.
fragmentFileThe file path and name of the fragment file.

◆ LoadFromFile() [2/3]

void V3DShader::LoadFromFile ( const sf::String &  vertexFile,
const sf::String &  fragmentFile 
)

Loads shader from a file.

Parameters
vertexFileThe file path and name of the vertex file.
fragmentFileThe file path and name of the fragment file.

◆ LoadFromFile() [3/3]

void V3DShader::LoadFromFile ( const sf::String &  filename,
ShaderType  type 
)

Loads shader from a file.

Parameters
filenameThe file path and name of the shader file.
typeThe type of shader this is.

◆ LoadFromMemory() [1/3]

void V3DShader::LoadFromMemory ( const std::string &  vertexShader,
const std::string &  geometryShader,
const std::string &  fragmentShader 
)

Loads shader from memory (like a string).

Parameters
vertexShaderThe vertex shader data.
geometryShaderThe geometry shader data.
fragmentShaderThe fragment shader data.

◆ LoadFromMemory() [2/3]

void V3DShader::LoadFromMemory ( const std::string &  vertexShader,
const std::string &  fragmentShader 
)

Loads shader from memory (like a string).

Parameters
vertexShaderThe vertex shader data.
fragmentShaderThe fragment shader data.

◆ LoadFromMemory() [3/3]

void V3DShader::LoadFromMemory ( const std::string &  shader,
ShaderType  type 
)

Loads shader from memory (like a string).

Parameters
shaderThe vertex shader data.
typeThe type of shader this is.

◆ SetAttribute()

void V3DShader::SetAttribute ( V3DVertexAttribute  Attribute,
const std::string &  name 
)

Set the name of a vertex attribute in a shader.

Parameters
AttributeVertex Attribute Type.
nameName of the variable in the shader this attribute associates with.

◆ SetCamera()

void V3DShader::SetCamera ( V3DCamera camera)
Parameters
cameraPointer to the currently referenced Camera.

◆ UpdateUniform()

virtual void V3DShader::UpdateUniform ( UniformType  type,
void *  data 
)
virtual

Set the name of a vertex attribute in a shader.

Parameters
typeThe Uniform type.
dataThe data you want to set the Uniform to.

The documentation for this class was generated from the following file: