示例#1
0
 public XnaGeometry(GeometryCreationData creationData, Device device)
     : base(creationData)
 {
     this.device        = device as XnaDevice;
     nativeDevice       = (device as XnaDevice).NativeDevice;
     nativeVertexFormat = new XnaVertexFormat();
 }
		private void TryInitializeXna()
		{
			RegisterCommonEngineSingletons();
			game = new XnaGame(this);
			window = new XnaWindow(game);
			window.ViewportPixelSize = settings.Resolution;
			RegisterInstance(window);
			RegisterSingleton<WindowsSystemInformation>();
			var device = new XnaDevice(game, window, settings);
			RegisterInstance(device);
			RegisterSingleton<Drawing>();
			RegisterSingleton<BatchRenderer2D>();
			RegisterSingleton<BatchRenderer3D>();
			game.StartXnaGameToInitializeGraphics();
			RegisterInstance(game);
			RegisterInstance(game.Content);
			RegisterSingleton<XnaSoundDevice>();
			RegisterSingleton<XnaScreenshotCapturer>();
			RegisterSingleton<VideoPlayer>();
			RegisterSingleton<XnaMouse>();
			RegisterSingleton<XnaKeyboard>();
			RegisterSingleton<XnaTouch>();
			RegisterSingleton<XnaGamePad>();
			Register<InputCommands>();
			if (IsAlreadyInitialized)
				throw new UnableToRegisterMoreTypesAppAlreadyStarted();
		}
		public XnaGeometry(GeometryCreationData creationData, Device device)
			: base (creationData)
		{
			this.device = device as XnaDevice;
			nativeDevice = (device as XnaDevice).NativeDevice;
			nativeVertexFormat = new XnaVertexFormat();
		}
		public XnaImage(string contentName, XnaDevice device)
			: base(contentName)
		{
			nativeDevice = device.NativeDevice;
			if (nativeDevice == null || device.NativeContent == null)
				throw new UnableToContinueWithoutXnaGraphicsDevice();
		}
		private XnaImage(ImageCreationData data, XnaDevice device)
			: base(data)
		{
			nativeDevice = device.NativeDevice;
			if (nativeDevice == null || device.NativeContent == null)
				throw new UnableToContinueWithoutXnaGraphicsDevice();
		}
示例#6
0
 public XnaDrawing(XnaDevice device, Window window)
     : base(device)
 {
     this.device = device;
     this.window = window;
     window.ViewportSizeChanged += Reset;
 }
		public XnaVideo(string filename, XnaMedia.VideoPlayer player, XnaDevice graphicsDevice,
			SoundDevice soundDevice)
			: base(filename, soundDevice)
		{
			this.player = player;
			this.graphicsDevice = graphicsDevice;
			image = new VideoImage(graphicsDevice);
		}
		public VideoImage(XnaDevice graphicsDevice)
			: base(new ImageCreationData(new Size(4, 4)))
		{
			nativeDevice = graphicsDevice.NativeDevice;
			if (nativeDevice == null || graphicsDevice.NativeContent == null)
				throw new UnableToContinueWithoutXnaGraphicsDevice();
			NativeTexture = new Texture2D(nativeDevice, (int)PixelSize.Width, (int)PixelSize.Height);
		}
示例#9
0
 private XnaImage(ImageCreationData data, XnaDevice device)
     : base(data)
 {
     nativeDevice = device.NativeDevice;
     if (nativeDevice == null || device.NativeContent == null)
     {
         throw new UnableToContinueWithoutXnaGraphicsDevice();
     }
 }
示例#10
0
 public XnaImage(string contentName, XnaDevice device)
     : base(contentName)
 {
     nativeDevice = device.NativeDevice;
     if (nativeDevice == null || device.NativeContent == null)
     {
         throw new UnableToContinueWithoutXnaGraphicsDevice();
     }
 }
示例#11
0
        public XnaImage(string contentName, XnaDrawing drawing, XnaDevice device)
            : base(contentName, drawing)
        {
            nativeDevice = device.NativeDevice;
            if (nativeDevice == null || device.NativeContent == null)
                throw new UnableToContinueWithoutXnaGraphicsDevice();

            TryLoadImageData(contentName, device.NativeContent);
        }
示例#12
0
 public VideoImage(XnaDevice graphicsDevice)
     : base(new ImageCreationData(new Size(4, 4)))
 {
     nativeDevice = graphicsDevice.NativeDevice;
     if (nativeDevice == null || graphicsDevice.NativeContent == null)
     {
         throw new UnableToContinueWithoutXnaGraphicsDevice();
     }
     NativeTexture = new Texture2D(nativeDevice, (int)PixelSize.Width, (int)PixelSize.Height);
 }
示例#13
0
		protected XnaImage(XnaDevice device, Texture2D nativeTexture)
			: base("<NativeImage>")
		{
			nativeDevice = device.NativeDevice;
			NativeTexture = nativeTexture;
		}
示例#14
0
 private XnaShader(ShaderWithFormatCreationData creationData, XnaDevice device)
     : this((ShaderCreationData)creationData, device)
 {
 }
示例#15
0
 private XnaShader(ShaderCreationData creationData, XnaDevice device)
     : base(creationData)
 {
     this.device = device;
     TryCreateShader();
 }
示例#16
0
 public XnaDrawing(XnaDevice device)
     : base(device)
 {
     this.device = device;
 }
示例#17
0
		private XnaShader(ShaderCreationData creationData, XnaDevice device)
			: base(creationData)
		{
			this.device = device;
		}
示例#18
0
		public XnaShader(string contentName, XnaDevice device)
			: base(contentName)
		{
			this.device = device;
		}
示例#19
0
 public XnaDrawing(XnaDevice device)
     : base(device)
 {
     this.device = device;
 }
示例#20
0
 protected XnaImage(XnaDevice device, Texture2D nativeTexture)
     : base("<NativeImage>")
 {
     nativeDevice  = device.NativeDevice;
     NativeTexture = nativeTexture;
 }
		private XnaShader(ShaderWithFormatCreationData creationData, XnaDevice device)
			: this((ShaderCreationData)creationData, device) {}