Certainly, I don't know what I was thinking not posting code too.
#include <SFML/Graphics.hpp>
int main()
{
// Create the main window
sf::RenderWindow App(sf::VideoMode(800, 600),"nothing");
App.SetFramerateLimit(60);
// Start the game loop
while (App.IsOpened())
{
// Process events
sf::Event Event;
while (App.GetEvent(Event))
{
// Close window : exit
if (Event.Type == sf::Event::Closed)
App.Close();
if (Event.Type == sf::Event::MouseMoved)
App.Close();
if (Event.Type == sf::Event::KeyPressed)
App.Close();
}
// Clear screen
App.Clear();
// Draw the sprite
for(int i = 0; i < 100; i++)
{
sf::Shape new_shape = sf::Shape::Circle(rand() % 800, rand() % 600, rand() % 32 + 32,sf::Color(rand() % 255, rand() % 255, rand() % 255, 128));
if(rand() % 2)
{
new_shape.SetBlendMode(sf::Blend::Add);
}
App.Draw(new_shape);
}
// Update the window
App.Display();
}
return EXIT_SUCCESS;
}
I was told earlier that SetFramerateLimit() should not be used with UseVerticalSync(). Ideally I want my game to both render at 60 frames per second and also not tear the screen because verticle synching is not enabled. I want the events in the game to be locked into cycles rather than time so even when frame rate changes from machine to machine game events will be on a per frame update basis.