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

attempt at using vectors for objects

parent 2ee0d481
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -11,6 +11,10 @@ class EBO

public:
    EBO();
    EBO(const EBO &) = delete;
    EBO(EBO &&other) noexcept : ID{other.ID} { other.ID = 0; }
    EBO &operator=(const EBO &) = delete;
    EBO &operator=(EBO &&) noexcept = delete; // ????
    ~EBO();
    void Bind();
    void Unbind();
+9 −0
Original line number Diff line number Diff line
@@ -27,6 +27,15 @@ public:
           std::vector<unsigned int> const &_indices,
           std::vector<float> const &_normals);

    Object(const Object &) = delete;
    Object(Object &&other) noexcept
    : _VAO{std::move(other._VAO)} , _VBO_vertex{std::move(other._VBO_vertex)}
    , _VBO_normal{std::move(_VBO_normal)}, _EBO{std::move(other._EBO)}
    , vertices{other.vertices}, indices{other.indices}, normals{other.normals} {}

    Object &operator=(const Object &) = delete;
    Object &operator=(Object &&other) = delete;

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

+3 −3
Original line number Diff line number Diff line
@@ -13,8 +13,8 @@

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, 
              Frame &cam_frame, Frame &obj_frame, 
              CameraController &cam_control, ObjectController &obj_control);
              Camera &camera, std::vector<Object> &objects, 
              Frame &cam_frame, std::vector<Frame> &obj_frames, 
              CameraController &cam_control, std::vector<ObjectController> &obj_controls);

#endif
 No newline at end of file
+4 −0
Original line number Diff line number Diff line
@@ -11,6 +11,10 @@ class VAO

public:
    VAO();
    VAO(const VAO &) = delete;
    VAO(VAO &&other) noexcept : ID{other.ID} { other.ID = 0; }
    VAO &operator=(const VAO &) = delete;
    VAO &operator=(VAO &&) noexcept = delete; // ????
    ~VAO();
    void Bind();
    void Unbind();
+4 −0
Original line number Diff line number Diff line
@@ -11,6 +11,10 @@ class VBO

public:
    VBO();
    VBO(const VBO &) = delete;
    VBO(VBO &&other) noexcept : ID{other.ID} { other.ID = 0; }
    VBO &operator=(const VBO &) = delete;
    VBO &operator=(VBO &&) noexcept = delete; // ????
    ~VBO();
    void Bind();
    void Unbind();
Loading