Skip to content
Snippets Groups Projects
Commit 743b0676 authored by Odilitime's avatar Odilitime
Browse files

relay keyUp event to documentComponent, fix log labels, remove window extern

parent ba6cc240
No related branches found
No related tags found
No related merge requests found
......@@ -111,7 +111,16 @@ MultiComponent::MultiComponent(const float rawX, const float rawY, const float r
// should we mark win->renderDirty = true?
};
onKeyup=[this](int key, int scancode, int action, int mods) {
//std::cout << "MultiComponent::MultiComponent:onKeyup" << std::endl;
//std::cout << "MultiComponent::MultiComponent:onKeyup - focused on " << typeOfComponent(this->focusedComponent) << std::endl;
DocumentComponent *docComponent = dynamic_cast<DocumentComponent*>(this->focusedComponent.get());
if (docComponent) {
if (action == 0) {
if (docComponent->onKeyup) {
docComponent->onKeyup(key, scancode, action, mods);
}
}
return;
}
InputComponent *inputComponent = dynamic_cast<InputComponent*>(this->focusedComponent.get());
if (inputComponent) {
//std::cout << "inputComponent is focused, key pressed " << key << " action: " <<action << std::endl;
......@@ -216,12 +225,12 @@ void MultiComponent::render() {
GLint transformLocation = glGetUniformLocation(win->fontProgram, "transform");
GLenum glErr=glGetError();
if(glErr != GL_NO_ERROR) {
std::cout << "InputComponent::render - glGetUniformLocation not ok: " << glErr << std::endl;
std::cout << "MultiComponent::render - glGetUniformLocation not ok: " << glErr << std::endl;
}
glUniformMatrix4fv(transformLocation, 1, GL_FALSE, win->transformMatrix);
glErr=glGetError();
if(glErr != GL_NO_ERROR) {
std::cout << "InputComponent::render - glUniformMatrix4fv not ok: " << glErr << std::endl;
std::cout << "MultiComponent::render - glUniformMatrix4fv not ok: " << glErr << std::endl;
}
}
renderComponents(rootComponent);
......@@ -294,7 +303,7 @@ void MultiComponent::renderBoxComponents(std::shared_ptr<Component> component) {
void MultiComponent::renderComponentType(std::string str, std::shared_ptr<Component> component) {
if (!component) {
std::cout << "Window::renderComponentType - got null passed" << std::endl;
std::cout << "MultiComponent::renderComponentType - got null passed" << std::endl;
return;
}
if (typeOfComponent(component) == str) {
......
......@@ -50,6 +50,6 @@ public:
double cursorY = 0;
};
extern const std::unique_ptr<Window> window;
//extern const std::unique_ptr<Window> window;
#endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment