Adds a skydome with two scrolling layers of procedurally generated clouds to create an interestingish environment.
26 lines
780 B
C++
26 lines
780 B
C++
#pragma once
|
|
|
|
#include <string>
|
|
#include "bettola/math/vec3.h"
|
|
#include "bettola/math/mat4.h"
|
|
|
|
class Shader {
|
|
public:
|
|
Shader(void);
|
|
~Shader(void);
|
|
|
|
bool load_from_files(const std::string& vert_path, const std::string& frag_path);
|
|
void use(void);
|
|
|
|
void set_mat4(const std::string& name, const BettolaMath::Mat4& matrix) const;
|
|
void set_bool(const std::string& name, bool value) const;
|
|
void set_float(const std::string& name, float value) const;
|
|
void set_vec3(const std::string& name, const BettolaMath::Vec3& value) const;
|
|
unsigned int get_id(void) const { return _program_id; }
|
|
private:
|
|
bool compile_shader(unsigned int& shader_id, const char* shader_source, int shader_type);
|
|
|
|
std::string read_file(const std::string& path);
|
|
unsigned int _program_id;
|
|
};
|