I’m having some strange issues using ofFbo on the latest Master OF 007 on iOS.
To test, I’m drawing an image to the screen, with and without the FBO being created.
With no FBO, it looks like the image on the left, with the FBO running, it looks like the image on the right
testApp.h:
#pragma once
#include "ofMain.h"
#include "ofxiPhone.h"
#include "ofxiPhoneExtras.h"
class testApp : public ofxiPhoneApp {
public:
void setup();
void draw();
ofImage bg;
bool useFbo;
ofFbo* screenBuffer;
};
testApp.mm:
#include "testApp.h"
//--------------------------------------------------------------
void testApp::setup(){
iPhoneSetOrientation(OFXIPHONE_ORIENTATION_LANDSCAPE_RIGHT);
useFbo = true;
bg.loadImage("bg.jpg");
if(useFbo) {
ofFbo::Settings settings;
settings.width = 1024;
settings.height = 768;
settings.internalformat = GL_RGB;
settings.numSamples = 0;
settings.useDepth = false;
settings.useStencil = false;
screenBuffer = new ofFbo();
screenBuffer->allocate(settings);
}
}
//--------------------------------------------------------------
void testApp::draw(){
if(useFbo) {
screenBuffer->begin();
}
ofSetColor(255, 255, 255);
bg.draw(0, 0);
if(useFbo) {
screenBuffer->end();
screenBuffer->draw(0, 0);
}
}
Any ideas?