Add LockedSurface::lockedWidth/Height() member functions

This commit is contained in:
David Capello 2015-04-16 20:25:40 -03:00
parent 6b25004b48
commit cbed44e627
3 changed files with 18 additions and 0 deletions

View File

@ -191,6 +191,14 @@ namespace she {
// LockedSurface implementation
int lockedWidth() const override {
return m_bmp->w;
}
int lockedHeight() const override {
return m_bmp->h;
}
void unlock() override {
release_bitmap(m_bmp);
}

View File

@ -25,6 +25,8 @@ namespace she {
class LockedSurface {
public:
virtual ~LockedSurface() { }
virtual int lockedWidth() const = 0;
virtual int lockedHeight() const = 0;
virtual void unlock() = 0;
virtual void clear() = 0;

View File

@ -85,6 +85,14 @@ public:
// LockedSurface impl
int lockedWidth() const override {
return m_bitmap.width();
}
int lockedHeight() const override {
return m_bitmap.height();
}
void unlock() override {
m_bitmap.unlockPixels();
}