aboutsummaryrefslogtreecommitdiff
path: root/include/MessageBoard.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'include/MessageBoard.hpp')
-rw-r--r--include/MessageBoard.hpp32
1 files changed, 32 insertions, 0 deletions
diff --git a/include/MessageBoard.hpp b/include/MessageBoard.hpp
new file mode 100644
index 0000000..f399761
--- /dev/null
+++ b/include/MessageBoard.hpp
@@ -0,0 +1,32 @@
+#pragma once
+
+#include "Message.hpp"
+#include <SFML/Graphics/RenderTexture.hpp>
+#include <SFML/Graphics/RenderWindow.hpp>
+#include <SFML/Window/Event.hpp>
+#include <stdexcept>
+
+namespace dchat
+{
+ class MessageBoard
+ {
+ public:
+ MessageBoard(const sf::Vector2u &size);
+ ~MessageBoard();
+
+ void updateStaticContentTexture(const sf::Vector2u &newSize);
+ void addMessage(Message *message);
+
+ void processEvent(const sf::Event &event);
+ void draw(sf::RenderWindow &window);
+ private:
+ sf::RenderTexture staticContentTexture;
+ bool useStaticContentTexture;
+ bool dirty;
+ bool selectingText;
+ bool leftMouseButtonPressed;
+ sf::Vector2f mousePos;
+ sf::Vector2f selectingTextStart;
+ std::vector<Message*> messages;
+ };
+}