//********************************** Banshee Engine (www.banshee3d.com) **************************************************// //**************** Copyright (c) 2016 Marko Pintera (marko.pintera@gmail.com). All rights reserved. **********************// using System.Runtime.CompilerServices; namespace BansheeEngine { /** @addtogroup Utility * @{ */ /// /// Available builtin shader types. /// public enum BuiltinShader // Note: Must match C++ BuiltinShader enum { Custom, Standard, Transparent } /// /// Contains various builtin resources that are always available. /// public static class Builtin { /// /// Types of builtin meshes that are always available in the engine. /// private enum BuiltinMesh // Note: Must match C++ enum BuiltinMesh { Box, Sphere, Cone, Cylinder, Quad, Disc } /// /// Returns a pure white texture. /// public static SpriteTexture WhiteTexture { get { return Internal_GetWhiteTexture(); } } /// /// Returns one of the builtin shaders /// public static Shader GetShader(BuiltinShader shader) { if (shader == BuiltinShader.Custom) return null; return Internal_GetBuiltinShader((int)shader); } /// /// Returns a axis aligned box of unit size. /// public static Mesh Box { get { return Internal_GetMesh(BuiltinMesh.Box); } } /// /// Returns a unit sphere mesh. /// public static Mesh Sphere { get { return Internal_GetMesh(BuiltinMesh.Sphere); } } /// /// Returns a cone mesh. /// public static Mesh Cone { get { return Internal_GetMesh(BuiltinMesh.Cone); } } /// /// Returns a cylinder mesh. /// public static Mesh Cylinder { get { return Internal_GetMesh(BuiltinMesh.Cylinder); } } /// /// Returns a quad mesh with unit size edges. /// public static Mesh Quad { get { return Internal_GetMesh(BuiltinMesh.Quad); } } /// /// Returns a disc mesh with unit radius. /// public static Mesh Disc { get { return Internal_GetMesh(BuiltinMesh.Disc); } } /// /// Returns the default Font used in the engine. /// 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(); } /** @} */ }