Skip to content

Commit

Permalink
Insert LABEL in ModuleGameUI switch
Browse files Browse the repository at this point in the history
  • Loading branch information
Casa\Adrián Meizoso committed Mar 14, 2018
1 parent 01f7069 commit 7b7ef66
Showing 1 changed file with 27 additions and 25 deletions.
52 changes: 27 additions & 25 deletions LCSEngine/ModuleGameUI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
}

Expand Down

0 comments on commit 7b7ef66

Please sign in to comment.