protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); _view = new AndroidGameView(this, 60); _scene = new MyScene(_view); this.SetContentView(_view); }
public override bool FinishedLaunching(UIApplication app, NSDictionary options) { _window = new UIWindow(UIScreen.MainScreen.Bounds); _controller = new UIViewController(); _view = new iOSGameView(UIScreen.MainScreen.ApplicationFrame); _scene = new MyScene(_view); _window.RootViewController = _controller; _controller.View = _view; _window.MakeKeyAndVisible(); return(true); }
public static void Main(string[] args) { if ((SDL.SDL_Init((SDL.SDL_INIT_NOPARACHUTE | SDL.SDL_INIT_VIDEO)) < 0)) { throw new SDL2Exception(); } using (var loop = new SDL2EventLoop()) { using (var view = new SDL2GameView("Temp", 640, 480, false, true, 0, 0)) { using (var scene = new MyScene(view)) { view.Event += (object sender, SDL2EventArgs e) => { if (e.Event.type == SDL.SDL_EventType.SDL_KEYDOWN && e.Event.key.keysym.sym == SDL.SDL_Keycode.SDLK_ESCAPE) { view.Dispose(); } }; view.EnterLoop(); } } } SDL.SDL_Quit(); }