Witam. Moje pytanie brzmi: Jaka jest różnica w działaniu metody Keyboard::isKeyPressed() a enumu Event::KeyPressed? Zobrazuję to na przykładzie:
#include <SFML/Graphics.hpp>
#include <SFML/Window.hpp>
#include <SFML/System.hpp>
using namespace sf;
int main()
{
RenderWindow window1(VideoMode(500,400,32),"window");
window1.setFramerateLimit(60);
window1.setVerticalSyncEnabled(true);
while(window1.isOpen())
{
Event event1;
while(window1.pollEvent(event1))
{
if(event1.type==Event::Closed)
window1.close();
if(event1.type==Event::KeyPressed)
if(event1.key.code==Keyboard::A)
window1.setSize(Vector2u(200,200));
if(Keyboard::isKeyPressed(Keyboard::S))
window1.setSize(Vector2u(440,300));
}
}
return EXIT_SUCCESS;
}