diff --git a/ui/ui.cpp b/ui/ui.cpp index 402d3b8bc6..c50d5b1655 100644 --- a/ui/ui.cpp +++ b/ui/ui.cpp @@ -8,6 +8,7 @@ #include "gfx_es2/draw_buffer.h" DrawBuffer ui_draw2d; +DrawBuffer ui_draw2d_front; UIState uistate; // Theme. @@ -18,7 +19,8 @@ static int themeCheckOnImage; static int themeCheckOffImage; void UIInit(const Atlas *atlas, int uiFont, int buttonImage, int checkOn, int checkOff) { - ui_draw2d.SetAtlas(atlas); + ui_draw2d.SetAtlas(atlas); + ui_draw2d_front.SetAtlas(atlas); themeAtlas = atlas; themeUIFont = uiFont; themeButtonImage = buttonImage; @@ -53,6 +55,7 @@ bool UIRegionHit(int x, int y, int w, int h, int margin) { void UIBegin() { uistate.hotitem = 0; ui_draw2d.Begin(); + ui_draw2d_front.Begin(); } void UIEnd() { @@ -63,7 +66,8 @@ void UIEnd() { uistate.activeitem = -1; } } - ui_draw2d.End(); + ui_draw2d.End(); + ui_draw2d_front.End(); uistate.lastx = uistate.mousex; uistate.lasty = uistate.mousey; diff --git a/ui/ui.h b/ui/ui.h index 4eddbbfbf5..70976de9be 100644 --- a/ui/ui.h +++ b/ui/ui.h @@ -108,6 +108,7 @@ struct Atlas; // This is the drawbuffer used for UI. Remember to flush it at the end of the frame. // TODO: One should probably pass it in through UIInit. extern DrawBuffer ui_draw2d; +extern DrawBuffer ui_draw2d_front; // for things that need to be on top of the rest void UIInit(const Atlas *atlas, int uiFont, int buttonImage, int checkOn, int checkOff); @@ -189,4 +190,6 @@ int UIList(int id, int x, int y, int w, int h, UIListAdapter *adapter, UIListSta // Do this afterwards (or similar): // ShaderManager::SetUIProgram(); // ui_draw2d.Flush(ShaderManager::Program()); +// ui_draw2d_front.Flush(ShaderManager::Program()); + void UIEnd();