Hello, I need to display an image of 1920x1080 size. I can display smaller imager(750x500, 350x350, etc), but the 1920x1080 just print out totally blank. I did it this morning, then restarted computer and it won’t work anymore, as if Visual Studio changed its mind??!! The command prompt keeps saying pixels are not allocated.
Please if anyone experienced this before and solved this, can you help? thank you!
all my code below - just 3 functions main(), setup() and draw():
int main( ){
ofAppGlutWindow window;
ofSetupOpenGL(&window, 2000, 1100, OF_WINDOW); // <-------- setup the GL context
// this kicks off the running of my app
// can be OF_WINDOW or OF_FULLSCREEN
// pass in width and height too:
ofRunApp( new ofApp());
}
//--------------------------------------------------------------
void ofApp::setup(){
shader.load( “shaderVert.c”, “shaderFrag.c” );
counter = 0;
ofDirectory dir;
int n = dir.listDir(“seq”);
seq.resize(n);
for (int i = 0;i < n;i++) {
string fileName = dir.getPath(i);
ofLoadImage(seq[i], fileName);
}
image.loadImage(“1.png”);
fbo.allocate(image.getWidth(), image.getHeight(), GL_RGBA);
}
//--------------------------------------------------------------
void ofApp::draw(){
fbo.begin();
ofClear(255, 255, 255, 0);
shader.begin();
float time = ofGetElapsedTimef();
shader.setUniform1f(“time”, time); //Passing float parameter “time” to shader
int n = seq.size();
float duration = n / 12.0;
float pos = fmodf(time, duration);
int i = int(pos / duration*n);
float x = 0.0;
float y = 0.0;
//ofEnableAlphaBlending();
seq[i].setAnchorPercent(0.5, 0.5);
image.draw(0,0);
shader.end();
fbo.end();
fbo.draw(0, 0);
ofPixels pix;
fbo.readToPixels(pix);
ofSaveImage(pix,“11111.png”, OF_IMAGE_QUALITY_BEST);
}