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

Author Topic: RenderWindow crash on dual monitor (laptop w/ external)  (Read 2250 times)

0 Members and 1 Guest are viewing this topic.

stubler

  • Newbie
  • *
  • Posts: 17
    • View Profile
RenderWindow crash on dual monitor (laptop w/ external)
« on: March 03, 2010, 06:52:46 pm »
I use my laptop with an external monitor in my office. I use both screens (dual monitor setup) with the external monitor as the primary display. The following code crashes, sometimes taking the whole machine with it. I do not experience problems using a single monitor or using two monitors with the laptop screen set as the primary display.

Any help would be appreciated.
Thanks

Code: [Select]
 sf::RenderWindow canvas(sf::VideoMode(), "Dual Crasher", sf::Style::Fullscreen);
  sf::Color canvasColor(192,192,192);
  canvas.Clear();
  canvas.Display();
  // Start game loop
  while (canvas.IsOpened())
  {
    // Process events
    sf::Event Event;
    while (canvas.GetEvent(Event))
    {
      // Close window : exit
      if (Event.Type == sf::Event::Closed)
        canvas.Close();

      // Escape key : exit
      else if (Event.Type == sf::Event::KeyPressed)
      {
        if (Event.Key.Code == sf::Key::Escape)
          canvas.Close();
      }
    }

    // Draw background
    canvas.Clear(canvasColor);

    // Finally, display the rendered frame on screen
    canvas.Display();
  }

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
RenderWindow crash on dual monitor (laptop w/ external)
« Reply #1 on: March 03, 2010, 07:24:11 pm »
SFML has no real support for multiple monitors, so I guess that this kind of things can happen. Anyway, I have no idea what to do to fix that, you'll probably have to wait until I implement a robust support for multiple monitors.

What you can do (if you really want to help) is debugging the application and see where it crashes in SFML source code.
Laurent Gomila - SFML developer