PageRenderTime 348ms CodeModel.GetById 151ms app.highlight 2ms RepoModel.GetById 149ms app.codeStats 0ms

/Graphics/Basics/Geometry.cs

#
C# | 42 lines | 20 code | 2 blank | 20 comment | 0 complexity | c9e390be305d0bf77c9dc6152a06e9c4 MD5 | raw file
 1using Delta.ContentSystem.Rendering;
 2using Delta.Engine.Dynamic;
 3
 4namespace Delta.Graphics.Basics
 5{
 6	/// <summary>
 7	/// Geometry mesh implementation class, each graphic framework has its own
 8	/// implementation (own drawing logic, optimizations, vertex buffers, etc.).
 9	/// <para />
10	/// You can use this class to extend geometry mesh functionality for all
11	/// platforms. If you just change OpenTKGeometry, your game will not be able
12	/// to use that changes on any other graphic platform.
13	/// </summary>
14	public abstract class Geometry : BaseGeometry
15	{
16		#region Create (Static)
17		/// <summary>
18		/// Create geometry from geometry mesh data, used to generate meshes
19		/// instead of loading them from content, but can be used for that too.
20		/// </summary>
21		/// <param name="createFromGeometryData">The create from geometry data.</param>
22		/// <returns>Geometry that was created from GeometryData</returns>
23		public static Geometry Create(GeometryData createFromGeometryData)
24		{
25			// Load Mesh normally with the string constructor that loads MeshData
26			return Factory.Create<Geometry>(createFromGeometryData);
27		}
28		#endregion
29
30		#region Constructors
31		/// <summary>
32		/// Create geometry from already created GeometryData (from content or for
33		/// creating dynamic meshes, like for Lines, UI rendering or Effects).
34		/// </summary>
35		/// <param name="setMeshData">Geometry mesh data</param>
36		protected Geometry(GeometryData setMeshData)
37			: base(setMeshData)
38		{
39		}
40		#endregion
41	}
42}