ofImage draw slow in windows 7

I’m trying to make an application moving images, I’m developing in windows 7 (Intel Core 2 Duo 2.8 GHz, RAM: 3 GB , integrated intel video card) and when I load 20 images or more i have 10 fps or less. But if I run the same code in an old windows xp (Intel Core Duo 1.73 GHz, Ram 1GB and integrated intel video card) I have about 70 fps

OF have problems in windows 7?

this is my code

testApp.h

  
#ifndef _TEST_APP  
#define _TEST_APP  
  
  
#include "ofMain.h"  
#include <dirent.h>  
#include <errno.h>  
  
class testApp : public ofBaseApp{  
  
	public:  
		void setup();  
		void update();  
		void draw();  
  
		void keyPressed  (int key);  
		void keyReleased(int key);  
		void mouseMoved(int x, int y );  
		void mouseDragged(int x, int y, int button);  
		void mousePressed(int x, int y, int button);  
		void mouseReleased(int x, int y, int button);  
		void windowResized(int w, int h);  
  
    private:  
        ofImage * imagenes[20];  
  
};  
  
#endif  
  

testApp.cpp

  
#include "testApp.h"  
  
//--------------------------------------------------------------  
void testApp::setup(){  
    DIR *dp;  
  
	struct dirent *dirp;  
	std::string dir("C:/datos/img/");  
	string nombreArchivo;  
	int i = 0;  
	if((dp = opendir(dir.c_str())) == NULL) {  
		printf("Error(%d) al intentar abirir el direcotrio %s\n" ,errno,dir.c_str());  
		return;  
	}  
  
	while ((dirp = readdir(dp)) != NULL && i < 20) {  
		nombreArchivo = string(dirp->d_name);  
		if(nombreArchivo != "Thumbs.db" && nombreArchivo != "." && nombreArchivo != ".."){  
		    printf("entro al if con:%s\n", nombreArchivo.c_str());  
			imagenes[i] = new ofImage();  
			imagenes[i]->loadImage(dir + nombreArchivo);  
			i++;  
		}  
	}  
}  
  
//--------------------------------------------------------------  
void testApp::update(){  
    //float f = ofGetFrameRate();  
    //printf("fps: %f\n", f);  
}  
  
//--------------------------------------------------------------  
void testApp::draw(){  
    int i = 0;  
    while (imagenes[i] != NULL && i < 20) {  
        imagenes[i]->draw(10*i, 20*i, 200, 200);  
        i++;  
	}  
}  
  
//--------------------------------------------------------------  
void testApp::keyPressed(int key){  
  
}  
  
//--------------------------------------------------------------  
void testApp::keyReleased(int key){  
  
}  
  
//--------------------------------------------------------------  
void testApp::mouseMoved(int x, int y ){  
  
}  
  
//--------------------------------------------------------------  
void testApp::mouseDragged(int x, int y, int button){  
  
}  
  
//--------------------------------------------------------------  
void testApp::mousePressed(int x, int y, int button){  
  
}  
  
//--------------------------------------------------------------  
void testApp::mouseReleased(int x, int y, int button){  
  
}  
  
//--------------------------------------------------------------  
void testApp::windowResized(int w, int h){  
  
}  
  

main.cpp

  
#include "ofMain.h"  
#include "testApp.h"  
#include "ofAppGlutWindow.h"  
  
//========================================================================  
int main( ){  
  
    ofAppGlutWindow window;  
	ofSetupOpenGL(&window, 1024,768, 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 testApp());  
  
}  
  

can you try setting OF_GAME_MODE instead of OF_WINDOW. i think winows 7 uses some kind of desktop compositing, so it’s already using some sort of hardware acceleration that can make things slower in an opengl window, perhaps running in game mode can make things faster?

I believe you can also switch aero (which I think is the name of the “3d” bling bling window manager on vista/seven) off. This might help especially as you seem to have an integrated intel video card.

regards

david

I tried disabling de aero theme, I set the Windows clasic theme and try setting OF_GAME_MODE and not work, and when I set this get the error:

OF_ERROR: game mode error: selected format (1024x768:32@60) not available

–edit–
the error goes away, was a previous test :oops: but still is slow