feat: default window
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
#include <SFML/Graphics.hpp>
|
||||
|
||||
int main()
|
||||
{
|
||||
sf::RenderWindow window(sf::VideoMode(1024, 800), "Space Invader", sf::Style::Titlebar | sf::Style::Close);
|
||||
|
||||
while (window.isOpen())
|
||||
{
|
||||
sf::Event event;
|
||||
while (window.pollEvent(event))
|
||||
{
|
||||
if (event.type == sf::Event::Closed)
|
||||
{
|
||||
window.close();
|
||||
}
|
||||
else if (event.type == sf::Event::KeyPressed)
|
||||
{
|
||||
if (event.key.code == sf::Keyboard::Escape)
|
||||
{
|
||||
window.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Update here
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user