Example #1
0
 public Control(string name, Rectangle area)
 {
     _threadSafety = new ThreadSafetyEnforcer(name);
     _invoker      = new Invoker(_threadSafety);
     _area         = area;
     Name          = name;
 }
Example #2
0
 public Control(TGraphics graphics, string name, Rectangle area)
 {
     _graphics     = graphics;
     _threadSafety = new ThreadSafetyEnforcer(name);
     _invoker      = new Invoker(_threadSafety);
     _area         = area;
     _anchor       = ControlAnchor.Default;
     Name          = name;
 }
Example #3
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"));
        }