minor changes and added namespace to avoid conflicts when integrating with PanoPainter
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
#include "pch.h"
|
||||
#include "app.h"
|
||||
|
||||
using namespace ui;
|
||||
|
||||
App App::I; // singleton
|
||||
|
||||
#ifdef __APPLE__
|
||||
@@ -18,6 +20,13 @@ void App::create()
|
||||
height = 500;
|
||||
}
|
||||
|
||||
void App::clear()
|
||||
{
|
||||
glClearColor(.1f, .1f, .1f, 1.f);
|
||||
glViewport(0, 0, (GLsizei)width, (GLsizei)height);
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
}
|
||||
|
||||
void App::initShaders()
|
||||
{
|
||||
static const char* shader_v =
|
||||
@@ -143,6 +152,7 @@ void App::initLayout()
|
||||
LOG("initializing layout updating after load");
|
||||
layout[main_id]->update(width, height, zoom);
|
||||
LOG("initializing layout components");
|
||||
sidebar = layout[main_id]->find<NodeBorder>("sidebar");
|
||||
if (auto* button = layout[main_id]->find<NodeButton>("btn-close"))
|
||||
{
|
||||
button->on_click = [] { exit(0); };
|
||||
@@ -264,11 +274,11 @@ void App::init()
|
||||
|
||||
void App::update(float dt)
|
||||
{
|
||||
glClearColor(.1f, .1f, .1f, 1.f);
|
||||
glViewport(0, 0, (GLsizei)width, (GLsizei)height);
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
//glClearColor(.1f, .1f, .1f, 1.f);
|
||||
//glViewport(0, 0, (GLsizei)width, (GLsizei)height);
|
||||
//glClear(GL_COLOR_BUFFER_BIT);
|
||||
|
||||
//layout.reload();
|
||||
layout.reload();
|
||||
if (auto* main = layout[main_id])
|
||||
main->update(width, height, zoom);
|
||||
|
||||
@@ -295,7 +305,7 @@ void App::resize(float w, float h)
|
||||
width = w;
|
||||
height = h;
|
||||
if (auto* main = layout[main_id])
|
||||
main->update(w, h, zoom);
|
||||
main->update(w , h, zoom);
|
||||
}
|
||||
|
||||
void App::mouse_down(int button, float x, float y)
|
||||
|
||||
Reference in New Issue
Block a user