PageRenderTime 43ms CodeModel.GetById 18ms RepoModel.GetById 0ms app.codeStats 0ms

/Graphics/Basics/Geometry.cs

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