Skip to content

Instantly share code, notes, and snippets.

@admsyn
Created September 13, 2013 17:58
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 admsyn/3d307ab75d37b289558a to your computer and use it in GitHub Desktop.
Save admsyn/3d307ab75d37b289558a to your computer and use it in GitHub Desktop.
#include "testApp.h"
//--------------------------------------------------------------
void testApp::setup(){
dim = 128;
tex.allocate( dim, dim, GL_RGB32F );
int arraySize = dim*dim*4;
pixels = new float[arraySize];
for ( int i=0; i<arraySize; i++ ) {
pixels[i] = ofRandom( 1.0 );
}
tex.loadData( pixels, dim, dim, GL_RGB32F );
}
//--------------------------------------------------------------
void testApp::update(){
int arraySize = dim*dim*4;
for ( int i=0; i<arraySize; i++ ) {
pixels[i] = ofRandom( 1.0 );
}
ofFloatPixels p;
p.setFromPixels(pixels, dim, dim, 3);
// tex.loadData( pixels, dim, dim, GL_RGB32F );
tex.loadData(p);
}
//--------------------------------------------------------------
void testApp::draw(){
tex.draw( 0, 0 );
}
//--------------------------------------------------------------
void testApp::keyPressed(int key){
}
//--------------------------------------------------------------
void testApp::keyReleased(int key){
}
//--------------------------------------------------------------
void testApp::mouseMoved(int x, int y){
}
//--------------------------------------------------------------
void testApp::mouseDragged(int x, int y, int button){
}
//--------------------------------------------------------------
void testApp::mousePressed(int x, int y, int button){
}
//--------------------------------------------------------------
void testApp::mouseReleased(int x, int y, int button){
}
//--------------------------------------------------------------
void testApp::windowResized(int w, int h){
}
//--------------------------------------------------------------
void testApp::gotMessage(ofMessage msg){
}
//--------------------------------------------------------------
void testApp::dragEvent(ofDragInfo dragInfo){
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment