Browse Source

keyup case fix, textureTransformMatrix reset

master
Odilitime 5 years ago
parent
commit
e7e468f674
  1. 16
      src/graphics/components/MultiComponent.cpp

16
src/graphics/components/MultiComponent.cpp

@ -112,13 +112,13 @@ MultiComponent::MultiComponent(const float rawX, const float rawY, const float r @@ -112,13 +112,13 @@ MultiComponent::MultiComponent(const float rawX, const float rawY, const float r
//renderDirty = true;
// should we mark win->renderDirty = true?
};
onKeyup=[this](int key, int scancode, int action, int mods) {
onKeyUp=[this](int key, int scancode, int action, int mods) {
//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);
if (docComponent->onKeyUp) {
docComponent->onKeyUp(key, scancode, action, mods);
}
}
return;
@ -226,7 +226,15 @@ void MultiComponent::render() { @@ -226,7 +226,15 @@ void MultiComponent::render() {
Shader *textureShader = this->win->shaderLoader.getShader(VertexShader("TextureShader.vert"),
FragmentShader("TextureShader.frag"));
textureShader->bind();
GLint transformLocation = textureShader->uniform("transform");
glUniformMatrix4fv(transformLocation, 1, GL_FALSE, this->win->textureTransformMatrix);
GLenum glErr=glGetError();
if(glErr != GL_NO_ERROR) {
std::cout << "MultiComponent::render - glUniformMatrix4fv - not ok: " << glErr << std::endl;
}
//std::cout << "MultiComponent::render - start Box components" << std::endl;
renderBoxComponents(rootComponent);
//std::cout << "MultiComponent::render - end Box components" << std::endl;
textureShader->release();
// if we flip, we can't put tab labels on top of the tab
fontShader->bind();
@ -242,7 +250,9 @@ void MultiComponent::render() { @@ -242,7 +250,9 @@ void MultiComponent::render() {
std::cout << "MultiComponent::render - glUniformMatrix4fv not ok: " << glErr << std::endl;
}
}
//std::cout << "MultiComponent::render - start text components" << std::endl;
renderComponents(rootComponent);
//std::cout << "MultiComponent::render - end text components" << std::endl;
}
// draw this component and all it's children

Loading…
Cancel
Save