added resizing to osx window

This commit is contained in:
Omar Mohamed Ali Mudhir
2017-01-25 09:15:22 +00:00
parent 9d6171c7d8
commit 2f042c3e95
7 changed files with 127 additions and 21 deletions

View File

@@ -85,7 +85,7 @@ void App::load_layout()
std::stack<NodePair> stack;
tinyxml2::XMLDocument xml;
auto ret = xml.LoadFile("data\\layout.xml");
auto ret = xml.LoadFile("data/layout.xml");
auto x_root = xml.RootElement();
NodePair current = { y_root, x_root };
@@ -299,6 +299,7 @@ void App::init()
" frag = col;"
"}";
#ifdef _WIN32
static CONSOLE_SCREEN_BUFFER_INFO info;
GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &info);
// colors: http://stackoverflow.com/questions/4053837/colorizing-text-in-the-console-with-c
@@ -317,7 +318,8 @@ void App::init()
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), info.wAttributes);
}, nullptr);
glEnable(GL_DEBUG_OUTPUT);
#endif
load_layout();
for (auto& s : shapes_list)
@@ -431,10 +433,6 @@ void App::update(float dt)
glEnable(GL_SCISSOR_TEST);
glScissor(box.x, height - box.y - 1 - box.w, box.z, box.w);
}
else
{
glDisable(GL_SCISSOR_TEST);
}
//glScissor(10, height - 10 - 1 - 50, 480, 50);
glm::mat4 pivot = glm::translate(glm::vec3(.5f, .5f, 0.f));
@@ -455,6 +453,7 @@ void App::update(float dt)
shader_color.use();
shader_color.u_mat4("mvp", mvp);
plane.draw_stroke();
glDisable(GL_SCISSOR_TEST);
}
tex.unbind();
sampler.unbind();