Permalink
Browse files

Merge pull request #615 from janus2/master

use update method instead of reloadTexture
  • Loading branch information...
arturoc committed Aug 18, 2017
2 parents 77e6fa7 + 9cf3514 commit e93ec0b27cc5e7e873d76e0621f995c50042758b
@@ -168,7 +168,7 @@ Accepted modes are:
void ofApp::draw(){
ofColor colorOne(255, 0, 0);
ofColor colorTwo(0, 0, 0);
ofColor colorTwo(0, 0, 255);
ofBackgroundGradient(colorOne, colorTwo, OF_GRADIENT_CIRCULAR);
// Sets the background to a circular gradient
@@ -181,7 +181,7 @@ void ofApp::draw(){
void ofApp::draw(){
ofColor colorOne(255, 0, 0);
ofColor colorTwo(0, 0, 0);
ofColor colorTwo(0, 0, 255);
ofBackgroundGradient(colorOne, colorTwo, OF_GRADIENT_LINEAR);
// Sets the background to a linear gradient
@@ -194,7 +194,7 @@ void ofApp::draw(){
void ofApp::draw(){
ofColor colorOne(255, 0, 0);
ofColor colorTwo(0, 0, 0);
ofColor colorTwo(0, 0, 255);
ofBackgroundGradient(colorOne, colorTwo, OF_GRADIENT_BAR);
// Sets the background to a bar gradient
@@ -83,7 +83,7 @@ while ( i < img.getPixels().size() ) {
img.getPixels()[i] = abs(sin( float(i) / 18.f)) * 255.f; // make some op-art
i++;
}
img.reloadTexture();
img.update();
~~~~
It allocates an image of width (w) and height (h). The type can be of three types: OF_IMAGE_GRAYSCALE, OF_IMAGE_COLOR, OF_IMAGE_COLOR_ALPHA. You don't need to call this before loading an image, but for when you want to allocate space ahead of when you are going to use the image.
@@ -132,7 +132,7 @@ void ofApp::setup() {
img.getPixels()[i] = abs(sin( float(i) / 18.f )) * 255.f;
i++;
}
img.reloadTexture();
img.update();
mesh.setMode(OF_PRIMITIVE_TRIANGLE_STRIP);

0 comments on commit e93ec0b

Please sign in to comment.