style: window size & black background
This commit is contained in:
@@ -135,6 +135,9 @@
|
||||
<ItemGroup>
|
||||
<ClCompile Include="main.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="main.h" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
|
||||
@@ -22,4 +22,9 @@
|
||||
<Filter>Fichiers sources</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="main.h">
|
||||
<Filter>Fichiers d%27en-tête</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -1,4 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup />
|
||||
<PropertyGroup>
|
||||
<ShowAllFiles>false</ShowAllFiles>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
@@ -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