Ordering
parent
60a371cdca
commit
723475e2a5
|
@ -0,0 +1,14 @@
|
|||
class Game
|
||||
{
|
||||
public:Game();
|
||||
void run();
|
||||
|
||||
private:
|
||||
void processEvents();
|
||||
void update();
|
||||
void render();
|
||||
|
||||
private:
|
||||
sf::RenderWindow mWindow;
|
||||
sf::CircleShape mPlayer;
|
||||
};
|
|
@ -0,0 +1,8 @@
|
|||
#include <SFML/Graphics.hpp>
|
||||
#include <Game.hpp>
|
||||
|
||||
int main()
|
||||
{
|
||||
Game game;
|
||||
game.run();
|
||||
}
|
22
src/main.cpp
22
src/main.cpp
|
@ -1,22 +0,0 @@
|
|||
#include <SFML/Graphics.hpp>
|
||||
|
||||
int main()
|
||||
{
|
||||
sf::RenderWindow window(sf::VideoMode(640, 480), "SFML Application");
|
||||
sf::CircleShape shape;
|
||||
shape.setRadius(40.f);
|
||||
shape.setPosition(100.f, 100.f);
|
||||
shape.setFillColor(sf::Color::Cyan);
|
||||
while (window.isOpen())
|
||||
{
|
||||
sf::Event event;
|
||||
while (window.pollEvent(event))
|
||||
{
|
||||
if (event.type == sf::Event::Closed)
|
||||
window.close();
|
||||
}
|
||||
window.clear();
|
||||
window.draw(shape);
|
||||
window.display();
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue