Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Why is displaying a sf::Sprite so incredible slow? [DONE]  (Read 2665 times)

0 Members and 1 Guest are viewing this topic.

JDieskau

  • Newbie
  • *
  • Posts: 6
    • View Profile
Why is displaying a sf::Sprite so incredible slow? [DONE]
« on: April 02, 2009, 05:08:33 pm »
Code for testing:
Code: [Select]
#include <iostream>
#include <SFML/Graphics.hpp>

int main( int argc, char **argv )
{
  sf::RenderWindow App;
  App.Create( sf::VideoMode::GetDesktopMode(), "Test", sf::Style::Close );

  sf::Image img;
  if ( !img.LoadFromFile ( "test.png" ) ) {
    return false;
  }

  sf::Sprite spr;
  spr.SetImage( img );


  while ( true ) {
    App.Draw ( spr );

    App.Display();
    App.Clear();

    std::cout << 1.f / App.GetFrameTime() << std::endl;
  }
}

Quote
$file test.png
test.png: PNG image data, 1024 x 1024, 8-bit/color RGB, non-interlaced

I've got 6-7 fps on a 2,16Ghz Core2Duo with a GeForce 9600M GT....
What is wrong here? I use sfml 1.4 on Gentoo Linux.

EDIT: Ok, its apparently a bug in the nvidia-driver or xserver. If I turn dualview off, it works pretty good (2000fps).