ofxFBOTexture. Color is not set properly when drawing in memory

Hello,

I am using ofxFBOTexture to draw in memory and code like this:

fbo->clear(0.0, 0.0, 0.5, 0.1);
fbo->begin();
ofSetColor(0xffffff);
ofCircle(200, 200, 20);

ofSetColor(0xff0000);
ofCircle(250, 250, 20);

fbo->end();

Draws figures only with the LAST color I use. In this case both circles will be drawn red. And future attempt to draw with diferent colors breaks all my color ideas.

I see that ofSetColor() does not change image in memory, because if I do fbo->end() and after that change the color, color on that texture will be changed.

Is that a bug in FBOTexture? And if you know, please write how to fix it.

Thanks

first, you shouldn’t be using ofxFBOTexture, is an old addon and now it’s available in the core as ofFBO. but the problem you are having with the color is that anything you draw including, images or fbos get tinted by the last color you set, so you need to set the color to white before drawing the fbo:

  
  
...  
fbo.end();  
ofSetColor(255);  
fbo.draw(x,y);  
  

Working!

Thanks a lot!

I use 6.1 because I use VS 2008. I tied to build 7.0 under VS2008 but it required too much effort and I stopped. VS2010 is working extremely slow on my working laptop.

If you know how to use lates openframeworks under VS2008 - please write.