mirror of
https://github.com/zoriya/ComSquare.git
synced 2026-06-01 17:55:30 +00:00
SFML working nicely can open and close the window and set a title
This commit is contained in:
@@ -8,12 +8,13 @@
|
||||
#include <SFML/System.hpp>
|
||||
#include <SFML/Window.hpp>
|
||||
#include <SFML/Graphics//RenderWindow.hpp>
|
||||
#include <iostream>
|
||||
|
||||
namespace ComSquare::Renderer
|
||||
{
|
||||
void SFRenderer::setWindowName(std::string newWindowName)
|
||||
{
|
||||
this->window.setTitle(newWindowName);
|
||||
this->window.setTitle(newWindowName + " - ComSquare");
|
||||
}
|
||||
|
||||
void SFRenderer::drawScreen()
|
||||
@@ -40,4 +41,15 @@ namespace ComSquare::Renderer
|
||||
this->texture.create(width, height);
|
||||
}
|
||||
|
||||
void SFRenderer::getEvents()
|
||||
{
|
||||
sf::Event event;
|
||||
while (this->window.pollEvent(event)) {
|
||||
if (event.type == sf::Event::Closed) {
|
||||
this->shouldExit = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user