public static bool SetViewport(int x, int y, int w, int h) { PushAll(); Viewport viewport = new Viewport(); viewport.set_MinZ(0f); viewport.set_MaxZ(1f); int v = x; int num2 = y; int num3 = x + w; int num4 = y + h; Fix(ref v, Engine.ScreenWidth); Fix(ref num2, Engine.ScreenHeight); Fix(ref num3, Engine.ScreenWidth); Fix(ref num4, Engine.ScreenHeight); viewport.set_X(v); viewport.set_Y(num2); viewport.set_Width(num3 - v); viewport.set_Height(num4 - num2); if ((viewport.get_Width() == 0) || (viewport.get_Height() == 0)) { return false; } Engine.m_Device.set_Viewport(viewport); return true; }