ofTexture or ofImage?

Hey,

I’m kind of new to Openframeworks and just graphics in general and am kind of confused from the online descriptions, so bear with me.

I’m trying to build an ofTexture object so that I can draw basic shapes to it(like rectangle and circles), and then display the resulting image, using the draw method. I also want to, once I have displayed the image, add more basic shapes to it.

Would I be better off using an ofImage object? Or if anyone could enlighten me on the difference…

Much Appreciated

from what you describe, I think you want an fbo – I’ll try to describe the three things here

ofTexture is graphics memory on the graphics card GPU, you use it to draw images on to the screen. You upload data to the GPU and once it’s there, it’s fast to draw it.

ofImage is an image object which has a texture inside it. as well it contains pixel data on the CPU so it’s a bit larger. everything in OF that has pixels has a texture for drawing itself. ofImage has functionality for loading and saving files, etc.

ofFbo is an offscreen texture that you can draw into – think of it like PGraphics if you are used to processing, it’s an offscreen texture and you draw into it on the gpu. You can then re-draw that image and keep drawing into it, etc.

3 Likes

Sounds like I need exactly that. Much appreciated for the speedy reply and the differentiation on ofImage, ofTexture, and ofFbo!!