static DepthStencilState() { #if !PORTABLE _default = new Utilities.ObjectFactoryWithReset <DepthStencilState>(() => new DepthStencilState { Name = "DepthStencilState.Default", DepthBufferEnable = true, DepthBufferWriteEnable = true }); _depthRead = new Utilities.ObjectFactoryWithReset <DepthStencilState>(() => new DepthStencilState { Name = "DepthStencilState.DepthRead", DepthBufferEnable = true, DepthBufferWriteEnable = false }); _none = new Utilities.ObjectFactoryWithReset <DepthStencilState>(() => new DepthStencilState { Name = "DepthStencilState.None", DepthBufferEnable = false, DepthBufferWriteEnable = false }); #endif }
static SamplerState() { _anisotropicClamp = new Utilities.ObjectFactoryWithReset <SamplerState>(() => new SamplerState { Name = "SamplerState.AnisotropicClamp", Filter = TextureFilter.Anisotropic, AddressU = TextureAddressMode.Clamp, AddressV = TextureAddressMode.Clamp, AddressW = TextureAddressMode.Clamp, }); _anisotropicWrap = new Utilities.ObjectFactoryWithReset <SamplerState>(() => new SamplerState { Name = "SamplerState.AnisotropicWrap", Filter = TextureFilter.Anisotropic, AddressU = TextureAddressMode.Wrap, AddressV = TextureAddressMode.Wrap, AddressW = TextureAddressMode.Wrap, }); _linearClamp = new Utilities.ObjectFactoryWithReset <SamplerState>(() => new SamplerState { Name = "SamplerState.LinearClamp", Filter = TextureFilter.Linear, AddressU = TextureAddressMode.Clamp, AddressV = TextureAddressMode.Clamp, AddressW = TextureAddressMode.Clamp, }); _linearWrap = new Utilities.ObjectFactoryWithReset <SamplerState>(() => new SamplerState { Name = "SamplerState.LinearWrap", Filter = TextureFilter.Linear, AddressU = TextureAddressMode.Wrap, AddressV = TextureAddressMode.Wrap, AddressW = TextureAddressMode.Wrap, }); _pointClamp = new Utilities.ObjectFactoryWithReset <SamplerState>(() => new SamplerState { Name = "SamplerState.PointClamp", Filter = TextureFilter.Point, AddressU = TextureAddressMode.Clamp, AddressV = TextureAddressMode.Clamp, AddressW = TextureAddressMode.Clamp, }); _pointWrap = new Utilities.ObjectFactoryWithReset <SamplerState>(() => new SamplerState { Name = "SamplerState.PointWrap", Filter = TextureFilter.Point, AddressU = TextureAddressMode.Wrap, AddressV = TextureAddressMode.Wrap, AddressW = TextureAddressMode.Wrap, }); }
static SamplerState () { _anisotropicClamp = new Utilities.ObjectFactoryWithReset<SamplerState>(() => new SamplerState { Name = "SamplerState.AnisotropicClamp", Filter = TextureFilter.Anisotropic, AddressU = TextureAddressMode.Clamp, AddressV = TextureAddressMode.Clamp, AddressW = TextureAddressMode.Clamp, }); _anisotropicWrap = new Utilities.ObjectFactoryWithReset<SamplerState>(() => new SamplerState { Name = "SamplerState.AnisotropicWrap", Filter = TextureFilter.Anisotropic, AddressU = TextureAddressMode.Wrap, AddressV = TextureAddressMode.Wrap, AddressW = TextureAddressMode.Wrap, }); _linearClamp = new Utilities.ObjectFactoryWithReset<SamplerState>(() => new SamplerState { Name = "SamplerState.LinearClamp", Filter = TextureFilter.Linear, AddressU = TextureAddressMode.Clamp, AddressV = TextureAddressMode.Clamp, AddressW = TextureAddressMode.Clamp, }); _linearWrap = new Utilities.ObjectFactoryWithReset<SamplerState>(() => new SamplerState { Name = "SamplerState.LinearWrap", Filter = TextureFilter.Linear, AddressU = TextureAddressMode.Wrap, AddressV = TextureAddressMode.Wrap, AddressW = TextureAddressMode.Wrap, }); _pointClamp = new Utilities.ObjectFactoryWithReset<SamplerState>(() => new SamplerState { Name = "SamplerState.PointClamp", Filter = TextureFilter.Point, AddressU = TextureAddressMode.Clamp, AddressV = TextureAddressMode.Clamp, AddressW = TextureAddressMode.Clamp, }); _pointWrap = new Utilities.ObjectFactoryWithReset<SamplerState>(() => new SamplerState { Name = "SamplerState.PointWrap", Filter = TextureFilter.Point, AddressU = TextureAddressMode.Wrap, AddressV = TextureAddressMode.Wrap, AddressW = TextureAddressMode.Wrap, }); }
static RasterizerState () { _cullClockwise = new Utilities.ObjectFactoryWithReset<RasterizerState>(() => new RasterizerState { CullMode = CullMode.CullClockwiseFace }); _cullCounterClockwise = new Utilities.ObjectFactoryWithReset<RasterizerState>(() => new RasterizerState { CullMode = CullMode.CullCounterClockwiseFace }); _cullNone = new Utilities.ObjectFactoryWithReset<RasterizerState>(() => new RasterizerState { CullMode = CullMode.None }); }
static RasterizerState() { _cullClockwise = new Utilities.ObjectFactoryWithReset <RasterizerState>(() => new RasterizerState { Name = "RasterizerState.CullClockwise", CullMode = CullMode.CullClockwiseFace }); _cullCounterClockwise = new Utilities.ObjectFactoryWithReset <RasterizerState>(() => new RasterizerState { Name = "RasterizerState.CullCounterClockwise", CullMode = CullMode.CullCounterClockwiseFace }); _cullNone = new Utilities.ObjectFactoryWithReset <RasterizerState>(() => new RasterizerState { Name = "RasterizerState.CullNone", CullMode = CullMode.None }); }
static BlendState() { _additive = new Utilities.ObjectFactoryWithReset <BlendState>(() => new BlendState { Name = "BlendState.Additive", ColorSourceBlend = Blend.SourceAlpha, AlphaSourceBlend = Blend.SourceAlpha, ColorDestinationBlend = Blend.One, AlphaDestinationBlend = Blend.One }); _alphaBlend = new Utilities.ObjectFactoryWithReset <BlendState>(() => new BlendState() { Name = "BlendState.AlphaBlend", ColorSourceBlend = Blend.One, AlphaSourceBlend = Blend.One, ColorDestinationBlend = Blend.InverseSourceAlpha, AlphaDestinationBlend = Blend.InverseSourceAlpha }); _nonPremultiplied = new Utilities.ObjectFactoryWithReset <BlendState>(() => new BlendState() { Name = "BlendState.NonPremultiplied", ColorSourceBlend = Blend.SourceAlpha, AlphaSourceBlend = Blend.SourceAlpha, ColorDestinationBlend = Blend.InverseSourceAlpha, AlphaDestinationBlend = Blend.InverseSourceAlpha }); _opaque = new Utilities.ObjectFactoryWithReset <BlendState>(() => new BlendState() { Name = "BlendState.Opaque", ColorSourceBlend = Blend.One, AlphaSourceBlend = Blend.One, ColorDestinationBlend = Blend.Zero, AlphaDestinationBlend = Blend.Zero }); }
static DepthStencilState () { _default = new Utilities.ObjectFactoryWithReset<DepthStencilState>(() => new DepthStencilState { Name = "DepthStencilState.Default", DepthBufferEnable = true, DepthBufferWriteEnable = true }); _depthRead = new Utilities.ObjectFactoryWithReset<DepthStencilState>(() => new DepthStencilState { Name = "DepthStencilState.DepthRead", DepthBufferEnable = true, DepthBufferWriteEnable = false }); _none = new Utilities.ObjectFactoryWithReset<DepthStencilState>(() => new DepthStencilState { Name = "DepthStencilState.None", DepthBufferEnable = false, DepthBufferWriteEnable = false }); }
static BlendState() { _additive = new Utilities.ObjectFactoryWithReset<BlendState>(() => new BlendState { ColorSourceBlend = Blend.SourceAlpha, AlphaSourceBlend = Blend.SourceAlpha, ColorDestinationBlend = Blend.One, AlphaDestinationBlend = Blend.One }); _alphaBlend = new Utilities.ObjectFactoryWithReset<BlendState>(() => new BlendState() { ColorSourceBlend = Blend.One, AlphaSourceBlend = Blend.One, ColorDestinationBlend = Blend.InverseSourceAlpha, AlphaDestinationBlend = Blend.InverseSourceAlpha }); _nonPremultiplied = new Utilities.ObjectFactoryWithReset<BlendState>(() => new BlendState() { ColorSourceBlend = Blend.SourceAlpha, AlphaSourceBlend = Blend.SourceAlpha, ColorDestinationBlend = Blend.InverseSourceAlpha, AlphaDestinationBlend = Blend.InverseSourceAlpha }); _opaque = new Utilities.ObjectFactoryWithReset<BlendState>(() => new BlendState() { ColorSourceBlend = Blend.One, AlphaSourceBlend = Blend.One, ColorDestinationBlend = Blend.Zero, AlphaDestinationBlend = Blend.Zero }); }
static SamplerState () { #if OPENGL #if GLES if (GraphicsCapabilities.SupportsTextureFilterAnisotropic) { GL.GetFloat(GetPNameMaxTextureMaxAnisotropy, ref SamplerState.MaxTextureMaxAnisotropy); } #else GL.GetFloat(GetPNameMaxTextureMaxAnisotropy, out SamplerState.MaxTextureMaxAnisotropy); #endif GraphicsExtensions.CheckGLError(); #endif _anisotropicClamp = new Utilities.ObjectFactoryWithReset<SamplerState>(() => new SamplerState { Name = "SamplerState.AnisotropicClamp", Filter = TextureFilter.Anisotropic, AddressU = TextureAddressMode.Clamp, AddressV = TextureAddressMode.Clamp, AddressW = TextureAddressMode.Clamp, }); _anisotropicWrap = new Utilities.ObjectFactoryWithReset<SamplerState>(() => new SamplerState { Name = "SamplerState.AnisotropicWrap", Filter = TextureFilter.Anisotropic, AddressU = TextureAddressMode.Wrap, AddressV = TextureAddressMode.Wrap, AddressW = TextureAddressMode.Wrap, }); _linearClamp = new Utilities.ObjectFactoryWithReset<SamplerState>(() => new SamplerState { Name = "SamplerState.LinearClamp", Filter = TextureFilter.Linear, AddressU = TextureAddressMode.Clamp, AddressV = TextureAddressMode.Clamp, AddressW = TextureAddressMode.Clamp, }); _linearWrap = new Utilities.ObjectFactoryWithReset<SamplerState>(() => new SamplerState { Name = "SamplerState.LinearWrap", Filter = TextureFilter.Linear, AddressU = TextureAddressMode.Wrap, AddressV = TextureAddressMode.Wrap, AddressW = TextureAddressMode.Wrap, }); _pointClamp = new Utilities.ObjectFactoryWithReset<SamplerState>(() => new SamplerState { Name = "SamplerState.PointClamp", Filter = TextureFilter.Point, AddressU = TextureAddressMode.Clamp, AddressV = TextureAddressMode.Clamp, AddressW = TextureAddressMode.Clamp, }); _pointWrap = new Utilities.ObjectFactoryWithReset<SamplerState>(() => new SamplerState { Name = "SamplerState.PointWrap", Filter = TextureFilter.Point, AddressU = TextureAddressMode.Wrap, AddressV = TextureAddressMode.Wrap, AddressW = TextureAddressMode.Wrap, }); }
static SamplerState() { #if OPENGL #if GLES if (GraphicsCapabilities.SupportsTextureFilterAnisotropic) { GL.GetFloat(GetPNameMaxTextureMaxAnisotropy, ref SamplerState.MaxTextureMaxAnisotropy); } #else GL.GetFloat(GetPNameMaxTextureMaxAnisotropy, out SamplerState.MaxTextureMaxAnisotropy); #endif GraphicsExtensions.CheckGLError(); #endif _anisotropicClamp = new Utilities.ObjectFactoryWithReset <SamplerState>(() => new SamplerState { Name = "SamplerState.AnisotropicClamp", Filter = TextureFilter.Anisotropic, AddressU = TextureAddressMode.Clamp, AddressV = TextureAddressMode.Clamp, AddressW = TextureAddressMode.Clamp, }); _anisotropicWrap = new Utilities.ObjectFactoryWithReset <SamplerState>(() => new SamplerState { Name = "SamplerState.AnisotropicWrap", Filter = TextureFilter.Anisotropic, AddressU = TextureAddressMode.Wrap, AddressV = TextureAddressMode.Wrap, AddressW = TextureAddressMode.Wrap, }); _linearClamp = new Utilities.ObjectFactoryWithReset <SamplerState>(() => new SamplerState { Name = "SamplerState.LinearClamp", Filter = TextureFilter.Linear, AddressU = TextureAddressMode.Clamp, AddressV = TextureAddressMode.Clamp, AddressW = TextureAddressMode.Clamp, }); _linearWrap = new Utilities.ObjectFactoryWithReset <SamplerState>(() => new SamplerState { Name = "SamplerState.LinearWrap", Filter = TextureFilter.Linear, AddressU = TextureAddressMode.Wrap, AddressV = TextureAddressMode.Wrap, AddressW = TextureAddressMode.Wrap, }); _pointClamp = new Utilities.ObjectFactoryWithReset <SamplerState>(() => new SamplerState { Name = "SamplerState.PointClamp", Filter = TextureFilter.Point, AddressU = TextureAddressMode.Clamp, AddressV = TextureAddressMode.Clamp, AddressW = TextureAddressMode.Clamp, }); _pointWrap = new Utilities.ObjectFactoryWithReset <SamplerState>(() => new SamplerState { Name = "SamplerState.PointWrap", Filter = TextureFilter.Point, AddressU = TextureAddressMode.Wrap, AddressV = TextureAddressMode.Wrap, AddressW = TextureAddressMode.Wrap, }); }