Exemplo n.º 1
0
 /// <summary>
 /// Constructs an XnaMouseEventSource
 /// </summary>
 public XnaMouseInputDevice(XnaGraphicsPlatform platform)
 {
     this.firstUpdateHappened = false;
     this.isFormActive        = true;
     this.platform            = platform;
     this.pressedButtons      = new RCSet <UIMouseButton>();
     this.scrollWheelPos      = 0;
 }
Exemplo n.º 2
0
 /// <summary>
 /// Constructs an XnaSprite object.
 /// </summary>
 /// <param name="rawBitmap">The underlying System.Drawing.Bitmap of this XnaSprite.</param>
 /// <param name="pixelSize">The pixel size of this XnaSprite.</param>
 public XnaSprite(Bitmap rawBitmap, RCIntVector pixelSize, XnaGraphicsPlatform platform)
     : base(rawBitmap.Width / pixelSize.X, rawBitmap.Height / pixelSize.Y, pixelSize)
 {
     this.isLocked          = false;
     this.rawBitmap         = rawBitmap;
     this.transparentBitmap = null;
     this.isUploaded        = false;
     this.xnaTexture        = null;
     this.platform          = platform;
 }
Exemplo n.º 3
0
        /// <summary>
        /// Constructs an XnaRenderLoop object.
        /// </summary>
        /// <param name="platform">Reference to the platform.</param>
        public XnaRenderLoop(XnaGraphicsPlatform platform)
        {
            this.mouseInputDevice    = new XnaMouseInputDevice(platform);
            this.keyboardInputDevice = new XnaKeyboardInputDevice();
            UIRoot.Instance.RegisterMouseInputDevice(this.mouseInputDevice);
            UIRoot.Instance.RegisterKeyboardInputDevice(this.keyboardInputDevice);

            List <XnaRenderLoopImpl.UpdateDlgt>     updateFunctions = new List <XnaRenderLoopImpl.UpdateDlgt>();
            List <XnaRenderLoopImpl.RenderDlgt>     renderFunctions = new List <XnaRenderLoopImpl.RenderDlgt>();
            List <XnaRenderLoopImpl.InitializeDlgt> initFunctions   = new List <XnaRenderLoopImpl.InitializeDlgt>();

            updateFunctions.Add(this.mouseInputDevice.Update);
            updateFunctions.Add(this.keyboardInputDevice.Update);
            updateFunctions.Add(this.Update);
            renderFunctions.Add(this.Render);
            initFunctions.Add(this.Initialize);

            this.implementation = new XnaRenderLoopImpl(updateFunctions, renderFunctions, initFunctions);
            this.platform       = platform;
        }
Exemplo n.º 4
0
 /// <summary>
 /// Constructs an XnaSpriteManager object.
 /// </summary>
 /// <param name="platform">Reference to the platform.</param>
 public XnaSpriteManager(XnaGraphicsPlatform platform)
 {
     this.platform       = platform;
     this.sprites        = new RCSet <XnaSprite>();
     this.renderContexts = new Dictionary <XnaSprite, XnaSpriteRenderContext>();
 }