static void Main(string[] args) { random = new Random((int)DateTime.Now.Ticks); if (SDL.SDL_Init(SDL.SDL_INIT_VIDEO) != 0) { MessageErr("SDL_Init: ERREUR ({0})\n", SDL.SDL_GetError()); return; } if (Sfx.initialiser_son() != 0) { MessageErr("Son non initialisé! Fermeture..."); return; } if (Gfx.initialiser_2d() != 0) { MessageErr("2D non initialisé! Fermeture..."); return; } while (SDL.SDL_WasInit(SDL.SDL_INIT_VIDEO | SDL.SDL_INIT_AUDIO) != 0) { Gfx.nettoyerEcran(Color.Black); Gfx.debut2D(); Gfx.presenterEcran(); Gfx.fin2D(); Gfx.gererTouches(); // IPS fixées à 60 Thread.Sleep(16); } }
internal static Size getResolution() { int w, h; if (rendu == IntPtr.Zero) { //Program.MessageErr("Impossible d'obtenir la taille de la fenêtre"); Sfx.deinitialiser_son(); deinitialiser_2d(); SDL.SDL_Quit(); return(new Size(-1, -1)); } SDL.SDL_GetRendererOutputSize(rendu, out w, out h); return(new Size(w, h)); }