| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485 |
- //********************************** Banshee Engine (www.banshee3d.com) **************************************************//
- //**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
- using System.Runtime.CompilerServices;
- namespace BansheeEngine
- {
- /// <summary>
- /// Contains various builtin resources that are always available.
- /// </summary>
- public static class Builtin
- {
- /// <summary>
- /// Types of builtin meshes that are always available in the engine.
- /// </summary>
- private enum BuiltinMesh // Note: Must match C++ enum BuiltinMesh
- {
- Box, Sphere, Cone, Quad, Disc
- }
- /// <summary>
- /// Returns a pure white texture.
- /// </summary>
- public static SpriteTexture WhiteTexture
- {
- get { return Internal_GetWhiteTexture(); }
- }
- /// <summary>
- /// Returns the default shader to be used with renderables.
- /// </summary>
- public static Shader DiffuseShader
- {
- get { return Internal_GetDiffuseShader(); }
- }
- /// <summary>
- /// Returns a axis aligned box of unit size.
- /// </summary>
- public static Mesh Box
- {
- get { return Internal_GetMesh(BuiltinMesh.Box); }
- }
- /// <summary>
- /// Returns a unit sphere mesh.
- /// </summary>
- public static Mesh Sphere
- {
- get { return Internal_GetMesh(BuiltinMesh.Sphere); }
- }
- /// <summary>
- /// Returns a cone mesh.
- /// </summary>
- public static Mesh Cone
- {
- get { return Internal_GetMesh(BuiltinMesh.Cone); }
- }
- /// <summary>
- /// Returns a quad mesh with unit size edges.
- /// </summary>
- public static Mesh Quad
- {
- get { return Internal_GetMesh(BuiltinMesh.Quad); }
- }
- /// <summary>
- /// Returns a disc mesh with unit radius.
- /// </summary>
- public static Mesh Disc
- {
- get { return Internal_GetMesh(BuiltinMesh.Disc); }
- }
- [MethodImpl(MethodImplOptions.InternalCall)]
- private static extern SpriteTexture Internal_GetWhiteTexture();
- [MethodImpl(MethodImplOptions.InternalCall)]
- private static extern Shader Internal_GetDiffuseShader();
- [MethodImpl(MethodImplOptions.InternalCall)]
- private static extern Mesh Internal_GetMesh(BuiltinMesh mesh);
- }
- }
|