public void Initialise(CVImageAttributes attributes)
        {
            FImageAttributes = attributes;

            InitialiseBack();
            InitialiseFrontFromBack();
        }
Пример #2
0
 public override void OnImageAttributesUpdate(CVImageAttributes attributes)
 {
     if (ImageAttributesUpdate == null)
     {
         return;
     }
     ImageAttributesUpdate(this, new ImageAttributesChangedEventArgs(attributes));
 }
Пример #3
0
 protected void OnImageAttributesUpdate(CVImageAttributes attributes)
 {
     if (ImageAttributesUpdate == null)
     {
         return;
     }
     ImageAttributesUpdate(this, new ImageAttributesChangedEventArgs(attributes));
 }
        void InitialiseFrontFromBack()
        {
            lock (FBackLock)
                lock (FAttributesLock)
                {
                    FImageAttributes = FBackBuffer.ImageAttributes;

                    FFrontLock.AcquireWriterLock(LockTimeout);
                    try
                    {
                        FFrontBuffer.SetImage(FBackBuffer);
                    }
                    finally
                    {
                        FFrontLock.ReleaseWriterLock();
                    }
                }

            OnImageAttributesUpdate(FImageAttributes);
        }
Пример #5
0
        public static Texture CreateTexture(CVImageAttributes attributes, Device device)
        {
            var          format = attributes.ColorFormat;
            TColorFormat newFormat;
            var          useConverted = NeedsConversion(format, out newFormat);


            var ex    = device is DeviceEx;
            var pool  = ex ? Pool.Default : Pool.Managed;
            var usage = (ex ? Usage.Dynamic : Usage.None) & ~Usage.AutoGenerateMipMap;

            try
            {
                return(new Texture(device, Math.Max(attributes.Width, 1), Math.Max(attributes.Height, 1), 1, usage, GetDXFormat(useConverted ? newFormat : format), pool));
            }
            catch (Exception e)
            {
                Log(e);
                return(new Texture(device, 1, 1, 1, usage, Format.X8R8G8B8, Pool.Managed));
            }
        }
 public virtual void OnImageAttributesUpdate(CVImageAttributes attributes)
 {
 }
Пример #7
0
		protected void OnImageAttributesUpdate(CVImageAttributes attributes)
		{
			if (ImageAttributesUpdate == null)
				return;
			ImageAttributesUpdate(this, new ImageAttributesChangedEventArgs(attributes));
		}
Пример #8
0
 public ImageAttributesChangedEventArgs(CVImageAttributes attributes)
 {
     this.Attributes = attributes;
 }
Пример #9
0
 public void Initialise(CVImageAttributes attributes)
 {
     Initialise(attributes.Size, attributes.ColorFormat);
 }
		public virtual void OnImageAttributesUpdate(CVImageAttributes attributes) { }
		void InitialiseFrontFromBack()
		{
			lock (FBackLock)
				lock (FAttributesLock)
				{
					FImageAttributes = FBackBuffer.ImageAttributes;

					FFrontLock.AcquireWriterLock(LockTimeout);
					try
					{
						FFrontBuffer.SetImage(FBackBuffer);
					}
					finally
					{
						FFrontLock.ReleaseWriterLock();
					}
				}

			OnImageAttributesUpdate(FImageAttributes);
		}
		public void Initialise(CVImageAttributes attributes)
		{
			FImageAttributes = attributes;

			InitialiseBack();
			InitialiseFrontFromBack();
		}
Пример #13
0
		public void Initialise(CVImageAttributes attributes)
		{
			Initialise(attributes.Size, attributes.ColorFormat);
		}
Пример #14
0
		public override void OnImageAttributesUpdate(CVImageAttributes attributes)
		{
			if (ImageAttributesUpdate == null)
				return;
			ImageAttributesUpdate(this, new ImageAttributesChangedEventArgs(attributes));
		}
Пример #15
0
		public ImageAttributesChangedEventArgs(CVImageAttributes attributes)
		{
			this.Attributes = attributes;
		}
		public static Texture CreateTexture(CVImageAttributes attributes, Device device)
		{ 
			TColorFormat format = attributes.ColorFormat;
			TColorFormat newFormat;
			bool useConverted = NeedsConversion(format, out newFormat);


			bool ex = device is DeviceEx;
			var pool = ex ? Pool.Default : Pool.Managed;
			var usage = (ex ? Usage.Dynamic : Usage.None) & ~Usage.AutoGenerateMipMap;

			try
			{
				return new Texture(device, Math.Max(attributes.Width, 1), Math.Max(attributes.Height, 1), 1, usage, GetDXFormat(useConverted ? newFormat : format), pool);
			}
			catch (Exception e)
			{
				ImageUtils.Log(e);
                return new Texture(device, 1, 1, 1, usage, Format.X8R8G8B8, Pool.Managed);
			}
		}
Пример #17
0
		void UpdateAttributes(CVImageAttributes attributes)
		{
			FImage.Initialise(attributes);
		}