hellow!
i'm korean ^^;
I can't speak English very well yet.
#include <SFML/Window.hpp>
#include <SFML/Graphics.hpp>
#pragma comment(lib, "sfml-system-s.lib")
#pragma comment(lib, "sfml-window-s.lib")
#pragma comment(lib, "sfml-graphics-s.lib")
int main()
{
sf::RenderWindow App(sf::VideoMode(317, 528, 32), "GANDI", sf::Style::Close);
sf::Image img;
img.LoadFromFile("korea.png");
sf::Sprite spr;
spr.SetImage(img);
spr.SetPosition(0,0);
while (App.IsOpened())
{
static int mvx, mvy;
sf::Event Event;
while (App.GetEvent(Event))
{
if (Event.Type == sf::Event::Closed)
App.Close();
if (Event.Type == sf::Event::KeyPressed)
{
if (Event.Key.Code == sf::Key::F12)
{
sf::Image Screen = App.Capture();
Screen.SaveToFile("screenshot.png");
}
}
if(Event.Type == sf::Event::MouseButtonReleased)
{
if(Event.MouseButton.Button == sf::Mouse::Left)
{
}
}
if(Event.Type == sf::Event::MouseMoved)
{
mvx = Event.MouseMove.X;
mvy = Event.MouseMove.Y;
}
}
App.Clear(sf::Color(0, 0, 0));
App.Draw(spr);
App.Display();
}
return EXIT_SUCCESS;
}
I want to draw image. so I found it in tutorial.
sf::Image img;
img.LoadFromFile("korea.png");
sf::Sprite spr;
spr.SetImage(img);
and,
App.Draw(spr)i'm not using
App.SetFramerateLimit(60).
but, when i run program, fps is "20"!
when delete
App.Draw(spr), fps is "900~1000"!...
I don't know what to do..
please help me.
I check fps, by "bandicam"