Here a minimal code with a rotating quad that is a little bit laggy:
sf::RenderWindow window(sf::VideoMode(800, 600), "Virtual Shock Testing",sf::Style::Default,settings);
glEnable( GL_BLEND );
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
window.setVerticalSyncEnabled(true);
window.setFramerateLimit(60);
//--- OPENGL INITIALIZE ---
//Perspective
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrtho (0, 800, 600,0, 0, 1);
glViewport(0,0,800,600);
glMatrixMode (GL_MODELVIEW);
glEnableClientState(GL_VERTEX_ARRAY);
glEnableClientState(GL_COLOR_ARRAY);
sf::Time time;
sf::Clock clock;
SpriteBatch spritebatch;
Sprite test;
test.SetColor(Color(1,0,0,1));
test.SetTexture(0);
test.SetTextureSource(Rectf(0,0,1,1));
float rotation = 0;
// Start the game loop
while (window.isOpen())
{
// Process events
sf::Event event;
while (window.pollEvent(event))
{
// Close window : exit
if (event.type == sf::Event::Closed) {
window.close();
}
// Escape pressed : exit
if (event.type == sf::Event::KeyPressed && event.key.code == sf::Keyboard::Escape) {
window.close();
}
}
rotation+=0.0001*time.asMicroseconds()/1000.00;
test.SetPosition(Rect(200,200,400,400),Vector2i(400,400),rotation);
window.clear();
spritebatch.Begin();
spritebatch.Draw(test);
spritebatch.End();
window.display();
time = clock.restart();
}
I'm not using network.