Beispiel #1
0
        /// <summary>
        /// Initializes methods common to all NeHe lessons
        /// </summary>
        protected void Initialize(BaseDisplayDemo demo)
        {
#if Release
            try
            {
#endif
            //Mixer.Open(22050, AudioFormat.Default, 2, 2048);



            // Sets keyboard events
            // Sets the ticker to update OpenGL Context
            Events.Tick += new TickEventHandler(this.Tick);
            // Sets the resize window event
            Events.VideoResize += new VideoResizeEventHandler(Events_VideoResize);
            Events.Quit        += new QuitEventHandler(Events_Quit);
            // Set the Frames per second.
            Events.Fps = 60;
            targetDT   = (float)1 / (float)Events.Fps;
            // Creates SDL.NET Surface to hold an OpenGL scene
            //screen = Video.SetVideoModeWindowOpenGL(width, height, true);
            //Environment.
            //screen = Video.SetVideoModeOpenGL(width, height, 16);
            screen = Video.SetVideoModeWindowOpenGL(System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width / 2, System.Windows.Forms.Screen.PrimaryScreen.Bounds.Height / 2, true);

            //Video.WindowIcon();
            // Video.
            //Video.SetVideoModeWindowOpenGL(Video.Screen.Width,Video.Screen.Height,true);
            //Tao.Sdl.Sdl.SDL_WM_IconifyWindow();


            // Sets Window icon and title
            this.WindowAttributes();

            MeleeMusic.PlayDefault();
            this.demo    = demo;
            physicsTimer = new PhysicsTimer(Update2, 1 / (float)Events.Fps, 3);
            physicsTimer.Start(false);

#if Release
        }
        catch (Exception ex)
        {
            ErrorBox.DisplayError(ex);
            throw;
        }
#endif
        }
Beispiel #2
0
 /// <summary>
 /// Basic constructor
 /// </summary>
 public ReMasterSDL(BaseDisplayDemo demo)
 {
     Initialize(demo);
 }