Skip to content

Instantly share code, notes, and snippets.

@darrenmothersele
Created December 9, 2013 17:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save darrenmothersele/7875888 to your computer and use it in GitHub Desktop.
Save darrenmothersele/7875888 to your computer and use it in GitHub Desktop.
#pragma once
#include "ofMain.h"
class testApp : public ofBaseApp{
public:
int randomCounts[20];
void setup();
void update();
void draw();
};
#include "testApp.h"
#include <ofGraphics.h>
void testApp::setup(){
ofBackground(255);
ofSetColor(0);
}
void testApp::update(){
int index = ofRandom(20);
randomCounts[index]++;
}
void testApp::draw(){
int w = ofGetWidth() / 20;
for (int x = 0; x < 20; ++x) {
ofRect(x * w, ofGetHeight() - randomCounts[x], w - 1, randomCounts[x]);
}
}
#include "ofMain.h"
#include "testApp.h"
int main( ){
ofSetupOpenGL(1024,768,OF_WINDOW);
ofRunApp(new testApp());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment