mirror of
https://github.com/aseprite/aseprite.git
synced 2025-02-11 09:40:42 +00:00
Add ScreenGraphics to get a "Graphics" to draw directly onto the screen.
This commit is contained in:
parent
fe50b6a30a
commit
a33f10373c
@ -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()
|
||||
{
|
||||
}
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user