Your code could be a lot more efficient. Also, you do not have to, and really shouldn't be, using pointers and new. Here, I sanitized your code for you.
#include <SFML/Graphics.hpp>
int main()
{
sf::RenderWindow win(sf::VideoMode(1024, 600, 32), "SFML");
sf::Event event;
sf::Color black(0, 0, 0);
sf::Color white(255, 255, 255);
sf::Image Image1(1024, 600, black);
sf::Sprite Sprite;
Sprite.SetImage(Image1);
win.SetFramerateLimit(1./0.03);
while (win.IsOpened())
{
while (win.GetEvent(event))
{
switch (event.Type)
{
case (sf::Event::Closed): win.Close();
case (sf::Event::MouseMoved): Image1.SetPixel(event.MouseMove.X, event.MouseMove.Y, white); break;
}
}
win.Clear();
win.Draw(Sprite);
win.Display();
}
return EXIT_SUCCESS;
}
I tried to emulate your coding style as best as possible. Notice that the event checking is in a while loop. Also notice the SetFramerateLimit().