Hey Folks,
I'm not entirely sure is a SFML issue or a Windows 7 issue or a Visual studio issue or something else but I'd welcome any thoughts. First I'm using windows 7, sfml2.2 and visual studio2012.
So I use a very basic program - infact I use the example code in the "SFML and Visual studio" getting started tutorial. (
http://www.sfml-dev.org/tutorials/2.2/start-vc.php). However I change the window to full screen mode. I also add an if statement which doesn't do anything except define an int. I put the breakpoint inside this if statement. The purpose was to let the game loop run for a bit before reaching a breakpoint.
(note the below code isn't mine game - however I wanted to use it a demo as this happens even when using a simple sfml program.)
sf::RenderWindow window(sf::VideoMode(200, 200), "SFML works!", sf::Style::Fullscreen);
sf::CircleShape shape(100.f);
shape.setFillColor(sf::Color::Green);
int count = 0;
while (window.isOpen())
{
sf::Event event;
while (window.pollEvent(event))
{
if (event.type == sf::Event::Closed)
window.close();
}
window.clear();
window.draw(shape);
window.display();
count++;
if (count == 666)
{
int test = 0; //<-------- I add a break-point here in VS2012.
}
}
- So when count == 666, then the breakpoint gets hit.
- When I do not use fullscreen mode, it automatically goes back to the VS window and to the exact break-point.
- However when I do use fullscreen mode (as above), the sfml window always remains as the only visible item on screen and the VS studio does not appear.
- However I do think the focus has switched to another window as if I pressed alt+f4, then the VS studio window gets closed. However I only see this after I get back to the windows7 desktop. It is impossible to know for sure as the fullscreen sfml window is all that is visible.
- I have to ctrl + alt + del -> cancel and then I can see the VS studio window and the windows7 desktop screen.
So my questions are:-
- Is this normal behaviour?
- Can it be changed somehow as I find it makes it more troublesome when debugging my program to have to do ctrl +alt + del each time there is a break-point.