mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-25 16:55:07 +02:00
fix the quad color being broken after rendering text
This commit is contained in:
parent
8016fb5e0d
commit
7a45b1bc96
2 changed files with 9 additions and 0 deletions
|
@ -13,6 +13,7 @@
|
|||
|
||||
#include <gpu/GPUConfig.h>
|
||||
|
||||
#include <DeferredLightingEffect.h>
|
||||
#include <GeometryCache.h>
|
||||
#include <PerfStat.h>
|
||||
#include <TextRenderer.h>
|
||||
|
@ -49,7 +50,12 @@ void RenderableTextEntityItem::render(RenderArgs* args) {
|
|||
|
||||
glm::vec3 topLeft(-halfDimensions.x, -halfDimensions.y, SLIGHTLY_BEHIND);
|
||||
glm::vec3 bottomRight(halfDimensions.x, halfDimensions.y, SLIGHTLY_BEHIND);
|
||||
|
||||
// TODO: Determine if we want these entities to have the deferred lighting effect? I think we do, so that the color
|
||||
// used for a sphere, or box have the same look as those used on a text entity.
|
||||
DependencyManager::get<DeferredLightingEffect>()->bindSimpleProgram();
|
||||
DependencyManager::get<GeometryCache>()->renderQuad(topLeft, bottomRight, glm::vec4(toGlm(getBackgroundColorX()), alpha));
|
||||
DependencyManager::get<DeferredLightingEffect>()->releaseSimpleProgram();
|
||||
|
||||
TextRenderer* textRenderer = TextRenderer::getInstance(SANS_FONT_FAMILY, FIXED_FONT_POINT_SIZE / 2.0f);
|
||||
|
||||
|
|
|
@ -481,9 +481,12 @@ glm::vec2 Font::drawString(float x, float y, const QString & str,
|
|||
}
|
||||
|
||||
_vao->release();
|
||||
_texture->release(); // TODO: Brad & Sam, let's discuss this. Without this non-textured quads get their colors borked.
|
||||
_program->release();
|
||||
// FIXME, needed?
|
||||
// glDisable(GL_TEXTURE_2D);
|
||||
|
||||
|
||||
return advance;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue