public void AddView(SDL2GameView view) { if (!_views.Contains(view)) { _views.Add(view); view.Destroyed += OnDestroyed; } }
public bool RemoveView (SDL2GameView view) { if (_views.Contains(view) && !_closedList.Contains(view)) { view.Destroyed -= OnDestroyed; lock (_closedList) _closedList.Add(view); return true; } return false; }
public bool RemoveView(SDL2GameView view) { if (_views.Contains(view) && !_closedList.Contains(view)) { view.Destroyed -= OnDestroyed; lock (_closedList) _closedList.Add(view); return(true); } return(false); }
public static void Main (string[] args) { if (SDL.SDL_Init(SDL.SDL_INIT_NOPARACHUTE | SDL.SDL_INIT_VIDEO) < 0) throw new SDL2Exception(); var view = new SDL2GameView("Match3", 1024, 768, false, true, 0, 0); var game = new Game(view); var loop = new SDL2EventLoop(); loop.Event += (object sender, SDL2EventArgs e) => { if (e.Event.type == SDL.SDL_EventType.SDL_KEYDOWN && e.Event.key.keysym.sym == SDL.SDL_Keycode.SDLK_ESCAPE) loop.Dispose(); }; loop.AddView(view); loop.EnterLoop(); view.Dispose(); loop.Dispose(); SDL.SDL_Quit(); }
public static void Main (string[] args) { if (SDL.SDL_Init(SDL.SDL_INIT_NOPARACHUTE | SDL.SDL_INIT_VIDEO) < 0) throw new SDL2Exception(); var gameView = new SDL2GameView("Temp", 800, 600, false); var scene = new TempScene(gameView); var loop = new SDL2EventLoop(); loop.Event += (object sender, SDL2EventArgs e) => { if (e.Event.type == SDL.SDL_EventType.SDL_KEYDOWN && e.Event.key.keysym.sym == SDL.SDL_Keycode.SDLK_ESCAPE) loop.Dispose(); }; #if !DEBUG SDL.SDL_ShowCursor(0); #endif loop.AddView(gameView); loop.EnterLoop(); gameView.Dispose(); SDL.SDL_Quit(); }
public void AddView (SDL2GameView view) { if (!_views.Contains(view)) { _views.Add(view); view.Destroyed += OnDestroyed; } }