You should never try to do any SFML related functions before you create your SFML window, things tend to not work correctly.
I actually thought SFML would ensure a valid OpenGL context when it needs one. wizh, is the
Game instance global?
Some suggestions concerning the STL (even if it was just a quick and dirty example, writing the correct code doesn't really take longer):
for(std::vector<int>::size_type i = 0; i != snakeSegments.size(); i++)
That's not the usual way to iterate. First, you can use
std::size_t directly if you need indices. But generally, prefer iterators if you don't need random access, because they allow you to switch containers. Also, pre-increment
++i can be faster for complexer types (not integers).
for (std::vector<int>::iterator itr = snakeSegments.begin(); itr != snakeSegments.end(); ++itr)
With C++11, you can infer the type:
for (auto itr = snakeSegments.begin(); itr != snakeSegments.end(); ++itr)
Or directly use the range-based for loop:
for (sf::Sprite& sprite : snakeSegments)
Furthermore,
std::vector::at() is almost always the wrong choice. It performs an index check and throws an exception. If your indices are correct, you don't need that (definitely not in an iteration loop). If they are not correct, the STL implementation will still check the error in debug mode with an assertion.
In short: Use
std::vector::operator[] for random access. And use iterators to iterate.