protected Composition(Context context, Texture texture, Depth depth, FrameBuffer frameBuffer) : base(context) { this.Size = texture.Size; this.Type = texture.Type; this.Texture = texture; this.Depth = depth; this.FrameBuffer = frameBuffer; this.Create(); this.Texture.Composition = this; this.Renderer = this.CreateRenderer(this.Context, () => this.Size, () => this.Type); }
protected Composition(Composition original) : base(original) { this.Size = original.Size; this.Type = original.Type; this.Texture = original.Texture.Refurbish(); this.Texture.Composition = this; original.Texture.Composition = null; original.Texture = null; this.Depth = original.Depth.Refurbish(); original.Depth = null; this.FrameBuffer = original.FrameBuffer.Refurbish(); original.FrameBuffer = null; this.Renderer = original.Renderer.Refurbish(); original.Renderer = null; }
protected FrameBuffer(FrameBuffer original) : base(original) { this.Identifier = original.Identifier; original.Identifier = 0; }
internal void Delete(FrameBuffer frameBuffer) { this.frameBufferBin.Add(frameBuffer); }
protected override void Dispose(bool disposing) { if (this.Texture.NotNull() && this.Texture.Identifier != 0 && this.Depth.NotNull() && this.Depth.Identifier != 0 && this.FrameBuffer.NotNull() && this.FrameBuffer.Identifier != 0) this.Context.Recycle(this); else { if (this.Texture.NotNull()) { this.Texture.Composition = null; this.Context.Delete(this.Texture); this.Texture = null; } if (this.Depth.NotNull()) { this.Context.Delete(this.Depth); this.Depth = null; } if (this.FrameBuffer.NotNull()) { this.Context.Delete(this.FrameBuffer); this.FrameBuffer = null; } } }
protected internal override void Delete() { if (this.Renderer.NotNull()) this.Renderer = null; if (this.Texture.NotNull()) { this.Texture.Composition = null; this.Texture.Delete(); this.Texture = null; } if (this.Depth.NotNull()) { this.Depth.Delete(); this.Depth = null; } if (this.FrameBuffer.NotNull()) { this.FrameBuffer.Delete(); this.FrameBuffer = null; } }