style: window size & black background
This commit is contained in:
@@ -1,28 +1,25 @@
|
||||
#include <SFML/Graphics.hpp>
|
||||
#include "main.h";
|
||||
|
||||
int main()
|
||||
{
|
||||
sf::RenderWindow window(sf::VideoMode(1024, 800), "Space Invader", sf::Style::Titlebar | sf::Style::Close);
|
||||
RenderWindow window(VideoMode(SCREEN_WIDTH, SCREEN_HEIGHT), "Space Invader", Style::Titlebar | Style::Close);
|
||||
window.setFramerateLimit(60);
|
||||
window.setVerticalSyncEnabled(true);
|
||||
|
||||
while (window.isOpen())
|
||||
{
|
||||
sf::Event event;
|
||||
Event event;
|
||||
while (window.pollEvent(event))
|
||||
{
|
||||
if (event.type == sf::Event::Closed)
|
||||
if (event.type == Event::Closed)
|
||||
{
|
||||
window.close();
|
||||
}
|
||||
else if (event.type == sf::Event::KeyPressed)
|
||||
{
|
||||
if (event.key.code == sf::Keyboard::Escape)
|
||||
{
|
||||
window.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Update here
|
||||
window.clear(Color::Black);
|
||||
|
||||
window.display();
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user