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

Author Topic: Evasive Bug... Could Be Anything  (Read 11036 times)

0 Members and 1 Guest are viewing this topic.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Evasive Bug... Could Be Anything
« Reply #15 on: December 16, 2010, 07:44:22 am »
Ok, now what if you remove everything and simply create a RenderWindow and call Clear()?
Laurent Gomila - SFML developer

Noegddgeon

  • Jr. Member
  • **
  • Posts: 53
    • View Profile
    • Soundcloud
Evasive Bug... Could Be Anything
« Reply #16 on: December 16, 2010, 11:44:12 am »
Wow, it does the same thing. It's not like I changed any of the library files, so I find this rather peculiar. sf::RenderWindow::Clear, and then a white screen of death.
Whether you think you can or you can't, you're right.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Evasive Bug... Could Be Anything
« Reply #17 on: December 16, 2010, 11:54:04 am »
You see... it's always possible and easy to find a minimal code that reproduces the problem ;)

So this looks like a configuration problem (bad compiler options, wrong SFML libraries, ...) but unfortunately I can't help you much for Mac OS X.

If it worked before, then try to restart from scratch (download SFML, reinstall it, etc.).
Laurent Gomila - SFML developer

Noegddgeon

  • Jr. Member
  • **
  • Posts: 53
    • View Profile
    • Soundcloud
Evasive Bug... Could Be Anything
« Reply #18 on: December 17, 2010, 03:17:37 am »
I reinstalled SFML and tried running it again but had no success :p Could you try running it on your platform, Laurent, and see if it runs or whether you get a similar or different message, perhaps? :] Thank you for your help. I'm determined to solve this problem.
Whether you think you can or you can't, you're right.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Evasive Bug... Could Be Anything
« Reply #19 on: December 17, 2010, 07:59:19 am »
Quote
Could you try running it on your platform, Laurent, and see if it runs or whether you get a similar or different message, perhaps?

Well, I run SFML everyday on my Windows PC so I would know if there was a such an obvious problem... ;)
Laurent Gomila - SFML developer

Noegddgeon

  • Jr. Member
  • **
  • Posts: 53
    • View Profile
    • Soundcloud
Evasive Bug... Could Be Anything
« Reply #20 on: December 17, 2010, 10:52:31 am »
Of course ;] But the fact that this is such an obvious problem and yet has no solution baffles me. And I've run other applications today which I've previously written that call the Clear() function as well, and with no problems whatsoever. I don't know how one can explain that. And I tried rewriting the code in various ways, all with the same result. I took out the Clear function, and the program ran. Put it back in, all in different places, with the same result.

In any case, Laurent, I appreciate your time, and I did learn a little bit about how to debug in my IDE :]
Whether you think you can or you can't, you're right.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Evasive Bug... Could Be Anything
« Reply #21 on: December 17, 2010, 11:10:36 am »
Quote
And I've run other applications today which I've previously written that call the Clear() function as well, and with no problems whatsoever.

So this is clearly a problem with this particular project. Trying creating it again from scratch, or copying configuration from one of the older projects that works.

Anyway, if all other SFML programs work, this is clearly not a bug in SFML.
Laurent Gomila - SFML developer

Noegddgeon

  • Jr. Member
  • **
  • Posts: 53
    • View Profile
    • Soundcloud
Evasive Bug... Could Be Anything
« Reply #22 on: December 17, 2010, 10:28:11 pm »
Problem solved, Laurent. You were right :] For some reason, it just must have been some sort of corrupted project... doesn't make any sense, but the fix is fairly easy. I appreciate all your time and assistance. Perhaps you'll see me again soon with something more interesting to ask about ;]
Whether you think you can or you can't, you're right.

Noegddgeon

  • Jr. Member
  • **
  • Posts: 53
    • View Profile
    • Soundcloud
Evasive Bug... Could Be Anything
« Reply #23 on: December 17, 2010, 11:16:19 pm »
Actually, I discovered something else. The programs will compile fine without linking the sfml-audio framework.... however, once I link that framework is when the RenderTarget::Clear function thing pops up and causes the white screen of infinite loop death. Any thoughts on why this might be the case?

EDIT: I also just linked the sndfile framework to it as well, but to no avail. Still does the same thing.... displays EXC_BAD_ACCESS with RenderTarget::Clear() showing as the thread it's stopped at. lolll Does this mean I can't link to the audio framework anymore? XD

EDIT 2: I have a feeling it's all related to the fact that my RenderWindow is global, perhaps, and it's causing some sort of problems. Or at least I'm trying something new. But I tried altering my functions so that they will take an Input argument. However, I'm not exactly sure how I can go about doing this. How do I pass this:

const sf::Input& Input

to a function properly? This is what I made and I'll write the errors as well:

Code: [Select]

// Function prototype
void getInput(int&, int&, int&, int&, sf::Clock&, sf::Clock&, sf::RenderWindow&, const sf::Input);
*
*
*
// Function call
 // Process input
 getInput(Player1.y, Player1.boty, Player2.y, Player2.boty, Player1.PaddleTimer, Player2.PaddleTimer, App, Input);
*
*
*
// Beginning of the actual function implementation
// Process inputs and move players accordingly
void getInput(int &y1, int &boty1, int &y2, int &boty2, sf::Clock &Pad1, sf::Clock &Pad2, sf::RenderWindow App, const sf::Input& Input)
{
   
   App.GetInput();
   
   if ((Input.IsKeyDown(sf::Key::Up)) && (Pad1.GetElapsedTime() >= 0.01))
   {
      if (y1 > 0)
      {
    y1--;
    boty1--;
 }
 Pad1.Reset();
   }


Errors:

warning: synthesized method 'sf::Input::Input(const sf::Input&)' first required here
warning:   initializing argument 8 of 'void getInput(int&, int&, int&, int&, sf::Clock&, sf::Clock&, sf::RenderWindow&, sf::Input)'

Those were both on the line where the function gets called.

I'm familiar with functions and passing by value and by reference but I don't know how to do it with the Input construct, as it seems a little different. Guidance would be much appreciated, and perhaps my theory could then solve the problem :] Thanks a lot!
Whether you think you can or you can't, you're right.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Evasive Bug... Could Be Anything
« Reply #24 on: December 18, 2010, 08:59:27 am »
sf::Input is not copyable, so you must always pass instances by const reference (const sf::Input&).
Laurent Gomila - SFML developer

Noegddgeon

  • Jr. Member
  • **
  • Posts: 53
    • View Profile
    • Soundcloud
Evasive Bug... Could Be Anything
« Reply #25 on: December 18, 2010, 09:21:24 am »
Thank you, sir :] I fixed the code and compiled it, but of course, there are new problems to greet me. Now it gets stuck on the strlen thread before the RenderWindow is even deployed, saying I get another EXC_BAD_ACCESS. I wonder if perhaps there's a bug with Mac OS X and the audio framework in weird situations? I ran other applications using the audio framework with success, so I'm confused.
Whether you think you can or you can't, you're right.

 

anything