public DeviceScreen(GameDevice device) { if (device == null) { throw new Exception("Initial DeviceScreen with null device"); } else { mDevice = device; } int[] resolution = device.GetScreenDimension(); if (resolution == null || resolution.Length != 2) { //throw new IllegalArgumentException("Device report illegal resolution length"); mScreenWidth = 1080; mScreenHeight = 2340; } else { mScreenWidth = resolution[0]; mScreenHeight = resolution[1]; } int orientation = device.GetScreenMainOrientation(); if (orientation < 0) { throw new FormatException("Device report illegal default screen orientation"); } else { mCurrentGameOrientation = orientation; } Log = mDevice.GetLogger(); mScreenshotSlotCount = mDevice.GetScreenshotSlotCount(); mScreenshotCurrentSlot = 0; }
public DeviceInteract(JoshGameLibrary20 gl, GameDevice device) { if (device == null) { throw new Exception("Initial DeviceScreen with null device"); } else { mDevice = device; } Log = mDevice.GetLogger(); int[] resolution = device.GetScreenDimension(); if (resolution == null || resolution.Length != 2) { Log.W(TAG, "Auto detect for device resolution failed, use default 1080x2340. Override this."); mScreenWidth = 1080; mScreenHeight = 2340; } else { mScreenWidth = resolution[0]; mScreenHeight = resolution[1]; } int orientation = device.GetScreenMainOrientation(); if (orientation < 0) { throw new Exception("Device report illegal default screen orientation"); } else { mCurrentGameOrientation = orientation; } }