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

Author Topic: Weird Noise  (Read 4109 times)

0 Members and 1 Guest are viewing this topic.

Nico

  • Newbie
  • *
  • Posts: 3
    • View Profile
    • Email
Weird Noise
« on: August 15, 2012, 06:02:30 am »
Im experiencing some weird noise from what i think its the video card, when i run this example code. It changes when i move the mouse, and stops when im clicking the tittle bar (pausing the app) and starts again when i stop doing it. It also does this running the "Window" example and the "Win32" example. Other SFML2 examples like Pong or the opengl one runs well, the problem is with the others. Its very annoying.

My Specs:
XFX Radeon HD6870
AMD Phenom 955
4 gb Ram


#include <SFML/Graphics.hpp>

int main()
{
  // Create the main window
     sf::RenderWindow window(sf::VideoMode(800, 600), "SFML window");
     sf::Texture texture;
     if (!texture.loadFromFile("vol.jpg"))
         return EXIT_FAILURE;

     sf::Sprite sprite(texture);

     // Start the game loop
     while (window.isOpen())
     {
         // Process events
         sf::Event event;
         while (window.pollEvent(event))
         {
             // Close window : exit
             if (event.type == sf::Event::Closed)
                 window.close();
         }

         // Clear screen
         window.clear();

        // Draw the sprite
         window.draw(sprite);
         // Update the window
         window.display();
     }

     return EXIT_SUCCESS;
 }


 

binary1248

  • SFML Team
  • Hero Member
  • *****
  • Posts: 1405
  • I am awesome.
    • View Profile
    • The server that really shouldn't be running
Re: Weird Noise
« Reply #1 on: August 15, 2012, 07:43:05 am »
So.... how are we supposed to help exactly? You know it is coming from your hardware and you post code for us to try to reproduce it on our own systems? SFML was not designed to make graphics cards emit strange sounds. And besides wild guessing I don't think anyone here can resolve your issue. Perhaps you should try asking on a hardware oriented forum. Some hardware do emit strange high-pitched noise when the system is under load. The only difference between the SFML examples that make this sound and the ones that don't is that they limit their framerate hence the reduced stress on your system when running those examples.

This might help.
SFGUI # SFNUL # GLS # Wyrm <- Why do I waste my time on such a useless project? Because I am awesome (first meaning).

Nico

  • Newbie
  • *
  • Posts: 3
    • View Profile
    • Email
Re: Weird Noise
« Reply #2 on: August 15, 2012, 07:49:30 am »
Yes, i know that sfml is not supposed to do that kind of noise, but its only with this sfml code and those examples. I cant imagine what it can be. Other OpenGL apps, games or the others examples run well without that sound. This is so strange :/. Thanks you anyway

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11032
    • View Profile
    • development blog
    • Email
Re: Weird Noise
« Reply #3 on: August 15, 2012, 08:47:32 am »
I think we had similar issues here and the 'solution' is to limit your framerate (e.g. window.setFramrateLimi(60) ).
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Nico

  • Newbie
  • *
  • Posts: 3
    • View Profile
    • Email
Re: Weird Noise
« Reply #4 on: August 15, 2012, 02:51:26 pm »
Oh, that worked, thanks.

Elrind

  • Newbie
  • *
  • Posts: 1
    • View Profile
Re: Weird Noise
« Reply #5 on: August 21, 2014, 07:36:15 pm »
I think we had similar issues here and the 'solution' is to limit your framerate (e.g. window.setFramrateLimi(60) ).

You sir, saving me again.