예제 #1
0
        internal void Initialize()
        {
            _threadSafety = new ThreadSafetyEnforcer("Main Window Class");
            _invoker      = new Invoker(_threadSafety);

            //This selects our first screen, and Loads it.


            //Width, Height, BitsPerPixle, resizable, openGL, fullscreen, hardware, frame
            //Video.SetVideoMode(ScreenWidth, ScreenHeight, BestBitsPerPixle, true, false, false, true, true);
            //Video.WindowCaption = "Tortoise Demo";

            //MainSurface = GenerateSurface();


            DebugFont = FontManager.GetInstance(Graphics, 12, FontTypes.Sans);

            TMouseState mouse    = Graphics.InputManager.MouseStateManager;
            TKeyState   keyboard = Graphics.InputManager.KeyStateManager;


            mouse.MouseDownEvent += Mouse_ButtonDown;
            mouse.MouseUpEvent   += Mouse_ButtonUp;
            mouse.MouseMoveEvent += Mouse_Move;

            keyboard.KeyboardKeyPressEvent   += Window_KeyDown;
            keyboard.KeyboardKeyReleaseEvent += Window_KeyUp;
            keyboard.KeyboardEvent           += Window_KeyPress;

            //_keyboard.KeyPress += new EventHandler<KeyEventArgs>(Window_KeyPress);

            Graphics.Control.Resize += new EventHandler(Window_Resize);


            tickEventData  = new TickEventArgs();
            frameTimer     = new Timer(true);
            TotalTimer     = new Timer(true);
            lastFrameTimes = new LimitedList <double>(30, 0);


            StormLib.Console.SetIfNotExsistValue("gf_RenderUpdateRec", ConsoleVarable.OnOffVarable("Draw Boxes showing Updated Areas"));
            StormLib.Console.SetIfNotExsistValue("gf_ShowFPS", ConsoleVarable.OnOffVarable("Displays FPS information"));
        }
예제 #2
0
 public override void Tick(TickEventArgs e)
 {
     base.Tick(e);
 }