mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-11 22:11:51 +00:00
src/graphics moved to src/graphics/core
This commit is contained in:
parent
ba762584a7
commit
b56408a202
63 changed files with 156 additions and 147 deletions
36
src/graphics/core/Shader.h
Normal file
36
src/graphics/core/Shader.h
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
#ifndef GRAPHICS_CORE_SHADER_H_
|
||||
#define GRAPHICS_CORE_SHADER_H_
|
||||
|
||||
#include <string>
|
||||
#include <glm/glm.hpp>
|
||||
#include "../../typedefs.h"
|
||||
|
||||
class GLSLExtension;
|
||||
|
||||
class Shader {
|
||||
uint id;
|
||||
public:
|
||||
static GLSLExtension* preprocessor;
|
||||
|
||||
Shader(unsigned int id);
|
||||
~Shader();
|
||||
|
||||
void use();
|
||||
void uniformMatrix(std::string name, glm::mat4 matrix);
|
||||
void uniform1i(std::string name, int x);
|
||||
void uniform1f(std::string name, float x);
|
||||
void uniform2f(std::string name, float x, float y);
|
||||
void uniform2f(std::string name, glm::vec2 xy);
|
||||
void uniform2i(std::string name, glm::ivec2 xy);
|
||||
void uniform3f(std::string name, float x, float y, float z);
|
||||
void uniform3f(std::string name, glm::vec3 xyz);
|
||||
|
||||
static Shader* create(
|
||||
std::string vertexFile,
|
||||
std::string fragmentFile,
|
||||
std::string vertexSource,
|
||||
std::string fragmentSource
|
||||
);
|
||||
};
|
||||
|
||||
#endif // GRAPHICS_SHADER_H_
|
||||
Loading…
Add table
Add a link
Reference in a new issue