public static IRenderTarget New(VideoTypes videoType, IDisposableResource parent, string filename, int width, int height, bool generateMipmaps, MultiSampleTypes multiSampleType, SurfaceFormats surfaceFormat, DepthStencilFormats depthStencilFormat, RenderTargetUsage renderTargetUsage, BufferUsages usage, Loader.LoadedCallbackMethod loadedCallback) { IRenderTarget api = null; #if WIN32 if (videoType == VideoTypes.D3D9) api = new D3D9.RenderTarget(parent, filename, width, height, generateMipmaps, multiSampleType, surfaceFormat, depthStencilFormat, renderTargetUsage, usage, loadedCallback); #endif #if WIN32 || WINRT || WP8 if (videoType == VideoTypes.D3D11) api = new D3D11.RenderTarget(parent, filename, width, height, generateMipmaps, multiSampleType, surfaceFormat, depthStencilFormat, renderTargetUsage, usage, loadedCallback); #endif #if WIN32 || OSX || LINUX || iOS || ANDROID || NaCl if (videoType == VideoTypes.OpenGL) api = new OpenGL.RenderTarget(parent, filename, width, height, generateMipmaps, multiSampleType, surfaceFormat, depthStencilFormat, renderTargetUsage, usage, loadedCallback); #endif #if XNA if (videoType == VideoTypes.XNA) api = new XNA.RenderTarget(parent, filename, width, height, generateMipmaps, multiSampleType, surfaceFormat, depthStencilFormat, renderTargetUsage, usage, loadedCallback); #endif #if VITA if (videoType == VideoTypes.Vita) api = new Vita.RenderTarget(parent, filename, width, height, generateMipmaps, multiSampleType, surfaceFormat, depthStencilFormat, renderTargetUsage, usage, loadedCallback); #endif if (api == null) Debug.ThrowError("RenderTargetAPI", "Unsuported InputType: " + videoType); return api; }
public static IRenderTarget New(VideoTypes videoType, IDisposableResource parent, string filename, int width, int height, bool generateMipmaps, MultiSampleTypes multiSampleType, SurfaceFormats surfaceFormat, DepthStencilFormats depthStencilFormat, RenderTargetUsage renderTargetUsage, BufferUsages usage, Loader.LoadedCallbackMethod loadedCallback) { IRenderTarget api = null; #if WIN32 if (videoType == VideoTypes.D3D9) { api = new D3D9.RenderTarget(parent, filename, width, height, generateMipmaps, multiSampleType, surfaceFormat, depthStencilFormat, renderTargetUsage, usage, loadedCallback); } #endif #if WIN32 || WINRT || WP8 if (videoType == VideoTypes.D3D11) { api = new D3D11.RenderTarget(parent, filename, width, height, generateMipmaps, multiSampleType, surfaceFormat, depthStencilFormat, renderTargetUsage, usage, loadedCallback); } #endif #if WIN32 || OSX || LINUX || iOS || ANDROID || NaCl if (videoType == VideoTypes.OpenGL) { api = new OpenGL.RenderTarget(parent, filename, width, height, generateMipmaps, multiSampleType, surfaceFormat, depthStencilFormat, renderTargetUsage, usage, loadedCallback); } #endif #if XNA if (videoType == VideoTypes.XNA) { api = new XNA.RenderTarget(parent, filename, width, height, generateMipmaps, multiSampleType, surfaceFormat, depthStencilFormat, renderTargetUsage, usage, loadedCallback); } #endif #if VITA if (videoType == VideoTypes.Vita) { api = new Vita.RenderTarget(parent, filename, width, height, generateMipmaps, multiSampleType, surfaceFormat, depthStencilFormat, renderTargetUsage, usage, loadedCallback); } #endif if (api == null) { Debug.ThrowError("RenderTargetAPI", "Unsuported InputType: " + videoType); } return(api); }