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

Author Topic: Creating sf::RenderWindow very slow  (Read 3195 times)

0 Members and 1 Guest are viewing this topic.

xinux

  • Newbie
  • *
  • Posts: 13
    • View Profile
Creating sf::RenderWindow very slow
« on: August 15, 2011, 03:09:09 am »
Today I decided to revive an old project I haven't touched for a while, and I'm currently updating it with the new changes to sfml 2.
I have been able to fix most things easily, but here I don't know what possibly could be wrong.

Code: [Select]
sf::RenderWindow window;

This line takes, in my current project, ~20 seconds to process.
It works fine, it's just very slow.

Code: [Select]
sf::RenderWindow window;
sf::RenderWindow window2;
sf::RenderWindow window3;


This code takes just as long to process as the single line above.

I tried making a new clean project and ran only that line in the main function, and it processed it instantly.
Now, I have a lot of code in my project, but I don't think any of it could affect it in this way.

I'm using the Qt libs in my project and use Qt Creator (mingw) on Windows 7 (64bit) to compile.
Does anyone have a clue what could be the problem?

Hiura

  • SFML Team
  • Hero Member
  • *****
  • Posts: 4321
    • View Profile
    • Email
Creating sf::RenderWindow very slow
« Reply #1 on: August 15, 2011, 02:19:18 pm »
Default sf::[Render]Window constructor does just nothing. It shouldn't even take a noticeable time. Make sure you're not mixing two version of SFML Delete everything, from dll to header, and rebuild SFML; it could solve the problem. Make sure you're not mixing release and debug version of your project and SFML libraries. Try also to run a minimal code without Qt to see if there is any differences.
SFML / OS X developer

xinux

  • Newbie
  • *
  • Posts: 13
    • View Profile
Creating sf::RenderWindow very slow
« Reply #2 on: August 15, 2011, 03:57:31 pm »
Quote from: "Hiura"
Default sf::[Render]Window constructor does just nothing. It shouldn't even take a noticeable time. Make sure you're not mixing two version of SFML Delete everything, from dll to header, and rebuild SFML; it could solve the problem. Make sure you're not mixing release and debug version of your project and SFML libraries. Try also to run a minimal code without Qt to see if there is any differences.


I have formatted my computer since I last used sfml, I only saved my project; everything's clean and up-to-date.


Ok, now I have deleted row after row in search in what is causing it; until the code is identical to the code in the 'clean' project (that worked perfectly) earlier.

I'm shocked to say that the actual filename of the executable is causing this.
The name of it is currently "game.exe", and when i alter it the program starts instantly.
This is no longer a code-related problem, and I should take it up elsewhere, but has anyone else had something like this happen?

slotdev

  • Sr. Member
  • ****
  • Posts: 385
    • View Profile
Re: Creating sf::RenderWindow very slow
« Reply #3 on: April 13, 2012, 11:40:08 pm »
I'm shocked to say that the actual filename of the executable is causing this.
The name of it is currently "game.exe", and when i alter it the program starts instantly.
This is no longer a code-related problem, and I should take it up elsewhere, but has anyone else had something like this happen?

Yes, I have *exactly* this problem. I rename my game.exe to whatever.exe and it's absolutely fine. This is really, really wierd. Maybe it's a problem with antivirus, or something wierd thinking game.exe is a risk?
SFML 2.1

xinux

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: Creating sf::RenderWindow very slow
« Reply #4 on: April 14, 2012, 01:20:54 am »
Yes, I have *exactly* this problem. I rename my game.exe to whatever.exe and it's absolutely fine. This is really, really wierd. Maybe it's a problem with antivirus, or something wierd thinking game.exe is a risk?

Interesting. Could you post your specs, and your task manager process list?
I can look if I can find any similarities.