Exemple #1
0
void handleDisplay() {
  // Clear the window
  glClearColor(0.0, 0.0, 0.0, 0.0);
  glClear(GL_COLOR_BUFFER_BIT);

  console.draw();
  coordinates.draw();

  // Swap buffers (color buffers, makes previous render visible)
  glutSwapBuffers();
}
Exemple #2
0
	void update(void) {
		switch (currKey) {
		case Input::KEY_LEFT:
			if (cursor->x > 0) {
				--cursor->x;
				console->draw(cursor);
				bufferDirty = true;
			}
			break;
		case Input::KEY_UP:
			if (cursor->y > 0) {
				--cursor->y;
				console->draw(cursor);
				bufferDirty = true;
			}
			break;
		case Input::KEY_RIGHT:
			if (cursor->x < width) {
				++cursor->x;
				console->draw(cursor);
				bufferDirty = true;
			}
			break;
		case Input::KEY_DOWN:
			if (cursor->y < height) {
				++cursor->y;
				console->draw(cursor);
				bufferDirty = true;
			}
			break;
		case Input::KEY_CONTROL_C:
			exit(0);
			break;
		default:
			key->content = currKey;
			console->draw(key);
			bufferDirty = true;
			break;
		}
	}
Exemple #3
0
// -------------------------------------------------------------- //
void GameApp::draw()
{
  ofBackground( 0, 0, 0 );

  hmd.beginDraw();

    Environment* activeEnv = getActiveEnvironment();
    if( activeEnv )
      activeEnv->draw();

  hmd.endDraw();

  console.draw();
}