/// <summary> /// Registers <see cref="dotTraceProfiler"/> as the profiler for the current Ultraviolet context. /// </summary> /// <param name="owner">The Ultraviolet context with which to register the profiler.</param> /// <param name="factory">The Ultraviolet factory for the Ultraviolet context.</param> /// <remarks>This method must be called during the application's initialization phase, before any /// of the static methods on <see cref="UltravioletProfiler"/> have been invoked.</remarks> public static void RegisterProfiler(UltravioletContext owner, UltravioletFactory factory) { Contract.Require(owner, "owner"); Contract.Require(factory, "factory"); factory.RemoveFactoryMethod<UltravioletProfilerFactory>(); factory.SetFactoryMethod<UltravioletProfilerFactory>(uv => new dotTraceProfiler(uv)); }
/// <summary> /// Initializes the specified factory. /// </summary> /// <param name="owner">The Ultraviolet context that owns the initializer.</param> /// <param name="factory">The <see cref="UltravioletFactory"/> to initialize.</param> public void Initialize(UltravioletContext owner, UltravioletFactory factory) { factory.SetFactoryMethod<SurfaceSourceFactory>((stream) => new DesktopSurfaceSource(stream)); factory.SetFactoryMethod<SurfaceSaverFactory>(() => new DesktopSurfaceSaver()); factory.SetFactoryMethod<IconLoaderFactory>(() => new DesktopIconLoader()); factory.SetFactoryMethod<FileSystemServiceFactory>(() => new FileSystemService()); factory.SetFactoryMethod<ScreenRotationServiceFactory>((display) => new DesktopScreenOrientationService(display)); factory.SetFactoryMethod<ScreenDensityServiceFactory>((display) => new DesktopScreenDensityService(owner, display)); var softwareKeyboardService = new DesktopSoftwareKeyboardService(); factory.SetFactoryMethod<SoftwareKeyboardServiceFactory>(() => softwareKeyboardService); }
/// <inheritdoc/> public void Initialize(UltravioletContext owner, UltravioletFactory factory) { MonoMac.AppKit.NSApplication.Init(); factory.RemoveFactoryMethod<SurfaceSourceFactory>(); factory.RemoveFactoryMethod<SurfaceSaverFactory>(); factory.RemoveFactoryMethod<IconLoaderFactory>(); factory.RemoveFactoryMethod<ScreenDensityServiceFactory>(); factory.SetFactoryMethod<SurfaceSourceFactory>((stream) => new OSXSurfaceSource(stream)); factory.SetFactoryMethod<SurfaceSaverFactory>(() => new OSXSurfaceSaver()); factory.SetFactoryMethod<IconLoaderFactory>(() => new OSXIconLoader()); factory.SetFactoryMethod<ScreenDensityServiceFactory>((display) => new OSXScreenDensityService(display)); }
/// <summary> /// Registers <see cref="dotTraceProfiler"/> as the profiler for the current Ultraviolet context. /// </summary> /// <param name="owner">The Ultraviolet context with which to register the profiler.</param> /// <param name="factory">The Ultraviolet factory for the Ultraviolet context.</param> /// <remarks>This method must be called during the application's initialization phase, before any /// of the static methods on <see cref="UltravioletProfiler"/> have been invoked.</remarks> public static void RegisterProfiler(UltravioletContext owner, UltravioletFactory factory) { }
/// <summary> /// Initializes the specified factory. /// </summary> /// <param name="owner">The Ultraviolet context that owns the initializer.</param> /// <param name="factory">The <see cref="UltravioletFactory"/> to initialize.</param> public void Initialize(UltravioletContext owner, UltravioletFactory factory) { factory.SetFactoryMethod(owner.IsRunningInServiceMode ? new SpriteBatchFactory((uv) => null) : new SpriteBatchFactory((uv) => new SpriteBatch(uv))); }
/// <inheritdoc/> public void Initialize(UltravioletContext owner, UltravioletFactory factory) { }
/// <inheritdoc/> public void Initialize(UltravioletContext owner, UltravioletFactory factory) { factory.SetFactoryMethod <SongPlayerFactory>((uv) => new FMODSongPlayer(uv)); factory.SetFactoryMethod <SoundEffectPlayerFactory>((uv) => new FMODSoundEffectPlayer(uv)); }
/// <inheritdoc/> public void Initialize(UltravioletContext owner, UltravioletFactory factory) { InitializeProfilingFactoryMethods(owner, factory); }
/// <inheritdoc/> public void Initialize(UltravioletContext owner, UltravioletFactory factory) { factory.SetFactoryMethod <UIViewProviderInitializerFactory>(() => new PresentationFoundationInitializer()); factory.SetFactoryMethod <UIViewFactory>((uv, uiPanel, uiPanelDefinition, vmfactory) => PresentationFoundationView.Load(uv, uiPanel, uiPanelDefinition, vmfactory)); factory.SetFactoryMethod <MessageBoxScreenFactory>((mb, mbowner) => new MessageBoxScreen(mb, mbowner.GlobalContent)); }
/// <inheritdoc/> public void Initialize(UltravioletContext owner, UltravioletFactory factory) { factory.SetFactoryMethod<UIViewProviderInitializerFactory>(() => new PresentationFoundationInitializer()); factory.SetFactoryMethod<UIViewFactory>((uv, uiPanel, uiPanelDefinition, vmfactory) => PresentationFoundationView.Load(uv, uiPanel, uiPanelDefinition, vmfactory)); factory.SetFactoryMethod<MessageBoxScreenFactory>((mb, mbowner) => new MessageBoxScreen(mb, mbowner.GlobalContent)); }
/// <inheritdoc/> public void Initialize(UltravioletContext owner, UltravioletFactory factory) { factory.SetFactoryMethod <FMODPlatformSpecificImplementationDetailsFactory>((uv) => new FMODAndroidSpecificImplementationDetails()); }
/// <summary> /// Initializes the specified factory. /// </summary> /// <param name="owner">The Ultraviolet context that owns the initializer.</param> /// <param name="factory">The factory to initialize.</param> public void Initialize(UltravioletContext owner, UltravioletFactory factory) { factory.SetFactoryMethod<SongPlayerFactory>((uv) => new BASSSongPlayer(uv)); factory.SetFactoryMethod<SoundEffectPlayerFactory>((uv) => new BASSSoundEffectPlayer(uv)); }
/// <summary> /// Initializes the specified factory. /// </summary> /// <param name="owner">The Ultraviolet context that owns the initializer.</param> /// <param name="factory">The factory to initialize.</param> public void Initialize(UltravioletContext owner, UltravioletFactory factory) { // Core classes factory.SetFactoryMethod <CursorFactory>((uv, surface, hx, hv) => new OpenGLCursor(uv, surface, hx, hv)); factory.SetFactoryMethod <GeometryStreamFactory>((uv) => new OpenGLGeometryStream(uv)); factory.SetFactoryMethod <VertexBufferFactory>((uv, vdecl, vcount) => new OpenGLVertexBuffer(uv, vdecl, vcount, gl.GL_STATIC_DRAW)); factory.SetFactoryMethod <IndexBufferFactory>((uv, itype, icount) => new OpenGLIndexBuffer(uv, itype, icount, gl.GL_STATIC_DRAW)); factory.SetFactoryMethod <DynamicVertexBufferFactory>((uv, vdecl, vcount) => new OpenGLVertexBuffer(uv, vdecl, vcount, gl.GL_DYNAMIC_DRAW)); factory.SetFactoryMethod <DynamicIndexBufferFactory>((uv, itype, icount) => new OpenGLIndexBuffer(uv, itype, icount, gl.GL_DYNAMIC_DRAW)); factory.SetFactoryMethod <Surface2DFactory>((uv, width, height) => new OpenGLSurface2D(uv, width, height)); factory.SetFactoryMethod <Surface2DFromSourceFactory>((uv, source) => new OpenGLSurface2D(uv, source)); factory.SetFactoryMethod <Texture2DFactory>((uv, width, height, immutable) => new OpenGLTexture2D(uv, width, height, immutable)); factory.SetFactoryMethod <RenderTarget2DFactory>((uv, width, height, usage) => new OpenGLRenderTarget2D(uv, width, height, usage)); factory.SetFactoryMethod <RenderBuffer2DFactory>((uv, format, width, height, options) => new OpenGLRenderBuffer2D(uv, format, width, height, options)); // Core effects factory.SetFactoryMethod <BasicEffectFactory>((uv) => new OpenGLBasicEffect(uv)); factory.SetFactoryMethod <SpriteBatchEffectFactory>((uv) => new OpenGLSpriteBatchEffect(uv)); factory.SetFactoryMethod <BlurEffectFactory>((uv) => new OpenGLBlurEffect(uv)); // BlendState var blendStateOpaque = OpenGLBlendState.CreateOpaque(owner); var blendStateAlphaBlend = OpenGLBlendState.CreateAlphaBlend(owner); var blendStateAdditive = OpenGLBlendState.CreateAdditive(owner); var blendStateNonPremultiplied = OpenGLBlendState.CreateNonPremultiplied(owner); factory.SetFactoryMethod <BlendStateFactory>((uv) => new OpenGLBlendState(uv)); factory.SetFactoryMethod <BlendStateFactory>("Opaque", (uv) => blendStateOpaque); factory.SetFactoryMethod <BlendStateFactory>("AlphaBlend", (uv) => blendStateAlphaBlend); factory.SetFactoryMethod <BlendStateFactory>("Additive", (uv) => blendStateAdditive); factory.SetFactoryMethod <BlendStateFactory>("NonPremultiplied", (uv) => blendStateNonPremultiplied); // DepthStencilState var depthStencilStateDefault = OpenGLDepthStencilState.CreateDefault(owner); var depthStencilStateDepthRead = OpenGLDepthStencilState.CreateDepthRead(owner); var depthStencilStateNone = OpenGLDepthStencilState.CreateNone(owner); factory.SetFactoryMethod <DepthStencilStateFactory>((uv) => new OpenGLDepthStencilState(uv)); factory.SetFactoryMethod <DepthStencilStateFactory>("Default", (uv) => depthStencilStateDefault); factory.SetFactoryMethod <DepthStencilStateFactory>("DepthRead", (uv) => depthStencilStateDepthRead); factory.SetFactoryMethod <DepthStencilStateFactory>("None", (uv) => depthStencilStateNone); // RasterizerState var rasterizerStateCullClockwise = OpenGLRasterizerState.CreateCullClockwise(owner); var rasterizerStateCullCounterClockwise = OpenGLRasterizerState.CreateCullCounterClockwise(owner); var rasterizerStateCullNone = OpenGLRasterizerState.CreateCullNone(owner); factory.SetFactoryMethod <RasterizerStateFactory>((uv) => new OpenGLRasterizerState(uv)); factory.SetFactoryMethod <RasterizerStateFactory>("CullClockwise", (uv) => rasterizerStateCullClockwise); factory.SetFactoryMethod <RasterizerStateFactory>("CullCounterClockwise", (uv) => rasterizerStateCullCounterClockwise); factory.SetFactoryMethod <RasterizerStateFactory>("CullNone", (uv) => rasterizerStateCullNone); // SamplerState var samplerStatePointClamp = OpenGLSamplerState.CreatePointClamp(owner); var samplerStatePointWrap = OpenGLSamplerState.CreatePointWrap(owner); var samplerStateLinearClamp = OpenGLSamplerState.CreateLinearClamp(owner); var samplerStateLinearWrap = OpenGLSamplerState.CreateLinearWrap(owner); var samplerStateAnisotropicClamp = OpenGLSamplerState.CreateAnisotropicClamp(owner); var samplerStateAnisotropicWrap = OpenGLSamplerState.CreateAnisotropicWrap(owner); factory.SetFactoryMethod <SamplerStateFactory>((uv) => new OpenGLSamplerState(uv)); factory.SetFactoryMethod <SamplerStateFactory>("PointClamp", (uv) => samplerStatePointClamp); factory.SetFactoryMethod <SamplerStateFactory>("PointWrap", (uv) => samplerStatePointWrap); factory.SetFactoryMethod <SamplerStateFactory>("LinearClamp", (uv) => samplerStateLinearClamp); factory.SetFactoryMethod <SamplerStateFactory>("LinearWrap", (uv) => samplerStateLinearWrap); factory.SetFactoryMethod <SamplerStateFactory>("AnisotropicClamp", (uv) => samplerStateAnisotropicClamp); factory.SetFactoryMethod <SamplerStateFactory>("AnisotropicWrap", (uv) => samplerStateAnisotropicWrap); // Platform services var powerManagementService = new SDL2PowerManagementService(); factory.SetFactoryMethod <PowerManagementServiceFactory>(() => powerManagementService); }
/// <inheritdoc/> public void Initialize(UltravioletContext owner, UltravioletFactory factory) { // Core classes factory.SetFactoryMethod<CursorFactory>((uv, surface, hx, hv) => new OpenGLCursor(uv, surface, hx, hv)); factory.SetFactoryMethod<GeometryStreamFactory>((uv) => new OpenGLGeometryStream(uv)); factory.SetFactoryMethod<VertexBufferFactory>((uv, vdecl, vcount) => new OpenGLVertexBuffer(uv, vdecl, vcount, gl.GL_STATIC_DRAW)); factory.SetFactoryMethod<IndexBufferFactory>((uv, itype, icount) => new OpenGLIndexBuffer(uv, itype, icount, gl.GL_STATIC_DRAW)); factory.SetFactoryMethod<DynamicVertexBufferFactory>((uv, vdecl, vcount) => new OpenGLVertexBuffer(uv, vdecl, vcount, gl.GL_DYNAMIC_DRAW)); factory.SetFactoryMethod<DynamicIndexBufferFactory>((uv, itype, icount) => new OpenGLIndexBuffer(uv, itype, icount, gl.GL_DYNAMIC_DRAW)); factory.SetFactoryMethod<Surface2DFactory>((uv, width, height) => new OpenGLSurface2D(uv, width, height)); factory.SetFactoryMethod<Surface2DFromSourceFactory>((uv, source) => new OpenGLSurface2D(uv, source)); factory.SetFactoryMethod<Texture2DFactory>((uv, width, height, immutable) => new OpenGLTexture2D(uv, width, height, immutable)); factory.SetFactoryMethod<RenderTarget2DFactory>((uv, width, height, usage) => new OpenGLRenderTarget2D(uv, width, height, usage)); factory.SetFactoryMethod<RenderBuffer2DFactory>((uv, format, width, height, options) => new OpenGLRenderBuffer2D(uv, format, width, height, options)); // Core effects factory.SetFactoryMethod<BasicEffectFactory>((uv) => new OpenGLBasicEffect(uv)); factory.SetFactoryMethod<SpriteBatchEffectFactory>((uv) => new OpenGLSpriteBatchEffect(uv)); factory.SetFactoryMethod<BlurEffectFactory>((uv) => new OpenGLBlurEffect(uv)); // BlendState var blendStateOpaque = OpenGLBlendState.CreateOpaque(owner); var blendStateAlphaBlend = OpenGLBlendState.CreateAlphaBlend(owner); var blendStateAdditive = OpenGLBlendState.CreateAdditive(owner); var blendStateNonPremultiplied = OpenGLBlendState.CreateNonPremultiplied(owner); factory.SetFactoryMethod<BlendStateFactory>((uv) => new OpenGLBlendState(uv)); factory.SetFactoryMethod<BlendStateFactory>("Opaque", (uv) => blendStateOpaque); factory.SetFactoryMethod<BlendStateFactory>("AlphaBlend", (uv) => blendStateAlphaBlend); factory.SetFactoryMethod<BlendStateFactory>("Additive", (uv) => blendStateAdditive); factory.SetFactoryMethod<BlendStateFactory>("NonPremultiplied", (uv) => blendStateNonPremultiplied); // DepthStencilState var depthStencilStateDefault = OpenGLDepthStencilState.CreateDefault(owner); var depthStencilStateDepthRead = OpenGLDepthStencilState.CreateDepthRead(owner); var depthStencilStateNone = OpenGLDepthStencilState.CreateNone(owner); factory.SetFactoryMethod<DepthStencilStateFactory>((uv) => new OpenGLDepthStencilState(uv)); factory.SetFactoryMethod<DepthStencilStateFactory>("Default", (uv) => depthStencilStateDefault); factory.SetFactoryMethod<DepthStencilStateFactory>("DepthRead", (uv) => depthStencilStateDepthRead); factory.SetFactoryMethod<DepthStencilStateFactory>("None", (uv) => depthStencilStateNone); // RasterizerState var rasterizerStateCullClockwise = OpenGLRasterizerState.CreateCullClockwise(owner); var rasterizerStateCullCounterClockwise = OpenGLRasterizerState.CreateCullCounterClockwise(owner); var rasterizerStateCullNone = OpenGLRasterizerState.CreateCullNone(owner); factory.SetFactoryMethod<RasterizerStateFactory>((uv) => new OpenGLRasterizerState(uv)); factory.SetFactoryMethod<RasterizerStateFactory>("CullClockwise", (uv) => rasterizerStateCullClockwise); factory.SetFactoryMethod<RasterizerStateFactory>("CullCounterClockwise", (uv) => rasterizerStateCullCounterClockwise); factory.SetFactoryMethod<RasterizerStateFactory>("CullNone", (uv) => rasterizerStateCullNone); // SamplerState var samplerStatePointClamp = OpenGLSamplerState.CreatePointClamp(owner); var samplerStatePointWrap = OpenGLSamplerState.CreatePointWrap(owner); var samplerStateLinearClamp = OpenGLSamplerState.CreateLinearClamp(owner); var samplerStateLinearWrap = OpenGLSamplerState.CreateLinearWrap(owner); var samplerStateAnisotropicClamp = OpenGLSamplerState.CreateAnisotropicClamp(owner); var samplerStateAnisotropicWrap = OpenGLSamplerState.CreateAnisotropicWrap(owner); factory.SetFactoryMethod<SamplerStateFactory>((uv) => new OpenGLSamplerState(uv)); factory.SetFactoryMethod<SamplerStateFactory>("PointClamp", (uv) => samplerStatePointClamp); factory.SetFactoryMethod<SamplerStateFactory>("PointWrap", (uv) => samplerStatePointWrap); factory.SetFactoryMethod<SamplerStateFactory>("LinearClamp", (uv) => samplerStateLinearClamp); factory.SetFactoryMethod<SamplerStateFactory>("LinearWrap", (uv) => samplerStateLinearWrap); factory.SetFactoryMethod<SamplerStateFactory>("AnisotropicClamp", (uv) => samplerStateAnisotropicClamp); factory.SetFactoryMethod<SamplerStateFactory>("AnisotropicWrap", (uv) => samplerStateAnisotropicWrap); // Platform services var powerManagementService = new SDL2PowerManagementService(); factory.SetFactoryMethod<PowerManagementServiceFactory>(() => powerManagementService); }
private void InitializeProfilingFactoryMethods(UltravioletContext owner, UltravioletFactory factory) { // dotTraceProfiler.RegisterProfiler(owner, factory); }
/// <inheritdoc/> public void Initialize(UltravioletContext owner, UltravioletFactory factory) { factory.SetFactoryMethod <UIViewFactory>((uv, uiPanel, uiPanelDefinition, vmfactory) => ImGuiView.Create(uv, uiPanel, uiPanelDefinition, vmfactory)); }
/// <inheritdoc/> public void Initialize(UltravioletContext owner, UltravioletFactory factory) { // Core classes factory.SetFactoryMethod <GeometryStreamFactory>((uv) => new OpenGLGeometryStream(uv)); factory.SetFactoryMethod <VertexBufferFactory>((uv, vdecl, vcount) => new OpenGLVertexBuffer(uv, vdecl, vcount, gl.GL_STATIC_DRAW)); factory.SetFactoryMethod <IndexBufferFactory>((uv, itype, icount) => new OpenGLIndexBuffer(uv, itype, icount, gl.GL_STATIC_DRAW)); factory.SetFactoryMethod <DynamicVertexBufferFactory>((uv, vdecl, vcount) => new OpenGLVertexBuffer(uv, vdecl, vcount, gl.GL_DYNAMIC_DRAW)); factory.SetFactoryMethod <DynamicIndexBufferFactory>((uv, itype, icount) => new OpenGLIndexBuffer(uv, itype, icount, gl.GL_DYNAMIC_DRAW)); factory.SetFactoryMethod <Texture2DFromRawDataFactory>((uv, pixels, width, height, bytesPerPixel, srgb) => new OpenGLTexture2D(uv, pixels, width, height, bytesPerPixel, srgb)); factory.SetFactoryMethod <Texture2DFactory>((uv, width, height, options) => new OpenGLTexture2D(uv, width, height, options)); factory.SetFactoryMethod <Texture3DFromRawDataFactory>((uv, layers, width, height, bytesPerPixel, srgb) => new OpenGLTexture3D(uv, layers, width, height, bytesPerPixel, srgb)); factory.SetFactoryMethod <Texture3DFactory>((uv, width, height, depth, options) => new OpenGLTexture3D(uv, width, height, depth, options)); factory.SetFactoryMethod <RenderTarget2DFactory>((uv, width, height, usage) => new OpenGLRenderTarget2D(uv, width, height, usage)); factory.SetFactoryMethod <RenderBuffer2DFactory>((uv, format, width, height, options) => new OpenGLRenderBuffer2D(uv, format, width, height, options)); factory.SetFactoryMethod <DynamicTexture2DFactory>((uv, width, height, options, state, flushed) => new OpenGLDynamicTexture2D(uv, width, height, options, state, flushed)); factory.SetFactoryMethod <DynamicTexture3DFactory>((uv, width, height, depth, options, state, flushed) => new OpenGLDynamicTexture3D(uv, width, height, depth, options, state, flushed)); // Core effects factory.SetFactoryMethod <BasicEffectFactory>((uv) => new OpenGLBasicEffect(uv)); factory.SetFactoryMethod <SpriteBatchEffectFactory>((uv) => new OpenGLSpriteBatchEffect(uv)); factory.SetFactoryMethod <BlurEffectFactory>((uv) => new OpenGLBlurEffect(uv)); // BlendState var blendStateOpaque = OpenGLBlendState.CreateOpaque(owner); var blendStateAlphaBlend = OpenGLBlendState.CreateAlphaBlend(owner); var blendStateAdditive = OpenGLBlendState.CreateAdditive(owner); var blendStateNonPremultiplied = OpenGLBlendState.CreateNonPremultiplied(owner); factory.SetFactoryMethod <BlendStateFactory>((uv) => new OpenGLBlendState(uv)); factory.SetFactoryMethod <BlendStateFactory>("Opaque", (uv) => blendStateOpaque); factory.SetFactoryMethod <BlendStateFactory>("AlphaBlend", (uv) => blendStateAlphaBlend); factory.SetFactoryMethod <BlendStateFactory>("Additive", (uv) => blendStateAdditive); factory.SetFactoryMethod <BlendStateFactory>("NonPremultiplied", (uv) => blendStateNonPremultiplied); // DepthStencilState var depthStencilStateDefault = OpenGLDepthStencilState.CreateDefault(owner); var depthStencilStateDepthRead = OpenGLDepthStencilState.CreateDepthRead(owner); var depthStencilStateNone = OpenGLDepthStencilState.CreateNone(owner); factory.SetFactoryMethod <DepthStencilStateFactory>((uv) => new OpenGLDepthStencilState(uv)); factory.SetFactoryMethod <DepthStencilStateFactory>("Default", (uv) => depthStencilStateDefault); factory.SetFactoryMethod <DepthStencilStateFactory>("DepthRead", (uv) => depthStencilStateDepthRead); factory.SetFactoryMethod <DepthStencilStateFactory>("None", (uv) => depthStencilStateNone); // RasterizerState var rasterizerStateCullClockwise = OpenGLRasterizerState.CreateCullClockwise(owner); var rasterizerStateCullCounterClockwise = OpenGLRasterizerState.CreateCullCounterClockwise(owner); var rasterizerStateCullNone = OpenGLRasterizerState.CreateCullNone(owner); factory.SetFactoryMethod <RasterizerStateFactory>((uv) => new OpenGLRasterizerState(uv)); factory.SetFactoryMethod <RasterizerStateFactory>("CullClockwise", (uv) => rasterizerStateCullClockwise); factory.SetFactoryMethod <RasterizerStateFactory>("CullCounterClockwise", (uv) => rasterizerStateCullCounterClockwise); factory.SetFactoryMethod <RasterizerStateFactory>("CullNone", (uv) => rasterizerStateCullNone); // SamplerState var samplerStatePointClamp = OpenGLSamplerState.CreatePointClamp(owner); var samplerStatePointWrap = OpenGLSamplerState.CreatePointWrap(owner); var samplerStateLinearClamp = OpenGLSamplerState.CreateLinearClamp(owner); var samplerStateLinearWrap = OpenGLSamplerState.CreateLinearWrap(owner); var samplerStateAnisotropicClamp = OpenGLSamplerState.CreateAnisotropicClamp(owner); var samplerStateAnisotropicWrap = OpenGLSamplerState.CreateAnisotropicWrap(owner); factory.SetFactoryMethod <SamplerStateFactory>((uv) => new OpenGLSamplerState(uv)); factory.SetFactoryMethod <SamplerStateFactory>("PointClamp", (uv) => samplerStatePointClamp); factory.SetFactoryMethod <SamplerStateFactory>("PointWrap", (uv) => samplerStatePointWrap); factory.SetFactoryMethod <SamplerStateFactory>("LinearClamp", (uv) => samplerStateLinearClamp); factory.SetFactoryMethod <SamplerStateFactory>("LinearWrap", (uv) => samplerStateLinearWrap); factory.SetFactoryMethod <SamplerStateFactory>("AnisotropicClamp", (uv) => samplerStateAnisotropicClamp); factory.SetFactoryMethod <SamplerStateFactory>("AnisotropicWrap", (uv) => samplerStateAnisotropicWrap); // Platform services factory.SetFactoryMethod <ScreenDensityServiceFactory>("ImplFallback", (display) => new SDL2ScreenDensityService(owner, display)); }