diff --git a/src/gui/GuiContainer.cpp b/src/gui/GuiContainer.cpp index 28fc80aa617..c48ae9e037b 100644 --- a/src/gui/GuiContainer.cpp +++ b/src/gui/GuiContainer.cpp @@ -163,7 +163,10 @@ void Container::Draw() float size[2]; GetSize(size); if (!m_transparent) { - if (m_bgcol[3] < 1.0) glEnable(GL_BLEND); + if (m_bgcol[3] < 1.0) { + glEnable(GL_BLEND); + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + } glBegin(GL_QUADS); glColor4fv(m_bgcol); glVertex2f(0, size[1]); @@ -171,7 +174,10 @@ void Container::Draw() glVertex2f(size[0], 0); glVertex2f(0, 0); glEnd(); - glDisable(GL_BLEND); + if (m_bgcol[3] < 1.0) { + glBlendFunc(GL_ONE, GL_ZERO); + glDisable(GL_BLEND); + } } #ifdef GUI_DEBUG_CONTAINER glBegin(GL_LINE_LOOP); diff --git a/src/gui/GuiToolTip.cpp b/src/gui/GuiToolTip.cpp index 99a1b0d5eb4..8692d9258ac 100644 --- a/src/gui/GuiToolTip.cpp +++ b/src/gui/GuiToolTip.cpp @@ -51,6 +51,7 @@ void ToolTip::Draw() int age = SDL_GetTicks() - m_createdTime; float alpha = age/float(FADE_TIME_MS); alpha = std::min(alpha, 0.75f); glEnable(GL_BLEND); + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); GetSize(size); glColor4f(.2f,.2f,.6f,alpha); glBegin(GL_QUADS); @@ -71,6 +72,7 @@ void ToolTip::Draw() glColor4f(1,1,1,alpha); m_layout->Render(size[0]-2*TOOLTIP_PADDING); glPopMatrix(); + glBlendFunc(GL_ONE, GL_ZERO); glDisable(GL_BLEND); }