diff --git a/LCSEngine/ModuleGameUI.cpp b/LCSEngine/ModuleGameUI.cpp index b0b133b..03150d2 100644 --- a/LCSEngine/ModuleGameUI.cpp +++ b/LCSEngine/ModuleGameUI.cpp @@ -133,37 +133,39 @@ void ModuleGameUI::printGameUI() glDrawElements(GL_TRIANGLES, 6, GL_UNSIGNED_INT, NULL); break; } - } - } - else if ((*it)->visible && (*it)->type == LABEL) - { - UILabel* label = (UILabel*)(*it); - UIImage* image = (UIImage*)label->textImage; + case LABEL: + { + UILabel* label = (UILabel*)(*it); + UIImage* image = (UIImage*)label->textImage; - glUniform1i(glGetUniformLocation(program, "useText"), true); + glUniform1i(glGetUniformLocation(program, "useText"), true); - if (label->fontData != nullptr) - { - glActiveTexture(GL_TEXTURE0); - glBindTexture(GL_TEXTURE_2D, label->fontData->idTexture); - glUniform1i(glGetUniformLocation(program, "text"), 0); + if (label->fontData != nullptr) + { + glActiveTexture(GL_TEXTURE0); + glBindTexture(GL_TEXTURE_2D, label->fontData->idTexture); + glUniform1i(glGetUniformLocation(program, "text"), 0); - glBindBuffer(GL_ARRAY_BUFFER, image->idTexCoords); - glEnableVertexAttribArray(1); - glVertexAttribPointer(1, 2, GL_FLOAT, GL_FALSE, 2 * sizeof(GLfloat), (GLvoid*)0); - } - - glBindBuffer(GL_ARRAY_BUFFER, image->idVertVBO); - glEnableVertexAttribArray(0); - glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 3 * sizeof(GLfloat), (GLvoid*)0); + glBindBuffer(GL_ARRAY_BUFFER, image->idTexCoords); + glEnableVertexAttribArray(1); + glVertexAttribPointer(1, 2, GL_FLOAT, GL_FALSE, 2 * sizeof(GLfloat), (GLvoid*)0); + } - glBindBuffer(GL_ARRAY_BUFFER, image->idColors); - glEnableVertexAttribArray(2); - glVertexAttribPointer(2, 3, GL_FLOAT, GL_FALSE, 3 * sizeof(GLfloat), (GLvoid*)0); + glBindBuffer(GL_ARRAY_BUFFER, image->idVertVBO); + glEnableVertexAttribArray(0); + glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 3 * sizeof(GLfloat), (GLvoid*)0); + + glBindBuffer(GL_ARRAY_BUFFER, image->idColors); + glEnableVertexAttribArray(2); + glVertexAttribPointer(2, 3, GL_FLOAT, GL_FALSE, 3 * sizeof(GLfloat), (GLvoid*)0); - glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, image->idIdxVAO); + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, image->idIdxVAO); - glDrawElements(GL_TRIANGLES, 6, GL_UNSIGNED_INT, NULL); + glDrawElements(GL_TRIANGLES, 6, GL_UNSIGNED_INT, NULL); + } + default: + break; + } } }