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
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();
}