/// <summary> /// Constructor creating a new renderer attribute /// </summary> /// <param name="type">graphic device type </param> /// <param name="Name">short name</param> /// <param name="NameLong">long name</param> /// <param name="Default">'default' flag</param> public ILRendererAttribute(GraphicDeviceType type, string Name, string NameLong, bool Default, CoordSystem coords) { this.GraphicDeviceType = type; this.Name = Name; this.NameLong = NameLong; this.IsDefault = Default; this.Coords = coords; }
/// <summary> /// Constructor for a new attribute describing non-default renderer /// </summary> /// <param name="type">graphic device type </param> /// <param name="Name">short name</param> /// <param name="NameLong">long name</param> public ILRendererAttribute(GraphicDeviceType type, string Name, string NameLong) { this.GraphicDeviceType = type; this.Name = Name; this.NameLong = NameLong; this.IsDefault = false; this.Coords = CoordSystem.Screen; }
internal ILTextureManager(GraphicDeviceType deviceType) { m_textureSheets = new List<ILTextureStorage>(); m_deviceType = deviceType; if (m_deviceType != GraphicDeviceType.OpenGL) { throw new NotImplementedException("Only OpenGL contexts can be handled so far!"); } m_defaultHeight = 500; m_defaultWidth = 500; }
//public abstract ShaderCode CompileFromMemory( // string shaderCode, // ShaderMacro[] defines, // Include include, // string functionName, // string profile, // ShaderFlags flags); //public abstract ShaderCode CompileFromFile( // string filename, // ShaderMacro[] defines, // Include include, // string functionName, // string profile, // ShaderFlags flags); public GraphicDevice CreateDevice(GraphicDeviceType type = GraphicDeviceType.Hardware) { GraphicDeviceDesc desc = new GraphicDeviceDesc { DriverType = type }; return(CreateDevice(desc)); }
/// <summary> /// create manager instance, device dependent /// </summary> /// <param name="panel">The hosting panel, giving access to his manager instance</param> /// <param name="assemblies">assemblies to query for matching ILRenderer types</param> /// <remarks>While creating ILRendererManager instances, the given assemblies will be queried for /// available classes matching the device. Corresponding types are than provided by calling the /// GetRenderer() method.</remarks> public ILRendererManager (ILPanel panel, Assembly[] assemblies) { m_graphicsDevice = panel.GraphicDeviceType; m_panel = panel; m_rendererCollection = new Dictionary<string,string>(); m_rendererCache = new Dictionary<string,IILTextRenderer>(); foreach (Assembly ass in assemblies) { AddAssemblyTypes(ass); } if (m_rendererCollection.Count == 0) throw new InvalidOperationException("No valid ILRenderer found!"); }
internal ILTextureManager(GraphicDeviceType deviceType) { m_textureSheets = new List <ILTextureStorage>(); m_deviceType = deviceType; if (m_deviceType != GraphicDeviceType.OpenGL) { throw new NotImplementedException("Only OpenGL contexts can be handled so far!"); } m_defaultHeight = 500; m_defaultWidth = 500; }
/// <summary> /// create manager instance, device dependent /// </summary> /// <param name="panel">The hosting panel, giving access to his manager instance</param> /// <param name="assemblies">assemblies to query for matching ILRenderer types</param> /// <remarks>While creating ILRendererManager instances, the given assemblies will be queried for /// available classes matching the device. Corresponding types are than provided by calling the /// GetRenderer() method.</remarks> public ILRendererManager(ILPanel panel, Assembly[] assemblies) { m_graphicsDevice = panel.GraphicDeviceType; m_panel = panel; m_rendererCollection = new Dictionary <string, string>(); m_rendererCache = new Dictionary <string, IILTextRenderer>(); foreach (Assembly ass in assemblies) { AddAssemblyTypes(ass); } if (m_rendererCollection.Count == 0) { throw new InvalidOperationException("No valid ILRenderer found!"); } }
private GraphicDeviceType getDefaultDeviceType() { GraphicDeviceType ret = GraphicDeviceType.OpenGL; // lets see, if a configuration for the app is found string useD3D = ConfigurationManager.AppSettings["useDirect3D"]; if (String.IsNullOrEmpty(useD3D)) { // look for an ILNumerics.Drawing.dll.config file and probe this for the setting string path = Assembly.GetExecutingAssembly().GetModules()[0].FullyQualifiedName; Configuration c = ConfigurationManager.OpenExeConfiguration(path); KeyValueConfigurationElement kvelem = c.AppSettings.Settings["useDirect3D"]; if (kvelem != null) { useD3D = kvelem.Value; } } if (String.IsNullOrEmpty(useD3D)) { return(ret); } if (useD3D.Trim() == "1") { switch (Environment.OSVersion.Platform) { case PlatformID.Unix: System.Diagnostics.Debug.WriteLine("The Direct3D device is not available on Unix platform! Switching to OpenGL."); break; default: ret = GraphicDeviceType.Direct3D; break; } } return(ret); }