temp commit for merging with index fix
This commit is contained in:
parent
04695941de
commit
0daa2a2dcb
@ -7,8 +7,8 @@ SET(VERSION_MINOR 1)
|
||||
set(EXTRA_INCLUDES ${PROJECT_SOURCE_DIR}/src)
|
||||
|
||||
# choose source file
|
||||
file(GLOB LIB_SRC_LIST src/*.cpp src/tools/*.cpp src/scene/*.cpp)
|
||||
file(GLOB LIB_HEAD_LIST src/*.h src/tools/*.h src/scene/*.h)
|
||||
file(GLOB LIB_SRC_LIST src/*.cpp src/tools/*.cpp src/scene/*.cpp src/sparrowshell/*.cpp)
|
||||
file(GLOB LIB_HEAD_LIST src/*.h src/tools/*.h src/scene/*.h src/sparrowshell/*.h)
|
||||
set(EXEC_SRC_LIST src/test/main.cpp)
|
||||
|
||||
#set compilation option
|
||||
|
@ -9,7 +9,7 @@
|
||||
#include <btBulletDynamicsCommon.h>
|
||||
#include "resourcemanager.h"
|
||||
#include "scene/scenetree.h"
|
||||
#include "sparrowshell.h"
|
||||
#include "sparrowshell/sparrowshell.h"
|
||||
|
||||
Engine::Engine() :
|
||||
m_window(NULL),
|
||||
|
@ -11,6 +11,7 @@ void ContainerNode::addChild(SceneNode* node)
|
||||
{
|
||||
if(node != nullptr)
|
||||
{
|
||||
node->setSceneTree(m_scene);
|
||||
m_children.push_back(node);
|
||||
node->m_parent = this;
|
||||
}
|
||||
|
@ -8,7 +8,8 @@ void MeshNode::setDepth(float depth){
|
||||
|
||||
void MeshNode::setSceneTree(SceneTree *tree){
|
||||
SceneNode::setSceneTree(tree);
|
||||
tree->addToIndex(this);
|
||||
if (tree)
|
||||
tree->addToIndex(this);
|
||||
}
|
||||
|
||||
void MeshNode::toggleVisibility(){
|
||||
|
@ -1,158 +0,0 @@
|
||||
#include "sparrowshell.h"
|
||||
|
||||
#include "message.h"
|
||||
#include "input.h"
|
||||
#include "scene/scenetree.h"
|
||||
#include "scene/meshnode.h"
|
||||
#include "scene/textnode.h"
|
||||
#include "mesh.h"
|
||||
#include "phongmaterial.h"
|
||||
#include "tools/utils.h"
|
||||
#include "tools/font.h"
|
||||
|
||||
const unsigned int SparrowShell::BUFFER_MAX_LENGTH = 50;
|
||||
const unsigned int SparrowShell::BUFFER_DISPLAYED_NUMBER = 10;
|
||||
const unsigned int SparrowShell::SCROLLBAR_PIXEL_WIDTH = 10;
|
||||
const float SparrowShell::SHELL_DEPTH = 10;
|
||||
|
||||
SparrowShell::SparrowShell(sf::Window* window, Input* input):
|
||||
m_window(window),
|
||||
m_input(input),
|
||||
m_position(glm::ivec2(0,0)),
|
||||
m_buffer(ShellBuffer(BUFFER_MAX_LENGTH))
|
||||
{
|
||||
sf::Vector2u size = m_window->getSize();
|
||||
m_dimension = glm::ivec2(size.x,size.y/2);
|
||||
Mesh* mesh = new Mesh();
|
||||
m_buffer.setFontSize(16.f);
|
||||
mesh->addRectangle2D(m_position,m_dimension);
|
||||
PhongMaterial *mat = new PhongMaterial();
|
||||
mat->diffuse = glm::vec3(0.1,0.1,0.1);
|
||||
mat->m_opacity = 0.5;
|
||||
mesh->setMaterial(mat);
|
||||
mesh->setDepth(SHELL_DEPTH);
|
||||
mesh->initGL();
|
||||
m_background = new MeshNode(mesh);
|
||||
this->addChild(m_background);
|
||||
m_scrollbar = SparrowShell::ScrollBar(this);
|
||||
}
|
||||
|
||||
void SparrowShell::out(std::string s)
|
||||
{
|
||||
Font *shellfont = RESOURCE_GET(Font,"shellfont");
|
||||
TextNode* tnode = shellfont->getTextNode(s,glm::vec3(0.7,1,0.3),m_buffer.getFontSize());
|
||||
tnode->setDepth(SHELL_DEPTH+1);
|
||||
// m_currentScene->addToIndex(tnode);
|
||||
m_buffer.push(tnode);
|
||||
if (m_buffer.size() > BUFFER_DISPLAYED_NUMBER)
|
||||
m_resizeScrollBar = true;
|
||||
}
|
||||
|
||||
void SparrowShell::scrollUp(){
|
||||
if (m_index + BUFFER_DISPLAYED_NUMBER < m_buffer.size()){
|
||||
m_index++;
|
||||
m_indexMoved = true;
|
||||
}
|
||||
}
|
||||
|
||||
void SparrowShell::scrollDown(){
|
||||
if (m_index > 0){
|
||||
m_index--;
|
||||
m_indexMoved = true;
|
||||
}
|
||||
}
|
||||
|
||||
void SparrowShell::toggleShell(){
|
||||
m_shellEnabled = !m_shellEnabled;
|
||||
// if (m_shellEnabled){
|
||||
// for(unsigned int i = 0;i<m_buffer.size();i++)
|
||||
// m_scene->addToIndex(m_buffer[i]);
|
||||
// }else{
|
||||
// for(unsigned int i = 0;i<m_buffer.size();i++)
|
||||
// m_scene->removeFromIndex(m_buffer[i]);
|
||||
// }
|
||||
for(auto child : m_children){
|
||||
MeshNode* meshchild = dynamic_cast<MeshNode*>(child);
|
||||
if(meshchild)
|
||||
meshchild->toggleVisibility();
|
||||
}
|
||||
m_buffer.toggleBuffer();
|
||||
m_background->toggleVisibility();
|
||||
}
|
||||
|
||||
void SparrowShell::update(){
|
||||
TextNode* tnode;
|
||||
glm::vec2 text_pos(0);
|
||||
|
||||
for(auto action : m_input->getActions()){
|
||||
if(action == 15){
|
||||
toggleShell();
|
||||
}
|
||||
}
|
||||
//move position of shellBuffer
|
||||
// position textnode inside shellBuffer
|
||||
|
||||
if(m_shellEnabled){
|
||||
for(unsigned int i = 0; i<m_buffer.size(); i++){
|
||||
tnode = (TextNode*)m_buffer[i];
|
||||
if (i >= m_index && i < m_index + BUFFER_DISPLAYED_NUMBER){
|
||||
utils::setPosition2D(tnode,text_pos);
|
||||
text_pos.y += m_buffer.getFontSize();
|
||||
m_scene->addToIndex(tnode);
|
||||
}
|
||||
}
|
||||
}
|
||||
m_scrollbar.update();
|
||||
}
|
||||
|
||||
void SparrowShell::ShellBuffer::toggleBuffer(){
|
||||
for(auto child : m_children){
|
||||
MeshNode* meshchild = dynamic_cast<MeshNode*>(child);
|
||||
if(meshchild)
|
||||
meshchild->toggleVisibility();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void SparrowShell::ShellBuffer::push(TextNode* s){
|
||||
if (m_children.size() >= m_max_size){
|
||||
m_children[m_zero_offset++] = s;
|
||||
m_zero_offset %= m_max_size;
|
||||
}else
|
||||
m_children.push_back(s);
|
||||
}
|
||||
|
||||
SparrowShell::ScrollBar::ScrollBar(SparrowShell* shell):m_shell(shell){
|
||||
m_position = glm::ivec2(m_shell->m_dimension.x - SparrowShell::SCROLLBAR_PIXEL_WIDTH,0);
|
||||
m_dimension = glm::ivec2(SparrowShell::SCROLLBAR_PIXEL_WIDTH,m_shell->m_dimension.y);
|
||||
|
||||
Mesh* mesh = new Mesh();
|
||||
mesh->addRectangle2D(glm::vec2(0),m_dimension);
|
||||
PhongMaterial *mat = new PhongMaterial();
|
||||
mat->diffuse = glm::vec3(0,0,0.5);
|
||||
|
||||
mesh->setDepth(SHELL_DEPTH+1);
|
||||
mesh->setMaterial(mat);
|
||||
mesh->initGL();
|
||||
|
||||
m_mesh = new MeshNode(mesh);
|
||||
utils::setPosition2D(m_mesh,m_position);
|
||||
m_shell->addChild(m_mesh);
|
||||
}
|
||||
|
||||
void SparrowShell::ScrollBar::update(){
|
||||
m_position.y = m_shell->m_position.y;
|
||||
m_dimension.y = m_shell->m_dimension.y;
|
||||
|
||||
float cran = ((float)m_shell->m_dimension.y/(float)m_shell->m_buffer.size());
|
||||
int indexCursor = m_shell->m_buffer.size()-(m_shell->m_index+BUFFER_DISPLAYED_NUMBER);
|
||||
glm::ivec2 new_pos((int)m_position.x, (int) cran * indexCursor);
|
||||
|
||||
if (m_shell->m_resizeScrollBar){
|
||||
glm::ivec2 new_dim(m_dimension.x,(int)(cran * BUFFER_DISPLAYED_NUMBER));
|
||||
utils::resize2D(m_mesh,m_dimension,new_dim);
|
||||
m_shell->m_resizeScrollBar = false;
|
||||
}
|
||||
if (m_shell->m_resizeScrollBar || m_shell->m_indexMoved)
|
||||
utils::setPosition2D(m_mesh,new_pos);
|
||||
}
|
@ -1,81 +0,0 @@
|
||||
#ifndef SPARROWSHELL_H
|
||||
#define SPARROWSHELL_H
|
||||
|
||||
#include <list>
|
||||
|
||||
#include "system.h"
|
||||
#include "scene/scenetree.h"
|
||||
#include "glm/glm.hpp"
|
||||
|
||||
class Input;
|
||||
class MeshNode;
|
||||
class TextNode;
|
||||
|
||||
namespace sf {
|
||||
class Window;
|
||||
}
|
||||
|
||||
class SparrowShell : public ContainerNode
|
||||
{
|
||||
private:
|
||||
class ScrollBar{
|
||||
SparrowShell* m_shell;
|
||||
glm::ivec2 m_position;
|
||||
glm::ivec2 m_dimension;
|
||||
MeshNode *m_mesh;
|
||||
public:
|
||||
ScrollBar(){}
|
||||
ScrollBar(SparrowShell* shell);
|
||||
void update();
|
||||
};
|
||||
|
||||
class ShellBuffer : public ContainerNode {
|
||||
private:
|
||||
int m_zero_offset = 0;
|
||||
unsigned int m_max_size;
|
||||
float m_font_size;
|
||||
public:
|
||||
ShellBuffer(int buffer_size):m_max_size(buffer_size){}
|
||||
SceneNode* operator[](int i){return m_children[(m_zero_offset+i)%m_max_size];}
|
||||
void push(TextNode*);
|
||||
unsigned int size(){return m_children.size();}
|
||||
void toggleBuffer();
|
||||
|
||||
// if this font_size is scaling down, sizes which are power of 2 render better.
|
||||
void setFontSize(float font_size){m_font_size = font_size;}
|
||||
float getFontSize(){return m_font_size;}
|
||||
};
|
||||
|
||||
static const unsigned int BUFFER_MAX_LENGTH;
|
||||
static const unsigned int BUFFER_DISPLAYED_NUMBER;
|
||||
static const unsigned int SCROLLBAR_PIXEL_WIDTH;
|
||||
static const float SHELL_DEPTH;
|
||||
|
||||
sf::Window* m_window;
|
||||
Input* m_input;
|
||||
|
||||
glm::ivec2 m_position;
|
||||
glm::ivec2 m_dimension;
|
||||
ShellBuffer m_buffer;
|
||||
unsigned int m_index = 0;
|
||||
bool m_resizeScrollBar = false;
|
||||
bool m_indexMoved = false;
|
||||
bool m_shellEnabled = false;
|
||||
//textMesh
|
||||
MeshNode* m_background;
|
||||
ScrollBar m_scrollbar;
|
||||
|
||||
public:
|
||||
SparrowShell(sf::Window*, Input*);
|
||||
|
||||
void update();
|
||||
// void setScene(SceneTree *scene){m_currentScene = scene;}
|
||||
|
||||
void scrollUp();
|
||||
void scrollDown();
|
||||
|
||||
void toggleShell();
|
||||
void out(std::string);
|
||||
};
|
||||
|
||||
#endif // SPARROWSHELL_H
|
19
src/sparrowshell/shellbuffer.cpp
Normal file
19
src/sparrowshell/shellbuffer.cpp
Normal file
@ -0,0 +1,19 @@
|
||||
#include "shellbuffer.h"
|
||||
#include "scene/meshnode.h"
|
||||
#include "scene/textnode.h"
|
||||
|
||||
void ShellBuffer::toggleBuffer(){
|
||||
for(auto child : m_children){
|
||||
MeshNode* meshchild = dynamic_cast<MeshNode*>(child);
|
||||
if(meshchild)
|
||||
meshchild->toggleVisibility();
|
||||
}
|
||||
}
|
||||
|
||||
void ShellBuffer::push(TextNode* s){
|
||||
if (m_children.size() >= m_max_size){
|
||||
m_children[m_zero_offset++] = s;
|
||||
m_zero_offset %= m_max_size;
|
||||
}else
|
||||
m_children.push_back(s);
|
||||
}
|
25
src/sparrowshell/shellbuffer.h
Normal file
25
src/sparrowshell/shellbuffer.h
Normal file
@ -0,0 +1,25 @@
|
||||
#ifndef SHELLBUFFER_H
|
||||
#define SHELLBUFFER_H
|
||||
|
||||
#include "scene/containernode.h"
|
||||
|
||||
class TextNode;
|
||||
|
||||
class ShellBuffer : public ContainerNode {
|
||||
private:
|
||||
int m_zero_offset = 0;
|
||||
unsigned int m_max_size;
|
||||
float m_font_size;
|
||||
public:
|
||||
ShellBuffer(int buffer_size):m_max_size(buffer_size){}
|
||||
SceneNode* operator[](int i){return m_children[(m_zero_offset+i)%m_max_size];}
|
||||
void push(TextNode*);
|
||||
unsigned int size(){return m_children.size();}
|
||||
void toggleBuffer();
|
||||
|
||||
// if this font_size is scaling down, sizes which are power of 2 render better.
|
||||
void setFontSize(float font_size){m_font_size = font_size;}
|
||||
float getFontSize(){return m_font_size;}
|
||||
};
|
||||
|
||||
#endif // SHELLBUFFER_H
|
46
src/sparrowshell/shellscrollbar.cpp
Normal file
46
src/sparrowshell/shellscrollbar.cpp
Normal file
@ -0,0 +1,46 @@
|
||||
#include "shellscrollbar.h"
|
||||
#include "sparrowshell.h"
|
||||
#include "mesh.h"
|
||||
#include "phongmaterial.h"
|
||||
#include "scene/meshnode.h"
|
||||
#include "tools/utils.h"
|
||||
|
||||
|
||||
|
||||
ShellScrollBar::ShellScrollBar()
|
||||
{
|
||||
}
|
||||
|
||||
ShellScrollBar::ShellScrollBar(SparrowShell* shell):m_shell(shell){
|
||||
m_position = glm::ivec2(m_shell->getDimension().x - SparrowShell::SCROLLBAR_PIXEL_WIDTH,0);
|
||||
m_dimension = glm::ivec2(SparrowShell::SCROLLBAR_PIXEL_WIDTH,m_shell->getDimension().y);
|
||||
|
||||
Mesh* mesh = new Mesh();
|
||||
mesh->addRectangle2D(glm::vec2(0),m_dimension);
|
||||
PhongMaterial *mat = new PhongMaterial();
|
||||
mat->diffuse = glm::vec3(0,0,0.5);
|
||||
|
||||
mesh->setDepth(SparrowShell::SHELL_DEPTH+1);
|
||||
mesh->setMaterial(mat);
|
||||
mesh->initGL();
|
||||
|
||||
m_mesh = new MeshNode(mesh);
|
||||
utils::setPosition2D(m_mesh,m_position);
|
||||
m_shell->addChild(m_mesh);
|
||||
}
|
||||
|
||||
void ShellScrollBar::update(){
|
||||
m_position.y = m_shell->getPosition().y;
|
||||
m_dimension.y = m_shell->getDimension().y;
|
||||
|
||||
float cran = ((float)m_shell->getDimension().y/(float)m_shell->getBuffer()->size());
|
||||
int indexCursor = m_shell->getBuffer()->size()-(m_shell->getIndex()+SparrowShell::BUFFER_DISPLAYED_NUMBER);
|
||||
glm::ivec2 new_pos((int)m_position.x, (int) cran * indexCursor);
|
||||
|
||||
if (m_shell->isBufferResized()){
|
||||
glm::ivec2 new_dim(m_dimension.x,(int)(cran * SparrowShell::BUFFER_DISPLAYED_NUMBER));
|
||||
utils::resize2D(m_mesh,m_dimension,new_dim);
|
||||
}
|
||||
if (m_shell->isBufferResized() || m_shell->indexMoved())
|
||||
utils::setPosition2D(m_mesh,new_pos);
|
||||
}
|
20
src/sparrowshell/shellscrollbar.h
Normal file
20
src/sparrowshell/shellscrollbar.h
Normal file
@ -0,0 +1,20 @@
|
||||
#ifndef SHELLSCROLLBAR_H
|
||||
#define SHELLSCROLLBAR_H
|
||||
|
||||
#include "glm/vec2.hpp"
|
||||
|
||||
class MeshNode;
|
||||
class SparrowShell;
|
||||
|
||||
class ShellScrollBar
|
||||
{
|
||||
SparrowShell* m_shell;
|
||||
glm::ivec2 m_position;
|
||||
glm::ivec2 m_dimension;
|
||||
MeshNode *m_mesh;
|
||||
public:
|
||||
ShellScrollBar();
|
||||
ShellScrollBar(SparrowShell* shell);
|
||||
void update();
|
||||
};
|
||||
#endif // SHELLSCROLLBAR_H
|
99
src/sparrowshell/sparrowshell.cpp
Normal file
99
src/sparrowshell/sparrowshell.cpp
Normal file
@ -0,0 +1,99 @@
|
||||
#include "sparrowshell.h"
|
||||
|
||||
//#include "message.h"
|
||||
#include "input.h"
|
||||
#include "scene/scenetree.h"
|
||||
#include "scene/meshnode.h"
|
||||
#include "scene/textnode.h"
|
||||
#include "mesh.h"
|
||||
#include "phongmaterial.h"
|
||||
#include "tools/utils.h"
|
||||
#include "tools/font.h"
|
||||
|
||||
const unsigned int SparrowShell::BUFFER_MAX_LENGTH = 50;
|
||||
const unsigned int SparrowShell::BUFFER_DISPLAYED_NUMBER = 10;
|
||||
const unsigned int SparrowShell::SCROLLBAR_PIXEL_WIDTH = 10;
|
||||
const float SparrowShell::SHELL_DEPTH = 10;
|
||||
|
||||
SparrowShell::SparrowShell(sf::Window* window, Input* input):
|
||||
m_window(window),
|
||||
m_input(input),
|
||||
m_position(glm::ivec2(0,0)),
|
||||
m_buffer(new ShellBuffer(BUFFER_MAX_LENGTH))
|
||||
{
|
||||
sf::Vector2u size = m_window->getSize();
|
||||
m_dimension = glm::ivec2(size.x,size.y/2);
|
||||
Mesh* mesh = new Mesh();
|
||||
m_buffer->setFontSize(16.f);
|
||||
mesh->addRectangle2D(m_position,m_dimension);
|
||||
PhongMaterial *mat = new PhongMaterial();
|
||||
mat->diffuse = glm::vec3(0.1,0.1,0.1);
|
||||
mat->m_opacity = 0.5;
|
||||
mesh->setMaterial(mat);
|
||||
mesh->setDepth(SHELL_DEPTH);
|
||||
mesh->initGL();
|
||||
m_background = new MeshNode(mesh);
|
||||
this->addChild(m_background);
|
||||
m_scrollbar = ShellScrollBar(this);
|
||||
}
|
||||
|
||||
void SparrowShell::out(std::string s)
|
||||
{
|
||||
Font *shellfont = RESOURCE_GET(Font,"shellfont");
|
||||
TextNode* tnode = shellfont->getTextNode(s,glm::vec3(0.7,1,0.3),m_buffer->getFontSize());
|
||||
tnode->setDepth(SHELL_DEPTH+1);
|
||||
// m_currentScene->addToIndex(tnode);
|
||||
m_buffer->push(tnode);
|
||||
if (m_buffer->size() > SparrowShell::BUFFER_DISPLAYED_NUMBER)
|
||||
m_resizeBuffer = true;
|
||||
}
|
||||
|
||||
void SparrowShell::scrollUp(){
|
||||
if (m_index + SparrowShell::BUFFER_DISPLAYED_NUMBER < m_buffer->size()){
|
||||
m_index++;
|
||||
m_indexMoved = true;
|
||||
}
|
||||
}
|
||||
|
||||
void SparrowShell::scrollDown(){
|
||||
if (m_index > 0){
|
||||
m_index--;
|
||||
m_indexMoved = true;
|
||||
}
|
||||
}
|
||||
|
||||
void SparrowShell::toggleShell(){
|
||||
m_shellEnabled = !m_shellEnabled;
|
||||
for(auto child : m_children){
|
||||
MeshNode* meshchild = dynamic_cast<MeshNode*>(child);
|
||||
if(meshchild)
|
||||
meshchild->toggleVisibility();
|
||||
}
|
||||
m_buffer->toggleBuffer();
|
||||
m_background->toggleVisibility();
|
||||
}
|
||||
|
||||
void SparrowShell::update(){
|
||||
TextNode* tnode;
|
||||
glm::vec2 text_pos(0);
|
||||
|
||||
for(auto action : m_input->getActions()){
|
||||
if(action == 15){
|
||||
toggleShell();
|
||||
}
|
||||
}
|
||||
//move position of shellBuffer
|
||||
// position textnode inside shellBuffer
|
||||
|
||||
if(m_shellEnabled){
|
||||
for(unsigned int i = 0; i<m_buffer->size(); i++){
|
||||
// tnode = (TextNode*)(m_buffer+i);
|
||||
// if (i >= m_index && i < m_index + BUFFER_DISPLAYED_NUMBER){
|
||||
// utils::setPosition2D(tnode,text_pos);
|
||||
// text_pos.y += m_buffer->getFontSize();
|
||||
// m_scene->addToIndex(tnode);
|
||||
// }
|
||||
}
|
||||
}
|
||||
m_scrollbar.update();
|
||||
}
|
68
src/sparrowshell/sparrowshell.h
Normal file
68
src/sparrowshell/sparrowshell.h
Normal file
@ -0,0 +1,68 @@
|
||||
#ifndef SPARROWSHELL_H
|
||||
#define SPARROWSHELL_H
|
||||
|
||||
#include <list>
|
||||
|
||||
#include "system.h"
|
||||
#include "scene/scenetree.h"
|
||||
#include "glm/vec2.hpp"
|
||||
#include "sparrowshell/shellbuffer.h"
|
||||
#include "sparrowshell/shellscrollbar.h"
|
||||
|
||||
class Input;
|
||||
class MeshNode;
|
||||
class TextNode;
|
||||
class ShellBuffer;
|
||||
|
||||
namespace sf {
|
||||
class Window;
|
||||
}
|
||||
|
||||
class SparrowShell : public ContainerNode
|
||||
{
|
||||
private:
|
||||
sf::Window* m_window;
|
||||
Input* m_input;
|
||||
|
||||
glm::ivec2 m_position;
|
||||
glm::ivec2 m_dimension;
|
||||
ShellBuffer* m_buffer;
|
||||
unsigned int m_index = 0;
|
||||
bool m_resizeBuffer = false;
|
||||
bool m_indexMoved = false;
|
||||
bool m_shellEnabled = false;
|
||||
//textMesh
|
||||
MeshNode* m_background;
|
||||
ShellScrollBar m_scrollbar;
|
||||
|
||||
public:
|
||||
static const unsigned int BUFFER_MAX_LENGTH;
|
||||
static const unsigned int BUFFER_DISPLAYED_NUMBER;
|
||||
static const unsigned int SCROLLBAR_PIXEL_WIDTH;
|
||||
static const float SHELL_DEPTH;
|
||||
|
||||
SparrowShell(sf::Window*, Input*);
|
||||
|
||||
void update();
|
||||
|
||||
void scrollUp();
|
||||
void scrollDown();
|
||||
|
||||
void toggleShell();
|
||||
void out(std::string);
|
||||
void setSceneTree(SceneTree* tree)
|
||||
{
|
||||
ContainerNode::setSceneTree(tree);
|
||||
// m_buffer->setSceneTree(tree);
|
||||
}
|
||||
|
||||
glm::ivec2 getPosition(){return m_position;}
|
||||
glm::ivec2 getDimension(){return m_dimension;}
|
||||
|
||||
unsigned int getIndex(){return m_index;}
|
||||
ShellBuffer* getBuffer(){return m_buffer;}
|
||||
|
||||
bool isBufferResized(){return m_resizeBuffer;}
|
||||
bool indexMoved(){return m_indexMoved;}
|
||||
};
|
||||
#endif // SPARROWSHELL_H
|
@ -17,7 +17,7 @@
|
||||
#include <tools/font.h>
|
||||
#include <tools/utils.h>
|
||||
|
||||
#include <sparrowshell.h>
|
||||
#include <sparrowshell/sparrowshell.h>
|
||||
|
||||
|
||||
class myKeysMap : public IKeysMap{
|
||||
@ -109,7 +109,6 @@ int main(){
|
||||
engine.outputShell(std::to_string(i));
|
||||
}
|
||||
|
||||
|
||||
Input* input = engine.getInput();
|
||||
std::vector<int> v = {myKeysMap::TOGGLE_CONSOLE};
|
||||
input->addContext(Context("default",v));
|
||||
@ -152,5 +151,4 @@ int main(){
|
||||
*/
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user