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

Author Topic: Processor gets hot and motherboard beeps  (Read 3897 times)

0 Members and 1 Guest are viewing this topic.

lobax

  • Newbie
  • *
  • Posts: 1
    • View Profile
Processor gets hot and motherboard beeps
« on: November 29, 2009, 01:07:18 am »
Hi!

I was looking at the one of the tutorials, and decided to compile the one on  displaying a sprite.  But when i compile it, my computer starts beeping, and the tempeture of the processor just shoots up according to Core Temp (which i always have on). From a stable 30c it rockets up to 40c in less then a couple of seconds!

The program (which is the exact same as in the tutorial) does what it's supposed to do, and there are no errors what so ever from code::blocks.  

Code: [Select]
#include <SFML/Graphics.hpp>



int main()
{
    // Create the main rendering window
    sf::RenderWindow App(sf::VideoMode(800, 600, 32), "SFML Graphics");

    // Load the sprite image from a file
    sf::Image Image;
    if (!Image.LoadFromFile("you.bmp"))
        return EXIT_FAILURE;

    // Create the sprite
    sf::Sprite Sprite(Image);

    // Change its properties
    Sprite.SetColor(sf::Color(0, 255, 255, 128));
    Sprite.SetPosition(200.f, 100.f);
    Sprite.SetScale(2.f, 2.f);

    // Start game loop
    while (App.IsOpened())
    {
        // Process events
        sf::Event Event;
        while (App.GetEvent(Event))
        {
            // Close window : exit
            if (Event.Type == sf::Event::Closed)
                App.Close();
        }

        // Get elapsed time
        float ElapsedTime = App.GetFrameTime();

        // Move the sprite
        if (App.GetInput().IsKeyDown(sf::Key::Left))  Sprite.Move(-100 * ElapsedTime, 0);
        if (App.GetInput().IsKeyDown(sf::Key::Right)) Sprite.Move( 100 * ElapsedTime, 0);
        if (App.GetInput().IsKeyDown(sf::Key::Up))    Sprite.Move(0, -100 * ElapsedTime);
        if (App.GetInput().IsKeyDown(sf::Key::Down))  Sprite.Move(0,  100 * ElapsedTime);

        // Rotate the sprite
        if (App.GetInput().IsKeyDown(sf::Key::Add))      Sprite.Rotate(- 100 * ElapsedTime);
        if (App.GetInput().IsKeyDown(sf::Key::Subtract)) Sprite.Rotate(+ 100 * ElapsedTime);

        // Clear screen
        App.Clear();

        // Display sprite in our window
        App.Draw(Sprite);

        // Display window contents on screen
        App.Display();
    }

    return EXIT_SUCCESS;
}



The only thing i changed from the tutorial was "sprite.tga" to "you.bmp".

Any help in understanding the problem would be appriciated! Just please keep your answers simple, i'm a n00b att SFML ;)[/code]

OniLinkPlus

  • Hero Member
  • *****
  • Posts: 500
    • View Profile
Processor gets hot and motherboard beeps
« Reply #1 on: November 29, 2009, 03:05:33 am »
The heating up is supposed to happen. Motherboards should be able to withstand somewhere around 70-80C. Not sure about the beeping though. Does the console give you any error messages?
I use the latest build of SFML2

Core Xii

  • Jr. Member
  • **
  • Posts: 54
    • MSN Messenger - corexii@gmail.com
    • AOL Instant Messenger - Core+Xii
    • View Profile
Processor gets hot and motherboard beeps
« Reply #2 on: November 29, 2009, 08:41:14 am »
It's because you don't sleep at all, the program is running as fast as it can on the processor. Use App.SetFramerateLimit(60); to make it run at 60 frames per second rather than as fast as possible.

Hiura

  • SFML Team
  • Hero Member
  • *****
  • Posts: 4321
    • View Profile
    • Email
Processor gets hot and motherboard beeps
« Reply #3 on: November 29, 2009, 11:53:15 am »
Quote from: "Core Xii"
Use App.SetFramerateLimit(60); to make it run at 60 frames per second
Not exactly -> "Use App.SetFramerateLimit(60); to make it run at most 60 frames per second"
SFML / OS X developer

l0calh05t

  • Full Member
  • ***
  • Posts: 200
    • View Profile
Processor gets hot and motherboard beeps
« Reply #4 on: November 29, 2009, 06:16:03 pm »
or use vsync, which usually gives a far more stable framerate and prevents tearing

buggy123

  • Newbie
  • *
  • Posts: 26
    • View Profile
Processor gets hot and motherboard beeps
« Reply #5 on: December 06, 2009, 07:58:34 am »
is vsync on by default? I'm using App.setframerlimit(60) right after I create my window. (not in my loop)

My friends are reporting frame rates around 60-65. (It's running on 3 on my computer >_<)

what should I do?

Hiura

  • SFML Team
  • Hero Member
  • *****
  • Posts: 4321
    • View Profile
    • Email
Processor gets hot and motherboard beeps
« Reply #6 on: December 06, 2009, 01:15:54 pm »
What is the problem ?

(vsinc is sometimes set up in the GC-manager.)
SFML / OS X developer

 

anything