getting ready to draw a map overlay

This commit is contained in:
Josh Holtrop 2012-09-14 00:05:26 -04:00
parent 84aecf957c
commit ac79196325
2 changed files with 13 additions and 0 deletions

View File

@ -160,6 +160,7 @@ void Client::redraw()
draw_players(); draw_players();
draw_map(); draw_map();
draw_overlay();
m_window->display(); m_window->display();
} }
@ -268,3 +269,14 @@ void Client::draw_map()
} }
} }
} }
void Client::draw_overlay()
{
int overlay_size = (int)(m_width * 0.15);
glViewport(m_width - overlay_size - 50, m_height - overlay_size - 50,
overlay_size, overlay_size);
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glDisable(GL_BLEND);
glViewport(0, 0, m_width, m_height);
}

View File

@ -24,6 +24,7 @@ class Client
void redraw(); void redraw();
void draw_players(); void draw_players();
void draw_map(); void draw_map();
void draw_overlay();
refptr<sf::Window> m_window; refptr<sf::Window> m_window;
sf::Clock m_clock; sf::Clock m_clock;