Commit d08230a7 authored by Martin Štourač's avatar Martin Štourač
Browse files

incorporated 'hints' branch changes

parent 1f97d4a7
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -26,7 +26,7 @@ class Camera
    glm::u32vec2 window_size = glm::u32vec2{0, 0};

    public:
    Camera(glm::vec3 pos, glm::vec3 direction, float fov);
    Camera(glm::vec3 const &pos, glm::vec3 const &direction, float fov);

    void forward();
    void backward();
+2 −1
Original line number Diff line number Diff line
@@ -11,10 +11,11 @@ class EBO

public:
    EBO();
    ~EBO();
    void Bind();
    void Unbind();
    void Delete();
    void SendData(std::vector<unsigned int> &indices); //TO DO: remove size
    void SendData(std::vector<unsigned int> const &indices);
};


+10 −8
Original line number Diff line number Diff line
@@ -22,18 +22,20 @@ class Object
    bool buffer_object();

public:
    Object(glm::vec3 position, std::vector<float> &_vertices, std::vector<unsigned int> &_indices);
    Object(glm::vec3 const &position, 
           std::vector<float> const &_vertices, 
           std::vector<unsigned int> const &_indices);

    glm::vec3 getPosition(); 
    void setPosition(glm::vec3 new_pos);
    glm::vec3 const &getPosition() const { return positionVec; }
    void setPosition(glm::vec3 const &new_pos) { positionVec = new_pos; }

    std::vector<float>& getVertices();
    void setVertices(std::vector<float> &vertices);
    std::vector<float> const &getVertices() const { return vertices; }
    void setVertices(std::vector<float> const &new_vertices) { vertices = new_vertices; }

    std::vector<unsigned int>& getIndices();
    void setIndices(std::vector<unsigned int> &indices);
    std::vector<unsigned int> const &getIndices() const { return indices; }
    void setIndices(std::vector<unsigned int> const &new_indices) { indices = new_indices; }

    VAO& getVAO();
    VAO &getVAO() { return _VAO; }
};

#endif
 No newline at end of file
+2 −2
Original line number Diff line number Diff line
@@ -11,7 +11,7 @@
#include <iostream>
#include <vector>

Shader create_shader_program();
void gfx_draw(Shader &myShader, Camera camera, Object object);
void send_matrices_to_shader(Shader &myShader, glm::mat4 &model, glm::mat4 &view, glm::mat4 &projection);
void gfx_draw(Shader &myShader, Camera &camera, Object &object);

#endif
 No newline at end of file
+3 −3
Original line number Diff line number Diff line
@@ -12,11 +12,11 @@ class Shader
    unsigned int ID;
    // utility function for checking shader compilation/linking errors.
    // ------------------------------------------------------------------------
    void checkCompileErrors(unsigned int shader, std::string type);
    void checkCompileErrors(unsigned int shader, std::string const& type);

public:
    //constructor
    Shader(std::filesystem::path vertexPath, std::filesystem::path fragmentPath);
    Shader(std::filesystem::path const& vertexPath, std::filesystem::path const& fragmentPath);

    //shader activation
    void use();
@@ -26,7 +26,7 @@ public:
    void setInt(const std::string &name, int value) const;
    void setFloat(const std::string &name, float value) const;

    unsigned int getID() {return ID;}
    unsigned int getID() {return ID;} // Why do we need to expose ID???

    ~Shader();
};
Loading