53 lines
942 B
C++

#pragma once
#include <iostream>
#include "GL/glew.h"
#include <string>
#include <vector>
#include "IDrawable.h"
#include "ColorCube.h"
#include "Loader.h"
#include "ModelView.h"
#include "Viewer.h"
#include "CheckeredFloor.h"
#include "WireCube.h"
#include "LineSegment.h"
struct vertexAttr {
GLfloat posX, posY, posZ;
GLfloat r, g, b;
};
class MyGlWindow {
public:
MyGlWindow(int w, int h);
MyGlWindow();
~MyGlWindow();
void draw();
void setBgColor(float bgColor[3]);
std::map<std::string, float> floatValues;
bool view_from_box = false;
void AddDrawable(ADrawable *);
void resize(int w, int h);
Viewer viewer;
private:
ShaderProgram *_shaderProgram;
int m_width;
int m_height;
float _bgColor[3];
GLuint _vaoHandle;
GLuint _iboHandle;
std::vector<ADrawable *> _static_drawables;
std::vector<ADrawable *> _crane_boom;
void setup();
void setViewFromBox(glm::vec3 &eye, glm::vec3 &look, glm::vec3 &up);
};