2018-11-14 10:46:35 +09:00

53 lines
848 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"
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]);
float cubeRotation = .0f;
void AddDrawable(ADrawable *);
void resize(int w, int h);
Viewer viewer;
private:
ShaderProgram *_shaderProgram;
int m_width;
int m_height;
ColorCube _cube;
CheckeredFloor _floor;
float _bgColor[3];
GLuint _vaoHandle;
GLuint _iboHandle;
std::vector<ADrawable *> _drawables;
void setup();
void setupRectBuffer();
void setupCubeBuffer();
};