summaryrefslogtreecommitdiff
path: root/engine-ocean/Graphics/material.h
blob: 3434e72092ec392dc00b1b930cdd095a54aed0f0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#pragma once

#include "GLWrappers/texture.h"
#include <memory>

#include "glm/glm.hpp"

enum ColorSource{
    SOLID_COLOR,
    TEXTURE_COLOR,
    PER_VERTEX_COLOR
};

class Material{
public:
    Material(glm::vec3 color, float shininess = 1.f); //Constructor for setting SOLID_COLOR based material
    Material(float shininess = 1.f); //Constructor for setting PER_VERTEX_COLOR based material
    Material(std::shared_ptr<Texture> texture, float shininess = 1.f); //Constructor for setting TEXTURE_COLOR based material
    ~Material();

    // Functions for setting uniforms
    ColorSource getColorSource();
    void setColorSource(ColorSource source);
    std::shared_ptr<Texture> getTexture();
    void setTexture(std::shared_ptr<Texture> texture);
    glm::vec3 getColor();
    void setColor(glm::vec3 color);
    float getShininess();
    void setShininess(float shininess);

private:
    ColorSource m_colorSource;
    std::shared_ptr<Texture> m_texture;
    glm::vec3 m_color;
    float m_shininess;
};