| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124 |
- //********************************** Banshee Engine (www.banshee3d.com) **************************************************//
- //**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
- using System.Runtime.CompilerServices;
- namespace BansheeEngine
- {
- /** @addtogroup Utility
- * @{
- */
- /// <summary>
- /// Available builtin shader types.
- /// </summary>
- public enum BuiltinShader // Note: Must match C++ BuiltinShader enum
- {
- Custom,
- Standard,
- Transparent
- }
- /// <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, Cylinder, Quad, Disc
- }
- /// <summary>
- /// Returns a pure white texture.
- /// </summary>
- public static SpriteTexture WhiteTexture
- {
- get { return Internal_GetWhiteTexture(); }
- }
- /// <summary>
- /// Returns one of the builtin shaders
- /// </summary>
- public static Shader GetShader(BuiltinShader shader)
- {
- if (shader == BuiltinShader.Custom)
- return null;
- return Internal_GetBuiltinShader((int)shader);
- }
- /// <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 cylinder mesh.
- /// </summary>
- public static Mesh Cylinder
- {
- get { return Internal_GetMesh(BuiltinMesh.Cylinder); }
- }
- /// <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); }
- }
- /// <summary>
- /// Returns the default Font used in the engine.
- /// </summary>
- public static Font DefaultFont
- {
- get { return Internal_GetDefaultFont(); }
- }
- [MethodImpl(MethodImplOptions.InternalCall)]
- private static extern SpriteTexture Internal_GetWhiteTexture();
- [MethodImpl(MethodImplOptions.InternalCall)]
- private static extern Shader Internal_GetBuiltinShader(int shaderType);
- [MethodImpl(MethodImplOptions.InternalCall)]
- private static extern Mesh Internal_GetMesh(BuiltinMesh mesh);
- [MethodImpl(MethodImplOptions.InternalCall)]
- private static extern Font Internal_GetDefaultFont();
- }
- /** @} */
- }
|