56 lines
1011 B
C++
56 lines
1011 B
C++
#ifndef SPARROWSHELL_H
|
|
#define SPARROWSHELL_H
|
|
|
|
#include <list>
|
|
|
|
#include "system.h"
|
|
#include "scenetree.h"
|
|
#include "glm/glm.hpp"
|
|
|
|
class Input;
|
|
|
|
namespace sf {
|
|
class Window;
|
|
}
|
|
|
|
class SparrowShell : public SceneNode
|
|
{
|
|
private:
|
|
class ScrollBar{
|
|
SparrowShell* m_shell;
|
|
glm::ivec2 m_position;
|
|
glm::ivec2 m_dimension;
|
|
//TODO : Add rectangle mesh
|
|
|
|
public:
|
|
ScrollBar();
|
|
ScrollBar(SparrowShell* shell);
|
|
void update();
|
|
};
|
|
|
|
static const unsigned int BUFFER_MAX_LENGTH;
|
|
static const unsigned int BUFFER_DISPLAYED_NUMBER;
|
|
static const unsigned int SCROLLBAR_PIXEL_WIDTH;
|
|
|
|
std::list<std::string> m_buffer;
|
|
sf::Window* m_window;
|
|
Input* m_input;
|
|
int m_index = 0;
|
|
|
|
glm::ivec2 m_position;
|
|
glm::ivec2 m_dimension;
|
|
|
|
//textMesh
|
|
ScrollBar m_scrollbar;
|
|
|
|
public:
|
|
SparrowShell(sf::Window*, Input*);
|
|
|
|
void update();
|
|
void scrollUp();
|
|
void scrollDown();
|
|
void out(std::string);
|
|
};
|
|
|
|
#endif // SPARROWSHELL_H
|