| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283 |
- 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);
- }
- }
|