old-Testgame/main.h

30 lines
773 B
C
Raw Normal View History

2016-08-27 19:59:52 +00:00
#include <renderer/main.h>
2016-08-28 09:31:10 +00:00
#include <renderer/shader.h>
#include <renderer/shapes/triangle.h>
2016-08-28 13:25:35 +00:00
#include <renderer/shapes/quad.h>
2016-08-27 19:59:52 +00:00
#include <GL/glew.h>
2016-08-28 11:39:13 +00:00
#include <state.h>
2016-08-27 19:59:52 +00:00
class TestGame: public MainClass {
private:
2016-08-28 13:25:35 +00:00
Triangle t1, t2;
Quad t3;
2016-08-27 19:59:52 +00:00
GLuint program;
GLint attribute_coord2d;
auto render() -> void;
2016-08-28 12:55:35 +00:00
void logic();
2016-08-28 09:31:10 +00:00
VertexShader *vs;
FragmentShader *fs;
2016-08-28 10:20:52 +00:00
GLint attribute_v_color;
2016-08-28 11:39:13 +00:00
GameState state;
2016-08-28 12:55:35 +00:00
GLint uniform_m_transform;
2016-08-27 19:59:52 +00:00
protected:
virtual auto tick() -> bool;
virtual auto init() -> bool;
public:
2016-08-28 13:25:35 +00:00
TestGame(): MainClass(640,480), t1(0.0, 0.0, 0.5, 1.0, 1.0, 0.0), t2(1.0,0.0,1.5,1.0,2.0,0.0), t3(0.5,1.0,0.5,2.0,1.5,2.0,1.5,1.0) {
2016-08-28 11:39:13 +00:00
state.bright=true;
state.brightness=0.0;
};
2016-08-27 19:59:52 +00:00
virtual ~TestGame();
virtual auto stop() -> void;
};