Background Image in openFrameworks app

I have an openFrameworks program in which I am trying to set a background image inside the draw method.
I stumbled upon how processing handles this and it is done by passing the image to the Background(img). Perhaps, there isn’t an analogus overload with openFrameworks ofBackground.

If I try to draw the image (loaded in setup: bgImage.loadImage(“bg.png”)), and draw it everytime in the draw function, the background comes over everything else.

//Ohter stuff drawn here  

Also, disabling the openGL depth doesn’t help either.


How do I get the background image (format that I have here for the bg image is png)

i think you need to do something like that:

glPolygonMode (GL_BACK,GL_FILL);

glPolygonMode (GL_FRONT, GL_FILL);

If you disable the depth testing and draw the background image before everything else, it should remain behind all other elements… However, perhaps you mean that you are trying to reproduce the effect of layering up over time ( quite typical in Processing) and so not clearing the background every frame. In this case you would need to call ofSetBackgroundAuto(false) in the setup.

i have also found while i was googling for Qt and OFintegration this:
since i’haven’t tested yet i can’t say anything . only one thing in my opinion this:

 class FullScreenApp : public Application   

should be instead :

class FullScreenApp : public ofBaseApp