MxEngine
Namespaces | Classes | Typedefs | Enumerations | Functions | Variables
MxEngine Namespace Reference

Namespaces

 GUI
 

Classes

class  AABB
 
class  AbstractFactoryImpl
 
class  AppDestroyEvent
 
class  Application
 
class  Array2D
 
class  array_view
 
class  AssetManager
 
class  AudioBuffer
 
struct  AudioData
 
class  AudioListener
 
class  AudioLoader
 
class  AudioModule
 
struct  AudioModuleData
 
class  AudioPlayer
 
class  AudioSource
 
class  Behaviour
 
class  BoundingSphere
 
class  CameraBase
 
class  CameraController
 
struct  CameraRender
 
struct  CameraUnit
 
class  ChunkAllocator
 
class  Colors
 
struct  Component
 
class  ComponentFactory
 
class  ComponentManager
 
class  ComponentView
 
class  Cone
 
class  CreateStatic
 
class  CreateWithMalloc
 
class  CreateWithNew
 
class  CubeMap
 
class  DebugBuffer
 
struct  DebugBufferUnit
 
class  DebugDraw
 
class  DefaultLifetime
 
class  DirectionalLight
 
struct  DirectionalLigthUnit
 
struct  EnvironmentUnit
 
class  EventDispatcher
 
class  EventManager
 
struct  FactoryImpl
 
struct  FactoryImpl< T >
 
class  File
 
class  FileManager
 
struct  FileManagerImpl
 
class  FpsUpdateEvent
 
class  FrameBuffer
 
class  Frustrum
 
class  FrustrumCamera
 
class  GraphicConsole
 
class  GraphicModule
 
class  Image
 
class  ImageConverter
 
class  ImageData
 
class  ImageLoader
 
class  ImageManager
 
class  IndexBuffer
 
class  InputControl
 
class  InputManager
 
class  InstanceFactory
 
class  KeyEvent
 
class  LifetimeManager
 
class  LightBase
 
struct  LightingSystem
 
class  LinearAllocator
 
class  LocalResource
 
struct  LODConfig
 
class  LODGenerator
 
class  LoggerImpl
 
struct  ManagedResource
 
struct  Material
 
struct  MaterialInfo
 
class  Mesh
 
class  MeshData
 
struct  MeshInfo
 
class  MeshLOD
 
class  MeshRenderer
 
class  MeshSource
 
class  MouseMoveEvent
 
struct  MxFunction
 
struct  MxFunction< R(Args...)>
 
class  MxInstanceImpl
 
class  MxObject
 
class  NoDestroy
 
struct  ObjectInfo
 
class  ObjectLoader
 
class  OrthographicCamera
 
class  PerspectiveCamera
 
class  PhoenixSingleton
 
class  PointLight
 
struct  PointLightUnit
 
class  PoolAllocator
 
class  Primitives
 
class  ProfileSession
 
class  Random
 
class  RandomAllocator
 
class  Rectangle
 
struct  RenderAdaptor
 
class  RenderBuffer
 
class  RenderController
 
class  Renderer
 
class  RenderEvent
 
class  RenderManager
 
struct  RenderPipeline
 
struct  RenderUnit
 
class  Resource
 
class  RuntimeEditor
 
class  ScopeProfiler
 
class  ScopeTimer
 
class  Script
 
class  Shader
 
class  SingleThreaded
 
class  SingletonHolder
 
class  Skybox
 
class  SkyboxObject
 
class  SpotLight
 
struct  SpotLightUnit
 
class  StackAllocator
 
class  SubMesh
 
class  Texture
 
struct  Time
 
class  Transform
 
class  UpdateEvent
 
class  UUID
 
class  UUIDGenerator
 
struct  UUIDGeneratorImpl
 
struct  Vector3Cmp
 
class  VectorPool
 
struct  Vertex
 
class  VertexArray
 
class  VertexBuffer
 
class  VertexBufferLayout
 
class  VRCameraController
 
class  Window
 
class  WindowManager
 
class  WindowResizeEvent
 

Typedefs

using AppEventDispatcher = EventDispatcher< IEvent >
 
using ResourceFactory = AbstractFactoryImpl< Material, Mesh >
 
using MaterialHandle = Resource< Material, ResourceFactory >
 
using MeshHandle = Resource< Mesh, ResourceFactory >
 
using AudioFactory = AbstractFactoryImpl< AudioBuffer, AudioPlayer >
 
template<typename T >
using AResource = Resource< T, AudioFactory >
 
using GraphicFactory = AbstractFactoryImpl< CubeMap, FrameBuffer, IndexBuffer, RenderBuffer, Shader, Texture, VertexArray, VertexBuffer, VertexBufferLayout >
 
template<typename T >
using GResource = Resource< T, GraphicFactory >
 
template<typename T >
using ArrayView = array_view< T >
 
template<typename T >
using CResource = Resource< T, ComponentFactory >
 
using FilePath = std::filesystem::path
 
using FileStream = std::fstream
 
using FileSystemTime = std::filesystem::file_time_type
 
using JsonFile = nlohmann::json
 
using Logger = SingletonHolder< LoggerImpl >
 
using Vector2 = glm::vec< 2, float >
 
using Vector3 = glm::vec< 3, float >
 
using Vector4 = glm::vec< 4, float >
 
using VectorInt2 = glm::vec< 2, int >
 
using VectorInt3 = glm::vec< 3, int >
 
using VectorInt4 = glm::vec< 4, int >
 
using Matrix2x2 = glm::mat2x2
 
using Matrix2x3 = glm::mat2x3
 
using Matrix3x3 = glm::mat3x3
 
using Matrix2x4 = glm::mat2x4
 
using Matrix3x4 = glm::mat3x4
 
using Matrix4x4 = glm::mat4x4
 
using Quaternion = glm::quat
 
template<size_t Length, typename Type >
using Vector = glm::vec< Length, Type >
 
template<size_t Columns, size_t Rows, typename Type >
using Matrix = glm::mat< Columns, Rows, Type >
 
template<typename T >
using UniqueRef = std::unique_ptr< T >
 
template<typename T >
using Ref = std::shared_ptr< T >
 
using MaterialLibrary = MxVector< MaterialInfo >
 
using Profiler = SingletonHolder< ProfileSession >
 
using AtExitFunctionPointer) = void(*)(
 
template<typename T , typename U , typename Hash = eastl::hash<T>, typename Predicate = eastl::equal_to<T>, typename Allocator = EASTLAllocatorType>
using MxHashMap = eastl::hash_map< T, U, Hash, Predicate, Allocator >
 
template<typename T , typename U , size_t Nodes, bool overflow = true, typename Allocator = EASTLAllocatorType, typename Hash = eastl::hash<T>, typename Predicate = eastl::equal_to<T>>
using MxFixedHashMap = eastl::fixed_hash_map< T, U, Nodes, Nodes+1, overflow, Hash, Predicate, false, Allocator >
 
template<typename T , typename U , typename Hash = eastl::hash<T>, typename Predicate = eastl::equal_to<T>, typename Allocator = EASTLAllocatorType>
using MxHashMultiMap = eastl::hash_multimap< T, U, Hash, Predicate, Allocator >
 
template<typename T , typename U , size_t Nodes, bool overflow = true, typename Allocator = EASTLAllocatorType, typename Hash = eastl::hash<T>, typename Predicate = eastl::equal_to<T>>
using MxFixedHashMultiMap = eastl::fixed_hash_multimap< T, U, Nodes, Nodes+1, overflow, Hash, Predicate, false, Allocator >
 
template<typename T , typename Allocator = EASTLAllocatorType, typename Hash = eastl::hash<T>, typename Predicate = eastl::equal_to<T>>
using MxHashSet = eastl::hash_set< T, Hash, Predicate, Allocator >
 
template<typename T , size_t Nodes, bool overflow = true, typename Allocator = EASTLAllocatorType, typename Hash = eastl::hash<T>, typename Predicate = eastl::equal_to<T>>
using MxFixedHashSet = eastl::fixed_hash_set< T, Nodes, Nodes+1, overflow, Hash, Predicate, false, Allocator >
 
template<typename T , typename Allocator = EASTLAllocatorType, typename Hash = eastl::hash<T>, typename Predicate = eastl::equal_to<T>>
using MxHashMultiSet = eastl::hash_multiset< T, Hash, Predicate, Allocator >
 
template<typename T , size_t Nodes, bool overflow = true, typename Allocator = EASTLAllocatorType, typename Hash = eastl::hash<T>, typename Predicate = eastl::equal_to<T>>
using MxFixedHashMultiSet = eastl::fixed_hash_multiset< T, Nodes, Nodes+1, overflow, Hash, Predicate, false, Allocator >
 
template<typename T , typename U , typename Compare = eastl::less<T>, typename Allocator = EASTLAllocatorType>
using MxMap = eastl::map< T, U, Compare, Allocator >
 
template<typename T , typename U , size_t Nodes, bool overflow = true, typename Compare = eastl::less<T>, typename Allocator = EASTLAllocatorType>
using MxFixedMap = eastl::fixed_map< T, U, Nodes, overflow, Compare, Allocator >
 
template<typename T , typename Compare = eastl::less<T>, typename Allocator = EASTLAllocatorType>
using MxSet = eastl::set< T, Compare, Allocator >
 
template<typename T , size_t Nodes, bool overflow = true, typename Compare = eastl::less<T>, typename Allocator = EASTLAllocatorType>
using MxFixedSet = eastl::fixed_set< T, Nodes, overflow, Compare, Allocator >
 
using MxString = eastl::basic_string< char >
 
template<size_t Nodes, bool overflow = true, typename Allocator = EASTLAllocatorType>
using MxFixedString = eastl::basic_string< char, eastl::fixed_vector_allocator< sizeof(char), Nodes, EASTL_ALIGN_OF(char), 0, overflow, Allocator >>
 
template<typename T , typename Allocator = EASTLAllocatorType>
using MxVector = eastl::vector< T, Allocator >
 
template<typename T , size_t Nodes, bool overflow = true, typename Allocator = EASTLAllocatorType>
using MxFixedVector = eastl::fixed_vector< T, Nodes, overflow, Allocator >
 
using StringId = uint32_t
 
using TimeStep = float
 
using SystemTime = time_t
 

Enumerations

enum  SoundModel {
  NONE, INVERSE_DISTANCE, INVERSE_DISTANCE_CLAMPED, LINEAR_DISTANCE,
  LINEAR_DISTANCE_CLAMPED, EXPONENT_DISTANCE, EXPONENT_DISTANCE_CLAMPED
}
 
enum  CameraType : uint8_t { PERSPECTIVE, ORTHOGRAPHIC, FRUSTRUM }
 
enum  KeyCode {
  UNKNOWN = -1, SPACE = 32, APOSTROPHE = 39, COMMA = 44,
  MINUS = 45, PERIOD = 46, SLASH = 47, D0 = 48,
  D1 = 49, D2 = 50, D3 = 51, D4 = 52,
  D5 = 53, D6 = 54, D7 = 55, D8 = 56,
  D9 = 57, SEMICOLON = 59, EQUAL = 61, A = 65,
  B = 66, C = 67, D = 68, E = 69,
  F = 70, G = 71, H = 72, I = 73,
  J = 74, K = 75, L = 76, M = 77,
  N = 78, O = 79, P = 80, Q = 81,
  R = 82, S = 83, T = 84, U = 85,
  V = 86, W = 87, X = 88, Y = 89,
  Z = 90, LEFT_BRACKET = 91, BACKSLASH = 92, RIGHT_BRACKET = 93,
  GRAVE_ACCENT = 96, WORLD_1 = 16, WORLD_2 = 16, ESCAPE = 256,
  ENTER = 257, TAB = 258, BACKSPACE = 259, INSERT = 260,
  DELETE = 261, RIGHT = 262, LEFT = 263, DOWN = 264,
  UP = 265, PAGE_UP = 266, PAGE_DOWN = 267, HOME = 268,
  END = 269, CAPS_LOCK = 280, SCROLL_LOCK = 281, NUM_LOCK = 282,
  PRINT_SCREEN = 283, PAUSE = 284, F1 = 290, F2 = 291,
  F3 = 292, F4 = 293, F5 = 294, F6 = 295,
  F7 = 296, F8 = 297, F9 = 298, F10 = 299,
  F11 = 300, F12 = 301, F13 = 302, F14 = 303,
  F15 = 304, F16 = 305, F17 = 306, F18 = 307,
  F19 = 308, F20 = 309, F21 = 310, F22 = 311,
  F23 = 312, F24 = 313, F25 = 314, KP_0 = 320,
  KP_1 = 321, KP_2 = 322, KP_3 = 323, KP_4 = 324,
  KP_5 = 325, KP_6 = 326, KP_7 = 327, KP_8 = 328,
  KP_9 = 329, KP_DECIMAL = 330, KP_DIVIDE = 331, KP_MULTIPLY = 332,
  KP_SUBTRACT = 333, KP_ADD = 334, KP_ENTER = 335, KP_EQUAL = 336,
  LEFT_SHIFT = 340, LEFT_CONTROL = 341, LEFT_ALT = 342, LEFT_SUPER = 343,
  RIGHT_SHIFT = 344, RIGHT_CONTROL = 345, RIGHT_ALT = 346, RIGHT_SUPER = 347,
  MENU = 348
}
 
enum  Attachment {
  COLOR_ATTACHMENT0, COLOR_ATTACHMENT1, COLOR_ATTACHMENT2, COLOR_ATTACHMENT3,
  COLOR_ATTACHMENT4, COLOR_ATTACHMENT5, COLOR_ATTACHMENT6, COLOR_ATTACHMENT9,
  COLOR_ATTACHMENT10, COLOR_ATTACHMENT11, COLOR_ATTACHMENT12, COLOR_ATTACHMENT13,
  COLOR_ATTACHMENT14, COLOR_ATTACHMENT15, DEPTH_ATTACHMENT, STENCIL_ATTACHMENT,
  DEPTH_STENCIL_ATTACHMENT
}
 
enum  ShaderType { VERTEX_SHADER = GL_VERTEX_SHADER, GEOMETRY_SHADER = GL_GEOMETRY_SHADER, FRAGMENT_SHADER = GL_FRAGMENT_SHADER }
 
enum  TextureFormat : uint8_t {
  RGB, RGBA, RGB16, RGB16F,
  RGBA16, RGBA16F, RGB32F, RGBA32F,
  DEPTH
}
 
enum  TextureWrap : uint8_t { CLAMP_TO_EDGE, CLAMP_TO_BORDER, MIRRORED_REPEAT, REPEAT }
 
enum  UsageType {
  STREAM_DRAW, STREAM_READ, STREAM_COPY, STATIC_DRAW,
  STATIC_READ, STATIC_COPY, DYNAMIC_DRAW, DYNAMIC_READ,
  DYNAMIC_COPY
}
 
enum  AudioType : uint8_t { WAV, MP3, OGG, FLAC }
 
enum  ImageType {
  PNG, BMP, TGA, JPG,
  HDR
}
 

Functions

constexpr AABB operator* (const AABB &box, const Vector3 &scale)
 
constexpr AABB operator/ (const AABB &box, const Vector3 &scale)
 
constexpr AABB operator+ (const AABB &box, const Vector3 &translate)
 
constexpr AABB operator- (const AABB &box, const Vector3 &translate)
 
AABB operator* (const AABB &box, const Matrix4x4 &matrix)
 
constexpr BoundingSphere ToSphere (const AABB &box)
 
MaterialHandle ConvertMaterial (const MaterialInfo &mat, MxHashMap< StringId, GResource< Texture >> &textures)
 
const char * EnumToString (KeyCode key)
 
 MAKE_EVENT_BASE (IEvent)
 
auto InitializeSphere ()
 
auto GetAttachedTexture (const FrameBuffer &framebuffer)
 
auto GetAttachedTexture (const GResource< FrameBuffer > &framebuffer)
 
auto GetAttachedCubeMap (const FrameBuffer &framebuffer)
 
auto GetAttachedCubeMap (const GResource< FrameBuffer > &framebuffer)
 
void AlClearErrors ()
 
bool AlLogCall (const char *function, const char *file, int line)
 
void GlClearErrors ()
 
bool GlLogCall (const char *function, const char *file, int line)
 
size_t GetGLTypeSize (unsigned int type)
 
void PrintDebugInformation (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *message, const void *userParam)
 
template<>
const char * TypeToString< unsigned char > ()
 
template<>
const char * TypeToString< unsigned int > ()
 
template<>
const char * TypeToString< float > ()
 
template<>
unsigned int GetGLType< float > ()
 
template<>
unsigned int GetGLType< unsigned int > ()
 
template<>
unsigned int GetGLType< unsigned char > ()
 
template<typename T >
const char * TypeToString ()
 
template<typename T >
unsigned int GetGLType ()
 
const char * EnumToString (TextureFormat format)
 
const char * EnumToString (TextureWrap wrap)
 
template<typename T >
array_view< T > make_view (T &value)
 
const char * EnumToString (AudioType type)
 
auto ToMxString (const FilePath &path)
 
auto ToFilePath (const MxString &str)
 
template<typename S , typename... Args, typename Char = fmt::char_t<S>>
std::basic_string< Char > Format (const S &formatStr, Args &&... args)
 
template<typename S , typename... Args, typename Char = fmt::char_t<S>>
MxString MxFormat (const S &formatStr, Args &&... args)
 
void CopyImageData (void *context, void *data, int size)
 
constexpr Vector2 MakeVector2 (float x, float y)
 
constexpr Vector3 MakeVector3 (float x, float y, float z)
 
constexpr Vector4 MakeVector4 (float x, float y, float z, float w)
 
constexpr Vector2 MakeVector2 (float value)
 
constexpr Vector3 MakeVector3 (float value)
 
constexpr Vector4 MakeVector4 (float value)
 
template<typename Vector >
float Dot (const Vector &v1, const Vector &v2)
 
Vector3 Cross (const Vector3 &v1, const Vector3 &v2)
 
Quaternion LookAtRotation (const Vector3 &direction, const Vector3 &up)
 
Matrix4x4 MakeViewMatrix (const Vector3 &eye, const Vector3 &center, const Vector3 &up)
 
Matrix4x4 MakePerspectiveMatrix (float fov, float aspect, float znear, float zfar)
 
Matrix4x4 MakeFrustrumMatrix (float left, float right, float bottom, float top, float znear, float zfar)
 
Matrix4x4 MakeReversedPerspectiveMatrix (float fov, float aspect, float znear, float zfar)
 
Matrix4x4 MakeOrthographicMatrix (float left, float right, float bottom, float top, float znear, float zfar)
 
Matrix4x4 MakeBiasMatrix ()
 
template<typename T >
Normalize (const T &value)
 
template<typename T >
auto Length (const T &value)
 
template<typename T >
auto Length2 (const T &value)
 
Matrix4x4 Translate (const Matrix4x4 &mat, const Vector3 &vec)
 
Matrix4x4 Scale (const Matrix4x4 &mat, const Vector3 &vec)
 
Matrix4x4 Scale (const Matrix4x4 &mat, float value)
 
Matrix4x4 Rotate (const Matrix4x4 &mat, float angle, const Vector3 &axis)
 
Matrix4x4 ToMatrix (const Quaternion &q)
 
Quaternion MakeQuaternion (float angle, const Vector3 &axis)
 
Vector3 MakeEulerAngles (const Quaternion &q)
 
Quaternion Lerp (const Quaternion &q1, const Quaternion q2, float a)
 
Quaternion Slerp (const Quaternion &q1, const Quaternion q2, float a)
 
template<size_t Columns, size_t Rows, typename T >
Matrix< Columns, Rows, T > Transpose (const Matrix< Columns, Rows, T > &mat)
 
template<size_t Columns, size_t Rows, typename T >
Matrix< Columns, Rows, T > Inverse (const Matrix< Columns, Rows, T > &mat)
 
template<typename T >
constexpr T Clamp (const T &value, const T &low, const T &high)
 
template<typename T , typename U >
decltype(std::declval< T >()+std::declval< U >()) constexpr Max (const T &v1, const U &v2)
 
template<typename T , typename U , typename R >
decltype(std::declval< T >()+std::declval< U >()+std::declval< R >()) constexpr Max (const T &v1, const U &v2, const R &v3)
 
template<typename T , typename U >
decltype(std::declval< T >()+std::declval< U >()) constexpr Min (const T &v1, const U &v2)
 
template<typename T , typename U , typename R >
decltype(std::declval< T >()+std::declval< U >()+std::declval< R >()) constexpr Min (const T &v1, const U &v2, const R &v3)
 
template<typename T >
constexpr T Radians (const T &degrees)
 
template<typename T >
constexpr T Degrees (const T &radians)
 
template<typename T >
constexpr T Zero ()
 
template<typename T >
constexpr T One ()
 
template<typename T >
constexpr T Pi ()
 
template<typename T >
constexpr T epsilon ()
 
template<typename T >
constexpr T TwoPi ()
 
template<typename T >
constexpr T RootPi ()
 
template<typename T >
constexpr T HalfPi ()
 
template<typename T >
constexpr T ThreeOverTwoPi ()
 
template<typename T >
constexpr T QuarterPi ()
 
template<typename T >
constexpr T OneOverPi ()
 
template<typename T >
constexpr T OneOverTwoPi ()
 
template<typename T >
constexpr T TwoOverPi ()
 
template<typename T >
constexpr T FourOverPi ()
 
template<typename T >
constexpr T TwoOverRootPi ()
 
template<typename T >
constexpr T OneOverRootTwo ()
 
template<typename T >
constexpr T RootHalfPi ()
 
template<typename T >
constexpr T RootTwoPi ()
 
template<typename T >
constexpr T RootLnFour ()
 
template<typename T >
constexpr T e ()
 
template<typename T >
constexpr T Euler ()
 
template<typename T >
constexpr T RootTwo ()
 
template<typename T >
constexpr T RootThree ()
 
template<typename T >
constexpr T RootFive ()
 
template<typename T >
constexpr T LnTwo ()
 
template<typename T >
constexpr T LnTen ()
 
template<typename T >
constexpr T LnLnTwo ()
 
template<typename T >
constexpr T Third ()
 
template<typename T >
constexpr T TwoThirds ()
 
template<typename T >
constexpr T GoldenRatio ()
 
constexpr float SignedSqrt (float x)
 
template<typename Vector >
float Angle (const Vector &v1, const Vector &v2)
 
constexpr float Sqr (float x)
 
constexpr size_t Log2 (size_t n)
 
constexpr size_t FloorToPow2 (size_t n)
 
constexpr size_t CeilToPow2 (size_t n)
 
template<typename T >
auto DegreesVec (T vec) -> decltype(vec.length(), vec[0], vec)
 
template<typename T >
auto RadiansVec (T vec) -> decltype(vec.length(), vec[0], vec)
 
template<typename T >
VectorMax (const T &v1, const T &v2)
 
template<typename T >
VectorMin (const T &v1, const T &v2)
 
std::pair< Vector3, Vector3 > MinMaxComponents (Vector3 *verteces, size_t size)
 
constexpr std::array< Vector3, 2 > ComputeTangentSpace (const Vector3 &v1, const Vector3 &v2, const Vector3 &v3, const Vector2 &t1, const Vector2 &t2, const Vector2 &t3)
 
Vector3 ComputeNormal (const Vector3 &v1, const Vector3 &v2, const Vector3 &v3)
 
Matrix3x3 RotateAngles (float xRot, float yRot, float zRot)
 
template<typename T , typename... Args>
UniqueRef< T > MakeUnique (Args &&... args)
 
template<typename T , typename... Args>
Ref< T > MakeRef (Args &&... args)
 
template<typename T , typename... Args>
T * Alloc (Args &&... args)
 
template<typename T >
void Free (T *value)
 
template<typename T >
GetRandomImpl (Random::Generator &gen, T lower, T upper)
 
template<typename T >
auto ToMxString (const T &value)
 
auto ToMxString (const std::string &value)
 
constexpr StringId crc32 (const char *str, size_t size, size_t idx=0, uint32_t prev_crc=0xFFFFFFFF)
 
template<typename StringClass >
StringId MakeStringId (const StringClass &str)
 
constexpr StringId operator""_id (const char *s, size_t size)
 
MxString BeautifyTime (TimeStep time)
 
std::ostream & operator<< (std::ostream &out, const UUID &uuid)
 
std::istream & operator>> (std::istream &in, UUID &uuid)
 

Variables

ALenum soundModelTable []
 
Vector3 DirectionTable []
 
Vector3 UpTable []
 
GLenum AttachmentTable []
 
GLenum BlendTable []
 
GLenum formatTable []
 
GLenum wrapTable []
 
GLenum DataType []
 
std::array< int, 3 > ProfileType
 
std::array< int, 3 > CursorType
 
std::map< int, int > FileModeTable
 
constexpr size_t KB = 1024
 
constexpr size_t MB = 1024 * KB
 
constexpr size_t GB = 1024 * MB
 

Detailed Description

Main namespace of MxEngine framework. All classes are located here or in nested namespaces

Function Documentation

§ Alloc()

template<typename T , typename... Args>
T* MxEngine::Alloc ( Args &&...  args)
inline

wrapper around new operator args arguments for construction of T object

Returns
new object of type T

§ Angle()

template<typename Vector >
float MxEngine::Angle ( const Vector &  v1,
const Vector &  v2 
)
inline

computes angle in radians between two vectors

Parameters
v1first vector (can be not normalized)
v2second vector (can be not normalized)
Returns
angle between vectors in range [-pi/2; pi/2]

§ BeautifyTime()

MxString MxEngine::BeautifyTime ( TimeStep  time)

creates human-readable time string (10ms, 1.3s and etc.)

Parameters
timetimestep to convert to string
Returns
string object with beautifies timestep

§ CeilToPow2()

constexpr size_t MxEngine::CeilToPow2 ( size_t  n)
inline

returns nearest power of two which is greater or equal to input (1024 -> 1024, 1023 -> 1024, 1025 -> 2048)

Parameters
nvalue to ceil from
Returns
power of two not less than n

§ ComputeNormal()

Vector3 MxEngine::ComputeNormal ( const Vector3 &  v1,
const Vector3 &  v2,
const Vector3 &  v3 
)
inline

compute normal vector pair using triangle vertecies

Parameters
v1first vertex position of vertecies
v2second vertex position of vertecies
v3third vertex position of vertecies
Returns
normalized normal vector

§ ComputeTangentSpace()

constexpr std::array<Vector3, 2> MxEngine::ComputeTangentSpace ( const Vector3 &  v1,
const Vector3 &  v2,
const Vector3 &  v3,
const Vector2 &  t1,
const Vector2 &  t2,
const Vector2 &  t3 
)
inline

compute (Tangent, Bitangent) vector pair using vertex positions and uv-coords

Parameters
v1first vertex position
v2second vertex position
v3third vertex position
t1first uv-coords
t2second uv-coords
t3third uv-coords
Returns
(Tangent, Bitangent) pair in a form of array with size = 2

§ crc32()

constexpr StringId MxEngine::crc32 ( const char *  str,
size_t  size,
size_t  idx = 0,
uint32_t  prev_crc = 0xFFFFFFFF 
)

computes hash for a string at compile time

Parameters
strstring from which hash is computed
sizesize of str, if str is literal, sizeof(str) can be taken
idxcurrent index in string, defaults to 0
prev_crcpart of already computed hash, defaults to 0xFFFFFFFF
Returns
hash of the string

§ DegreesVec()

template<typename T >
auto MxEngine::DegreesVec ( vec) -> decltype(vec.length(), vec[0], vec)
inline

applies radians->degrees transformation for each element of vector

Parameters
vecvector of radians values
Returns
vector of degrees values

§ FloorToPow2()

constexpr size_t MxEngine::FloorToPow2 ( size_t  n)
inline

returns nearest power of two which is less or equal to input (1024 -> 1024, 1023 -> 512, 1025 -> 1024)

Parameters
nvalue to floor from
Returns
power of two not greater than n

§ Format()

template<typename S , typename... Args, typename Char = fmt::char_t<S>>
std::basic_string<Char> MxEngine::Format ( const S &  formatStr,
Args &&...  args 
)
inline

formats string. for more info see https://github.com/fmtlib/fmt documentation

Parameters
formatStrformatting string
argsvariadic argument list
Returns
formatted string object

§ Free()

template<typename T >
void MxEngine::Free ( T *  value)
inline

wrapper around delete operator

Parameters
valuevalue to delete

§ Log2()

constexpr size_t MxEngine::Log2 ( size_t  n)
inline

computes log2 of integer value at compile time

Parameters
nvalue from which log2(n) is computed
Returns
log2(n), floored to nearest value, i.e. pow(2, log2(n)) <= n

§ make_view()

template<typename T >
array_view<T> MxEngine::make_view ( T &  value)
inline

constructs array view from one value

Parameters
valueelement which will be inside array_view
Returns
array_view of value

§ MakeRef()

template<typename T , typename... Args>
Ref<T> MxEngine::MakeRef ( Args &&...  args)
inline

wrapper around shared_ptr args arguments for construction of T object

Returns
shared_ptr<T>

§ MakeStringId()

template<typename StringClass >
StringId MxEngine::MakeStringId ( const StringClass &  str)

generates string id hash at runtime

Parameters
strstring object from which hash is taken
Returns
string id hash

§ MakeUnique()

template<typename T , typename... Args>
UniqueRef<T> MxEngine::MakeUnique ( Args &&...  args)
inline

wrapper around unique_ptr args arguments for construction of T object

Returns
unique_ptr<T>

§ MinMaxComponents()

std::pair<Vector3, Vector3> MxEngine::MinMaxComponents ( Vector3 *  verteces,
size_t  size 
)
inline

computes pair of vectors with min and max coords inside verteces array

Parameters
vertecespointer to an array of Vector3
sizenumber of verteces to compute
Returns
(min components, max components) vector pair

§ operator""_id()

constexpr StringId MxEngine::operator""_id ( const char *  s,
size_t  size 
)

transforms string literal into hash by appending _id suffix ("str"_id) at runtime

§ RadiansVec()

template<typename T >
auto MxEngine::RadiansVec ( vec) -> decltype(vec.length(), vec[0], vec)
inline

applies degrees->radians transformation for each element of vector

Parameters
vecvector of degrees values
Returns
vector of radians values

§ RotateAngles()

Matrix3x3 MxEngine::RotateAngles ( float  xRot,
float  yRot,
float  zRot 
)
inline

creates rotation matrix from rottion angles applied as one-by-one

Parameters
xRotfirst rotation applied around x-axis
yRotsecond rotation applied around y-axis
zRotthird rotation applied around z-axis
Returns
rotation matrix 3x3

§ SignedSqrt()

constexpr float MxEngine::SignedSqrt ( float  x)
inline

computes safe sqrt for any floating point value

Parameters
xvalue from which sqrt(x) is computed
Returns
sqrt(x) if x >= 0.0f, -sqrt(-x) if x < 0.0f

§ VectorMax()

template<typename T >
T MxEngine::VectorMax ( const T &  v1,
const T &  v2 
)
inline

computes max components of two vectors

Parameters
v1first vector
v2second vector
Returns
vector of max components from v1 and v2

§ VectorMin()

template<typename T >
T MxEngine::VectorMin ( const T &  v1,
const T &  v2 
)
inline

computes min components of two vectors

Parameters
v1first vector
v2second vector
Returns
vector of min components from v1 and v2

Variable Documentation

§ AttachmentTable

GLenum MxEngine::AttachmentTable[]
Initial value:
{
GL_COLOR_ATTACHMENT0,
GL_COLOR_ATTACHMENT1,
GL_COLOR_ATTACHMENT2,
GL_COLOR_ATTACHMENT3,
GL_COLOR_ATTACHMENT4,
GL_COLOR_ATTACHMENT5,
GL_COLOR_ATTACHMENT6,
GL_COLOR_ATTACHMENT9,
GL_COLOR_ATTACHMENT10,
GL_COLOR_ATTACHMENT11,
GL_COLOR_ATTACHMENT12,
GL_COLOR_ATTACHMENT13,
GL_COLOR_ATTACHMENT14,
GL_COLOR_ATTACHMENT15,
GL_DEPTH_ATTACHMENT,
GL_STENCIL_ATTACHMENT,
GL_DEPTH_STENCIL_ATTACHMENT,
}

§ BlendTable

GLenum MxEngine::BlendTable[]
Initial value:
=
{
0x00000000,
GL_ONE_MINUS_SRC_COLOR,
GL_SRC_ALPHA,
GL_ONE_MINUS_SRC_ALPHA,
GL_DST_ALPHA,
GL_ONE_MINUS_DST_ALPHA,
GL_DST_COLOR,
GL_ONE_MINUS_DST_COLOR,
GL_CONSTANT_COLOR,
GL_ONE_MINUS_CONSTANT_COLOR,
GL_CONSTANT_ALPHA,
GL_ONE_MINUS_CONSTANT_ALPHA,
}

§ CursorType

std::array<int, 3> MxEngine::CursorType
Initial value:
=
{
GLFW_CURSOR_NORMAL,
GLFW_CURSOR_HIDDEN,
GLFW_CURSOR_DISABLED,
}

§ DataType

GLenum MxEngine::DataType[]
Initial value:
=
{
GL_STREAM_DRAW,
GL_STREAM_READ,
GL_STREAM_COPY,
GL_STATIC_DRAW,
GL_STATIC_READ,
GL_STATIC_COPY,
GL_DYNAMIC_DRAW,
GL_DYNAMIC_READ,
GL_DYNAMIC_COPY,
}

§ DirectionTable

Vector3 MxEngine::DirectionTable[]
Initial value:
=
{
Normalize(MakeVector3( 1.0f, 0.0001f, 0.0001f)),
Normalize(MakeVector3( -1.0f, 0.0001f, 0.0001f)),
Normalize(MakeVector3(0.0001f, 1.0f, 0.0001f)),
Normalize(MakeVector3(0.0001f, -1.0f, 0.0001f)),
Normalize(MakeVector3(0.0001f, 0.0001f, 1.0f)),
Normalize(MakeVector3(0.0001f, 0.0001f, -1.0f)),
}

§ FileModeTable

std::map<int, int> MxEngine::FileModeTable
Initial value:
=
{
{ File::READ, std::fstream::in },
{ File::WRITE, std::fstream::out },
{ File::BINARY, std::fstream::binary },
{ File::READ | File::BINARY, std::fstream::in | std::fstream::binary },
{ File::WRITE | File::BINARY, std::fstream::out | std::fstream::binary },
{ File::READ | File::WRITE, std::fstream::in | std::fstream::out },
{ File::READ | File::WRITE | File::BINARY, std::fstream::in | std::fstream::out | std::fstream::binary },
}

§ formatTable

GLenum MxEngine::formatTable[]
Initial value:
=
{
GL_RGB,
GL_RGBA,
GL_RGB16,
GL_RGB16F,
GL_RGBA16,
GL_RGBA16F,
GL_RGB32F,
GL_RGBA32F,
GL_DEPTH_COMPONENT
}

§ ProfileType

std::array<int, 3> MxEngine::ProfileType
Initial value:
=
{
GLFW_OPENGL_ANY_PROFILE,
GLFW_OPENGL_COMPAT_PROFILE,
GLFW_OPENGL_CORE_PROFILE,
}

§ soundModelTable

ALenum MxEngine::soundModelTable[]
Initial value:
= {
AL_NONE,
AL_INVERSE_DISTANCE,
AL_INVERSE_DISTANCE_CLAMPED,
AL_LINEAR_DISTANCE,
AL_LINEAR_DISTANCE_CLAMPED,
AL_EXPONENT_DISTANCE,
AL_EXPONENT_DISTANCE_CLAMPED,
}

§ UpTable

Vector3 MxEngine::UpTable[]
Initial value:
=
{
MakeVector3(0.0f, -1.0f, 0.0f),
MakeVector3(0.0f, -1.0f, 0.0f),
MakeVector3(0.0f, 0.0f, 1.0f),
MakeVector3(0.0f, 0.0f, -1.0f),
MakeVector3(0.0f, -1.0f, 0.0f),
MakeVector3(0.0f, -1.0f, 0.0f),
}

§ wrapTable

GLenum MxEngine::wrapTable[]
Initial value:
=
{
GL_CLAMP_TO_EDGE,
GL_CLAMP_TO_BORDER,
GL_MIRRORED_REPEAT,
GL_REPEAT,
}