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

Author Topic: Instantiation of sf::Window  (Read 2014 times)

0 Members and 1 Guest are viewing this topic.

crewnerd

  • Newbie
  • *
  • Posts: 3
    • View Profile
Instantiation of sf::Window
« on: February 01, 2011, 06:04:58 am »
Hi

I'm using SFML to create a GL context and view some articulated rigid body motions. I like the API. But lately I noticed that my program produces different results (motions) every time it's run. After disabling different parts of the code I found that an instantiation of sf::Window changes the results even if the window is not used at all. Say calc() is the name of the function that launches the motion computation. If I call calc() alone it would always give the same results for any number of tests, but preceding calc() by an instantiation of Window, for example

sf::Window App;
calc();

, will give different results.

I checked all the code invoked by calc() against all kinds of warnings (Wall and Wextra) with no alerts. The program is running on ubuntu 10.10 32b, on a core i5-based notebook, with the intel HD Graphics integrated chip. This is version 1.6 of sfml.

How do I know for sure which of the instructions, calc() or (sf::Window App) is at fault?

Thank you.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Instantiation of sf::Window
« Reply #1 on: February 01, 2011, 07:44:19 am »
What does calc() do? Do you think that you could reduce it to something minimal that we could test easily (while still producing the problem)?
Laurent Gomila - SFML developer

crewnerd

  • Newbie
  • *
  • Posts: 3
    • View Profile
Instantiation of sf::Window
« Reply #2 on: February 01, 2011, 07:55:32 am »
Quote from: "Laurent"
What does calc() do? Do you think that you could reduce it to something minimal that we could test easily (while still producing the problem)?


Actually it's a big code that uses several libraries to animate articulated figures...I'm afraid I can't simplify it to a reasonable size here.

But is there any memory allocation in
 sf::Window App;
?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Instantiation of sf::Window
« Reply #3 on: February 01, 2011, 07:58:28 am »
Quote
But is there any memory allocation in
sf::Window App;

Nop, the default constructor is empty.

You can try copying the Window class to your code (just the members & default constructor) and play with it to see what's wrong.
Laurent Gomila - SFML developer

crewnerd

  • Newbie
  • *
  • Posts: 3
    • View Profile
Instantiation of sf::Window
« Reply #4 on: February 01, 2011, 08:03:06 am »
Quote from: "Laurent"
Quote
But is there any memory allocation in
sf::Window App;

Nop, the default constructor is empty.

You can try copying the Window class to your code (just the members & default constructor) and play with it to see what's wrong.


Never mind my problem, I tried to replace the call to sf::Window by a huge dummy matrix allocation and it changed the result too. So the problem seems to come from calc(). I'll try to see what I can get with valgrind.

Thanks.