From fae0c2bfe95a122de0f165791690dc18928a931c Mon Sep 17 00:00:00 2001 From: pixel Date: Fri, 14 Nov 2003 17:21:14 +0000 Subject: Started working on widgets. --- lib/base.cc | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'lib/base.cc') 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); +} -- cgit v1.2.3