draw image on fboTexture

HI!

I’m trying to draw an image inside a fbo texture but i’ve always got a white rectangle, without texture.

II’m osing OF R006 and ofxFboTexture form 22nd July 2009.

The code is something like this:

setup:
img.loadImage(“img1.jpg”);
img.resize(w/4,h/4);

draw:
fboText.begin();
glPushMatrix();

glTranslatef… // position
glRotatef… // rotate

img.draw(0, 0, w, h);

glPopMatrix();
fboText.end();

//
//

If I try to work with the texture of image:
ofTexture & imgTex = img.getTextureReference();
imgTex.draw(0, 0);

i’ve got a log message:
OF_WARNING: ofImage - getTextureReference - texture is not allocated


How could i do this?

Thanx!!!

a common reason to get the “texture not allocated” message is when your image file is not found. is the name “img1.jpg” correct? and is the file inside your “data” folder?

Rui

Hi pelintra!

I’ve revised my code and, yes, i didn’t call the image load function!!!

Now it’s working!!!

Thanks for your help.

GUillermo