Add ScreenGraphics to get a "Graphics" to draw directly onto the screen.

This commit is contained in:
David Capello 2011-02-12 21:32:43 -03:00
parent fe50b6a30a
commit a33f10373c
2 changed files with 21 additions and 0 deletions

View File

@ -124,3 +124,16 @@ gfx::Size Graphics::measureString(const std::string& str)
return gfx::Size(ji_font_text_len(m_currentFont, str.c_str()),
text_height(m_currentFont));
}
//////////////////////////////////////////////////////////////////////
// ScreenGraphics
ScreenGraphics::ScreenGraphics()
: Graphics(screen, 0, 0)
{
setFont(font); // Allegro default font
}
ScreenGraphics::~ScreenGraphics()
{
}

View File

@ -55,6 +55,14 @@ private:
FONT* m_currentFont;
};
// Class to draw directly in the screen.
class ScreenGraphics : public Graphics
{
public:
ScreenGraphics();
virtual ~ScreenGraphics();
};
// Class to temporary set the Graphics' clip region to a sub-rectangle
// (in the life-time of the IntersectClip instance).
class IntersectClip