Hi!
I'm quite new to C++ programming and I'm trying to make yet another pong clone
I've tried SDL and SFML and so far I really like the second
, but there is some problems that I can't find solution.
1. Relates to UseVerticalSync.
2. Relates to game window moving across the desktop.
1.I've got some weird bugs when I enable UseVerticalSync.
With UseVerticalSync enabled and FrameLimit disabled everything goes ok if mouse is not moved, but if I move mouse over game screen framerate jumps to either limit (if it's enabled), either about 5000 with framelimit disabled and antialiasing enabled at 4. And
what's more important the ball goes out of screen borders despite the fact that border checking is in the game loop! If I disable verticalsync or mouse is being hold still the problem disappears. I really can't figure out where's the problem, but I suppose it's in UseVerticalSync...
2.Second problem is quite similar and occurs when I move window with mouse. If i move window long enough to ball go out of borders it's just disappearing. Is there some way to stop program execution or clock at all while moving window? Or perhaps there is some way to reset clock when moving of window stops?
I've tried sf::Sleep(1.01f) - it's not helping. The ball goes out of screen less frequently but still sometimes does.
I'm using WindowsXP and Code::Blocks with MinGW.
The code and executable is uploaded here:
http://mb13.oos.cc/web/pong.zipVerticalSync and FrameLimit is set in main.cpp.
Game loop is in game.cpp.
Any help is appreciated.
Thanx
MB