stratgame

view src/game_part.cc @ 0:86b53f76899f

foo
author John Tsiombikas <nuclear@member.fsf.org>
date Mon, 21 May 2012 19:07:40 +0300
parents
children 369b51c9e4a8
line source
1 #include "opengl.h"
2 #include "game_part.h"
3 #include "level.h"
5 Game::~Game() {}
7 void Game::draw() const
8 {
9 glClear(GL_COLOR_BUFFER_BIT);
11 glMatrixMode(GL_MODELVIEW);
12 glLoadIdentity();
13 glRotatef(current_time / 100.0, 0, 0, 1);
14 glScalef(0.5, 0.5, 1);
16 glBegin(GL_QUADS);
17 glColor3f(1, 0, 0);
18 glVertex2f(-1, -1);
19 glColor3f(0, 1, 0);
20 glVertex2f(1, -1);
21 glColor3f(0, 0, 1);
22 glVertex2f(1, 1);
23 glColor3f(1, 0, 1);
24 glVertex2f(-1, 1);
25 glEnd();
26 }
28 void Game::key(int key, bool pressed)
29 {
30 switch(key) {
31 case 27:
32 cur_part = menu_part;
33 break;
35 default:
36 break;
37 }
38 }