public void Initialise(CVImageAttributes attributes) { FImageAttributes = attributes; InitialiseBack(); InitialiseFrontFromBack(); }
public override void OnImageAttributesUpdate(CVImageAttributes attributes) { if (ImageAttributesUpdate == null) { return; } ImageAttributesUpdate(this, new ImageAttributesChangedEventArgs(attributes)); }
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); }
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) { }
protected void OnImageAttributesUpdate(CVImageAttributes attributes) { if (ImageAttributesUpdate == null) return; ImageAttributesUpdate(this, new ImageAttributesChangedEventArgs(attributes)); }
public ImageAttributesChangedEventArgs(CVImageAttributes attributes) { this.Attributes = attributes; }
public void Initialise(CVImageAttributes attributes) { Initialise(attributes.Size, attributes.ColorFormat); }
public override void OnImageAttributesUpdate(CVImageAttributes attributes) { if (ImageAttributesUpdate == null) return; ImageAttributesUpdate(this, new ImageAttributesChangedEventArgs(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); } }
void UpdateAttributes(CVImageAttributes attributes) { FImage.Initialise(attributes); }