diff options
author | pixel <pixel> | 2003-11-14 17:21:14 +0000 |
---|---|---|
committer | pixel <pixel> | 2003-11-14 17:21:14 +0000 |
commit | fae0c2bfe95a122de0f165791690dc18928a931c (patch) | |
tree | 1f8056a480702d72c4f871ad7375a575510bb7ff /lib/base.cc | |
parent | d7575bef1e530eac004c973b0384a12561f0bb8b (diff) |
Started working on widgets.
Diffstat (limited to 'lib/base.cc')
-rw-r--r-- | lib/base.cc | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/base.cc b/lib/base.cc index 49e883e..5282617 100644 --- a/lib/base.cc +++ b/lib/base.cc @@ -78,3 +78,19 @@ void mogltk::base::Leave2DMode() { bool mogltk::base::is2D() { return true; } + +void mogltk::base::changeviewport(int x, int y, unsigned int w, unsigned int h) { + SDL_Rect r; + + if ((w == 0) && (h == 0)) { + w = GetWidth() - x; + h = GetHeight() - y; + } + + r.x = x; + r.y = y; + r.w = w; + r.h = h; + + SDL_SetClipRect(surface, &r); +} |