From c817f882e65108950cff366614a72ac9a09d075f Mon Sep 17 00:00:00 2001 From: Laurent Gomila Date: Sun, 25 Dec 2011 23:13:13 +0100 Subject: [PATCH] Enabled v-sync in OpenGL and Pong examples (to make them smoother) --- examples/opengl/OpenGL.cpp | 1 + examples/pong/Pong.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/examples/opengl/OpenGL.cpp b/examples/opengl/OpenGL.cpp index f86522ee..38451722 100644 --- a/examples/opengl/OpenGL.cpp +++ b/examples/opengl/OpenGL.cpp @@ -15,6 +15,7 @@ int main() { // Create the main window sf::RenderWindow window(sf::VideoMode(800, 600), "SFML OpenGL", sf::Style::Default, sf::ContextSettings(32)); + window.EnableVerticalSync(true); // Create a sprite for the background sf::Texture backgroundTexture; diff --git a/examples/pong/Pong.cpp b/examples/pong/Pong.cpp index a203dea7..3b1b940a 100644 --- a/examples/pong/Pong.cpp +++ b/examples/pong/Pong.cpp @@ -28,6 +28,7 @@ int main() // Create the window of the application sf::RenderWindow window(sf::VideoMode(gameWidth, gameHeight, 32), "SFML Pong"); + window.EnableVerticalSync(true); // Load the sounds used in the game sf::SoundBuffer ballSoundBuffer;