Welcome to Ariyana’s documentation!

Ariyana is an open source and free WIP game engine.

Building

Getting Source

git clone https://github.com/kochol/ariyana.git
cd ariyana
git submodule update --init

Quick Start

These are step for users who use Windows with Visual Studio.

Enter ariyana directory:

cd ariyana

Generate Visual Studio 2017 project files:

deps\bx\tools\bin\windows\genie vs2017

Open ariyana solution in Visual Studio 2017:

start .build\projects\vs2017\ariyana.sln

Generate Visual Studio 2017 project files with test projects:

deps\bx\tools\bin\windows\genie --with-tests vs2017

Design goals

The goal of this engine design is to make a fast engine.

Jobify the engine with fibers

The first design goal is using fibers to jobify the engine and use all of the CPU cores. For more info see GDC talk by Christian Gyrling in his 2015 GDC Talk ‘Parallelizing the Naughty Dog Engine Using Fibers’

Frame data

Use frame data to enable the parallel work of different parts of the engine without waiting for each other to finish their job. For example gameplay systems update entities and send them to scene system then scene system store them to perform culling and sorting next frame after that sends it to render system for next frame rendering so rendering is always two frame behind gameplay systems this design makes every thing works in parallel. For more info see GDC talk by Christian Gyrling in his 2015 GDC Talk ‘Parallelizing the Naughty Dog Engine Using Fibers’

For this system to work I made different update stages that be called for every system that needs it.

Entity, Component and Node

This part of the design I got inspired by Godot engine where Components can attach to each other and creates a tree. The base class here is Node class that Entity and Component class are inherited from them so Components can attach to entities and vice versa. This design works well for example when you work on a project with your colleges and everyone can work on a different entity without conflict.

Also, entities are useful when later we add networking to the engine.

API Reference

Class Hierarchy

Full API

Namespaces

Namespace ari
Classes
Namespace ari::Internal

Contents

Namespace bgfx
Namespace bx
Namespace ftl
Namespace ImWindow
Namespace spdlog

Classes and Structs

Struct AxisEvent
Inheritance Relationships
Base Type
Struct Documentation
struct AxisEvent : public ari::Event

Public Functions

AxisEvent()

Public Members

GamepadAxis::Enum m_axis
int32_t m_value
GamepadHandle m_gamepad
Struct CharEvent
Inheritance Relationships
Base Type
Struct Documentation
struct CharEvent : public ari::Event

Public Functions

CharEvent()

Public Members

uint8_t m_len
uint8_t m_char[4]
Struct ColorVertex
Struct Documentation
struct ColorVertex

Public Members

uint32_t argb
Struct DropFileEvent
Inheritance Relationships
Base Type
Struct Documentation
struct DropFileEvent : public ari::Event

Public Functions

DropFileEvent()

Public Members

bx::FilePath m_filePath
Struct Event
Inheritance Relationships
Derived Types
Struct Documentation
struct Event

Subclassed by ari::AxisEvent, ari::CharEvent, ari::DropFileEvent, ari::GamepadEvent, ari::KeyEvent, ari::MouseEvent, ari::SizeEvent, ari::SuspendEvent, ari::WindowEvent

Public Types

enum Enum

Values:

Axis
Char
Exit
Gamepad
Key
Mouse
Size
Window
Suspend
DropFile

Public Functions

Event(Enum _type)

Public Members

Event::Enum m_type
Template Struct OnComponentAssigned
Struct Documentation
template <class T>
struct OnComponentAssigned

Public Members

Entity *entity
T *component
Template Struct OnComponentRemoved
Struct Documentation
template <class T>
struct OnComponentRemoved

Public Members

Entity *entity
T *component
Struct OnEntityCreated
Struct Documentation
struct OnEntityCreated

Public Members

Entity *entity
Struct OnEntityDestroyed
Struct Documentation
struct OnEntityDestroyed

Public Members

Entity *entity
Struct OnFrameData
Struct Documentation
struct OnFrameData

Public Members

FrameData *frame_data
Struct GamepadAxis
Struct Documentation
struct GamepadAxis

Public Types

enum Enum

Values:

LeftX
LeftY
LeftZ
RightX
RightY
RightZ
Count
Struct GamepadEvent
Inheritance Relationships
Base Type
Struct Documentation
struct GamepadEvent : public ari::Event

Public Functions

GamepadEvent()

Public Members

GamepadHandle m_gamepad
bool m_connected
Struct GamepadHandle
Struct Documentation
struct GamepadHandle

Public Members

uint16_t idx
Struct GamepadState
Struct Documentation
struct GamepadState

Public Functions

GamepadState()

Public Members

int32_t m_axis[Count]
Struct InitParams
Struct Documentation
struct InitParams

Public Functions

InitParams()

Public Members

uint32_t Height
uint32_t Width
bool FullScreen
IProgram *Program
Struct InputBinding
Struct Documentation
struct InputBinding

Public Functions

void set(Key::Enum _key, uint8_t _modifiers, uint8_t _flags, InputBindingFn _fn, const void *_userData = NULL)
void end()

Public Members

Key::Enum m_key
uint8_t m_modifiers
uint8_t m_flags
InputBindingFn m_fn
const void *m_userData
Struct Key
Struct Documentation
struct Key

Public Types

enum Enum

Values:

None = 0
Esc
Return
Tab
Space
Backspace
Up
Down
Left
Right
Insert
Delete
Home
End
PageUp
PageDown
Print
Plus
Minus
LeftBracket
RightBracket
Semicolon
Quote
Comma
Period
Slash
Backslash
Tilde
F1
F2
F3
F4
F5
F6
F7
F8
F9
F10
F11
F12
NumPad0
NumPad1
NumPad2
NumPad3
NumPad4
NumPad5
NumPad6
NumPad7
NumPad8
NumPad9
Key0
Key1
Key2
Key3
Key4
Key5
Key6
Key7
Key8
Key9
KeyA
KeyB
KeyC
KeyD
KeyE
KeyF
KeyG
KeyH
KeyI
KeyJ
KeyK
KeyL
KeyM
KeyN
KeyO
KeyP
KeyQ
KeyR
KeyS
KeyT
KeyU
KeyV
KeyW
KeyX
KeyY
KeyZ
GamepadA
GamepadB
GamepadX
GamepadY
GamepadThumbL
GamepadThumbR
GamepadShoulderL
GamepadShoulderR
GamepadUp
GamepadDown
GamepadLeft
GamepadRight
GamepadBack
GamepadStart
GamepadGuide
Count
Struct KeyEvent
Inheritance Relationships
Base Type
Struct Documentation
struct KeyEvent : public ari::Event

Public Functions

KeyEvent()

Public Members

Key::Enum m_key
uint8_t m_modifiers
bool m_down
Struct Modifier
Struct Documentation
struct Modifier

Public Types

enum Enum

Values:

None = 0
LeftAlt = 0x01
RightAlt = 0x02
LeftCtrl = 0x04
RightCtrl = 0x08
LeftShift = 0x10
RightShift = 0x20
LeftMeta = 0x40
RightMeta = 0x80
Struct MouseButton
Struct Documentation
struct MouseButton

Public Types

enum Enum

Values:

None
Left
Middle
Right
Count
Struct MouseEvent
Inheritance Relationships
Base Type
Struct Documentation
struct MouseEvent : public ari::Event

Public Functions

MouseEvent()

Public Members

int32_t m_mx
int32_t m_my
int32_t m_mz
MouseButton::Enum m_button
bool m_down
bool m_move
Struct MouseState
Struct Documentation
struct MouseState

Public Functions

MouseState()

Public Members

int32_t m_mx
int32_t m_my
int32_t m_mz
uint8_t m_buttons[Count]
Struct PosVertex
Struct Documentation
struct PosVertex

Public Members

float x
float y
float z
Template Struct Rect
Struct Documentation
template <class T>
struct Rect

Public Functions

Rect()
Rect(const T _x, const T _y, const T _width, const T _height)
void Set(const T _x, const T _y, const T _width, const T _height)
bool operator==(const Rect<T> &v) const
bool operator!=(const Rect<T> &v) const

Public Members

template<>
T p[4]
T x
T y
T width
T height
union ari::Rect::@0 ari::Rect::@1
Struct SizeEvent
Inheritance Relationships
Base Type
Struct Documentation
struct SizeEvent : public ari::Event

Public Functions

SizeEvent()

Public Members

uint32_t m_width
uint32_t m_height
Struct Suspend
Struct Documentation
struct Suspend

Public Types

enum Enum

Values:

WillSuspend
DidSuspend
WillResume
DidResume
Count
Struct SuspendEvent
Inheritance Relationships
Base Type
Struct Documentation
struct SuspendEvent : public ari::Event

Public Functions

SuspendEvent()

Public Members

Suspend::Enum m_state
Struct TextureParams
Struct Documentation
struct TextureParams

Public Members

uint32_t Flags = BGFX_TEXTURE_NONE
bgfx::TextureInfo *Info = nullptr
bimg::Orientation::Enum *Orientation = nullptr
Struct TinyStlAllocator
Struct Documentation
struct TinyStlAllocator

Public Static Functions

static void *static_allocate(size_t _bytes)
static void static_deallocate(void *_ptr, size_t)
Struct Vector3
Struct Documentation
struct Vector3

Public Functions

Vector3()
Vector3(const float _x, const float _y, const float _z)
void Set(const float _x, const float _y, const float _z)
Vector3 operator-(const Vector3 &v) const
void Cross(const Vector3 &_v1, const Vector3 &_v2)
float GetLength() const

Returns the vector length.

void Normalize()
bx::Vec3 ToVec3() const

Public Members

float v[3]
float x
float y
float z
union ari::Vector3::@4 ari::Vector3::@5
Struct WindowEvent
Inheritance Relationships
Base Type
Struct Documentation
struct WindowEvent : public ari::Event

Public Functions

WindowEvent()

Public Members

void *m_nwh
Struct WindowHandle
Struct Documentation
struct WindowHandle

Public Members

uint16_t idx
Struct WindowState
Struct Documentation
struct WindowState

Public Functions

WindowState()

Public Members

WindowHandle m_handle
uint32_t m_width
uint32_t m_height
MouseState m_mouse
void *m_nwh
bx::FilePath m_dropFile
Struct FileInfo
Struct Documentation
struct FileInfo

Public Members

std::string Name
Class BoxShape
Inheritance Relationships
Base Type
Class Documentation
class BoxShape : public ari::Node3D

Public Functions

BoxShape()
virtual ~BoxShape()

Destructor.

virtual void Render(const Matrix &matrix, bgfx::Encoder *encoder, uint16_t _view_id)

Render.

Public Static Functions

static void Init(RenderSystem *render_system)
static void Shutdown()

Public Static Attributes

bgfx::VertexBufferHandle m_sVBPos
bgfx::VertexBufferHandle m_sVBColor
bgfx::IndexBufferHandle m_sIB
bgfx::ProgramHandle m_sProgram
Class Button
Inheritance Relationships
Base Type
Class Documentation
class Button : public ari::Gui

Public Functions

bool BeginRender()

Public Members

DelegateNoParam<void> OnClick
char *Label
Class Camera
Inheritance Relationships
Base Type
Class Documentation
class Camera : public ari::Node3D

Public Functions

Camera()

Constructor.

virtual ~Camera()

Destructor.

void Rotate(float _angle, const Vector3 &_axis)

Rotate the camera around an axis.

void RotateByMouse(int _x, int _y, float _speed)

Rotate by mouse movement.

void MoveBF(const float &_speed)

Move back & forward.

void MoveLR(const float &_speed)

Move left & right.

void MoveUD(const float &_speed)

Move up & down.

Public Members

Vector3 Target
Vector3 Up
Vector3 Right
Matrix _view
Matrix _proj
bool _isActive

Protected Attributes

float m_fCurRotX = 0.0f
float m_fLastRotX = 0.0f
Class CheckBox
Inheritance Relationships
Base Type
Class Documentation
class CheckBox : public ari::Gui

Public Functions

CheckBox()
~CheckBox()
bool BeginRender()

Public Members

bool Checked
char *Label
Class Component
Inheritance Relationships
Base Type
Derived Types
Class Documentation
class Component : public ari::Node

Subclassed by ari::Gui, ari::Node3D, ari::Viewport

Public Functions

Component()

Constructor.

virtual ~Component()

Destructor.

Public Members

bool _isFromNode3D
bool _isFromGui
Template Class DelegateEightParam
Class Documentation
template <class Treturn, class Targ1, class Targ2, class Targ3, class Targ4, class Targ5, class Targ6, class Targ7, class Targ8>
class DelegateEightParam

Public Functions

DelegateEightParam()
~DelegateEightParam()
void Bind(Treturn (*_fun)(Targ1, Targ2, Targ3, Targ4, Targ5, Targ6, Targ7, Targ8))
template <class Tclass>
void ari::DelegateEightParam::Bind(Tclass * _obj, Treturn(Tclass::*)(Targ1, Targ2, Targ3, Targ4, Targ5, Targ6, Targ7, Targ8) _fun)
bool IsBound()
Treturn Execute(Targ1 arg1, Targ2 arg2, Targ3 arg3, Targ4 arg4, Targ5 arg5, Targ6 arg6, Targ7 arg7, Targ8 arg8)

Protected Attributes

template<>
Treturn (*m_pFun)(Targ1, Targ2, Targ3, Targ4, Targ5, Targ6, Targ7, Targ8)
BaseFuncEightParam *m_pMemFun
Class DelegateEightParam::BaseFuncEightParam
Nested Relationships

This class is a nested type of Template Class DelegateEightParam.

Class Documentation
class BaseFuncEightParam

Public Functions

template<>
virtual ~BaseFuncEightParam()
template<>
virtual Treturn Call(Targ1 arg1, Targ2 arg2, Targ3 arg3, Targ4 arg4, Targ5 arg5, Targ6 arg6, Targ7 arg7, Targ8 arg8) = 0
Template Class DelegateEightParam::MemFuncEightParam
Nested Relationships

This class is a nested type of Template Class DelegateEightParam.

Inheritance Relationships
Base Type
  • public ari::DelegateEightParam< Treturn, Targ1, Targ2, Targ3, Targ4, Targ5, Targ6, Targ7, Targ8 >::BaseFuncEightParam
Class Documentation
template <class Tclass>
class MemFuncEightParam : public ari::DelegateEightParam<Treturn, Targ1, Targ2, Targ3, Targ4, Targ5, Targ6, Targ7, Targ8>::BaseFuncEightParam

Public Functions

ari::DelegateEightParam< Treturn, Targ1, Targ2, Targ3, Targ4, Targ5, Targ6, Targ7, Targ8 >::MemFuncEightParam::MemFuncEightParam(Tclass * _obj, Treturn(Tclass::*)(Targ1, Targ2, Targ3, Targ4, Targ5, Targ6, Targ7, Targ8) _fun)
template<>
Treturn Call(Targ1 arg1, Targ2 arg2, Targ3 arg3, Targ4 arg4, Targ5 arg5, Targ6 arg6, Targ7 arg7, Targ8 arg8)

Protected Attributes

template<>
Tclass *m_pObj
template<>
template<>
Treturn (Tclass::*m_pFun)(Targ1, Targ2, Targ3, Targ4, Targ5, Targ6, Targ7, Targ8)
Template Class DelegateFiveParam
Class Documentation
template <class Treturn, class Targ1, class Targ2, class Targ3, class Targ4, class Targ5>
class DelegateFiveParam

Public Functions

DelegateFiveParam()
~DelegateFiveParam()
void Bind(Treturn (*_fun)(Targ1, Targ2, Targ3, Targ4, Targ5))
template <class Tclass>
void ari::DelegateFiveParam::Bind(Tclass * _obj, Treturn(Tclass::*)(Targ1, Targ2, Targ3, Targ4, Targ5) _fun)
bool IsBound()
Treturn Execute(Targ1 arg1, Targ2 arg2, Targ3 arg3, Targ4 arg4, Targ5 arg5)

Protected Attributes

template<>
Treturn (*m_pFun)(Targ1, Targ2, Targ3, Targ4, Targ5)
BaseFuncFiveParam *m_pMemFun
Class DelegateFiveParam::BaseFuncFiveParam
Nested Relationships

This class is a nested type of Template Class DelegateFiveParam.

Class Documentation
class BaseFuncFiveParam

Public Functions

template<>
virtual ~BaseFuncFiveParam()
template<>
virtual Treturn Call(Targ1 arg1, Targ2 arg2, Targ3 arg3, Targ4 arg4, Targ5 arg5) = 0
Template Class DelegateFiveParam::MemFuncFiveParam
Nested Relationships

This class is a nested type of Template Class DelegateFiveParam.

Inheritance Relationships
Base Type
  • public ari::DelegateFiveParam< Treturn, Targ1, Targ2, Targ3, Targ4, Targ5 >::BaseFuncFiveParam
Class Documentation
template <class Tclass>
class MemFuncFiveParam : public ari::DelegateFiveParam<Treturn, Targ1, Targ2, Targ3, Targ4, Targ5>::BaseFuncFiveParam

Public Functions

ari::DelegateFiveParam< Treturn, Targ1, Targ2, Targ3, Targ4, Targ5 >::MemFuncFiveParam::MemFuncFiveParam(Tclass * _obj, Treturn(Tclass::*)(Targ1, Targ2, Targ3, Targ4, Targ5) _fun)
template<>
Treturn Call(Targ1 arg1, Targ2 arg2, Targ3 arg3, Targ4 arg4, Targ5 arg5)

Protected Attributes

template<>
Tclass *m_pObj
template<>
template<>
Treturn (Tclass::*m_pFun)(Targ1, Targ2, Targ3, Targ4, Targ5)
Template Class DelegateFourParam
Class Documentation
template <class Treturn, class Targ1, class Targ2, class Targ3, class Targ4>
class DelegateFourParam

Public Functions

DelegateFourParam()
~DelegateFourParam()
void Bind(Treturn (*_fun)(Targ1, Targ2, Targ3, Targ4))
template <class Tclass>
void ari::DelegateFourParam::Bind(Tclass * _obj, Treturn(Tclass::*)(Targ1, Targ2, Targ3, Targ4) _fun)
bool IsBound()
Treturn Execute(Targ1 arg1, Targ2 arg2, Targ3 arg3, Targ4 arg4)

Protected Attributes

template<>
Treturn (*m_pFun)(Targ1, Targ2, Targ3, Targ4)
BaseFuncFourParam *m_pMemFun
Class DelegateFourParam::BaseFuncFourParam
Nested Relationships

This class is a nested type of Template Class DelegateFourParam.

Class Documentation
class BaseFuncFourParam

Public Functions

template<>
virtual ~BaseFuncFourParam()
template<>
virtual Treturn Call(Targ1 arg1, Targ2 arg2, Targ3 arg3, Targ4 arg4) = 0
Template Class DelegateFourParam::MemFuncFourParam
Nested Relationships

This class is a nested type of Template Class DelegateFourParam.

Inheritance Relationships
Base Type
  • public ari::DelegateFourParam< Treturn, Targ1, Targ2, Targ3, Targ4 >::BaseFuncFourParam
Class Documentation
template <class Tclass>
class MemFuncFourParam : public ari::DelegateFourParam<Treturn, Targ1, Targ2, Targ3, Targ4>::BaseFuncFourParam

Public Functions

ari::DelegateFourParam< Treturn, Targ1, Targ2, Targ3, Targ4 >::MemFuncFourParam::MemFuncFourParam(Tclass * _obj, Treturn(Tclass::*)(Targ1, Targ2, Targ3, Targ4) _fun)
template<>
Treturn Call(Targ1 arg1, Targ2 arg2, Targ3 arg3, Targ4 arg4)

Protected Attributes

template<>
Tclass *m_pObj
template<>
template<>
Treturn (Tclass::*m_pFun)(Targ1, Targ2, Targ3, Targ4)
Template Class DelegateNineParam
Class Documentation
template <class Treturn, class Targ1, class Targ2, class Targ3, class Targ4, class Targ5, class Targ6, class Targ7, class Targ8, class Targ9>
class DelegateNineParam

Public Functions

DelegateNineParam()
~DelegateNineParam()
void Bind(Treturn (*_fun)(Targ1, Targ2, Targ3, Targ4, Targ5, Targ6, Targ7, Targ8, Targ9))
template <class Tclass>
void ari::DelegateNineParam::Bind(Tclass * _obj, Treturn(Tclass::*)(Targ1, Targ2, Targ3, Targ4, Targ5, Targ6, Targ7, Targ8, Targ9) _fun)
bool IsBound()
Treturn Execute(Targ1 arg1, Targ2 arg2, Targ3 arg3, Targ4 arg4, Targ5 arg5, Targ6 arg6, Targ7 arg7, Targ8 arg8, Targ9 arg9)

Protected Attributes

template<>
Treturn (*m_pFun)(Targ1, Targ2, Targ3, Targ4, Targ5, Targ6, Targ7, Targ8, Targ9)
BaseFuncNineParam *m_pMemFun
Class DelegateNineParam::BaseFuncNineParam
Nested Relationships

This class is a nested type of Template Class DelegateNineParam.

Class Documentation
class BaseFuncNineParam

Public Functions

template<>
virtual ~BaseFuncNineParam()
template<>
virtual Treturn Call(Targ1 arg1, Targ2 arg2, Targ3 arg3, Targ4 arg4, Targ5 arg5, Targ6 arg6, Targ7 arg7, Targ8 arg8, Targ9 arg9) = 0
Template Class DelegateNineParam::MemFuncNineParam
Nested Relationships

This class is a nested type of Template Class DelegateNineParam.

Inheritance Relationships
Base Type
  • public ari::DelegateNineParam< Treturn, Targ1, Targ2, Targ3, Targ4, Targ5, Targ6, Targ7, Targ8, Targ9 >::BaseFuncNineParam
Class Documentation
template <class Tclass>
class MemFuncNineParam : public ari::DelegateNineParam<Treturn, Targ1, Targ2, Targ3, Targ4, Targ5, Targ6, Targ7, Targ8, Targ9>::BaseFuncNineParam

Public Functions

ari::DelegateNineParam< Treturn, Targ1, Targ2, Targ3, Targ4, Targ5, Targ6, Targ7, Targ8, Targ9 >::MemFuncNineParam::MemFuncNineParam(Tclass * _obj, Treturn(Tclass::*)(Targ1, Targ2, Targ3, Targ4, Targ5, Targ6, Targ7, Targ8, Targ9) _fun)
template<>
Treturn Call(Targ1 arg1, Targ2 arg2, Targ3 arg3, Targ4 arg4, Targ5 arg5, Targ6 arg6, Targ7 arg7, Targ8 arg8, Targ9 arg9)

Protected Attributes

template<>
Tclass *m_pObj
template<>
template<>
Treturn (Tclass::*m_pFun)(Targ1, Targ2, Targ3, Targ4, Targ5, Targ6, Targ7, Targ8, Targ9)
Template Class DelegateNoParam
Class Documentation
template <class Treturn>
class DelegateNoParam

Public Functions

DelegateNoParam()
~DelegateNoParam()
void Bind(Treturn (*_fun)())
template <class Tclass>
void ari::DelegateNoParam::Bind(Tclass * _obj, Treturn(Tclass::*)() _fun)
bool IsBound()
Treturn Execute()

Protected Attributes

template<>
Treturn (*m_pFun)()
BaseFuncNoParam *m_pMemFun
Class DelegateNoParam::BaseFuncNoParam
Nested Relationships

This class is a nested type of Template Class DelegateNoParam.

Class Documentation
class BaseFuncNoParam

Public Functions

template<>
virtual ~BaseFuncNoParam()
template<>
virtual Treturn Call() = 0
Template Class DelegateNoParam::MemFuncNoParam
Nested Relationships

This class is a nested type of Template Class DelegateNoParam.

Inheritance Relationships
Base Type
  • public ari::DelegateNoParam< Treturn >::BaseFuncNoParam
Class Documentation
template <class Tclass>
class MemFuncNoParam : public ari::DelegateNoParam<Treturn>::BaseFuncNoParam

Public Functions

ari::DelegateNoParam< Treturn >::MemFuncNoParam::MemFuncNoParam(Tclass * _obj, Treturn(Tclass::*)() _fun)
template<>
Treturn Call()

Protected Attributes

template<>
Tclass *m_pObj
template<>
template<>
Treturn (Tclass::*m_pFun)()
Template Class DelegateOneParam
Class Documentation
template <class Treturn, class Targ1>
class DelegateOneParam

Public Functions

DelegateOneParam()
~DelegateOneParam()
void Bind(Treturn (*_fun)(Targ1))
template <class Tclass>
void ari::DelegateOneParam::Bind(Tclass * _obj, Treturn(Tclass::*)(Targ1) _fun)
bool IsBound()
Treturn Execute(Targ1 arg1)

Protected Attributes

template<>
Treturn (*m_pFun)(Targ1)
BaseFuncOneParam *m_pMemFun
Class DelegateOneParam::BaseFuncOneParam
Nested Relationships

This class is a nested type of Template Class DelegateOneParam.

Class Documentation
class BaseFuncOneParam

Public Functions

template<>
virtual ~BaseFuncOneParam()
template<>
virtual Treturn Call(Targ1 arg1) = 0
Template Class DelegateOneParam::MemFuncOneParam
Nested Relationships

This class is a nested type of Template Class DelegateOneParam.

Inheritance Relationships
Base Type
  • public ari::DelegateOneParam< Treturn, Targ1 >::BaseFuncOneParam
Class Documentation
template <class Tclass>
class MemFuncOneParam : public ari::DelegateOneParam<Treturn, Targ1>::BaseFuncOneParam

Public Functions

ari::DelegateOneParam< Treturn, Targ1 >::MemFuncOneParam::MemFuncOneParam(Tclass * _obj, Treturn(Tclass::*)(Targ1) _fun)
template<>
Treturn Call(Targ1 arg1)

Protected Attributes

template<>
Tclass *m_pObj
template<>
template<>
Treturn (Tclass::*m_pFun)(Targ1)
Template Class DelegateSevenParam
Class Documentation
template <class Treturn, class Targ1, class Targ2, class Targ3, class Targ4, class Targ5, class Targ6, class Targ7>
class DelegateSevenParam

Public Functions

DelegateSevenParam()
~DelegateSevenParam()
void Bind(Treturn (*_fun)(Targ1, Targ2, Targ3, Targ4, Targ5, Targ6, Targ7))
template <class Tclass>
void ari::DelegateSevenParam::Bind(Tclass * _obj, Treturn(Tclass::*)(Targ1, Targ2, Targ3, Targ4, Targ5, Targ6, Targ7) _fun)
bool IsBound()
Treturn Execute(Targ1 arg1, Targ2 arg2, Targ3 arg3, Targ4 arg4, Targ5 arg5, Targ6 arg6, Targ7 arg7)

Protected Attributes

template<>
Treturn (*m_pFun)(Targ1, Targ2, Targ3, Targ4, Targ5, Targ6, Targ7)
BaseFuncSevenParam *m_pMemFun
Class DelegateSevenParam::BaseFuncSevenParam
Nested Relationships

This class is a nested type of Template Class DelegateSevenParam.

Class Documentation
class BaseFuncSevenParam

Public Functions

template<>
virtual ~BaseFuncSevenParam()
template<>
virtual Treturn Call(Targ1 arg1, Targ2 arg2, Targ3 arg3, Targ4 arg4, Targ5 arg5, Targ6 arg6, Targ7 arg7) = 0
Template Class DelegateSevenParam::MemFuncSevenParam
Nested Relationships

This class is a nested type of Template Class DelegateSevenParam.

Inheritance Relationships
Base Type
  • public ari::DelegateSevenParam< Treturn, Targ1, Targ2, Targ3, Targ4, Targ5, Targ6, Targ7 >::BaseFuncSevenParam
Class Documentation
template <class Tclass>
class MemFuncSevenParam : public ari::DelegateSevenParam<Treturn, Targ1, Targ2, Targ3, Targ4, Targ5, Targ6, Targ7>::BaseFuncSevenParam

Public Functions

ari::DelegateSevenParam< Treturn, Targ1, Targ2, Targ3, Targ4, Targ5, Targ6, Targ7 >::MemFuncSevenParam::MemFuncSevenParam(Tclass * _obj, Treturn(Tclass::*)(Targ1, Targ2, Targ3, Targ4, Targ5, Targ6, Targ7) _fun)
template<>
Treturn Call(Targ1 arg1, Targ2 arg2, Targ3 arg3, Targ4 arg4, Targ5 arg5, Targ6 arg6, Targ7 arg7)

Protected Attributes

template<>
Tclass *m_pObj
template<>
template<>
Treturn (Tclass::*m_pFun)(Targ1, Targ2, Targ3, Targ4, Targ5, Targ6, Targ7)
Template Class DelegateSixParam
Class Documentation
template <class Treturn, class Targ1, class Targ2, class Targ3, class Targ4, class Targ5, class Targ6>
class DelegateSixParam

Public Functions

DelegateSixParam()
~DelegateSixParam()
void Bind(Treturn (*_fun)(Targ1, Targ2, Targ3, Targ4, Targ5, Targ6))
template <class Tclass>
void ari::DelegateSixParam::Bind(Tclass * _obj, Treturn(Tclass::*)(Targ1, Targ2, Targ3, Targ4, Targ5, Targ6) _fun)
bool IsBound()
Treturn Execute(Targ1 arg1, Targ2 arg2, Targ3 arg3, Targ4 arg4, Targ5 arg5, Targ6 arg6)

Protected Attributes

template<>
Treturn (*m_pFun)(Targ1, Targ2, Targ3, Targ4, Targ5, Targ6)
BaseFuncSixParam *m_pMemFun
Class DelegateSixParam::BaseFuncSixParam
Nested Relationships

This class is a nested type of Template Class DelegateSixParam.

Class Documentation
class BaseFuncSixParam

Public Functions

template<>
virtual ~BaseFuncSixParam()
template<>
virtual Treturn Call(Targ1 arg1, Targ2 arg2, Targ3 arg3, Targ4 arg4, Targ5 arg5, Targ6 arg6) = 0
Template Class DelegateSixParam::MemFuncSixParam
Nested Relationships

This class is a nested type of Template Class DelegateSixParam.

Inheritance Relationships
Base Type
  • public ari::DelegateSixParam< Treturn, Targ1, Targ2, Targ3, Targ4, Targ5, Targ6 >::BaseFuncSixParam
Class Documentation
template <class Tclass>
class MemFuncSixParam : public ari::DelegateSixParam<Treturn, Targ1, Targ2, Targ3, Targ4, Targ5, Targ6>::BaseFuncSixParam

Public Functions

ari::DelegateSixParam< Treturn, Targ1, Targ2, Targ3, Targ4, Targ5, Targ6 >::MemFuncSixParam::MemFuncSixParam(Tclass * _obj, Treturn(Tclass::*)(Targ1, Targ2, Targ3, Targ4, Targ5, Targ6) _fun)
template<>
Treturn Call(Targ1 arg1, Targ2 arg2, Targ3 arg3, Targ4 arg4, Targ5 arg5, Targ6 arg6)

Protected Attributes

template<>
Tclass *m_pObj
template<>
template<>
Treturn (Tclass::*m_pFun)(Targ1, Targ2, Targ3, Targ4, Targ5, Targ6)
Template Class DelegateTenParam
Class Documentation
template <class Treturn, class Targ1, class Targ2, class Targ3, class Targ4, class Targ5, class Targ6, class Targ7, class Targ8, class Targ9, class Targ10>
class DelegateTenParam

Public Functions

DelegateTenParam()
~DelegateTenParam()
void Bind(Treturn (*_fun)(Targ1, Targ2, Targ3, Targ4, Targ5, Targ6, Targ7, Targ8, Targ9, Targ10))
template <class Tclass>
void ari::DelegateTenParam::Bind(Tclass * _obj, Treturn(Tclass::*)(Targ1, Targ2, Targ3, Targ4, Targ5, Targ6, Targ7, Targ8, Targ9, Targ10) _fun)
bool IsBound()
Treturn Execute(Targ1 arg1, Targ2 arg2, Targ3 arg3, Targ4 arg4, Targ5 arg5, Targ6 arg6, Targ7 arg7, Targ8 arg8, Targ9 arg9, Targ10 arg10)

Protected Attributes

template<>
Treturn (*m_pFun)(Targ1, Targ2, Targ3, Targ4, Targ5, Targ6, Targ7, Targ8, Targ9, Targ10)
BaseFuncTenParam *m_pMemFun
Class DelegateTenParam::BaseFuncTenParam
Nested Relationships

This class is a nested type of Template Class DelegateTenParam.

Class Documentation
class BaseFuncTenParam

Public Functions

template<>
virtual ~BaseFuncTenParam()
template<>
virtual Treturn Call(Targ1 arg1, Targ2 arg2, Targ3 arg3, Targ4 arg4, Targ5 arg5, Targ6 arg6, Targ7 arg7, Targ8 arg8, Targ9 arg9, Targ10 arg10) = 0
Template Class DelegateTenParam::MemFuncTenParam
Nested Relationships

This class is a nested type of Template Class DelegateTenParam.

Inheritance Relationships
Base Type
  • public ari::DelegateTenParam< Treturn, Targ1, Targ2, Targ3, Targ4, Targ5, Targ6, Targ7, Targ8, Targ9, Targ10 >::BaseFuncTenParam
Class Documentation
template <class Tclass>
class MemFuncTenParam : public ari::DelegateTenParam<Treturn, Targ1, Targ2, Targ3, Targ4, Targ5, Targ6, Targ7, Targ8, Targ9, Targ10>::BaseFuncTenParam

Public Functions

ari::DelegateTenParam< Treturn, Targ1, Targ2, Targ3, Targ4, Targ5, Targ6, Targ7, Targ8, Targ9, Targ10 >::MemFuncTenParam::MemFuncTenParam(Tclass * _obj, Treturn(Tclass::*)(Targ1, Targ2, Targ3, Targ4, Targ5, Targ6, Targ7, Targ8, Targ9, Targ10) _fun)
template<>
Treturn Call(Targ1 arg1, Targ2 arg2, Targ3 arg3, Targ4 arg4, Targ5 arg5, Targ6 arg6, Targ7 arg7, Targ8 arg8, Targ9 arg9, Targ10 arg10)

Protected Attributes

template<>
Tclass *m_pObj
template<>
template<>
Treturn (Tclass::*m_pFun)(Targ1, Targ2, Targ3, Targ4, Targ5, Targ6, Targ7, Targ8, Targ9, Targ10)
Template Class DelegateThreeParam
Class Documentation
template <class Treturn, class Targ1, class Targ2, class Targ3>
class DelegateThreeParam

Public Functions

DelegateThreeParam()
~DelegateThreeParam()
void Bind(Treturn (*_fun)(Targ1, Targ2, Targ3))
template <class Tclass>
void ari::DelegateThreeParam::Bind(Tclass * _obj, Treturn(Tclass::*)(Targ1, Targ2, Targ3) _fun)
bool IsBound()
Treturn Execute(Targ1 arg1, Targ2 arg2, Targ3 arg3)

Protected Attributes

template<>
Treturn (*m_pFun)(Targ1, Targ2, Targ3)
BaseFuncThreeParam *m_pMemFun
Class DelegateThreeParam::BaseFuncThreeParam
Nested Relationships

This class is a nested type of Template Class DelegateThreeParam.

Class Documentation
class BaseFuncThreeParam

Public Functions

template<>
virtual ~BaseFuncThreeParam()
template<>
virtual Treturn Call(Targ1 arg1, Targ2 arg2, Targ3 arg3) = 0
Template Class DelegateThreeParam::MemFuncThreeParam
Nested Relationships

This class is a nested type of Template Class DelegateThreeParam.

Inheritance Relationships
Base Type
  • public ari::DelegateThreeParam< Treturn, Targ1, Targ2, Targ3 >::BaseFuncThreeParam
Class Documentation
template <class Tclass>
class MemFuncThreeParam : public ari::DelegateThreeParam<Treturn, Targ1, Targ2, Targ3>::BaseFuncThreeParam

Public Functions

ari::DelegateThreeParam< Treturn, Targ1, Targ2, Targ3 >::MemFuncThreeParam::MemFuncThreeParam(Tclass * _obj, Treturn(Tclass::*)(Targ1, Targ2, Targ3) _fun)
template<>
Treturn Call(Targ1 arg1, Targ2 arg2, Targ3 arg3)

Protected Attributes

template<>
Tclass *m_pObj
template<>
template<>
Treturn (Tclass::*m_pFun)(Targ1, Targ2, Targ3)
Template Class DelegateTwoParam
Class Documentation
template <class Treturn, class Targ1, class Targ2>
class DelegateTwoParam

Public Functions

DelegateTwoParam()
~DelegateTwoParam()
void Bind(Treturn (*_fun)(Targ1, Targ2))
template <class Tclass>
void ari::DelegateTwoParam::Bind(Tclass * _obj, Treturn(Tclass::*)(Targ1, Targ2) _fun)
bool IsBound()
Treturn Execute(Targ1 arg1, Targ2 arg2)

Protected Attributes

template<>
Treturn (*m_pFun)(Targ1, Targ2)
BaseFuncTwoParam *m_pMemFun
Class DelegateTwoParam::BaseFuncTwoParam
Nested Relationships

This class is a nested type of Template Class DelegateTwoParam.

Class Documentation
class BaseFuncTwoParam

Public Functions

template<>
virtual ~BaseFuncTwoParam()
template<>
virtual Treturn Call(Targ1 arg1, Targ2 arg2) = 0
Template Class DelegateTwoParam::MemFuncTwoParam
Nested Relationships

This class is a nested type of Template Class DelegateTwoParam.

Inheritance Relationships
Base Type
  • public ari::DelegateTwoParam< Treturn, Targ1, Targ2 >::BaseFuncTwoParam
Class Documentation
template <class Tclass>
class MemFuncTwoParam : public ari::DelegateTwoParam<Treturn, Targ1, Targ2>::BaseFuncTwoParam

Public Functions

ari::DelegateTwoParam< Treturn, Targ1, Targ2 >::MemFuncTwoParam::MemFuncTwoParam(Tclass * _obj, Treturn(Tclass::*)(Targ1, Targ2) _fun)
template<>
Treturn Call(Targ1 arg1, Targ2 arg2)

Protected Attributes

template<>
Tclass *m_pObj
template<>
template<>
Treturn (Tclass::*m_pFun)(Targ1, Targ2)
Class Dock
Inheritance Relationships
Base Type
Class Documentation
class Dock : public ari::Gui

Public Functions

Dock()
~Dock()
bool BeginRender()
void EndRender()

Public Members

bool isOpened
char *Label
Class DockableWindow
Inheritance Relationships
Base Type
Class Documentation
class DockableWindow : public ari::Gui

Public Types

enum Oriention

Values:

Center
Top
Left
Right
Botton

Public Functions

DockableWindow(GuiSystem *_pGuiSystem)
~DockableWindow()
bool BeginRender()
void Dock(Oriention _oriention = Oriention::Center, float _raito = 0.5f) const
void DockWith(DockableWindow *_pOtherDock, Oriention _oriention = Oriention::Center, float _raito = 0.5f) const
void SetTitle(const char *_pTitle) const
void SetAlone(bool _alone) const
void SetClosable(bool _closable) const
void SetFillingSpace(bool _fill) const
void GetLastPosition(float &_x, float &_y) const
void GetLastSize(float &_width, float &_height) const
PlatformWindow *GetPlatformWindow() const

Note
: only call this function on OnGui callback

Public Members

DelegateNoParam<void> OnGui

This is a callback for when we want to draw the Guis good to get the window size here.

DelegateNoParam<void> OnWindowChanged

This callback is for when platform window change or assigned. Good for setting the event listeners.

Protected Attributes

GuiSystem *m_pGuiSystem
ImWindow::ImwWindow *m_pWindow
PlatformWindow *m_pPlatformWindow
Class DockSpace
Inheritance Relationships
Base Type
Class Documentation
class DockSpace : public ari::Gui

Public Functions

bool BeginRender()
void EndRender()
Class Engine
Class Documentation
class Engine

Public Functions

Engine()

Constructor.

~Engine()

Destructor.

bool Init(InitParams *params)

Init the engine device.

bool Run()
void LockUpdateThread()
void UnlockUpdateThread()
Event *Poll()
void Release(const Event *_event)
uint32_t GetCurrentFrameNumber() const
std::shared_ptr<spdlog::logger> GetLogger() const
InitParams *GetParams() const
void SetParams(InitParams *_params)
PlatformWindow *GetMainWindow() const
PlatformWindow *NewWindow(PlatformWindow::Type _type)
uint16_t GetNewViewId()
uint32_t GetMsaaFlags() const
float GetElapsedTime() const
float GetDeltaTime() const

Public Members

PluginManager plugin_manager
TextureManager texture_manager

Public Static Functions

static Engine &GetSingleton()

Protected Attributes

InitParams *m_params
std::shared_ptr<spdlog::logger> Logger
PlatformWindow *m_pWindow
uint32_t m_debug
uint32_t m_reset
uint32_t m_frame_number
uint16_t m_viewId = 0
int64_t m_time_offset
bx::Thread *m_pGfxThread
bx::Mutex *m_pMutex = nullptr
int m_iLockStatus = 0
ftl::TaskScheduler *m_pTaskMgr

0 = No action, 1 = Lock, 2 = Unlock the update thread.

MouseState m_MouseState
bool m_bRun
bool m_bNeedReset
float m_fElapsedTime = 0.0f
float m_fDeltaTime = 0.0f

Protected Static Functions

static int InitBgfxInThread(bx::Thread *_thread, void *_userData)
Class Entity
Inheritance Relationships
Base Type
Class Documentation
class Entity : public ari::Node

Public Functions

Entity()

Constuctor.

~Entity()

Destructor.

Class EventQueue
Class Documentation
class EventQueue

Public Functions

EventQueue()
~EventQueue()
void postAxisEvent(GamepadHandle _gamepad, GamepadAxis::Enum _axis, int32_t _value)
void postCharEvent(uint8_t _len, const uint8_t _char[4])
void postExitEvent()
void postGamepadEvent(GamepadHandle _gamepad, bool _connected)
void postKeyEvent(Key::Enum _key, uint8_t _modifiers, bool _down)
void postMouseEvent(int32_t _mx, int32_t _my, int32_t _mz)
void postMouseEvent(int32_t _mx, int32_t _my, int32_t _mz, MouseButton::Enum _button, bool _down)
void postSizeEvent(uint32_t _width, uint32_t _height)
void postWindowEvent(void *_nwh = NULL)
void postSuspendEvent(Suspend::Enum _state)
void postDropFileEvent(const bx::FilePath &_filePath)
const Event *poll()
void release(const Event *_event) const
Template Class EventSubscriber
Inheritance Relationships
Base Type
Class Documentation
template <typename T>
class EventSubscriber : public ari::Internal::BaseEventSubscriber

Subclass this as EventSubscriber<EventType> and then call World::subscribe() in order to subscribe to events. Make sure to call World::unsubscribe() or World::unsubscribeAll() when your subscriber is deleted!

Public Functions

virtual ~EventSubscriber()
virtual void Receive(World *world, const T &event) = 0

Called when an event is emitted by the world.

Class FrameData
Class Documentation
class FrameData

Public Functions

FrameData()

Public Members

tinystl::vector<Node3D *> Nodes
tinystl::vector<Matrix> WorldMatrices
uint32_t FrameNumber
Camera *Camera
Class Gui
Inheritance Relationships
Base Type
Derived Types
Class Documentation
class Gui : public ari::Component

Subclassed by ari::Button, ari::CheckBox, ari::Dock, ari::DockableWindow, ari::DockSpace, ari::Image, ari::Label, ari::Popup, ari::TextBox, ari::Window, shiva::ProjectGui

Public Functions

Gui()
virtual ~Gui()
virtual bool BeginRender()
virtual void EndRender()

Public Members

bool SameLine = false
bool Separator = false
bool Visible = true
Class GuiSystem
Inheritance Relationships
Base Types
Class Documentation
class GuiSystem : public ari::System, public ari::EventSubscriber<events::OnComponentAssigned<Dock>>

Public Functions

GuiSystem()
virtual ~GuiSystem()
void Update(World *p_world, UpdateState state)

Update the system.

void Configure(World *p_world)

Configure the system after adding it to the world.

void Unconfigure(World *p_world)

Unconfigure the system before removing it from the world.

Type GetSystemType()

Returns the system type.

bool NeedUpdateOnState(UpdateState state)

Ask the system if needs update on different states.

void Receive(World *world, const events::OnComponentAssigned<Dock> &event)

Called when an event is emitted by the world.

Protected Functions

void RenderGui(Node *node)

Protected Attributes

bool m_bIsDockCreated
Class Image
Inheritance Relationships
Base Type
Class Documentation
class Image : public ari::Gui

Public Functions

bool BeginRender()

Public Members

std::shared_ptr<Texture> ImageTexture
ImVec2 Size
DelegateNoParam<void> OnHovered
Class BaseEventSubscriber
Inheritance Relationships
Derived Types
Class IProgram
Class Documentation
class IProgram

Public Functions

IProgram(const char *programName)
virtual ~IProgram()
virtual void Init() = 0
virtual bool Update(uint32_t frame_number, float elasped) = 0
virtual int Shutdown() = 0
tinystl::string GetProgramName() const

Protected Attributes

tinystl::string m_sProgramName
Class Label
Inheritance Relationships
Base Type
Class Documentation
class Label : public ari::Gui

Public Functions

Label()

Constructor.

~Label()
bool BeginRender()

Public Members

const char *Text
Class Node
Inheritance Relationships
Derived Types
Class Documentation
class Node

Subclassed by ari::Component, ari::Entity

Public Types

enum Type

Values:

Entity = 0
Component
Unknown

Public Functions

Node()

Constructor.

virtual ~Node()

Destructor.

template <class T>
T *AddChild(T *child)

Adds a node as child.

template <class T>
T *GetChild()
template <class T>
tinystl::vector<Node *> GetChildren()
template <class T>
void RemoveChild(T *child)

Removes a child from this node.

Parameters
  • child: The pointer to the child.

void RemoveChildren(bool _delete = false)

Removes all children of this node.

virtual Node *GetParent()

Returns the node parent.

virtual void SetParent(Node *parent)

Sets the node parent.

Node::Type GetType() const

Returns the node type.

Entity *GetParentEntity() const

Returns the parent Entity in the tree.

const tinystl::vector<Node *> &GetChildren() const
World *GetWorld() const
void Destroy(bool addToDestroyQueue = true)

Send the node to the destroy queue. It will be deleted in next two frame;

uint32_t IsInDestroyQueue() const

Protected Attributes

Node *m_pParent
tinystl::vector<Node *> m_vChilds
Node::Type m_eNodeType
World *m_pWorld
uint32_t m_iIsInDestroyQueue = 0
std::unordered_map<TypeIndex, tinystl::vector<Node *>> childs
Class Node3D
Inheritance Relationships
Base Type
Derived Types
Class Documentation
class Node3D : public ari::Component

Subclassed by ari::BoxShape, ari::Camera

Public Functions

Node3D()

Constructor.

virtual ~Node3D()

Destructor.

virtual void Render(const Matrix &matrix, bgfx::Encoder *encoder, uint16_t _view_id)

Render.

Public Members

Vector3 Position
Vector3 Rotation
Vector3 Scale
Matrix _finalMat
bool _isRenderable
Class PlatformWindow
Class Documentation
class PlatformWindow

Public Types

enum Type

Values:

Main
Child
Popup

Public Functions

PlatformWindow(Type _type)
virtual ~PlatformWindow()
virtual bool Init(int _posx, int _posy, int _width, int _height, uint32_t _flags, const char *_title) = 0
virtual bool Run() = 0
virtual void Show(bool _show) = 0
virtual void SetMousePos(int _x, int _y) = 0
virtual void SetTitle(const char *_title) = 0
virtual void SetFlags(uint32_t _flags, bool _addFlags = false) = 0
virtual void GetPos(int &_x, int &_y) = 0
virtual void SetPos(int _x, int _y) = 0
virtual void GetSize(int &_width, int &_height)
virtual void SetSize(int _width, int _height) = 0
virtual void SetAlpha(unsigned char _alpha) = 0
virtual void SetMouseLock(bool _lock) = 0
virtual void ToggleFrame() = 0
virtual bool IsWindowMaximized() = 0
virtual void SetWindowMaximized(bool _maximize) = 0
virtual bool IsWindowMinimized() = 0
virtual void SetWindowMinimized(bool _minimize) = 0
virtual void *GetHandle() = 0
void AddOnKeyDelegate(DelegateTwoParam<void, Key::Enum, bool> *_pDelegate)
void RemoveOnKeyDelegate(DelegateTwoParam<void, Key::Enum, bool> *_pDelegate)
void AddOnCharDelegate(DelegateTwoParam<void, uint8_t, uint8_t *> *_pDelegate)
void RemoveOnCharDelegate(DelegateTwoParam<void, uint8_t, uint8_t *> *_pDelegate)
void AddOnMouseButtonDelegate(DelegateTwoParam<void, MouseButton::Enum, bool> *_pDelegate)
void RemoveOnMouseButtonDelegate(DelegateTwoParam<void, MouseButton::Enum, bool> *_pDelegate)
void AddOnMouseMoveDelegate(DelegateTwoParam<void, int, int> *_pDelegate)
void RemoveOnMouseMoveDelegate(DelegateTwoParam<void, int, int> *_pDelegate)
void AddOnMouseWheelDelegate(DelegateOneParam<void, int> *_pDelegate)
void RemoveOnMouseWheelDelegate(DelegateOneParam<void, int> *_pDelegate)
void AddOnSizeDelegate(DelegateTwoParam<void, int, int> *_pDelegate)
void RemoveOnSizeDelegate(DelegateTwoParam<void, int, int> *_pDelegate)
bool ProcessEvents(uint32_t &_width, uint32_t &_height, uint32_t &_debug, uint32_t &_reset, MouseState *_mouse)

Protected Attributes

Type m_Type
uint32_t m_width
uint32_t m_height
uint32_t m_oldWidth
uint32_t m_oldHeight
uint32_t m_frameWidth
uint32_t m_frameHeight
float m_aspectRatio
EventQueue m_eventQueue
tinystl::vector<DelegateTwoParam<void, Key::Enum, bool> *> m_vOnKeys
tinystl::vector<DelegateTwoParam<void, uint8_t, uint8_t *> *> m_vOnChar
tinystl::vector<DelegateTwoParam<void, MouseButton::Enum, bool> *> m_vOnMouseButtons
tinystl::vector<DelegateTwoParam<void, int, int> *> m_vOnMouseMove
tinystl::vector<DelegateOneParam<void, int> *> m_vOnMouseWheel
tinystl::vector<DelegateTwoParam<void, int, int> *> m_vOnSize
Class Plugin
Inheritance Relationships
Base Type
Class Documentation
class Plugin : public ari::Resource

Public Types

enum Type

Values:

TextureLoader
MeshLoader
Unknown

Public Functions

Plugin(const uint32_t &_handel, const std::string &_fileName)
virtual ~Plugin()
virtual void *Create() = 0

Protected Attributes

Type m_eType = Type::Unknown
Class PluginManager
Inheritance Relationships
Base Type
Class Documentation
class PluginManager : public ari::ResourceManager<Plugin>

Protected Functions

bool LoadResource(Plugin **ppOut, uint32_t handle, const std::string &filename, void *extraParams)
Class Popup
Inheritance Relationships
Base Type
Class Documentation
class Popup : public ari::Gui

Public Functions

bool BeginRender()
void EndRender()
void Show()
void Hide()

Public Members

char *Name = nullptr

Name must be unique.

Protected Attributes

bool m_bDoEndPopup = false
bool m_bOpenPopup = false
bool m_bClosePopup = false
Class RenderSystem
Inheritance Relationships
Base Types
Class Documentation
class RenderSystem : public ari::System, public ari::EventSubscriber<events::OnComponentAssigned<BoxShape>>, public ari::EventSubscriber<events::OnFrameData>

Public Types

enum VertexType

Values:

Pos
Color
Count

Public Functions

RenderSystem()
~RenderSystem()
void Update(World *p_world, UpdateState state)

Update the system.

void Configure(World *p_world)

Configure the system after adding it to the world.

void Unconfigure(World *p_world)

Unconfigure the system before removing it from the world.

Type GetSystemType()

Returns the system type.

bool NeedUpdateOnState(UpdateState state)

Ask the system if needs update on different states.

void Receive(World *world, const events::OnComponentAssigned<BoxShape> &event)

Called when an event is emitted by the world.

void Receive(World *world, const events::OnFrameData &event)

Called when an event is emitted by the world.

bgfx::VertexDecl *GetVertexDecl(VertexType vertex_type) const
bgfx::ProgramHandle *GetProgram() const

Protected Attributes

bgfx::VertexDecl *m_pVertexDeclArray
bgfx::ProgramHandle *m_Program
FrameData *m_pFrameDataCurrent
FrameData *m_pFrameDataNext
uint16_t m_view_id = 0
Class Resource
Inheritance Relationships
Derived Types
Class Documentation
class Resource

Subclassed by ari::Plugin, ari::Texture

Public Functions

Resource()
Resource(const uint32_t &_handel, const std::string &_fileName)
virtual ~Resource()
uint32_t GetHandel() const
std::string GetFileName() const

Protected Attributes

uint32_t m_iHandle
std::string m_sFileName
Class ResourceLoader
Class Documentation
class ResourceLoader

Public Functions

ResourceLoader()

Constructor.

virtual ~ResourceLoader()

Destructor.

virtual bool IsALoadableFileExtension(std::string _extention)

returns true if the file maybe is able to be loaded by this Loader based on the file extension (e.g. “.mesh”)

virtual Resource *LoadResource(bx::FileReaderI *pStream, uint32_t _handle, const std::string &_filename, void *_extraParams) = 0

Loads a resource from a FileSystem and return its pointer.

Return
Returns the created resource pointer. Note resource may not loaded yet.
Parameters
  • pStream:
  • _extraParams:

Protected Attributes

std::vector<std::string> m_aFileExtension

The file extension list that this loader is capable to load.

bool m_bSwapEndian

Swap the loaded data or not.

Template Class ResourceManager
Class Documentation
template <class T>
class ResourceManager

Public Functions

virtual ~ResourceManager()
std::shared_ptr<T> Load(const std::string &filename, void *extraParams)
void AddLoader(ResourceLoader *pLoader)
uint32_t GetNewHandle()
std::shared_ptr<T> AddResource(T *_resource)

Protected Functions

virtual bool LoadResource(T **ppOut, uint32_t handle, const std::string &filename, void *extraParams) = 0

Protected Attributes

std::vector<std::shared_ptr<T>> m_vResources

Stores the resources

std::stack<uint32_t> m_sHandles

Stores the unused handles number

std::vector<ResourceLoader *> m_vLoaders

Stores the resource loaders.

Class SceneSystem
Inheritance Relationships
Base Types
Class Documentation
class SceneSystem : public ari::System, public ari::EventSubscriber<events::OnEntityCreated>, public ari::EventSubscriber<events::OnEntityDestroyed>, public ari::EventSubscriber<events::OnComponentAssigned<Camera>>, public ari::EventSubscriber<events::OnComponentRemoved<Camera>>, public ari::EventSubscriber<events::OnComponentAssigned<BoxShape>>, public ari::EventSubscriber<events::OnComponentRemoved<BoxShape>>

Public Functions

SceneSystem()

Constructor.

~SceneSystem()

Destructor.

void Update(World *p_world, UpdateState state)

Update the system.

void Configure(World *p_world)

Configure the system after adding it to the world.

void Unconfigure(World *p_world)

Unconfigure the system before removing it from the world.

Type GetSystemType()

Returns the system type.

bool NeedUpdateOnState(UpdateState state)

Ask the system if needs update on different states.

void Receive(World *world, const events::OnEntityCreated &event)

Called when an event is emitted by the world.

void Receive(World *world, const events::OnEntityDestroyed &event)

Called when an event is emitted by the world.

void Receive(World *world, const events::OnComponentAssigned<Camera> &event)

Called when an event is emitted by the world.

void Receive(World *world, const events::OnComponentRemoved<Camera> &event)

Called when an event is emitted by the world.

void Receive(World *world, const events::OnComponentAssigned<BoxShape> &event)

Called when an event is emitted by the world.

void Receive(World *world, const events::OnComponentRemoved<BoxShape> &event)

Called when an event is emitted by the world.

Protected Functions

void CalcTransform(Node *node, Matrix *parentMat)

Protected Attributes

Camera *m_pActiveCamera
FrameData *m_FrameDatasUnused
FrameData *m_FrameDatasTransforms
FrameData *m_FrameDatasVisible
Class System
Inheritance Relationships
Derived Types
Class Documentation
class System

Subclassed by ari::GuiSystem, ari::RenderSystem, ari::SceneSystem

Public Types

enum Type

Values:

GameplaySystem
SceneSystem
RenderSystem
enum UpdateState

Values:

GameplayState
SceneManagerState
MainThreadState

Public Functions

System()

Constructor.

virtual ~System()

Destructor.

virtual void Update(World *p_world, UpdateState state) = 0

Update the system.

virtual void Configure(World *p_world) = 0

Configure the system after adding it to the world.

virtual void Unconfigure(World *p_world) = 0

Unconfigure the system before removing it from the world.

virtual Type GetSystemType() = 0

Returns the system type.

virtual bool NeedUpdateOnState(UpdateState state) = 0

Ask the system if needs update on different states.

Class TextBox
Inheritance Relationships
Base Type
Class Documentation
class TextBox : public ari::Gui

Public Functions

TextBox(size_t maxLength = 128)
~TextBox()
bool BeginRender()
void SetText(const char *_text) const

Public Members

char *Text
char *Label
Class Texture
Inheritance Relationships
Base Type
Class Documentation
class Texture : public ari::Resource

Public Functions

Texture()
Texture(const uint32_t &_handel, const std::string &_fileName)
~Texture()

Public Members

bgfx::TextureHandle Handle = BGFX_INVALID_HANDLE
Class TextureManager
Inheritance Relationships
Base Type
Class Documentation
class TextureManager : public ari::ResourceManager<Texture>

Public Functions

~TextureManager()

Protected Functions

bool LoadResource(Texture **ppOut, uint32_t handle, const std::string &filename, void *extraParams)
Class Viewport
Inheritance Relationships
Base Type
Class Documentation
class Viewport : public ari::Component

Public Members

RectI Rect
bgfx::TextureFormat::Enum TextureFormat = bgfx::TextureFormat::Count
bool CreateDepth = false
bool UseMSAA = false
bgfx::FrameBufferHandle m_frame_buffer_handle = BGFX_INVALID_HANDLE
RectI m_last_rect
bgfx::ViewId m_view_id = 0
Texture m_texture
Texture m_depth_texture
Class Window
Inheritance Relationships
Base Type
Class Documentation
class Window : public ari::Gui

Public Functions

Window()
~Window()
bool BeginRender()
void EndRender()

Public Members

char *Name
bool CloseButton
bool isOpen
ImVec2 Pos
ImVec2 Size
ImGuiWindowFlags Flags
Class World
Class Documentation
class World

Public Types

enum UpdateType

Values:

Sync
Async

Public Functions

World()

Constructor.

~World()

Destructor.

void SetUpdateType(UpdateType type)
UpdateType GetUpdateType() const
void AddSystem(System *p_system)

Add a new system to the world

void RemoveSystem(System *p_system)

Removes a system from world

void AddEntity(Entity *p_entity)

Adds a new entity to the world

void RemoveEntity(Entity *p_entity)

Removes an entity from world

void Update(float tick)

Updates the world

void _AddToDestroyQueue(Node *node)

internal use Node::Destroy() instead. Add a node to destroy queue

template <typename T>
void subscribe(EventSubscriber<T> *subscriber)

Subscribe to an event.

template <typename T>
void unsubscribe(EventSubscriber<T> *subscriber)

Unsubscribe from an event.

void unsubscribeAll(void *subscriber)

Unsubscribe from all events. Don’t be afraid of the void pointer, just pass in your subscriber as normal.

template <typename T>
void emit(const T &event)

Emit an event. This will do nothing if there are no subscribers for the event type.

const tinystl::vector<Entity *> &GetAllEntities() const
ftl::TaskScheduler *GetTaskScheduler() const

Protected Functions

void CheckDestroyQueue()

Protected Attributes

std::unordered_map<TypeIndex, tinystl::vector<Internal::BaseEventSubscriber *>> subscribers
bx::SpScUnboundedQueueT<Node> m_qDestroyQueue
tinystl::vector<System *> systems
tinystl::vector<Entity *> Entities
ftl::TaskScheduler *m_pTaskScheduler
UpdateType m_UpdateType
Class AssetBrowser
Inheritance Relationships
Base Type
Class Documentation
class AssetBrowser : public shiva::DockWindow

Public Functions

~AssetBrowser()
void Init(ari::World *p_world)
Class DirectoryTree
Class Documentation
class DirectoryTree

Public Functions

void Update()

Public Members

std::string Name
bx::FilePath Path
std::vector<FileInfo> FileList
std::vector<DirectoryTree> Directories
bool IsRoot = false
Class DockWindow
Inheritance Relationships
Derived Types
Class Documentation
class DockWindow

DockWindow is the base class for other windows in editor.

Subclassed by shiva::AssetBrowser, shiva::ProjectBrowser, shiva::PropertyEditor, shiva::Viewport

Public Functions

virtual ~DockWindow()
ari::DockableWindow *GetDock() const
virtual void Init(ari::World *p_world)
virtual void Shutdown()

Protected Attributes

ari::Entity *m_pEntity = nullptr
ari::DockableWindow *m_pWindow = nullptr
Class Editor
Class Documentation
class Editor

Public Functions

Editor()
~Editor()
void Init()
void Update(float elasped)
void LoadProject(Project *project)
Project *GetCurrentProject() const
ari::GuiSystem *GetGuiSystem()

Protected Attributes

ari::World m_EditorWorld
ari::GuiSystem m_GuiSystem
ari::RenderSystem m_RenderSystem
ari::SceneSystem m_SceneSystem
ProjectBrowser m_ProjectBrowser
EditorWindowManager m_EditorWindow
Project *m_pCurrentProject = nullptr
Class EditorSettings
Class Documentation
class EditorSettings

Public Members

std::string LastProjectPath

Public Static Functions

static EditorSettings &Get()
static void Save()
static void Load()
Class EditorWindowManager
Class Documentation
class EditorWindowManager

Public Functions

EditorWindowManager()
~EditorWindowManager()
void Init(ari::World *pWorld)
void Shutdown()

Protected Attributes

ari::Entity *m_pEntity = nullptr
AssetBrowser *m_pAssetBrowser = nullptr
Viewport *m_pViewport = nullptr
PropertyEditor *m_pPropertyEditor = nullptr
Class Project
Class Documentation
class Project

Public Functions

Project()
~Project()
void Save()
void UpdateProjectTree()
const DirectoryTree &GetTree() const
const bx::FilePath &GetPath() const

Public Static Functions

static Project *New(bx::FilePath projectPath, std::string name, bx::Error *err)
static Project *Load(bx::FilePath path, bx::Error *err)
Class ProjectBrowser
Inheritance Relationships
Base Type
Class Documentation
class ProjectBrowser : shiva::DockWindow

Public Functions

ProjectBrowser()
~ProjectBrowser()
void Init(ari::World *p_world)
void Shutdown()

Protected Functions

void OnNewProjectClick()
void OnOpenProjectClick()
void OnClickMbOk()
void ProjectOpened(Project *project)

Protected Attributes

ari::TextBox *m_pNewProjectName
ari::TextBox *m_pNewProjectPath
ari::Button *m_pNewProjectBtn
ari::TextBox *m_pOpenProjectPath
ari::Button *m_pOpenProjectBtn
ari::Popup *m_pMessageBox
ari::Label *m_pMbLabel
ari::Button *m_pMbOkBtn
Class ProjectGui
Inheritance Relationships
Base Type
Class Documentation
class ProjectGui : public ari::Gui

Custom GUI component to show a project in the list.

Public Functions

bool BeginRender()
void EndRender()
Class PropertyEditor
Inheritance Relationships
Base Type
Class Documentation
class PropertyEditor : public shiva::DockWindow

Public Functions

void Init(ari::World *p_world)
Class Viewport
Inheritance Relationships
Base Type
Class Documentation
class Viewport : public shiva::DockWindow

Public Functions

void Init(ari::World *p_world)

Protected Functions

void OnGui()
void OnHovered()

Protected Attributes

ari::Camera *m_pCamera = nullptr
ari::Viewport *m_pViewport = nullptr
ari::Image *m_pView = nullptr
ari::PlatformWindow *m_pPlatformWindow = nullptr
ari::DelegateTwoParam<void, int, int> m_OnMouseMove

Functions

Function ari::BX_ALIGN_DECL_16
Function Documentation
ari::BX_ALIGN_DECL_16(struct)
Function ari::getDefaultAllocator
Function Documentation
bx::AllocatorI *ari::getDefaultAllocator()
Function ari::getName
Function Documentation
const char *ari::getName(Key::Enum _key)
Template Function ari::getTypeIndex
Function Documentation
template <typename T>
TypeIndex ari::getTypeIndex()
Function ari::inputAddBindings
Function Documentation
void ari::inputAddBindings(const char *_name, const InputBinding *_bindings)
Function ari::inputChar
Function Documentation
void ari::inputChar(uint8_t _len, const uint8_t _char[4])

Adds single UTF-8 encoded character into input buffer.

Function ari::inputCharFlush
Function Documentation
void ari::inputCharFlush()

Flush internal input buffer.

Function ari::inputGetChar
Function Documentation
const uint8_t *ari::inputGetChar()

Returns single UTF-8 encoded character from input buffer.

Function ari::inputGetGamepadAxis
Function Documentation
int32_t ari::inputGetGamepadAxis(GamepadHandle _handle, GamepadAxis::Enum _axis)
Function ari::inputGetKeyState
Function Documentation
bool ari::inputGetKeyState(Key::Enum _key, uint8_t *_modifiers = NULL)
Function ari::inputGetModifiersState
Function Documentation
uint8_t ari::inputGetModifiersState()
Function ari::inputGetMouse
Function Documentation
void ari::inputGetMouse(float _mouse[3])
Function ari::inputInit
Function Documentation
void ari::inputInit()
Function ari::inputIsMouseLocked
Function Documentation
bool ari::inputIsMouseLocked()
Function ari::inputProcess
Function Documentation
void ari::inputProcess()
Function ari::inputRemoveBindings
Function Documentation
void ari::inputRemoveBindings(const char *_name)
Function ari::inputSetGamepadAxis
Function Documentation
void ari::inputSetGamepadAxis(GamepadHandle _handle, GamepadAxis::Enum _axis, int32_t _value)
Function ari::inputSetKeyState
Function Documentation
void ari::inputSetKeyState(Key::Enum _key, uint8_t _modifiers, bool _down)
Function ari::inputSetMouseButtonState
Function Documentation
void ari::inputSetMouseButtonState(MouseButton::Enum _button, uint8_t _state)
Function ari::inputSetMouseLock
Function Documentation
void ari::inputSetMouseLock(bool _lock)
Function ari::inputSetMousePos
Function Documentation
void ari::inputSetMousePos(int32_t _mx, int32_t _my, int32_t _mz)
Function ari::inputSetMouseResolution
Function Documentation
void ari::inputSetMouseResolution(uint16_t _width, uint16_t _height)
Function ari::inputShutdown
Function Documentation
void ari::inputShutdown()
Function ari::isValid(WindowHandle)
Function Documentation
bool ari::isValid(WindowHandle _handle)
Function ari::isValid(GamepadHandle)
Function Documentation
bool ari::isValid(GamepadHandle _handle)
Function ari::poll()
Function Documentation
const Event *ari::poll()
Function ari::poll(WindowHandle)
Function Documentation
const Event *ari::poll(WindowHandle)
Function ari::release
Function Documentation
void ari::release(const Event *_event)
Function BX_ERROR_RESULT
Function Documentation
BX_ERROR_RESULT(SH_ERROR_NOT_EMPTY_DIRECTPRY, BX_MAKEFOURCC('s', 'h', 0, 0))
Template Function castToString(const T&)
Function Documentation
template <typename T>
std::string castToString(const T &value)
Function castToString(const bool&)
Function Documentation
std::string castToString(const bool &value)
Function castToString(const int&)
Function Documentation
std::string castToString(const int &value)
Function castToString(const float&)
Function Documentation
std::string castToString(const float &value)
Function castToString(const std::string&)
Function Documentation
std::string castToString(const std::string &value)
Template Function from_json(const json&, T&)
Function Documentation
template <typename T>
void from_json(const json &j, T &obj)
Template Function from_json(const json&, T&)
Function Documentation
template <typename T>
void from_json(const json &j, T &obj)
Template Function fromString(const std::string&)
Function Documentation
template <typename T>
T fromString(const std::string &value)
Function fromString(const std::string&)
Function Documentation
template <typename T>
T fromString(const std::string &value)
Function fromString(const std::string&)
Function Documentation
template <typename T>
T fromString(const std::string &value)
Function fromString(const std::string&)
Function Documentation
template <typename T>
T fromString(const std::string &value)
Function fromString(const std::string&)
Function Documentation
template <typename T>
T fromString(const std::string &value)
Template Function meta::deserialize(Class&, const json&)
Function Documentation

Warning

doxygenfunction: Unable to resolve multiple matches for function “meta::deserialize” with arguments (Class&, const json&) in doxygen xml output for project “Ariyana engine” from directory: doxyoutput/xml. Potential matches:

- template <typename Class, typename = std::enable_if_t<!meta::isRegistered<Class>()>, typename = void>
  void meta::deserialize(Class&, const json&)
- template <typename Class, typename = std::enable_if_t<meta::isRegistered<Class>()>>
  void meta::deserialize(Class&, const json&)
- template <typename Class>
  Class meta::deserialize(const json&)
- template <typename K, typename V>
  void meta::deserialize(std::unordered_map<K, V>&, const json&)
- template <typename T>
  void meta::deserialize(std::vector<T>&, const json&)
Template Function meta::deserialize(Class&, const json&)
Function Documentation

Warning

doxygenfunction: Unable to resolve multiple matches for function “meta::deserialize” with arguments (Class&, const json&) in doxygen xml output for project “Ariyana engine” from directory: doxyoutput/xml. Potential matches:

- template <typename Class, typename = std::enable_if_t<!meta::isRegistered<Class>()>, typename = void>
  void meta::deserialize(Class&, const json&)
- template <typename Class, typename = std::enable_if_t<meta::isRegistered<Class>()>>
  void meta::deserialize(Class&, const json&)
- template <typename Class>
  Class meta::deserialize(const json&)
- template <typename K, typename V>
  void meta::deserialize(std::unordered_map<K, V>&, const json&)
- template <typename T>
  void meta::deserialize(std::vector<T>&, const json&)
Template Function meta::deserialize(std::vector<T>&, const json&)
Function Documentation
template <typename T>
void meta::deserialize(std::vector<T> &obj, const json &object)
Template Function meta::deserialize(std::unordered_map<K, V>&, const json&)
Function Documentation
template <typename K, typename V>
void meta::deserialize(std::unordered_map<K, V> &obj, const json &object)
Template Function meta::deserialize(const json&)
Function Documentation
template <typename Class>
Class meta::deserialize(const json &obj)
Function meta::registerMembers< shiva::EditorSettings >
Function Documentation

Warning

doxygenfunction: Cannot find function “meta::registerMembers< shiva::EditorSettings >” in doxygen xml output for project “Ariyana engine” from directory: doxyoutput/xml

Function meta::registerMembers< shiva::Project >
Function Documentation

Warning

doxygenfunction: Cannot find function “meta::registerMembers< shiva::Project >” in doxygen xml output for project “Ariyana engine” from directory: doxyoutput/xml

Template Function meta::serialize(const Class&)
Function Documentation

Warning

doxygenfunction: Unable to resolve multiple matches for function “meta::serialize” with arguments (const Class&) in doxygen xml output for project “Ariyana engine” from directory: doxyoutput/xml. Potential matches:

- template <typename Class, typename = std::enable_if_t <!meta::isRegistered<Class>()>, typename = void>
  json meta::serialize(const Class&)
- template <typename Class, typename = std::enable_if_t <meta::isRegistered<Class>()>>
  json meta::serialize(const Class&)
Template Function meta::serialize(const Class&)
Function Documentation

Warning

doxygenfunction: Unable to resolve multiple matches for function “meta::serialize” with arguments (const Class&) in doxygen xml output for project “Ariyana engine” from directory: doxyoutput/xml. Potential matches:

- template <typename Class, typename = std::enable_if_t <!meta::isRegistered<Class>()>, typename = void>
  json meta::serialize(const Class&)
- template <typename Class, typename = std::enable_if_t <meta::isRegistered<Class>()>>
  json meta::serialize(const Class&)
Template Function meta::serialize_basic(const Class&)
Function Documentation
template <typename Class>
json meta::serialize_basic(const Class &obj)
Template Function meta::serialize_basic(const std::vector<T>&)
Function Documentation
template <typename T>
json meta::serialize_basic(const std::vector<T> &obj)
Template Function meta::serialize_basic(const std::unordered_map<K, V>&)
Function Documentation
template <typename K, typename V>
json meta::serialize_basic(const std::unordered_map<K, V> &obj)
Template Function to_json(json&, const T&)
Function Documentation
template <typename T>
void to_json(json &j, const T &obj)
Template Function to_json(json&, const T&)
Function Documentation
template <typename T>
void to_json(json &j, const T &obj)

Variables

Variable ari::fDegToRad
Variable Documentation
const float ari::fDegToRad = 0.0174532925f
Variable ari::fEpsilon
Variable Documentation
const float ari::fEpsilon = 0.000001f
Variable ari::fRadToDeg
Variable Documentation
const float ari::fRadToDeg = 57.295779513f
Variable ari::g_pEngine
Variable Documentation
Engine *ari::g_pEngine
Variable ari::PI
Variable Documentation
const float ari::PI = 3.141592654f

P number.

Variable ari::PiOver2
Variable Documentation
const float ari::PiOver2 = 1.570796326f
Variable ari::TwoPI
Variable Documentation
const float ari::TwoPI = 6.283185307f
Variable g_allocator
Variable Documentation
bx::AllocatorI *g_allocator
Variable shiva::g_pEditor
Variable Documentation
Editor *shiva::g_pEditor

Defines

Define ARI_API
Define Documentation
ARI_API
Define ARI_CONFIG_MAX_WINDOW
Define Documentation
ARI_CONFIG_MAX_WINDOW
Define ARI_DECLARE_TYPE
Define Documentation
ARI_DECLARE_TYPE
Define ARI_DEFINE_TYPE
Define Documentation
ARI_DEFINE_TYPE(name)
Define ARI_EXPORT_DLL
Define Documentation
ARI_EXPORT_DLL
Define ARI_IMPORT_DLL
Define Documentation
ARI_IMPORT_DLL
Define ARI_PLUGIN_API
Define Documentation
ARI_PLUGIN_API
Define ARI_TYPE_IMPLEMENTATION
Define Documentation
ARI_TYPE_IMPLEMENTATION
Define ENTRY_CONFIG_MAX_GAMEPADS
Define Documentation
ENTRY_CONFIG_MAX_GAMEPADS
Define ENTRY_IMPLEMENT_EVENT
Define Documentation
ENTRY_IMPLEMENT_EVENT(_class, _type)
Define ENTRY_WINDOW_FLAG_ASPECT_RATIO
Define Documentation
ENTRY_WINDOW_FLAG_ASPECT_RATIO
Define ENTRY_WINDOW_FLAG_FRAME
Define Documentation
ENTRY_WINDOW_FLAG_FRAME
Define ENTRY_WINDOW_FLAG_NONE
Define Documentation
ENTRY_WINDOW_FLAG_NONE
Define INPUT_BINDING_END
Define Documentation
INPUT_BINDING_END
Define SHIVA_API
Define Documentation
SHIVA_API
Define TINYSTL_ALLOCATOR
Define Documentation
TINYSTL_ALLOCATOR

Typedefs

Typedef ari::InputBindingFn
Typedef Documentation
typedef void (*ari::InputBindingFn)(const void *_userData)
Typedef ari::RectF
Typedef Documentation
typedef Rect<float> ari::RectF
Typedef ari::RectI
Typedef Documentation
typedef Rect<int> ari::RectI
Typedef ari::RectU16
Typedef Documentation
typedef Rect<uint16_t> ari::RectU16
Typedef ari::TypeIndex
Typedef Documentation
typedef std::type_index ari::TypeIndex
Typedef json
Typedef Documentation
using json = nlohmann::json

Directories

Directory include

Directory path: include

Directory 2d

Parent directory (include/ari/en)

Directory path: include/ari/en/2d

Directory 3d

Parent directory (include/ari/en)

Directory path: include/ari/en/3d

Directory gfx

Parent directory (include/ari)

Directory path: include/ari/gfx

Directory io

Parent directory (include/ari)

Directory path: include/ari/io

Directory math

Parent directory (include/ari)

Directory path: include/ari/math

Directory shiva

Parent directory (include)

Directory path: include/shiva

Subdirectories

Files

File aridef.hpp

Parent directory (include/ari)

Definition (include/ari/aridef.hpp)
Program Listing for File aridef.hpp

Return to documentation for file (include/ari/aridef.hpp)

#pragma once

#if defined( _MSC_VER )
#   pragma warning(disable:4251) // dll interface for std types
#   define ARI_EXPORT_DLL __declspec(dllexport)
#   define ARI_IMPORT_DLL __declspec(dllimport)
#else
#   define ARI_EXPORT_DLL __attribute__((visibility("default")))
#   define ARI_IMPORT_DLL
#endif

#ifdef ARI_EXPORT
#   define ARI_API ARI_EXPORT_DLL
#else
#   define ARI_API ARI_IMPORT_DLL
#endif

#ifdef ARI_PLUGIN_EXPORT
#   define ARI_PLUGIN_API ARI_EXPORT_DLL
#else
#   define ARI_PLUGIN_API ARI_IMPORT_DLL
#endif

#define ARI_CONFIG_MAX_WINDOW          8
#define ENTRY_CONFIG_MAX_GAMEPADS      4
#define ENTRY_WINDOW_FLAG_NONE         UINT32_C(0x00000000)
#define ENTRY_WINDOW_FLAG_ASPECT_RATIO UINT32_C(0x00000001)
#define ENTRY_WINDOW_FLAG_FRAME        UINT32_C(0x00000002)

// Define ARI_NO_RTTI to turn off RTTI. This requires using the ARI_DEFINE_TYPE and ARI_DECLARE_TYPE macros on all types
// that you wish to use as components or events. If you use ARI_NO_RTTI, also place ARI_TYPE_IMPLEMENTATION in a single cpp file.
//#define ARI_NO_RTTI

#ifndef ARI_NO_RTTI

#include <typeindex>
#include <typeinfo>
#define ARI_TYPE_IMPLEMENTATION

#else

#define ARI_TYPE_IMPLEMENTATION \
    ari::TypeIndex ari::Internal::TypeRegistry::nextIndex = 1; \
    \
    ARI_DEFINE_TYPE(ari::Events::OnEntityCreated);\
    ARI_DEFINE_TYPE(ari::Events::OnEntityDestroyed); \

#endif

namespace bx
{
    struct AllocatorI;
}
namespace ari
{
    ARI_API bx::AllocatorI* getDefaultAllocator();

    struct ARI_API TinyStlAllocator
    {
        static void* static_allocate(size_t _bytes);
        static void static_deallocate(void* _ptr, size_t /*_bytes*/);
    };

#ifndef ARI_NO_RTTI
    typedef std::type_index TypeIndex;

#define ARI_DECLARE_TYPE
#define ARI_DEFINE_TYPE(name)

    template<typename T>
    TypeIndex getTypeIndex()
    {
        return std::type_index(typeid(T));
    }

#else
    typedef uint32_t TypeIndex;

    namespace Internal
    {
        class TypeRegistry
        {
        public:
            TypeRegistry()
            {
                index = nextIndex;
                ++nextIndex;
            }

            TypeIndex getIndex() const
            {
                return index;
            }

        private:
            static TypeIndex nextIndex;
            TypeIndex index;
        };
    }

#define ARI_DECLARE_TYPE public: static ari::Internal::TypeRegistry __ari_type_reg
#define ARI_DEFINE_TYPE(name) ari::Internal::TypeRegistry name::__ari_type_reg

    template<typename T>
    TypeIndex getTypeIndex()
    {
        return T::__ari_type_reg.getIndex();
    }
#endif

} // namespace ari

#   define TINYSTL_ALLOCATOR ari::TinyStlAllocator
Includes
  • typeindex
  • typeinfo
File arimath.hpp

Parent directory (include/ari/math)

Definition (include/ari/math/arimath.hpp)
Program Listing for File arimath.hpp

Return to documentation for file (include/ari/math/arimath.hpp)

#pragma once


namespace ari
{
    const float PI          = 3.141592654f;
    const float TwoPI       = 6.283185307f;
    const float PiOver2     = 1.570796326f;

    const float fDegToRad = 0.0174532925f;
    const float fRadToDeg = 57.295779513f;

    const float fEpsilon  = 0.000001f;

} // ari
Included By
Namespaces
File AssetBrowser.hpp

Parent directory (include/shiva/windows)

Definition (include/shiva/windows/AssetBrowser.hpp)
Program Listing for File AssetBrowser.hpp

Return to documentation for file (include/shiva/windows/AssetBrowser.hpp)

#pragma once
#include "shiva/shivadef.hpp"
#include "shiva/DirectoryTree.hpp"
#include "../../../src/editor/windows/AssetGui.hpp"
#include "ari/en/gui/DockableWindow.hpp"
#include "DockWindow.hpp"

namespace ari {
    class Button;
    class Dock;
    class DockSpace;
}

namespace shiva
{
    class AssetGui;

    class SHIVA_API AssetBrowser : public DockWindow
    {
    public:

        ~AssetBrowser();

        void Init(ari::World* p_world);

    private:

        void UpdateAssets(const DirectoryTree& _tree);
        static DirectoryTree* FindPathTree(DirectoryTree* _tree, const std::string& _path);
        void OnDblClick(AssetGui* _sender);
        void OnRightClick(AssetGui* _sender);

        std::vector<AssetGui*>  m_vAssets;

    }; // AssetBrowser

} // shiva
Includes
File BoxShape.hpp

Parent directory (include/ari/en/3d)

Definition (include/ari/en/3d/BoxShape.hpp)
Program Listing for File BoxShape.hpp

Return to documentation for file (include/ari/en/3d/BoxShape.hpp)

#pragma once
#include "Node3D.hpp"

namespace bgfx
{
    struct VertexBufferHandle;
    struct IndexBufferHandle;
    struct ProgramHandle;
}

namespace ari
{
    class RenderSystem;

    class ARI_API BoxShape: public Node3D
    {
    public:

        // Constructor
        BoxShape() { _isRenderable = true; }

        virtual ~BoxShape() = default;

        virtual void Render(const Matrix& matrix, bgfx::Encoder* encoder, uint16_t _view_id) override;

        static void Init(RenderSystem* render_system);
        static void Shutdown();

        static bgfx::VertexBufferHandle m_sVBPos;
        static bgfx::VertexBufferHandle m_sVBColor;
        static bgfx::IndexBufferHandle  m_sIB;
        static bgfx::ProgramHandle      m_sProgram;

    }; // BoxShape
}
Includes
File Button.hpp

Parent directory (include/ari/en/gui)

Definition (include/ari/en/gui/Button.hpp)
Program Listing for File Button.hpp

Return to documentation for file (include/ari/en/gui/Button.hpp)

#pragma once
#include "Gui.hpp"
#include "../../Delegate.hpp"

namespace ari
{
    class ARI_API Button: public Gui
    {
    public:

        bool BeginRender() override;

        DelegateNoParam<void> OnClick;

        char* Label;
    };
} // ari
Includes
Namespaces
Classes
File Camera.hpp

Parent directory (include/ari/en/3d)

Definition (include/ari/en/3d/Camera.hpp)
Program Listing for File Camera.hpp

Return to documentation for file (include/ari/en/3d/Camera.hpp)

#pragma once

#include "Node3D.hpp"
#include "../../math/Matrix.hpp"

namespace ari
{
    class ARI_API Camera: public Node3D
    {
    public:

        Camera() : Up(0.0f, 1.0f, 0.0f), _isActive(false) { }

        virtual ~Camera() = default;

        Vector3 Target,
            Up,
            Right;
        Matrix _view,
            _proj;
        bool _isActive;

        void Rotate(float _angle, const Vector3& _axis);

        void RotateByMouse(int _x, int _y, float _speed);

        void MoveBF(const float& _speed);

        void MoveLR(const float& _speed);

        void MoveUD(const float& _speed);

    protected:

        float           m_fCurRotX  = 0.0f, // Current Rotation X
                        m_fLastRotX = 0.0f; // Last Rotation X

    }; // Camera

} // ari
Includes
Namespaces
Classes
File CheckBox.hpp

Parent directory (include/ari/en/gui)

Definition (include/ari/en/gui/CheckBox.hpp)
Program Listing for File CheckBox.hpp

Return to documentation for file (include/ari/en/gui/CheckBox.hpp)

#pragma once
#include "Gui.hpp"

namespace ari
{
    class ARI_API CheckBox: public Gui
    {
    public:

        CheckBox();

        ~CheckBox() = default;

        bool BeginRender() override;

        bool        Checked;
        char    *   Label;
    };

} // ari
Includes
Namespaces
File Component.hpp

Parent directory (include/ari/en)

Definition (include/ari/en/Component.hpp)
Program Listing for File Component.hpp

Return to documentation for file (include/ari/en/Component.hpp)

#pragma once
#include "Node.hpp"

namespace ari
{
    class ARI_API Component: public Node
    {
    public:

        Component();

        virtual ~Component() = default;

        bool _isFromNode3D;
        bool _isFromGui;

    }; // Component

} // ari
Includes
Namespaces
File Delegate.hpp

Parent directory (include/ari)

Definition (include/ari/Delegate.hpp)
Program Listing for File Delegate.hpp

Return to documentation for file (include/ari/Delegate.hpp)

#pragma once

namespace ari
{
    template <class Treturn>
    class DelegateNoParam
    {
        class BaseFuncNoParam
        {
        public:
            virtual ~BaseFuncNoParam() = default;

            virtual Treturn Call() = 0;
        };

        template <class Tclass>
        class MemFuncNoParam : public BaseFuncNoParam
        {
        public:

            MemFuncNoParam(Tclass* _obj, Treturn(Tclass::*_fun)()) : m_pObj(_obj), m_pFun(_fun) {}

            Treturn Call() override
            {
                return (*m_pObj.*m_pFun)();
            }

        protected:

            Tclass  *   m_pObj;
            Treturn(Tclass::*m_pFun)();
        };

    public:

        DelegateNoParam() : m_pFun(nullptr), m_pMemFun(nullptr) { }

        ~DelegateNoParam()
        {
            delete m_pMemFun;
        }

        void Bind(Treturn(*_fun)()) { m_pFun = _fun; }

        template <class Tclass>
        void Bind(Tclass* _obj, Treturn(Tclass::*_fun)())
        {
            m_pMemFun = new MemFuncNoParam<Tclass>(_obj, _fun);
        }

        bool IsBound() { return m_pFun || m_pMemFun; }

        Treturn Execute()
        {
            if (m_pFun)
                return m_pFun();
            if (m_pMemFun)
                return m_pMemFun->Call();
        }

    protected:
        Treturn(*m_pFun)();
        BaseFuncNoParam *   m_pMemFun;
    };



    template <class Treturn, class Targ1>
    class DelegateOneParam
    {
        class BaseFuncOneParam
        {
        public:
            virtual ~BaseFuncOneParam() = default;

            virtual Treturn Call(Targ1 arg1) = 0;
        };

        template <class Tclass>
        class MemFuncOneParam : public BaseFuncOneParam
        {
        public:

            MemFuncOneParam(Tclass* _obj, Treturn(Tclass::*_fun)(Targ1)) : m_pObj(_obj), m_pFun(_fun) {}

            Treturn Call(Targ1 arg1) override
            {
                return (*m_pObj.*m_pFun)(arg1);
            }

        protected:

            Tclass  *   m_pObj;
            Treturn(Tclass::*m_pFun)(Targ1);
        };

    public:

        DelegateOneParam() : m_pFun(nullptr), m_pMemFun(nullptr) { }

        ~DelegateOneParam()
        {
            delete m_pMemFun;
        }

        void Bind(Treturn(*_fun)(Targ1)) { m_pFun = _fun; }

        template <class Tclass>
        void Bind(Tclass* _obj, Treturn(Tclass::*_fun)(Targ1))
        {
            m_pMemFun = new MemFuncOneParam<Tclass>(_obj, _fun);
        }

        bool IsBound() { return m_pFun || m_pMemFun; }

        Treturn Execute(Targ1 arg1)
        {
            if (m_pFun)
                return m_pFun(arg1);
            if (m_pMemFun)
                return m_pMemFun->Call(arg1);
        }

    protected:
        Treturn(*m_pFun)(Targ1);
        BaseFuncOneParam    *   m_pMemFun;
    };



    template <class Treturn, class Targ1, class Targ2>
    class DelegateTwoParam
    {
        class BaseFuncTwoParam
        {
        public:
            virtual ~BaseFuncTwoParam() = default;

            virtual Treturn Call(Targ1 arg1, Targ2 arg2) = 0;
        };

        template <class Tclass>
        class MemFuncTwoParam : public BaseFuncTwoParam
        {
        public:

            MemFuncTwoParam(Tclass* _obj, Treturn(Tclass::*_fun)(Targ1, Targ2)) : m_pObj(_obj), m_pFun(_fun) {}

            Treturn Call(Targ1 arg1, Targ2 arg2) override
            {
                return (*m_pObj.*m_pFun)(arg1, arg2);
            }

        protected:

            Tclass  *   m_pObj;
            Treturn(Tclass::*m_pFun)(Targ1, Targ2);
        };

    public:

        DelegateTwoParam() : m_pFun(nullptr), m_pMemFun(nullptr) { }

        ~DelegateTwoParam()
        {
            delete m_pMemFun;
        }

        void Bind(Treturn(*_fun)(Targ1, Targ2)) { m_pFun = _fun; }

        template <class Tclass>
        void Bind(Tclass* _obj, Treturn(Tclass::*_fun)(Targ1, Targ2))
        {
            m_pMemFun = new MemFuncTwoParam<Tclass>(_obj, _fun);
        }

        bool IsBound() { return m_pFun || m_pMemFun; }

        Treturn Execute(Targ1 arg1, Targ2 arg2)
        {
            if (m_pFun)
                return m_pFun(arg1, arg2);
            if (m_pMemFun)
                return m_pMemFun->Call(arg1, arg2);
        }

    protected:
        Treturn(*m_pFun)(Targ1, Targ2);
        BaseFuncTwoParam    *   m_pMemFun;
    };



    template <class Treturn, class Targ1, class Targ2, class Targ3>
    class DelegateThreeParam
    {
        class BaseFuncThreeParam
        {
        public:
            virtual ~BaseFuncThreeParam() = default;

            virtual Treturn Call(Targ1 arg1, Targ2 arg2, Targ3 arg3) = 0;
        };

        template <class Tclass>
        class MemFuncThreeParam : public BaseFuncThreeParam
        {
        public:

            MemFuncThreeParam(Tclass* _obj, Treturn(Tclass::*_fun)(Targ1, Targ2, Targ3)) : m_pObj(_obj), m_pFun(_fun) {}

            Treturn Call(Targ1 arg1, Targ2 arg2, Targ3 arg3) override
            {
                return (*m_pObj.*m_pFun)(arg1, arg2, arg3);
            }

        protected:

            Tclass  *   m_pObj;
            Treturn(Tclass::*m_pFun)(Targ1, Targ2, Targ3);
        };

    public:

        DelegateThreeParam() : m_pFun(nullptr), m_pMemFun(nullptr) { }

        ~DelegateThreeParam()
        {
            delete m_pMemFun;
        }

        void Bind(Treturn(*_fun)(Targ1, Targ2, Targ3)) { m_pFun = _fun; }

        template <class Tclass>
        void Bind(Tclass* _obj, Treturn(Tclass::*_fun)(Targ1, Targ2, Targ3))
        {
            m_pMemFun = new MemFuncThreeParam<Tclass>(_obj, _fun);
        }

        bool IsBound() { return m_pFun || m_pMemFun; }

        Treturn Execute(Targ1 arg1, Targ2 arg2, Targ3 arg3)
        {
            if (m_pFun)
                return m_pFun(arg1, arg2, arg3);
            if (m_pMemFun)
                return m_pMemFun->Call(arg1, arg2, arg3);
        }

    protected:
        Treturn(*m_pFun)(Targ1, Targ2, Targ3);
        BaseFuncThreeParam  *   m_pMemFun;
    };



    template <class Treturn, class Targ1, class Targ2, class Targ3, class Targ4>
    class DelegateFourParam
    {
        class BaseFuncFourParam
        {
        public:
            virtual ~BaseFuncFourParam() = default;

            virtual Treturn Call(Targ1 arg1, Targ2 arg2, Targ3 arg3, Targ4 arg4) = 0;
        };

        template <class Tclass>
        class MemFuncFourParam : public BaseFuncFourParam
        {
        public:

            MemFuncFourParam(Tclass* _obj, Treturn(Tclass::*_fun)(Targ1, Targ2, Targ3, Targ4)) : m_pObj(_obj), m_pFun(_fun) {}

            Treturn Call(Targ1 arg1, Targ2 arg2, Targ3 arg3, Targ4 arg4) override
            {
                return (*m_pObj.*m_pFun)(arg1, arg2, arg3, arg4);
            }

        protected:

            Tclass  *   m_pObj;
            Treturn(Tclass::*m_pFun)(Targ1, Targ2, Targ3, Targ4);
        };

    public:

        DelegateFourParam() : m_pFun(nullptr), m_pMemFun(nullptr) { }

        ~DelegateFourParam()
        {
            delete m_pMemFun;
        }

        void Bind(Treturn(*_fun)(Targ1, Targ2, Targ3, Targ4)) { m_pFun = _fun; }

        template <class Tclass>
        void Bind(Tclass* _obj, Treturn(Tclass::*_fun)(Targ1, Targ2, Targ3, Targ4))
        {
            m_pMemFun = new MemFuncFourParam<Tclass>(_obj, _fun);
        }

        bool IsBound() { return m_pFun || m_pMemFun; }

        Treturn Execute(Targ1 arg1, Targ2 arg2, Targ3 arg3, Targ4 arg4)
        {
            if (m_pFun)
                return m_pFun(arg1, arg2, arg3, arg4);
            if (m_pMemFun)
                return m_pMemFun->Call(arg1, arg2, arg3, arg4);
        }

    protected:
        Treturn(*m_pFun)(Targ1, Targ2, Targ3, Targ4);
        BaseFuncFourParam   *   m_pMemFun;
    };



    template <class Treturn, class Targ1, class Targ2, class Targ3, class Targ4, class Targ5>
    class DelegateFiveParam
    {
        class BaseFuncFiveParam
        {
        public:
            virtual ~BaseFuncFiveParam() = default;

            virtual Treturn Call(Targ1 arg1, Targ2 arg2, Targ3 arg3, Targ4 arg4, Targ5 arg5) = 0;
        };

        template <class Tclass>
        class MemFuncFiveParam : public BaseFuncFiveParam
        {
        public:

            MemFuncFiveParam(Tclass* _obj, Treturn(Tclass::*_fun)(Targ1, Targ2, Targ3, Targ4, Targ5)) : m_pObj(_obj), m_pFun(_fun) {}

            Treturn Call(Targ1 arg1, Targ2 arg2, Targ3 arg3, Targ4 arg4, Targ5 arg5) override
            {
                return (*m_pObj.*m_pFun)(arg1, arg2, arg3, arg4, arg5);
            }

        protected:

            Tclass  *   m_pObj;
            Treturn(Tclass::*m_pFun)(Targ1, Targ2, Targ3, Targ4, Targ5);
        };

    public:

        DelegateFiveParam() : m_pFun(nullptr), m_pMemFun(nullptr) { }

        ~DelegateFiveParam()
        {
            delete m_pMemFun;
        }

        void Bind(Treturn(*_fun)(Targ1, Targ2, Targ3, Targ4, Targ5)) { m_pFun = _fun; }

        template <class Tclass>
        void Bind(Tclass* _obj, Treturn(Tclass::*_fun)(Targ1, Targ2, Targ3, Targ4, Targ5))
        {
            m_pMemFun = new MemFuncFiveParam<Tclass>(_obj, _fun);
        }

        bool IsBound() { return m_pFun || m_pMemFun; }

        Treturn Execute(Targ1 arg1, Targ2 arg2, Targ3 arg3, Targ4 arg4, Targ5 arg5)
        {
            if (m_pFun)
                return m_pFun(arg1, arg2, arg3, arg4, arg5);
            if (m_pMemFun)
                return m_pMemFun->Call(arg1, arg2, arg3, arg4, arg5);
        }

    protected:
        Treturn(*m_pFun)(Targ1, Targ2, Targ3, Targ4, Targ5);
        BaseFuncFiveParam   *   m_pMemFun;
    };



    template <class Treturn, class Targ1, class Targ2, class Targ3, class Targ4, class Targ5, class Targ6>
    class DelegateSixParam
    {
        class BaseFuncSixParam
        {
        public:
            virtual ~BaseFuncSixParam() = default;

            virtual Treturn Call(Targ1 arg1, Targ2 arg2, Targ3 arg3, Targ4 arg4, Targ5 arg5, Targ6 arg6) = 0;
        };

        template <class Tclass>
        class MemFuncSixParam : public BaseFuncSixParam
        {
        public:

            MemFuncSixParam(Tclass* _obj, Treturn(Tclass::*_fun)(Targ1, Targ2, Targ3, Targ4, Targ5, Targ6)) : m_pObj(_obj), m_pFun(_fun) {}

            Treturn Call(Targ1 arg1, Targ2 arg2, Targ3 arg3, Targ4 arg4, Targ5 arg5, Targ6 arg6) override
            {
                return (*m_pObj.*m_pFun)(arg1, arg2, arg3, arg4, arg5, arg6);
            }

        protected:

            Tclass  *   m_pObj;
            Treturn(Tclass::*m_pFun)(Targ1, Targ2, Targ3, Targ4, Targ5, Targ6);
        };

    public:

        DelegateSixParam() : m_pFun(nullptr), m_pMemFun(nullptr) { }

        ~DelegateSixParam()
        {
            delete m_pMemFun;
        }

        void Bind(Treturn(*_fun)(Targ1, Targ2, Targ3, Targ4, Targ5, Targ6)) { m_pFun = _fun; }

        template <class Tclass>
        void Bind(Tclass* _obj, Treturn(Tclass::*_fun)(Targ1, Targ2, Targ3, Targ4, Targ5, Targ6))
        {
            m_pMemFun = new MemFuncSixParam<Tclass>(_obj, _fun);
        }

        bool IsBound() { return m_pFun || m_pMemFun; }

        Treturn Execute(Targ1 arg1, Targ2 arg2, Targ3 arg3, Targ4 arg4, Targ5 arg5, Targ6 arg6)
        {
            if (m_pFun)
                return m_pFun(arg1, arg2, arg3, arg4, arg5, arg6);
            if (m_pMemFun)
                return m_pMemFun->Call(arg1, arg2, arg3, arg4, arg5, arg6);
        }

    protected:
        Treturn(*m_pFun)(Targ1, Targ2, Targ3, Targ4, Targ5, Targ6);
        BaseFuncSixParam    *   m_pMemFun;
    };



    template <class Treturn, class Targ1, class Targ2, class Targ3, class Targ4, class Targ5, class Targ6, class Targ7>
    class DelegateSevenParam
    {
        class BaseFuncSevenParam
        {
        public:
            virtual ~BaseFuncSevenParam() = default;

            virtual Treturn Call(Targ1 arg1, Targ2 arg2, Targ3 arg3, Targ4 arg4, Targ5 arg5, Targ6 arg6, Targ7 arg7) = 0;
        };

        template <class Tclass>
        class MemFuncSevenParam : public BaseFuncSevenParam
        {
        public:

            MemFuncSevenParam(Tclass* _obj, Treturn(Tclass::*_fun)(Targ1, Targ2, Targ3, Targ4, Targ5, Targ6, Targ7)) : m_pObj(_obj), m_pFun(_fun) {}

            Treturn Call(Targ1 arg1, Targ2 arg2, Targ3 arg3, Targ4 arg4, Targ5 arg5, Targ6 arg6, Targ7 arg7) override
            {
                return (*m_pObj.*m_pFun)(arg1, arg2, arg3, arg4, arg5, arg6, arg7);
            }

        protected:

            Tclass  *   m_pObj;
            Treturn(Tclass::*m_pFun)(Targ1, Targ2, Targ3, Targ4, Targ5, Targ6, Targ7);
        };

    public:

        DelegateSevenParam() : m_pFun(nullptr), m_pMemFun(nullptr) { }

        ~DelegateSevenParam()
        {
            delete m_pMemFun;
        }

        void Bind(Treturn(*_fun)(Targ1, Targ2, Targ3, Targ4, Targ5, Targ6, Targ7)) { m_pFun = _fun; }

        template <class Tclass>
        void Bind(Tclass* _obj, Treturn(Tclass::*_fun)(Targ1, Targ2, Targ3, Targ4, Targ5, Targ6, Targ7))
        {
            m_pMemFun = new MemFuncSevenParam<Tclass>(_obj, _fun);
        }

        bool IsBound() { return m_pFun || m_pMemFun; }

        Treturn Execute(Targ1 arg1, Targ2 arg2, Targ3 arg3, Targ4 arg4, Targ5 arg5, Targ6 arg6, Targ7 arg7)
        {
            if (m_pFun)
                return m_pFun(arg1, arg2, arg3, arg4, arg5, arg6, arg7);
            if (m_pMemFun)
                return m_pMemFun->Call(arg1, arg2, arg3, arg4, arg5, arg6, arg7);
        }

    protected:
        Treturn(*m_pFun)(Targ1, Targ2, Targ3, Targ4, Targ5, Targ6, Targ7);
        BaseFuncSevenParam  *   m_pMemFun;
    };



    template <class Treturn, class Targ1, class Targ2, class Targ3, class Targ4, class Targ5, class Targ6, class Targ7, class Targ8>
    class DelegateEightParam
    {
        class BaseFuncEightParam
        {
        public:
            virtual ~BaseFuncEightParam() = default;

            virtual Treturn Call(Targ1 arg1, Targ2 arg2, Targ3 arg3, Targ4 arg4, Targ5 arg5, Targ6 arg6, Targ7 arg7, Targ8 arg8) = 0;
        };

        template <class Tclass>
        class MemFuncEightParam : public BaseFuncEightParam
        {
        public:

            MemFuncEightParam(Tclass* _obj, Treturn(Tclass::*_fun)(Targ1, Targ2, Targ3, Targ4, Targ5, Targ6, Targ7, Targ8)) : m_pObj(_obj), m_pFun(_fun) {}

            Treturn Call(Targ1 arg1, Targ2 arg2, Targ3 arg3, Targ4 arg4, Targ5 arg5, Targ6 arg6, Targ7 arg7, Targ8 arg8) override
            {
                return (*m_pObj.*m_pFun)(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8);
            }

        protected:

            Tclass  *   m_pObj;
            Treturn(Tclass::*m_pFun)(Targ1, Targ2, Targ3, Targ4, Targ5, Targ6, Targ7, Targ8);
        };

    public:

        DelegateEightParam() : m_pFun(nullptr), m_pMemFun(nullptr) { }

        ~DelegateEightParam()
        {
            delete m_pMemFun;
        }

        void Bind(Treturn(*_fun)(Targ1, Targ2, Targ3, Targ4, Targ5, Targ6, Targ7, Targ8)) { m_pFun = _fun; }

        template <class Tclass>
        void Bind(Tclass* _obj, Treturn(Tclass::*_fun)(Targ1, Targ2, Targ3, Targ4, Targ5, Targ6, Targ7, Targ8))
        {
            m_pMemFun = new MemFuncEightParam<Tclass>(_obj, _fun);
        }

        bool IsBound() { return m_pFun || m_pMemFun; }

        Treturn Execute(Targ1 arg1, Targ2 arg2, Targ3 arg3, Targ4 arg4, Targ5 arg5, Targ6 arg6, Targ7 arg7, Targ8 arg8)
        {
            if (m_pFun)
                return m_pFun(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8);
            if (m_pMemFun)
                return m_pMemFun->Call(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8);
        }

    protected:
        Treturn(*m_pFun)(Targ1, Targ2, Targ3, Targ4, Targ5, Targ6, Targ7, Targ8);
        BaseFuncEightParam  *   m_pMemFun;
    };



    template <class Treturn, class Targ1, class Targ2, class Targ3, class Targ4, class Targ5, class Targ6, class Targ7, class Targ8, class Targ9>
    class DelegateNineParam
    {
        class BaseFuncNineParam
        {
        public:
            virtual ~BaseFuncNineParam() = default;

            virtual Treturn Call(Targ1 arg1, Targ2 arg2, Targ3 arg3, Targ4 arg4, Targ5 arg5, Targ6 arg6, Targ7 arg7, Targ8 arg8, Targ9 arg9) = 0;
        };

        template <class Tclass>
        class MemFuncNineParam : public BaseFuncNineParam
        {
        public:

            MemFuncNineParam(Tclass* _obj, Treturn(Tclass::*_fun)(Targ1, Targ2, Targ3, Targ4, Targ5, Targ6, Targ7, Targ8, Targ9)) : m_pObj(_obj), m_pFun(_fun) {}

            Treturn Call(Targ1 arg1, Targ2 arg2, Targ3 arg3, Targ4 arg4, Targ5 arg5, Targ6 arg6, Targ7 arg7, Targ8 arg8, Targ9 arg9) override
            {
                return (*m_pObj.*m_pFun)(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9);
            }

        protected:

            Tclass  *   m_pObj;
            Treturn(Tclass::*m_pFun)(Targ1, Targ2, Targ3, Targ4, Targ5, Targ6, Targ7, Targ8, Targ9);
        };

    public:

        DelegateNineParam() : m_pFun(nullptr), m_pMemFun(nullptr) { }

        ~DelegateNineParam()
        {
            delete m_pMemFun;
        }

        void Bind(Treturn(*_fun)(Targ1, Targ2, Targ3, Targ4, Targ5, Targ6, Targ7, Targ8, Targ9)) { m_pFun = _fun; }

        template <class Tclass>
        void Bind(Tclass* _obj, Treturn(Tclass::*_fun)(Targ1, Targ2, Targ3, Targ4, Targ5, Targ6, Targ7, Targ8, Targ9))
        {
            m_pMemFun = new MemFuncNineParam<Tclass>(_obj, _fun);
        }

        bool IsBound() { return m_pFun || m_pMemFun; }

        Treturn Execute(Targ1 arg1, Targ2 arg2, Targ3 arg3, Targ4 arg4, Targ5 arg5, Targ6 arg6, Targ7 arg7, Targ8 arg8, Targ9 arg9)
        {
            if (m_pFun)
                return m_pFun(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9);
            if (m_pMemFun)
                return m_pMemFun->Call(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9);
        }

    protected:
        Treturn(*m_pFun)(Targ1, Targ2, Targ3, Targ4, Targ5, Targ6, Targ7, Targ8, Targ9);
        BaseFuncNineParam   *   m_pMemFun;
    };



    template <class Treturn, class Targ1, class Targ2, class Targ3, class Targ4, class Targ5, class Targ6, class Targ7, class Targ8, class Targ9, class Targ10>
    class DelegateTenParam
    {
        class BaseFuncTenParam
        {
        public:
            virtual ~BaseFuncTenParam() = default;

            virtual Treturn Call(Targ1 arg1, Targ2 arg2, Targ3 arg3, Targ4 arg4, Targ5 arg5, Targ6 arg6, Targ7 arg7, Targ8 arg8, Targ9 arg9, Targ10 arg10) = 0;
        };

        template <class Tclass>
        class MemFuncTenParam : public BaseFuncTenParam
        {
        public:

            MemFuncTenParam(Tclass* _obj, Treturn(Tclass::*_fun)(Targ1, Targ2, Targ3, Targ4, Targ5, Targ6, Targ7, Targ8, Targ9, Targ10)) : m_pObj(_obj), m_pFun(_fun) {}

            Treturn Call(Targ1 arg1, Targ2 arg2, Targ3 arg3, Targ4 arg4, Targ5 arg5, Targ6 arg6, Targ7 arg7, Targ8 arg8, Targ9 arg9, Targ10 arg10) override
            {
                return (*m_pObj.*m_pFun)(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10);
            }

        protected:

            Tclass  *   m_pObj;
            Treturn(Tclass::*m_pFun)(Targ1, Targ2, Targ3, Targ4, Targ5, Targ6, Targ7, Targ8, Targ9, Targ10);
        };

    public:

        DelegateTenParam() : m_pFun(nullptr), m_pMemFun(nullptr) { }

        ~DelegateTenParam()
        {
            delete m_pMemFun;
        }

        void Bind(Treturn(*_fun)(Targ1, Targ2, Targ3, Targ4, Targ5, Targ6, Targ7, Targ8, Targ9, Targ10)) { m_pFun = _fun; }

        template <class Tclass>
        void Bind(Tclass* _obj, Treturn(Tclass::*_fun)(Targ1, Targ2, Targ3, Targ4, Targ5, Targ6, Targ7, Targ8, Targ9, Targ10))
        {
            m_pMemFun = new MemFuncTenParam<Tclass>(_obj, _fun);
        }

        bool IsBound() { return m_pFun || m_pMemFun; }

        Treturn Execute(Targ1 arg1, Targ2 arg2, Targ3 arg3, Targ4 arg4, Targ5 arg5, Targ6 arg6, Targ7 arg7, Targ8 arg8, Targ9 arg9, Targ10 arg10)
        {
            if (m_pFun)
                return m_pFun(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10);
            if (m_pMemFun)
                return m_pMemFun->Call(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10);
        }

    protected:
        Treturn(*m_pFun)(Targ1, Targ2, Targ3, Targ4, Targ5, Targ6, Targ7, Targ8, Targ9, Targ10);
        BaseFuncTenParam    *   m_pMemFun;
    };



}
Namespaces
File DirectoryTree.hpp

Parent directory (include/shiva)

Definition (include/shiva/DirectoryTree.hpp)
Program Listing for File DirectoryTree.hpp

Return to documentation for file (include/shiva/DirectoryTree.hpp)

#pragma once
#include "shivadef.hpp"
#include <string>
#include "bx/file.h"
#include <vector>

namespace shiva
{
    struct FileInfo
    {
        std::string Name;
    };

    class SHIVA_API DirectoryTree
    {
    public:

        std::string Name;
        bx::FilePath Path;
        std::vector<FileInfo> FileList;
        std::vector<DirectoryTree> Directories;
        bool IsRoot = false;

        void Update();

    };

} // shiva
Includes
Namespaces
File Dock.hpp

Parent directory (include/ari/en/gui)

Definition (include/ari/en/gui/Dock.hpp)
Program Listing for File Dock.hpp

Return to documentation for file (include/ari/en/gui/Dock.hpp)

#pragma once
#include "Gui.hpp"
#include "dear-imgui/imgui.h"

namespace ari
{
    class ARI_API Dock: public Gui
    {
    public:

        Dock();

        ~Dock() = default;

        bool BeginRender() override;

        void EndRender() override;

        bool    isOpened;
        char*   Label;

    }; // Dock

} // ari
Includes
Namespaces
Classes
File DockableWindow.hpp

Parent directory (include/ari/en/gui)

Definition (include/ari/en/gui/DockableWindow.hpp)
Program Listing for File DockableWindow.hpp

Return to documentation for file (include/ari/en/gui/DockableWindow.hpp)

#pragma once
#include "Gui.hpp"
#include "../../Delegate.hpp"

namespace ImWindow
{
    class ImwWindow;
}

namespace ari
{
    class GuiSystem;
    class PlatformWindow;

    class ARI_API DockableWindow: public Gui
    {
        friend class AriImwWindow;

    public:
        enum class Oriention
        {
            Center,
            Top,
            Left,
            Right,
            Botton
        };

        DockableWindow(GuiSystem* _pGuiSystem);
        ~DockableWindow() override;

        bool BeginRender() override;

        void Dock(Oriention _oriention = Oriention::Center, float _raito = 0.5f) const;

        void DockWith(DockableWindow* _pOtherDock, Oriention _oriention = Oriention::Center,
            float _raito = 0.5f) const;

        void SetTitle(const char* _pTitle) const;
        void SetAlone(bool _alone) const;
        void SetClosable(bool _closable) const;
        void SetFillingSpace(bool _fill) const;

        void GetLastPosition(float& _x, float& _y) const;
        void GetLastSize(float& _width, float& _height) const;

        DelegateNoParam<void> OnGui;

        DelegateNoParam<void> OnWindowChanged;

        PlatformWindow* GetPlatformWindow() const;

    protected:

        GuiSystem           *   m_pGuiSystem;
        ImWindow::ImwWindow *   m_pWindow;
        PlatformWindow      *   m_pPlatformWindow;

    };

} // ari
Includes
File DockSpace.hpp

Parent directory (include/ari/en/gui)

Definition (include/ari/en/gui/DockSpace.hpp)
Program Listing for File DockSpace.hpp

Return to documentation for file (include/ari/en/gui/DockSpace.hpp)

#pragma once
#include "Gui.hpp"

namespace ari
{
    class ARI_API DockSpace: public Gui
    {
    public:

        bool BeginRender() override;
        void EndRender() override;

    }; // DockSpace

} // ari
Includes
Namespaces
File DockWindow.hpp

Parent directory (include/shiva/windows)

Definition (include/shiva/windows/DockWindow.hpp)
Program Listing for File DockWindow.hpp

Return to documentation for file (include/shiva/windows/DockWindow.hpp)

#pragma once
#include "shiva/shivadef.hpp"
#include "ari/en/gui/DockableWindow.hpp"
#include "ari/en/Entity.hpp"

namespace shiva
{
    class SHIVA_API DockWindow
    {
    public:

        virtual ~DockWindow() = default;

        ari::DockableWindow* GetDock() const { return m_pWindow; }

        virtual void Init(ari::World* p_world);

        virtual void Shutdown();

    protected:

        ari::Entity         *   m_pEntity = nullptr;
        ari::DockableWindow *   m_pWindow = nullptr;

    };

} // shiva
Includes
Namespaces
File Editor.hpp

Parent directory (include/shiva)

Definition (include/shiva/Editor.hpp)
Program Listing for File Editor.hpp

Return to documentation for file (include/shiva/Editor.hpp)

#pragma once
#include "shivadef.hpp"
#include "ari/en/World.hpp"
#include "ari/en/gui/GuiSystem.hpp"
#include "ari/en/3d/RenderSystem.hpp"
#include "ari/en/3d/SceneSystem.hpp"
#include "windows/ProjectBrowser.hpp"
#include "windows/EditorWindowManager.hpp"

namespace shiva
{
    class Project;

    class SHIVA_API Editor
    {
    public:

        Editor();

        ~Editor();

        void Init();

        void Update(float elasped);

        void LoadProject(Project* project);

        Project* GetCurrentProject() const { return m_pCurrentProject; }

        ari::GuiSystem* GetGuiSystem() { return &m_GuiSystem; }

    protected:

        ari::World          m_EditorWorld;
        ari::GuiSystem      m_GuiSystem;
        ari::RenderSystem   m_RenderSystem;
        ari::SceneSystem    m_SceneSystem;
        ProjectBrowser      m_ProjectBrowser;
        EditorWindowManager m_EditorWindow;
        Project         *   m_pCurrentProject = nullptr;

    }; // Editor

    extern SHIVA_API Editor* g_pEditor;

} // shiva
Includes
Namespaces
Classes
File EditorSettings.hpp

Parent directory (include/shiva)

Definition (include/shiva/EditorSettings.hpp)
Program Listing for File EditorSettings.hpp

Return to documentation for file (include/shiva/EditorSettings.hpp)

#pragma once
#include <Meta.h>

namespace shiva
{
    class EditorSettings
    {
    public:

        std::string         LastProjectPath;

        static EditorSettings& Get();
        static void Save();
        static void Load();
    };

} // shiva

namespace meta {

    template <>
    inline auto registerMembers<shiva::EditorSettings>()
    {
        return members(
            member("last_project_path", &shiva::EditorSettings::LastProjectPath)
        );
    }

} // end of namespace meta
Includes
  • Meta.h
File EditorWindowManager.hpp

Parent directory (include/shiva/windows)

Definition (include/shiva/windows/EditorWindowManager.hpp)
Program Listing for File EditorWindowManager.hpp

Return to documentation for file (include/shiva/windows/EditorWindowManager.hpp)

#pragma once
#include "shiva/shivadef.hpp"

namespace ari
{
    class World;
    class Entity;
    class DockSpace;
    class Window;
}

namespace shiva
{
    class AssetBrowser;
    class Viewport;
    class Project;
    class PropertyEditor;

    class SHIVA_API EditorWindowManager
    {
    public:

        EditorWindowManager();

        ~EditorWindowManager();

        void Init(ari::World* pWorld);

        void Shutdown();

    protected:

        ari::Entity         *   m_pEntity           = nullptr;
        AssetBrowser        *   m_pAssetBrowser     = nullptr;
        Viewport            *   m_pViewport         = nullptr;
        PropertyEditor      *   m_pPropertyEditor   = nullptr;

    }; // EditorWindowManager

} // shiva
Includes
Included By
File Engine.hpp

Parent directory (include/ari)

Definition (include/ari/Engine.hpp)
Program Listing for File Engine.hpp

Return to documentation for file (include/ari/Engine.hpp)

#pragma once
#include "aridef.hpp"
#include <memory>
#include "io/IoEnums.hpp"
#include "io/PlatformWindow.hpp"
#include "Program.hpp"
#include "PluginManager.hpp"
#include "gfx/TextureManager.hpp"

namespace bx
{
    class Thread;
    class Mutex;
}
namespace spdlog
{
    class logger;
}
namespace ftl
{
    class TaskScheduler;
}

namespace ari
{
    struct Event;

    struct InitParams
    {
        InitParams(): Height(600), Width(800), FullScreen(false)
        {}

        uint32_t Height,
                 Width;

        bool FullScreen;
        IProgram* Program;

    }; // InitParams

    class ARI_API Engine
    {
        friend class PlatformWindow;
        friend class GuiSystem;
    public:

        Engine();

        ~Engine();

        static Engine& GetSingleton();

        bool Init(InitParams* params);

        bool Run();

        void LockUpdateThread();

        void UnlockUpdateThread();

        Event* Poll();

        void Release(const Event * _event);

        uint32_t GetCurrentFrameNumber() const { return m_frame_number; }

        std::shared_ptr<spdlog::logger> GetLogger() const { return  Logger; }

        InitParams* GetParams() const { return m_params; }

        void SetParams(InitParams* _params) { m_params = _params; }

        PlatformWindow* GetMainWindow() const { return m_pWindow; }

        PlatformWindow* NewWindow(PlatformWindow::Type _type);

        uint16_t GetNewViewId();

        uint32_t GetMsaaFlags() const;

        float GetElapsedTime() const { return m_fElapsedTime; }

        float GetDeltaTime() const { return m_fDeltaTime; }

        PluginManager plugin_manager;
        TextureManager texture_manager;

    protected:

        static int InitBgfxInThread(bx::Thread* _thread, void* _userData);

        InitParams                  *   m_params;
        std::shared_ptr<spdlog::logger> Logger;
        PlatformWindow              *   m_pWindow;
        uint32_t                        m_debug, m_reset, m_frame_number;
        uint16_t                        m_viewId = 0;
        int64_t                         m_time_offset;
        bx::Thread                  *   m_pGfxThread;
        bx::Mutex                   *   m_pMutex = nullptr;
        int                             m_iLockStatus = 0;
        ftl::TaskScheduler          *   m_pTaskMgr;
        MouseState                      m_MouseState;
        bool                            m_bRun;
        bool                            m_bNeedReset;
        float                           m_fElapsedTime = 0.0f,
                                        m_fDeltaTime = 0.0f;

    }; // Engine

    extern ARI_API Engine* g_pEngine;

}
Includes
File Entity.hpp

Parent directory (include/ari/en)

Definition (include/ari/en/Entity.hpp)
Program Listing for File Entity.hpp

Return to documentation for file (include/ari/en/Entity.hpp)

#pragma once
#include "Node.hpp"

namespace ari
{
    class ARI_API Entity: public Node
    {
    public:

        Entity();

        ~Entity();

    }; // Entity

} // ari
Includes
Namespaces
Classes
File EventSubscriber.hpp

Parent directory (include/ari/en)

Definition (include/ari/en/EventSubscriber.hpp)
Program Listing for File EventSubscriber.hpp

Return to documentation for file (include/ari/en/EventSubscriber.hpp)

#pragma once
#include "../aridef.hpp"
#include <memory>

namespace ari
{
    class World;
    class Entity;
    class Component;
    class FrameData;

    namespace Internal
    {
        class ARI_API BaseEventSubscriber
        {
        public:

            virtual ~BaseEventSubscriber() = default;
        };

    } // Internal

    template<typename T>
    class ARI_API EventSubscriber: public Internal::BaseEventSubscriber
    {
    public:

        virtual ~EventSubscriber() = default;

        virtual void Receive(World* world, const T& event) = 0;

    }; // EventSubscriber


    namespace events
    {
        // Called when a new entity is created.
        struct OnEntityCreated
        {
            ARI_DECLARE_TYPE;

            Entity* entity;
        };

        // Called when an entity is about to be destroyed.
        struct OnEntityDestroyed
        {
            ARI_DECLARE_TYPE;

            Entity* entity;
        };

        // Called when a component is assigned (not necessarily created).
        template <class T>
        struct OnComponentAssigned
        {
            ARI_DECLARE_TYPE;

            Entity* entity;
            T* component;
        };

        // Called when a component is removed
        template <class T>
        struct OnComponentRemoved
        {
            ARI_DECLARE_TYPE;

            Entity* entity;
            T* component;
        };

        struct OnFrameData
        {
            ARI_DECLARE_TYPE;

            FrameData* frame_data;

        };

    } // events

} // ari
Includes
  • ../aridef.hpp
  • memory
File FrameData.hpp

Parent directory (include/ari/gfx)

Definition (include/ari/gfx/FrameData.hpp)
Program Listing for File FrameData.hpp

Return to documentation for file (include/ari/gfx/FrameData.hpp)

#pragma once
#include "../aridef.hpp"
#include "../math/Matrix.hpp"
#include <tinystl/vector.h>

namespace ari
{
    class Node3D;
    class Camera;

    class ARI_API FrameData
    {
    public:
        FrameData(): FrameNumber(0)
        {}

        tinystl::vector<Node3D*> Nodes;
        tinystl::vector<Matrix> WorldMatrices;
        uint32_t FrameNumber;
        Camera* Camera;

    }; // FrameData

} // ari
Includes
  • ../aridef.hpp
  • ../math/Matrix.hpp
  • tinystl/vector.h
Namespaces
File Gui.hpp

Parent directory (include/ari/en/gui)

Definition (include/ari/en/gui/Gui.hpp)
Program Listing for File Gui.hpp

Return to documentation for file (include/ari/en/gui/Gui.hpp)

#pragma once
#include "../Component.hpp"

namespace ari
{
    class ARI_API Gui: public Component
    {
    public:

        // Constructor
        Gui() { _isFromGui = true; }

        virtual ~Gui() = default;

        virtual bool BeginRender() { return true; }

        virtual void EndRender() { }

        bool SameLine = false;

        bool Separator = false;

        bool Visible = true;

    }; // Gui

} // ari
Includes
  • ../Component.hpp
Namespaces
Classes
File GuiSystem.hpp

Parent directory (include/ari/en/gui)

Definition (include/ari/en/gui/GuiSystem.hpp)
Program Listing for File GuiSystem.hpp

Return to documentation for file (include/ari/en/gui/GuiSystem.hpp)

#pragma once
#include "../System.hpp"
#include "../EventSubscriber.hpp"

namespace ari
{
    class Node;
    class Dock;

    class ARI_API GuiSystem: public System,
        public EventSubscriber<events::OnComponentAssigned<Dock>>
    {
        friend class AriImwWindow;

    public:

        GuiSystem();
        virtual ~GuiSystem();

        void Update(World* p_world, UpdateState state) override;
        void Configure(World* p_world) override;
        void Unconfigure(World* p_world) override;
        Type GetSystemType() override;
        bool NeedUpdateOnState(UpdateState state) override;

        void Receive(World* world, const events::OnComponentAssigned<Dock>& event) override;

    protected:
        bool    m_bIsDockCreated;

        void RenderGui(Node* node);
    };
}
Includes
  • ../EventSubscriber.hpp
  • ../System.hpp
Included By
Namespaces
File Image.hpp

Parent directory (include/ari/en/gui)

Definition (include/ari/en/gui/Image.hpp)
Program Listing for File Image.hpp

Return to documentation for file (include/ari/en/gui/Image.hpp)

#pragma once
#include "Gui.hpp"
#include "../../gfx/Texture.hpp"
#include "dear-imgui/imgui.h"
#include "../../Delegate.hpp"

namespace ari
{
    class ARI_API Image: public Gui
    {
    public:
        bool BeginRender() override;

        std::shared_ptr<Texture>    ImageTexture;
        ImVec2                      Size;
        DelegateNoParam<void>       OnHovered;

    }; // Image

} // ari
Includes
  • ../../Delegate.hpp
  • ../../gfx/Texture.hpp
  • Gui.hpp (File Gui.hpp)
  • dear-imgui/imgui.h
Namespaces
Classes
File Input.hpp

Parent directory (include/ari/io)

Definition (include/ari/io/Input.hpp)
Program Listing for File Input.hpp

Return to documentation for file (include/ari/io/Input.hpp)

#pragma once
#include "IoEnums.hpp"
#include "../aridef.hpp"

namespace ari
{
    typedef void(*InputBindingFn)(const void* _userData);

    struct ARI_API InputBinding
    {
        void set(Key::Enum _key, uint8_t _modifiers, uint8_t _flags, InputBindingFn _fn, const void* _userData = NULL)
        {
            m_key = _key;
            m_modifiers = _modifiers;
            m_flags = _flags;
            m_fn = _fn;
            m_userData = _userData;
        }

        void end()
        {
            m_key = Key::None;
            m_modifiers = Modifier::None;
            m_flags = 0;
            m_fn = NULL;
            m_userData = NULL;
        }

        Key::Enum m_key;
        uint8_t m_modifiers;
        uint8_t m_flags;
        InputBindingFn m_fn;
        const void* m_userData;
    };

#define INPUT_BINDING_END { Key::None, Modifier::None, 0, NULL, NULL }

    void inputInit();

    void inputShutdown();

    void inputAddBindings(const char* _name, const InputBinding* _bindings);

    void inputRemoveBindings(const char* _name);

    void inputProcess();

    void inputSetKeyState(Key::Enum  _key, uint8_t _modifiers, bool _down);

    bool inputGetKeyState(Key::Enum _key, uint8_t* _modifiers = NULL);

    uint8_t inputGetModifiersState();

    void inputChar(uint8_t _len, const uint8_t _char[4]);

    const uint8_t* inputGetChar();

    void inputCharFlush();

    void inputSetMouseResolution(uint16_t _width, uint16_t _height);

    void inputSetMousePos(int32_t _mx, int32_t _my, int32_t _mz);

    void inputSetMouseButtonState(MouseButton::Enum _button, uint8_t _state);

    void inputSetMouseLock(bool _lock);

    void inputGetMouse(float _mouse[3]);

    bool inputIsMouseLocked();

    void inputSetGamepadAxis(GamepadHandle _handle, GamepadAxis::Enum _axis, int32_t _value);

    int32_t inputGetGamepadAxis(GamepadHandle _handle, GamepadAxis::Enum _axis);

}
Includes
Namespaces
File IoEnums.hpp

Parent directory (include/ari/io)

Definition (include/ari/io/IoEnums.hpp)
Program Listing for File IoEnums.hpp

Return to documentation for file (include/ari/io/IoEnums.hpp)

#pragma once
#include "bx/bx.h"
#include "bx/filepath.h"

namespace ari
{
    struct WindowHandle  { uint16_t idx; };
    inline bool isValid(WindowHandle _handle)  { return UINT16_MAX != _handle.idx; }

    struct GamepadHandle { uint16_t idx; };
    inline bool isValid(GamepadHandle _handle) { return UINT16_MAX != _handle.idx; }

    struct MouseButton
    {
        enum Enum
        {
            None,
            Left,
            Middle,
            Right,

            Count
        };
    };

    struct GamepadAxis
    {
        enum Enum
        {
            LeftX,
            LeftY,
            LeftZ,
            RightX,
            RightY,
            RightZ,

            Count
        };
    };

    struct Modifier
    {
        enum Enum
        {
            None       = 0,
            LeftAlt    = 0x01,
            RightAlt   = 0x02,
            LeftCtrl   = 0x04,
            RightCtrl  = 0x08,
            LeftShift  = 0x10,
            RightShift = 0x20,
            LeftMeta   = 0x40,
            RightMeta  = 0x80,
        };
    };

    struct Key
    {
        enum Enum
        {
            None = 0,
            Esc,
            Return,
            Tab,
            Space,
            Backspace,
            Up,
            Down,
            Left,
            Right,
            Insert,
            Delete,
            Home,
            End,
            PageUp,
            PageDown,
            Print,
            Plus,
            Minus,
            LeftBracket,
            RightBracket,
            Semicolon,
            Quote,
            Comma,
            Period,
            Slash,
            Backslash,
            Tilde,
            F1,
            F2,
            F3,
            F4,
            F5,
            F6,
            F7,
            F8,
            F9,
            F10,
            F11,
            F12,
            NumPad0,
            NumPad1,
            NumPad2,
            NumPad3,
            NumPad4,
            NumPad5,
            NumPad6,
            NumPad7,
            NumPad8,
            NumPad9,
            Key0,
            Key1,
            Key2,
            Key3,
            Key4,
            Key5,
            Key6,
            Key7,
            Key8,
            Key9,
            KeyA,
            KeyB,
            KeyC,
            KeyD,
            KeyE,
            KeyF,
            KeyG,
            KeyH,
            KeyI,
            KeyJ,
            KeyK,
            KeyL,
            KeyM,
            KeyN,
            KeyO,
            KeyP,
            KeyQ,
            KeyR,
            KeyS,
            KeyT,
            KeyU,
            KeyV,
            KeyW,
            KeyX,
            KeyY,
            KeyZ,

            GamepadA,
            GamepadB,
            GamepadX,
            GamepadY,
            GamepadThumbL,
            GamepadThumbR,
            GamepadShoulderL,
            GamepadShoulderR,
            GamepadUp,
            GamepadDown,
            GamepadLeft,
            GamepadRight,
            GamepadBack,
            GamepadStart,
            GamepadGuide,

            Count
        };
    };

    struct Suspend
    {
        enum Enum
        {
            WillSuspend,
            DidSuspend,
            WillResume,
            DidResume,

            Count
        };
    };

    const char* getName(Key::Enum _key);

    struct MouseState
    {
        MouseState()
            : m_mx(0)
            , m_my(0)
            , m_mz(0)
        {
            for (unsigned char & m_button : m_buttons)
            {
                m_button = MouseButton::None;
            }
        }

        int32_t m_mx;
        int32_t m_my;
        int32_t m_mz;
        uint8_t m_buttons[MouseButton::Count];
    };

    struct GamepadState
    {
        GamepadState()
        {
            bx::memSet(m_axis, 0, sizeof(m_axis) );
        }

        int32_t m_axis[GamepadAxis::Count];
    };

    struct WindowState
    {
        WindowState()
            : m_width(0)
            , m_height(0)
            , m_nwh(NULL)
        {
            m_handle.idx = UINT16_MAX;
        }

        WindowHandle m_handle;
        uint32_t     m_width;
        uint32_t     m_height;
        MouseState   m_mouse;
        void*        m_nwh;
        bx::FilePath m_dropFile;
    };


} // ari
Includes
  • bx/bx.h
  • bx/filepath.h
Namespaces
File IoEvents.hpp

Parent directory (include/ari/io)

Definition (include/ari/io/IoEvents.hpp)
Program Listing for File IoEvents.hpp

Return to documentation for file (include/ari/io/IoEvents.hpp)

#pragma once
#include <cstdint>
#include "IoEnums.hpp"
#include "bx/filepath.h"
#include "bx/spscqueue.h"
#include "../en/EventSubscriber.hpp"

#define ENTRY_IMPLEMENT_EVENT(_class, _type) \
            _class() : Event(_type) {}

extern bx::AllocatorI* g_allocator;

namespace ari
{
    struct Event
    {
        enum Enum
        {
            Axis,
            Char,
            Exit,
            Gamepad,
            Key,
            Mouse,
            Size,
            Window,
            Suspend,
            DropFile,
        };

        Event(Enum _type)
            : m_type(_type)
        {
        }


        Event::Enum m_type;
    };

    struct AxisEvent : public Event
    {
        ENTRY_IMPLEMENT_EVENT(AxisEvent, Event::Axis);

        GamepadAxis::Enum m_axis;
        int32_t m_value;
        GamepadHandle m_gamepad;
    };

    struct CharEvent : public Event
    {
        ENTRY_IMPLEMENT_EVENT(CharEvent, Event::Char);

        uint8_t m_len;
        uint8_t m_char[4];
    };

    struct GamepadEvent : public Event
    {
        ENTRY_IMPLEMENT_EVENT(GamepadEvent, Event::Gamepad);

        GamepadHandle m_gamepad;
        bool m_connected;
    };

    struct KeyEvent : public Event
    {
        ENTRY_IMPLEMENT_EVENT(KeyEvent, Event::Key);

        Key::Enum m_key;
        uint8_t m_modifiers;
        bool m_down;
    };

    struct MouseEvent : public Event
    {
        ENTRY_IMPLEMENT_EVENT(MouseEvent, Event::Mouse);

        int32_t m_mx;
        int32_t m_my;
        int32_t m_mz;
        MouseButton::Enum m_button;
        bool m_down;
        bool m_move;
    };

    struct SizeEvent : public Event
    {
        ENTRY_IMPLEMENT_EVENT(SizeEvent, Event::Size);

        uint32_t m_width;
        uint32_t m_height;
    };

    struct WindowEvent : public Event
    {
        ENTRY_IMPLEMENT_EVENT(WindowEvent, Event::Window);

        void* m_nwh;
    };

    struct SuspendEvent : public Event
    {
        ENTRY_IMPLEMENT_EVENT(SuspendEvent, Event::Suspend);

        Suspend::Enum m_state;
    };

    struct DropFileEvent : public Event
    {
        ENTRY_IMPLEMENT_EVENT(DropFileEvent, Event::DropFile);

        bx::FilePath m_filePath;
    };

    const Event* poll();
    const Event* poll(WindowHandle );
    void release(const Event* _event);

    class EventQueue
    {
    public:
        EventQueue()
            : m_queue(g_allocator)
        {
        }

        ~EventQueue()
        {
            for (const Event* ev = poll(); NULL != ev; ev = poll() )
            {
                release(ev);
            }
        }

        void postAxisEvent(GamepadHandle _gamepad, GamepadAxis::Enum _axis, int32_t _value)
        {
            AxisEvent* ev = BX_NEW(g_allocator, AxisEvent)();
            ev->m_gamepad = _gamepad;
            ev->m_axis    = _axis;
            ev->m_value   = _value;
            m_queue.push(ev);
        }

        void postCharEvent(uint8_t _len, const uint8_t _char[4])
        {
            CharEvent* ev = BX_NEW(g_allocator, CharEvent)();
            ev->m_len = _len;
            bx::memCopy(ev->m_char, _char, 4);
            m_queue.push(ev);
        }

        void postExitEvent()
        {
            Event* ev = BX_NEW(g_allocator, Event)(Event::Exit);
            m_queue.push(ev);
        }

        void postGamepadEvent(GamepadHandle _gamepad, bool _connected)
        {
            GamepadEvent* ev = BX_NEW(g_allocator, GamepadEvent)();
            ev->m_gamepad   = _gamepad;
            ev->m_connected = _connected;
            m_queue.push(ev);
        }

        void postKeyEvent(Key::Enum _key, uint8_t _modifiers, bool _down)
        {
            KeyEvent* ev = BX_NEW(g_allocator, KeyEvent)();
            ev->m_key       = _key;
            ev->m_modifiers = _modifiers;
            ev->m_down      = _down;
            m_queue.push(ev);
        }

        void postMouseEvent(int32_t _mx, int32_t _my, int32_t _mz)
        {
            MouseEvent* ev = BX_NEW(g_allocator, MouseEvent)();
            ev->m_mx     = _mx;
            ev->m_my     = _my;
            ev->m_mz     = _mz;
            ev->m_button = MouseButton::None;
            ev->m_down   = false;
            ev->m_move   = true;
            m_queue.push(ev);
        }

        void postMouseEvent(int32_t _mx, int32_t _my, int32_t _mz, MouseButton::Enum _button, bool _down)
        {
            MouseEvent* ev = BX_NEW(g_allocator, MouseEvent)();
            ev->m_mx     = _mx;
            ev->m_my     = _my;
            ev->m_mz     = _mz;
            ev->m_button = _button;
            ev->m_down   = _down;
            ev->m_move   = false;
            m_queue.push(ev);
        }

        void postSizeEvent(uint32_t _width, uint32_t _height)
        {
            SizeEvent* ev = BX_NEW(g_allocator, SizeEvent)();
            ev->m_width  = _width;
            ev->m_height = _height;
            m_queue.push(ev);
        }

        void postWindowEvent(void* _nwh = NULL)
        {
            WindowEvent* ev = BX_NEW(g_allocator, WindowEvent)();
            ev->m_nwh = _nwh;
            m_queue.push(ev);
        }

        void postSuspendEvent(Suspend::Enum _state)
        {
            SuspendEvent* ev = BX_NEW(g_allocator, SuspendEvent)();
            ev->m_state = _state;
            m_queue.push(ev);
        }

        void postDropFileEvent(const bx::FilePath& _filePath)
        {
            DropFileEvent* ev = BX_NEW(g_allocator, DropFileEvent)();
            ev->m_filePath = _filePath;
            m_queue.push(ev);
        }

        const Event* poll()
        {
            return m_queue.pop();
        }

        void release(const Event* _event) const
        {
            BX_DELETE(g_allocator, const_cast<Event*>(_event) );
        }

    private:
        bx::SpScUnboundedQueueT<Event> m_queue;
    };

} // ari
Includes
  • ../en/EventSubscriber.hpp
  • IoEnums.hpp (File IoEnums.hpp)
  • bx/filepath.h
  • bx/spscqueue.h
  • cstdint
Namespaces
File JsonCast.h

Parent directory (include/ari)

Definition (include/ari/JsonCast.h)
Program Listing for File JsonCast.h

Return to documentation for file (include/ari/JsonCast.h)

#pragma once

#include <string>
#include <vector>
#include <unordered_map>

#include <json.hpp>

#include <Meta.h>
#include "StringCast.h"

using json = nlohmann::json;

template <typename T>
void to_json(json& j, const T& obj);

template <typename T>
void from_json(const json& j, T& obj);

namespace meta
{


template <typename Class,
    typename = std::enable_if_t <meta::isRegistered<Class>()>>
json serialize(const Class& obj);

template <typename Class,
    typename = std::enable_if_t <!meta::isRegistered<Class>()>,
    typename = void>
json serialize(const Class& obj);

template <typename Class>
json serialize_basic(const Class& obj);

// specialization for std::vector
template <typename T>
json serialize_basic(const std::vector<T>& obj);

// specialization for std::unodered_map
template <typename K, typename V>
json serialize_basic(const std::unordered_map<K, V>& obj);


//
//template<typename Class>
//Class deserialize(const json& obj);

template <typename Class,
    typename = std::enable_if_t<meta::isRegistered<Class>()>>
void deserialize(Class& obj, const json& object);

template <typename Class,
    typename = std::enable_if_t<!meta::isRegistered<Class>()>,
    typename = void>
void deserialize(Class& obj, const json& object);

// specialization for std::vector
template <typename T>
void deserialize(std::vector<T>& obj, const json& object);

// specialization for std::unodered_map
template <typename K, typename V>
void deserialize(std::unordered_map<K, V>& obj, const json& object);

}

#include "JsonCast.inl"
Includes
Included By
Namespaces
Typedefs
File JsonCast.inl

Parent directory (include/ari)

Definition (include/ari/JsonCast.inl)
Program Listing for File JsonCast.inl

Return to documentation for file (include/ari/JsonCast.inl)

#include "JsonCast.h"

template <typename T>
void to_json(json& j, const T& obj)
{
    j = meta::serialize(obj);
}

template <typename T>
void from_json(const json& j, T& obj)
{
    meta::deserialize(obj, j);
}

namespace meta
{


template <typename Class,
    typename>
json serialize(const Class& obj)
{
    json value;
    meta::doForAllMembers<Class>(
        [&obj, &value](auto& member)
        {
            auto& valueName = value[member.getName()];
            if (member.canGetConstRef()) {
                valueName = member.get(obj);
            } else if (member.hasGetter()) {
                valueName = member.getCopy(obj); // passing copy as const ref, it's okay
            }
        }
    );
    return value;
}

template <typename Class,
    typename, typename>
json serialize(const Class& obj)
{
    return serialize_basic(obj);
}

template <typename Class>
json serialize_basic(const Class& obj)
{
    return json(obj);
}

// specialization for std::vector
template <typename T>
json serialize_basic(const std::vector<T>& obj)
{
    json value;
    int i = 0;
    for (auto& elem : obj) {
        value[i] = elem;
        ++i;
    }
    return value;
}

// specialization for std::unordered_map
template <typename K, typename V>
json serialize_basic(const std::unordered_map<K, V>& obj)
{
    json value;
    for (auto& pair : obj) {
        value.emplace(castToString(pair.first), pair.second);
    }
    return value;
}


template <typename Class>
Class deserialize(const json& obj)
{
    Class c;
    deserialize(c, obj);
    return c;
}

template <typename Class,
    typename>
void deserialize(Class& obj, const json& object)
{
    if (object.is_object()) {
        meta::doForAllMembers<Class>(
            [&obj, &object](auto& member)
            {
                auto& objName = object[member.getName()];
                if (!objName.is_null()) {
                    using MemberT = meta::get_member_type<decltype(member)>;
                    if (member.hasSetter()) {
                        member.set(obj, objName.template get<MemberT>());
                    } else if (member.canGetRef()) {
                        member.getRef(obj) = objName.template get<MemberT>();
                    } else {
                        throw std::runtime_error("Error: can't deserialize member because it's read only");
                    }
                }
            }
        );
    } else {
        throw std::runtime_error("Error: can't deserialize from Json::json to Class.");
    }
}

template <typename Class,
    typename, typename>
void deserialize(Class& obj, const json& object)
{
    obj = object.get<Class>();
}

// specialization for std::vector
template <typename T>
void deserialize(std::vector<T>& obj, const json& object)
{
    obj.reserve(object.size()); // vector.resize() works only for default constructible types
    for (auto& elem : object) {
        obj.push_back(elem); // push rvalue
    }
}

// specialization for std::unodered_map
template <typename K, typename V>
void deserialize(std::unordered_map<K, V>& obj, const json& object)
{
    for (auto it = object.begin(); it != object.end(); ++it) {
        obj.emplace(fromString<K>(it.key()), it.value());
    }
}

}
Includes
Included By
Namespaces
File Label.hpp

Parent directory (include/ari/en/gui)

Definition (include/ari/en/gui/Label.hpp)
Program Listing for File Label.hpp

Return to documentation for file (include/ari/en/gui/Label.hpp)

#pragma once
#include "Gui.hpp"

namespace ari
{
    class ARI_API Label : public Gui
    {
    public:

        Label();

        ~Label() = default;

        bool BeginRender() override;

        const char  *   Text;
    };

}
Includes
Namespaces
Classes
File Matrix.hpp

Parent directory (include/ari/math)

Definition (include/ari/math/Matrix.hpp)
Program Listing for File Matrix.hpp

Return to documentation for file (include/ari/math/Matrix.hpp)

#pragma once

#include "../aridef.hpp"
#include "bx/macros.h"
#include "bx/float4x4_t.h"
#include "Vector.hpp"

namespace ari
{
    BX_ALIGN_DECL_16(struct) Matrix
    {
        union
        {
            float v[16];
            struct
            {
                float _11, _12, _13, _14;
                float _21, _22, _23, _24;
                float _31, _32, _33, _34;
                float _41, _42, _43, _44;
            };
            bx::float4x4_t f;
        };

        Matrix() :
            _11(1.0f), _12(0.0f), _13(0.0f), _14(0.0f),
            _21(0.0f), _22(1.0f), _23(0.0f), _24(0.0f),
            _31(0.0f), _32(0.0f), _33(1.0f), _34(0.0f),
            _41(0.0f), _42(0.0f), _43(0.0f), _44(1.0f)
        { }

        void Identity();

        Matrix operator *(const Matrix &m) const;

        void operator *=(const Matrix &m);

        void SetPositionRotation(const Vector3& position,
            const Vector3& rotation);

        void SetTransform(const Vector3& position,
            const Vector3& rotation,
            const Vector3& scale);

    }; // Matrix

} // ari
Includes
Namespaces
File Node.hpp

Parent directory (include/ari/en)

Definition (include/ari/en/Node.hpp)
Program Listing for File Node.hpp

Return to documentation for file (include/ari/en/Node.hpp)

#pragma once

#include "../aridef.hpp"
#include "tinystl/vector.h"
#include <memory>
#include <cassert>
#include <unordered_map>

namespace ari
{
    class World;
    class Entity;

    class ARI_API Node
    {
        friend class World;

    public:

        enum class Type
        {
            Entity = 0,
            Component,

            Unknown

        };

        Node();

        virtual ~Node();

        template <class T>
        T* AddChild(T* child)
        {
            m_vChilds.push_back(child);
            child->m_pWorld = m_pWorld;
            child->SetParent(this);

            // Add the child to map
            auto index = getTypeIndex<T>();
            auto found = childs.find(index);
            if (found == childs.end())
            {
                tinystl::vector<Node*> subList;
                subList.push_back(child);

                childs.insert({ index, subList });
            }
            else
            {
                found->second.push_back(child);
            }

            if (child->m_eNodeType == Type::Component)
            {
                assert(m_pWorld);
                m_pWorld->emit<events::OnComponentAssigned<T>>({ child->GetParentEntity(), child });
            }

            return child;

        } // AddChild

        // Returns the first attached Node.
        template <class T>
        T* GetChild()
        {
            auto found = childs.find(getTypeIndex<T>());
            if (found != childs.end())
            {
                return reinterpret_cast<T*>(found->second[0]);
            }
            return nullptr;
        }

        template <class T>
        tinystl::vector<Node*> GetChildren()
        {
            auto found = childs.find(getTypeIndex<T>());
            if (found != childs.end())
            {
                return found->second;
            }
            return tinystl::vector<Node*>();
        }

        template <class T>
        void RemoveChild(T* child)
        {
            for (tinystl::vector<Node*>::iterator it = m_vChilds.begin();
                it != m_vChilds.end(); ++it)
            {
                if ((*it) == child)
                {
                    child->m_pParent = nullptr;
                    m_vChilds.erase(it);

                    // Remove it from map
                    auto index = getTypeIndex<T>();
                    auto found = childs.find(index);
                    if (found != childs.end())
                    {
                        found->second.erase(std::remove(found->second.begin(), found->second.end(), child), found->second.end());
                        if (found->second.size() == 0)
                        {
                            childs.erase(found);
                        }
                    }

                    if (child->m_eNodeType == Type::Component)
                    {
                        assert(m_pWorld);
                        m_pWorld->emit<events::OnComponentRemoved<T>>({ child->GetParentEntity(), child });
                    }
                    return;
                }
            }

        } // RemoveChild

        void RemoveChildren(bool _delete = false);

        virtual Node* GetParent() { return m_pParent; }

        virtual void SetParent(Node* parent);

        Node::Type GetType() const { return m_eNodeType; }

        Entity* GetParentEntity() const;

        const tinystl::vector<Node*>& GetChildren() const { return m_vChilds; }

        World* GetWorld() const { return m_pWorld; }

        void Destroy(bool addToDestroyQueue = true);

        uint32_t IsInDestroyQueue() const { return m_iIsInDestroyQueue; }

    protected:

        Node* m_pParent;
        tinystl::vector<Node*> m_vChilds;
        Node::Type m_eNodeType;
        World* m_pWorld;
        uint32_t m_iIsInDestroyQueue = 0;
        std::unordered_map<TypeIndex,
            tinystl::vector<Node*>> childs;

    }; // Node

} // ari
Includes
  • ../aridef.hpp
  • cassert
  • memory
  • tinystl/vector.h
  • unordered_map
Namespaces
Classes
File Node3D.hpp

Parent directory (include/ari/en/3d)

Definition (include/ari/en/3d/Node3D.hpp)
Program Listing for File Node3D.hpp

Return to documentation for file (include/ari/en/3d/Node3D.hpp)

#pragma once

#include "../Component.hpp"
#include "../../math/Vector.hpp"
#include "../../math/Matrix.hpp"

namespace bgfx
{
    struct Encoder;
}
namespace ari
{
    class ARI_API Node3D: public Component
    {
    public:

        Node3D() : Scale(1.0f, 1.0f, 1.0f), _isRenderable(false) { _isFromNode3D = true; }

        virtual ~Node3D() = default;

        virtual void Render(const Matrix& matrix, bgfx::Encoder* encoder, uint16_t _view_id) { BX_UNUSED(matrix, encoder); }

        Vector3 Position,
            Rotation,
            Scale;

        Matrix _finalMat;
        bool _isRenderable;

    }; // Node3D

} // ari
Includes
  • ../../math/Matrix.hpp
  • ../../math/Vector.hpp
  • ../Component.hpp
Classes
File PIE.hpp

Parent directory (include/shiva/windows)

Definition (include/shiva/windows/PIE.hpp)
Program Listing for File PIE.hpp

Return to documentation for file (include/shiva/windows/PIE.hpp)

#pragma once

namespace shiva
{

} // shiva
Namespaces
File PlatformWindow.hpp

Parent directory (include/ari/io)

Definition (include/ari/io/PlatformWindow.hpp)
Program Listing for File PlatformWindow.hpp

Return to documentation for file (include/ari/io/PlatformWindow.hpp)

#pragma once
#include "../aridef.hpp"
#include <cstdint>
#include "IoEvents.hpp"
#include "../Delegate.hpp"
#include "tinystl/vector.h"

namespace ari
{
    class ARI_API PlatformWindow
    {
        friend class Engine;

    public:

        enum class Type
        {
            Main,
            Child,
            Popup
        };

        PlatformWindow(Type _type): m_Type(_type) {}
        virtual ~PlatformWindow() {}

        virtual bool Init(int _posx, int _posy, int _width, int _height, uint32_t _flags,
            const char* _title) = 0;

        virtual bool Run() = 0;

        virtual void Show(bool _show) = 0;

        virtual void SetMousePos(int _x, int _y) = 0;

        virtual void SetTitle(const char* _title) = 0;

        virtual void SetFlags(uint32_t _flags, bool _addFlags = false) = 0;

        virtual void GetPos(int& _x, int& _y) = 0;
        virtual void SetPos(int _x, int _y) = 0;

        virtual void GetSize(int& _width, int& _height);
        virtual void SetSize(int _width, int _height) = 0;

        virtual void SetAlpha(unsigned char _alpha) = 0;

        virtual void SetMouseLock(bool _lock) = 0;

        virtual void ToggleFrame() = 0;

        virtual bool IsWindowMaximized() = 0;
        virtual void SetWindowMaximized(bool _maximize) = 0;
        virtual bool IsWindowMinimized() = 0;
        virtual void SetWindowMinimized(bool _minimize) = 0;

        virtual void* GetHandle() = 0;

        void AddOnKeyDelegate(DelegateTwoParam<void, Key::Enum, bool>* _pDelegate);
        void RemoveOnKeyDelegate(DelegateTwoParam<void, Key::Enum, bool>* _pDelegate);

        void AddOnCharDelegate(DelegateTwoParam<void, uint8_t, uint8_t*>* _pDelegate);
        void RemoveOnCharDelegate(DelegateTwoParam<void, uint8_t, uint8_t*>* _pDelegate);

        void AddOnMouseButtonDelegate(DelegateTwoParam<void, MouseButton::Enum, bool>* _pDelegate);
        void RemoveOnMouseButtonDelegate(DelegateTwoParam<void, MouseButton::Enum, bool>* _pDelegate);

        void AddOnMouseMoveDelegate(DelegateTwoParam<void, int, int>* _pDelegate);
        void RemoveOnMouseMoveDelegate(DelegateTwoParam<void, int, int>* _pDelegate);

        void AddOnMouseWheelDelegate(DelegateOneParam<void, int>* _pDelegate);
        void RemoveOnMouseWheelDelegate(DelegateOneParam<void, int>* _pDelegate);

        void AddOnSizeDelegate(DelegateTwoParam<void, int, int>* _pDelegate);
        void RemoveOnSizeDelegate(DelegateTwoParam<void, int, int>* _pDelegate);

        bool ProcessEvents(uint32_t& _width, uint32_t& _height, uint32_t& _debug, uint32_t& _reset,
            MouseState* _mouse);

    protected:

        Type        m_Type;
        uint32_t    m_width;
        uint32_t    m_height;
        uint32_t    m_oldWidth;
        uint32_t    m_oldHeight;
        uint32_t    m_frameWidth;
        uint32_t    m_frameHeight;
        float       m_aspectRatio;
        EventQueue  m_eventQueue;
        tinystl::vector<DelegateTwoParam<void, Key::Enum, bool>*>
                    m_vOnKeys;
        tinystl::vector<DelegateTwoParam<void, uint8_t, uint8_t*>*>
                    m_vOnChar;
        tinystl::vector<DelegateTwoParam<void, MouseButton::Enum, bool>*>
                    m_vOnMouseButtons;
        tinystl::vector<DelegateTwoParam<void, int, int>*>
                    m_vOnMouseMove;
        tinystl::vector<DelegateOneParam<void, int>*>
                    m_vOnMouseWheel;
        tinystl::vector<DelegateTwoParam<void, int, int>*>
                    m_vOnSize;

    }; // Window

} // ari
Includes
  • ../Delegate.hpp
  • ../aridef.hpp
  • IoEvents.hpp (File IoEvents.hpp)
  • cstdint
  • tinystl/vector.h
Included By
Namespaces
File Plugin.hpp

Parent directory (include/ari)

Definition (include/ari/Plugin.hpp)
Program Listing for File Plugin.hpp

Return to documentation for file (include/ari/Plugin.hpp)

#pragma once
#include "Resource.hpp"

namespace ari
{
    class Plugin: public Resource
    {
    public:

        enum class Type
        {
            TextureLoader,
            MeshLoader,

            Unknown
        };

        Plugin(const uint32_t& _handel, const std::string& _fileName)
            : Resource(_handel, _fileName)
        {
        }

        virtual ~Plugin() = default;

        virtual void* Create() = 0;

    protected:

        Type    m_eType = Type::Unknown;

    }; // Plugin

} // ari
Includes
Namespaces
Classes
File PluginManager.hpp

Parent directory (include/ari)

Definition (include/ari/PluginManager.hpp)
Program Listing for File PluginManager.hpp

Return to documentation for file (include/ari/PluginManager.hpp)

#pragma once
#include "ResourceManager.hpp"
#include "Plugin.hpp"
#include "aridef.hpp"

namespace ari
{
    class ARI_API PluginManager: public ResourceManager<Plugin>
    {
    protected:

        bool LoadResource(Plugin** ppOut, uint32_t handle,
            const std::string& filename, void* extraParams) override;

    };

} // ari
Includes
Included By
Namespaces
File Popup.hpp

Parent directory (include/ari/en/gui)

Definition (include/ari/en/gui/Popup.hpp)
Program Listing for File Popup.hpp

Return to documentation for file (include/ari/en/gui/Popup.hpp)

#pragma once
#include "Gui.hpp"

namespace ari
{
    class ARI_API Popup: public Gui
    {
    public:

        bool BeginRender() override;

        void EndRender() override;

        void Show();

        void Hide();

        char*   Name = nullptr;

    protected:

        bool m_bDoEndPopup = false;
        bool m_bOpenPopup = false;
        bool m_bClosePopup = false;

    }; // Popup

} // ari
Includes
Namespaces
Classes
File Program.hpp

Parent directory (include/ari)

Definition (include/ari/Program.hpp)
Program Listing for File Program.hpp

Return to documentation for file (include/ari/Program.hpp)

#pragma once
#include <tinystl/string.h>

namespace ari
{
    class IProgram
    {
    public:
        IProgram(const char* programName): m_sProgramName(programName)
        { }

        virtual ~IProgram() = default;

        virtual void Init() = 0;

        virtual bool Update(uint32_t frame_number, float elasped) = 0;

        virtual int Shutdown() = 0;

        tinystl::string GetProgramName() const { return m_sProgramName; }

    protected:

        tinystl::string m_sProgramName;
    };
}
Includes
  • tinystl/string.h
Included By
Namespaces
File Project.hpp

Parent directory (include/shiva)

Definition (include/shiva/Project.hpp)
Program Listing for File Project.hpp

Return to documentation for file (include/shiva/Project.hpp)

#pragma once
#include "bx/filepath.h"
#include <string>
#include <Meta.h>
#include <bx/error.h>
#include "DirectoryTree.hpp"

BX_ERROR_RESULT(SH_ERROR_NOT_EMPTY_DIRECTPRY, BX_MAKEFOURCC('s', 'h', 0, 0));

namespace shiva
{
    class Project
    {
        friend auto meta::registerMembers<Project>();
    public:
        Project();

        ~Project();

        static Project* New(bx::FilePath projectPath, std::string name, bx::Error* err);

        void Save();
        static Project* Load(bx::FilePath path, bx::Error* err);

        void UpdateProjectTree();

        const DirectoryTree& GetTree() const { return m_Tree; }

        const bx::FilePath& GetPath() const { return m_ProjectPath; }

    private:

        bx::FilePath    m_ProjectPath;
        std::string     m_ProjectName;
        DirectoryTree   m_Tree;

    }; // Project

} // shiva

namespace meta {

    template <>
    inline auto registerMembers<shiva::Project>()
    {
        return members(
            member("name", &shiva::Project::m_ProjectName)
        );
    }

} // end of namespace meta
Includes
Classes
File ProjectBrowser.hpp

Parent directory (include/shiva/windows)

Definition (include/shiva/windows/ProjectBrowser.hpp)
Program Listing for File ProjectBrowser.hpp

Return to documentation for file (include/shiva/windows/ProjectBrowser.hpp)

#pragma once
#include "shiva/shivadef.hpp"
#include "ari/en/Entity.hpp"
#include "ari/en/gui/Gui.hpp"
#include "ari/en/gui/Button.hpp"
#include "ari/en/gui/Label.hpp"
#include "DockWindow.hpp"

namespace ari
{
    class DockableWindow;
    class World;
    class TextBox;
    class Popup;

} // ari

namespace shiva
{
    class Project;

    class ProjectGui: public ari::Gui
    {
    public:
        bool BeginRender() override;
        void EndRender() override;

    }; // ProjectGui

    class SHIVA_API ProjectBrowser : DockWindow
    {
    public:
        ProjectBrowser();

        ~ProjectBrowser();

        void Init(ari::World* p_world) override;

        void Shutdown() override;

    protected:

        ari::TextBox        *   m_pNewProjectName;
        ari::TextBox        *   m_pNewProjectPath;
        ari::Button         *   m_pNewProjectBtn;
        ari::TextBox        *   m_pOpenProjectPath;
        ari::Button         *   m_pOpenProjectBtn;
        ari::Popup          *   m_pMessageBox;
        ari::Label          *   m_pMbLabel;
        ari::Button         *   m_pMbOkBtn;

        void OnNewProjectClick();
        void OnOpenProjectClick();

        void OnClickMbOk();

        void ProjectOpened(Project* project);

    }; // ProjectBrowser

} // shiva
Includes
Included By
File PropertyEditor.hpp

Parent directory (include/shiva/windows)

Definition (include/shiva/windows/PropertyEditor.hpp)
Program Listing for File PropertyEditor.hpp

Return to documentation for file (include/shiva/windows/PropertyEditor.hpp)

#pragma once
#include "DockWindow.hpp"

namespace shiva
{
    class SHIVA_API PropertyEditor : public DockWindow
    {
    public:

        void Init(ari::World* p_world) override;

    };

} // shiva
Includes
Namespaces
File Rect.hpp

Parent directory (include/ari/math)

Definition (include/ari/math/Rect.hpp)
Program Listing for File Rect.hpp

Return to documentation for file (include/ari/math/Rect.hpp)

#pragma once

namespace ari
{
    template <class T>
    struct Rect
    {
        Rect() : x(0), y(0), width(0), height(0) { }

        Rect(const T _x, const T _y, const T _width, const T _height):
            x(_x), y(_y), width(_width), height(_height) { }

        void Set(const T _x, const T _y, const T _width, const T _height)
        {
            x      = _x;
            y      = _y;
            width  = _width;
            height = _height;
        }

        bool operator == (const Rect<T> &v) const
        {
            return (width == v.width && height == v.height && x == v.x && y == v.y);
        }

        bool operator != (const Rect<T> &v) const
        {
            return (width != v.width || height != v.height || x != v.x || y != v.y);
        }

        union
        {
            T p[4];
            struct
            {
                T   x,
                    y,
                    width,
                    height;
            };
        };
    };

    typedef Rect<uint16_t>  RectU16;
    typedef Rect<int>       RectI;
    typedef Rect<float>     RectF;

} // ari
Included By
Namespaces
File RenderSystem.hpp

Parent directory (include/ari/en/3d)

Definition (include/ari/en/3d/RenderSystem.hpp)
Program Listing for File RenderSystem.hpp

Return to documentation for file (include/ari/en/3d/RenderSystem.hpp)

#pragma once
#include "../System.hpp"
#include "../EventSubscriber.hpp"

namespace bgfx
{
    struct VertexDecl;
    struct ProgramHandle;
}

namespace ari
{
    class BoxShape;

    class ARI_API RenderSystem: public System,
        public EventSubscriber<events::OnComponentAssigned<BoxShape>>,
        public EventSubscriber<events::OnFrameData>
    {
    public:

        enum class VertexType
        {
            Pos,
            Color,
            Count
        };

        RenderSystem();
        ~RenderSystem();

        void Update(World* p_world, UpdateState state) override;
        void Configure(World* p_world) override;
        void Unconfigure(World* p_world) override;
        Type GetSystemType() override
        {
            return Type::RenderSystem;
        }
        bool NeedUpdateOnState(UpdateState state) override;

        void Receive(World* world, const events::OnComponentAssigned<BoxShape>& event) override;
        void Receive(World* world, const events::OnFrameData& event) override;

        bgfx::VertexDecl* GetVertexDecl(VertexType vertex_type) const;

        bgfx::ProgramHandle* GetProgram() const { return m_Program; }

    protected:

        bgfx::VertexDecl    *   m_pVertexDeclArray;
        bgfx::ProgramHandle *   m_Program;
        FrameData           *   m_pFrameDataCurrent,
                            *   m_pFrameDataNext;
        uint16_t                m_view_id = 0;
    };

} // ari
Includes
  • ../EventSubscriber.hpp
  • ../System.hpp
Included By
File Resource.hpp

Parent directory (include/ari)

Definition (include/ari/Resource.hpp)
Program Listing for File Resource.hpp

Return to documentation for file (include/ari/Resource.hpp)

#pragma once
#include <string>
#include "aridef.hpp"

namespace ari
{
    class ARI_API Resource
    {
        template <class T>
        friend class ResourceManager;

    public:

        Resource(): m_iHandle(0) { }

        Resource(const uint32_t& _handel, const std::string& _fileName):
            m_iHandle(_handel), m_sFileName(_fileName) { }

        virtual ~Resource() = default;

        uint32_t GetHandel() const { return m_iHandle; }

        std::string GetFileName() const { return m_sFileName; }

    protected:

        uint32_t    m_iHandle;
        std::string m_sFileName;
    };

} // ari
Includes
Namespaces
File ResourceLoader.hpp

Parent directory (include/ari)

Definition (include/ari/ResourceLoader.hpp)
Program Listing for File ResourceLoader.hpp

Return to documentation for file (include/ari/ResourceLoader.hpp)

#pragma once
#include "aridef.hpp"
#include <vector>
#include "bx/readerwriter.h"
#include "bx/file.h"

namespace ari
{
    class Resource;

    class ARI_API ResourceLoader
    {
    public:

        ResourceLoader() : m_bSwapEndian(false)
        {}

        virtual ~ResourceLoader() = default;

        virtual bool IsALoadableFileExtension(std::string _extention);


        virtual Resource* LoadResource(bx::FileReaderI* pStream, uint32_t _handle,
            const std::string& _filename, void* _extraParams) = 0;

    protected:

        std::vector<std::string>            m_aFileExtension;
        bool                                m_bSwapEndian;

    };

} // ari
Includes
Namespaces
File ResourceManager.hpp

Parent directory (include/ari)

Definition (include/ari/ResourceManager.hpp)
Program Listing for File ResourceManager.hpp

Return to documentation for file (include/ari/ResourceManager.hpp)

#pragma once
#include <string>
#include <vector>
#include <stack>

namespace ari
{
    class ResourceLoader;

    template <class T>
    class ResourceManager
    {
    public:

        virtual ~ResourceManager() = default;

        std::shared_ptr<T> Load(const std::string& filename,    void* extraParams)
        {
            // Searching for resource.
            for (const auto& res: m_vResources)
            {
                if (res)
                {
                    if (!res->GetFileName().empty() && !filename.empty())
                    {
                        if (res->GetFileName() == filename)
                        {
                            return res;
                        }
                    }
                }
            }

            // Resource not loaded yet.
            T* pResource = nullptr;
            const uint32_t handle = GetNewHandle();

            if (!LoadResource(&pResource, handle, filename, extraParams))
                return nullptr;

            return AddResource(pResource);
        }

        void AddLoader(ResourceLoader* pLoader)
        {
            m_vLoaders.push_back(pLoader);
        }

        uint32_t GetNewHandle()
        {
            uint32_t handle;
            if (!m_sHandles.empty())
            {
                handle = m_sHandles.top();
                m_sHandles.pop();
            }
            else
            {
                handle = uint32_t(m_vResources.size());
            }
            return handle;
        }

        std::shared_ptr<T> AddResource(T* _resource)
        {
            std::shared_ptr<T> sp(_resource);
            if (_resource->m_iHandle >= m_vResources.size())
                m_vResources.push_back(sp);
            else
                m_vResources[_resource->m_iHandle] = sp;

            return sp;
        }

    protected:

        virtual bool LoadResource(T** ppOut, uint32_t handle, const std::string& filename,
            void* extraParams) = 0;

        std::vector<std::shared_ptr<T>> m_vResources;
        std::stack<uint32_t>            m_sHandles;
        std::vector<ResourceLoader*>    m_vLoaders;

    };
} // ari
Includes
  • stack
  • string
  • vector
Namespaces
File SceneSystem.hpp

Parent directory (include/ari/en/3d)

Definition (include/ari/en/3d/SceneSystem.hpp)
Program Listing for File SceneSystem.hpp

Return to documentation for file (include/ari/en/3d/SceneSystem.hpp)

#pragma once
#include "../System.hpp"
#include "../EventSubscriber.hpp"
#include "../../gfx/FrameData.hpp"

namespace ari
{
    class Camera;
    class BoxShape;
    class Node;

    class ARI_API SceneSystem: public System,
        public EventSubscriber<events::OnEntityCreated>,
        public EventSubscriber<events::OnEntityDestroyed>,
        public EventSubscriber<events::OnComponentAssigned<Camera>>,
        public EventSubscriber<events::OnComponentRemoved<Camera>>,
        public EventSubscriber<events::OnComponentAssigned<BoxShape>>,
        public EventSubscriber<events::OnComponentRemoved<BoxShape>>
    {
    public:

        SceneSystem();

        ~SceneSystem();

        void Update(World* p_world, UpdateState state) override;
        void Configure(World* p_world) override;
        void Unconfigure(World* p_world) override;
        Type GetSystemType() override
        {
            return Type::SceneSystem;
        }
        bool NeedUpdateOnState(UpdateState state) override;

        void Receive(World* world, const events::OnEntityCreated& event) override;
        void Receive(World* world, const events::OnEntityDestroyed& event) override;
        void Receive(World* world, const events::OnComponentAssigned<Camera>& event) override;
        void Receive(World* world, const events::OnComponentRemoved<Camera>& event) override;
        void Receive(World* world, const events::OnComponentAssigned<BoxShape>& event) override;
        void Receive(World* world, const events::OnComponentRemoved<BoxShape>& event) override;

    protected:

        Camera * m_pActiveCamera;
        FrameData   *   m_FrameDatasUnused,         // This is the unused frame data pointers
                    *   m_FrameDatasTransforms,     // This is the transform calculated nodes
                    *   m_FrameDatasVisible;        // This is the visible nodes that must be rendered.

        void CalcTransform(Node* node, Matrix* parentMat);

    }; // SceneSystem

} // ari
Includes
  • ../../gfx/FrameData.hpp
  • ../EventSubscriber.hpp
  • ../System.hpp
Included By
Namespaces
File shivadef.hpp

Parent directory (include/shiva)

Definition (include/shiva/shivadef.hpp)
Program Listing for File shivadef.hpp

Return to documentation for file (include/shiva/shivadef.hpp)

#pragma once

#if defined( _MSC_VER )
#   pragma warning(disable:4251) // dll interface for std types
#   ifdef SHIVA_EXPORT
#       define SHIVA_API __declspec(dllexport)
#   else
#       define SHIVA_API __declspec(dllimport)
#   endif
#else
#   ifdef SHIVA_EXPORT
#       define SHIVA_API __attribute__((visibility("default")))
#   else
#       define SHIVA_API
#   endif
#endif
File StringCast.h

Parent directory (include/ari)

Definition (include/ari/StringCast.h)
Program Listing for File StringCast.h

Return to documentation for file (include/ari/StringCast.h)

// In JSON map keys can only be strings, so here's a class which makes conversion to/from string easy
#pragma once

#include <string>

template <typename T>
std::string castToString(const T& value);

// template specializations

std::string castToString(const bool& value);
std::string castToString(const int& value);
std::string castToString(const float& value);
std::string castToString(const std::string& value);

template <typename T>
T fromString(const std::string& value);

template <>
bool fromString(const std::string& valueStr);

template <>
int fromString(const std::string& valueStr);

template <>
float fromString(const std::string& valueStr);

template <>
std::string fromString(const std::string& valueStr);


// return empty string if no conversion possible
template <typename T>
std::string castToString(const T& /* value */)
{
    return std::string();
}

template <typename T>
T fromString(const std::string& /* value */)
{
    return T();
}
Includes
  • string
Included By
File System.hpp

Parent directory (include/ari/en)

Definition (include/ari/en/System.hpp)
Program Listing for File System.hpp

Return to documentation for file (include/ari/en/System.hpp)

#pragma once
#include "../aridef.hpp"

namespace ari
{
    class World;

    class ARI_API System
    {
    public:

        enum class Type
        {
            GameplaySystem,
            SceneSystem,
            RenderSystem
        };

        enum class UpdateState
        {
            GameplayState,
            SceneManagerState,
            MainThreadState
        };

        System() = default;

        virtual ~System() = default;

        virtual void Update(World* p_world, UpdateState state) = 0;

        virtual void Configure(World* p_world) = 0;

        virtual void Unconfigure(World* p_world) = 0;

        virtual Type GetSystemType() = 0;

        virtual bool NeedUpdateOnState(UpdateState state) = 0;

    }; // System

} // ari
Includes
  • ../aridef.hpp
Namespaces
Classes
File TextBox.hpp

Parent directory (include/ari/en/gui)

Definition (include/ari/en/gui/TextBox.hpp)
Program Listing for File TextBox.hpp

Return to documentation for file (include/ari/en/gui/TextBox.hpp)

#pragma once
#include "Gui.hpp"

namespace ari
{
    class ARI_API TextBox: public Gui
    {
    public:

        TextBox(size_t maxLength = 128);

        ~TextBox() override;

        bool BeginRender() override;

        void SetText(const char* _text) const;

        char* Text;
        char* Label;

    private:
        size_t m_MaxLength;

    };

} // ari
Includes
Namespaces
Classes
File Texture.hpp

Parent directory (include/ari/gfx)

Definition (include/ari/gfx/Texture.hpp)
Program Listing for File Texture.hpp

Return to documentation for file (include/ari/gfx/Texture.hpp)

#pragma once
#include "../aridef.hpp"
#include "../Resource.hpp"
#include "bgfx/bgfx.h"
#include "bimg/bimg.h"

namespace ari
{
    struct TextureParams
    {
        uint32_t Flags = BGFX_TEXTURE_NONE;
        bgfx::TextureInfo* Info = nullptr;
        bimg::Orientation::Enum* Orientation = nullptr;
    };

    class ARI_API Texture: public Resource
    {
    public:

        Texture() = default;

        Texture(const uint32_t& _handel, const std::string& _fileName);

        ~Texture() override;

        bgfx::TextureHandle Handle = BGFX_INVALID_HANDLE;

    };

} // ari
Includes
  • ../Resource.hpp
  • ../aridef.hpp
  • bgfx/bgfx.h
  • bimg/bimg.h
Namespaces
File TextureManager.hpp

Parent directory (include/ari/gfx)

Definition (include/ari/gfx/TextureManager.hpp)
Program Listing for File TextureManager.hpp

Return to documentation for file (include/ari/gfx/TextureManager.hpp)

#pragma once
#include "../ResourceManager.hpp"
#include "Texture.hpp"

namespace ari
{
    class ARI_API TextureManager: public ResourceManager<Texture>
    {
    public:
        ~TextureManager() override;

    protected:

        bool LoadResource(Texture** ppOut, uint32_t handle,
            const std::string& filename, void* extraParams) override;

    };

} // ari
Includes
Included By
Namespaces
File Tools.hpp

Parent directory (include/shiva/windows)

Definition (include/shiva/windows/Tools.hpp)
Program Listing for File Tools.hpp

Return to documentation for file (include/shiva/windows/Tools.hpp)

#pragma once

namespace shiva
{

} // shiva
Namespaces
File Vector.hpp

Parent directory (include/ari/math)

Definition (include/ari/math/Vector.hpp)
Program Listing for File Vector.hpp

Return to documentation for file (include/ari/math/Vector.hpp)

#pragma once

#include <bx/math.h>
#include "arimath.hpp"

namespace ari
{
    struct Vector3
    {
        Vector3(): x(0.0f), y(0.0f), z(0.0f) { }

        Vector3(const float _x, const float _y, const float _z): x(_x), y(_y), z(_z) { }

        void Set(const float _x, const float _y, const float _z)
        {
            x = _x;
            y = _y;
            z = _z;
        }

        Vector3 operator-(const Vector3& v) const
        {
            return { x - v.x, y - v.y, z - v.z };
        }

        void Cross(const Vector3& _v1, const Vector3& _v2)
        {
            x = _v1.y*_v2.z - _v1.z*_v2.y;
            y = _v1.z*_v2.x - _v1.x*_v2.z;
            z = _v1.x*_v2.y - _v1.y*_v2.x;
        }

        float GetLength() const
        {
            return sqrtf(x*x + y * y + z * z);
        }

        void Normalize()
        {
            float length = GetLength();
            length = fEpsilon > length ? fEpsilon : length;
            x /= length;
            y /= length;
            z /= length;
        }

        bx::Vec3 ToVec3() const
        {
            return {
                x,
                y,
                z
            };
        }

        union
        {
            float v[3];
            struct {
                float x,
                    y,
                    z;
            };
        };
    }; // Vector3

} // ari
Includes
Namespaces
File Vertices.hpp

Parent directory (include/ari/gfx)

Definition (include/ari/gfx/Vertices.hpp)
Program Listing for File Vertices.hpp

Return to documentation for file (include/ari/gfx/Vertices.hpp)

#pragma once

namespace ari
{
    struct PosVertex
    {
        float x, y, z;
    };

    struct ColorVertex
    {
        uint32_t argb;
    };

} // ari
Namespaces
File Viewport.hpp

Parent directory (include/ari/en/2d)

Definition (include/ari/en/2d/Viewport.hpp)
Program Listing for File Viewport.hpp

Return to documentation for file (include/ari/en/2d/Viewport.hpp)

#pragma once
#include "../Component.hpp"
#include "../../math/Rect.hpp"
#include <bgfx/bgfx.h>
#include "../../gfx/Texture.hpp"

namespace ari
{
    class ARI_API Viewport: public Component
    {
    public:

        RectI                       Rect;
        bgfx::TextureFormat::Enum   TextureFormat = bgfx::TextureFormat::Count;
        bool                        CreateDepth = false;
        bool                        UseMSAA = false;

        // internal

        bgfx::FrameBufferHandle     m_frame_buffer_handle = BGFX_INVALID_HANDLE;
        RectI                       m_last_rect;
        bgfx::ViewId                m_view_id = 0;
        Texture                     m_texture,
                                    m_depth_texture;
    };

} // ari
Includes
  • ../../gfx/Texture.hpp
  • ../../math/Rect.hpp
  • ../Component.hpp
  • bgfx/bgfx.h
Namespaces
File Viewport.hpp

Parent directory (include/shiva/windows)

Definition (include/shiva/windows/Viewport.hpp)
Program Listing for File Viewport.hpp

Return to documentation for file (include/shiva/windows/Viewport.hpp)

#pragma once
#include "DockWindow.hpp"

namespace ari
{
    class Camera;
    class Viewport;
    class Image;
}

namespace shiva
{
    class SHIVA_API Viewport : public DockWindow
    {
    public:

        void Init(ari::World* p_world) override;

    protected:

        ari::Camera         *   m_pCamera           = nullptr;
        ari::Viewport       *   m_pViewport         = nullptr;
        ari::Image          *   m_pView             = nullptr;
        ari::PlatformWindow *   m_pPlatformWindow   = nullptr;
        ari::DelegateTwoParam<void, int, int>
                                m_OnMouseMove;

        void OnGui();
        void OnHovered();

    };

} // shiva
Includes
File Window.hpp

Parent directory (include/ari/en/gui)

Definition (include/ari/en/gui/Window.hpp)
Program Listing for File Window.hpp

Return to documentation for file (include/ari/en/gui/Window.hpp)

#pragma once
#include "Gui.hpp"
#include "dear-imgui/imgui.h"

namespace ari
{
    class ARI_API Window: public Gui
    {
    public:
        Window();

        ~Window() = default;

        bool BeginRender() override;
        void EndRender() override;

        char    *   Name;
        bool        CloseButton,
                    isOpen;
        ImVec2      Pos,
                    Size;
        ImGuiWindowFlags    Flags;

    }; // Window

} // ari
Includes
Namespaces
Classes
File World.hpp

Parent directory (include/ari/en)

Definition (include/ari/en/World.hpp)
Program Listing for File World.hpp

Return to documentation for file (include/ari/en/World.hpp)

#pragma once
#include "../aridef.hpp"
#include "tinystl/vector.h"
#include "EventSubscriber.hpp"
#include <algorithm>
#include <unordered_map>
#include "bx/spscqueue.h"

namespace ftl
{
    class TaskScheduler;
}

namespace ari
{
    class Node;
    class System;
    class Entity;

    class ARI_API World
    {
    public:

        enum class UpdateType
        {
            Sync,
            Async
        };

        World();

        ~World();

        void SetUpdateType(UpdateType type) { m_UpdateType = type; }

        UpdateType GetUpdateType() const { return m_UpdateType; }

        void AddSystem(System* p_system);

        void RemoveSystem(System* p_system);

        void AddEntity(Entity* p_entity);

        void RemoveEntity(Entity* p_entity);

        void Update(float tick);

        void _AddToDestroyQueue(Node* node);

        template<typename T>
        void subscribe(EventSubscriber<T>* subscriber)
        {
            auto index = getTypeIndex<T>();
            auto found = subscribers.find(index);
            if (found == subscribers.end())
            {
                tinystl::vector<Internal::BaseEventSubscriber*> subList;
                subList.push_back(subscriber);

                subscribers.insert({ index, subList });
            }
            else
            {
                found->second.push_back(subscriber);
            }
        }

        template<typename T>
        void unsubscribe(EventSubscriber<T>* subscriber)
        {
            auto index = getTypeIndex<T>();
            auto found = subscribers.find(index);
            if (found != subscribers.end())
            {
                found->second.erase(std::remove(found->second.begin(), found->second.end(), subscriber), found->second.end());
                if (found->second.size() == 0)
                {
                    subscribers.erase(found);
                }
            }
        }

        void unsubscribeAll(void* subscriber)
        {
            for (auto kv : subscribers)
            {
                kv.second.erase(std::remove(kv.second.begin(), kv.second.end(), subscriber), kv.second.end());
                if (kv.second.empty())
                {
                    subscribers.erase(subscribers.find(kv.first));
                }
            }
        }


        template<typename T>
        void emit(const T& event)
        {
            auto found = subscribers.find(getTypeIndex<T>());
            if (found != subscribers.end())
            {
                for (auto* base : found->second)
                {
                    auto* sub = reinterpret_cast<EventSubscriber<T>*>(base);
                    sub->Receive(this, event);
                }
            }
        }

        const tinystl::vector<Entity*>& GetAllEntities() const { return Entities; }

        ftl::TaskScheduler* GetTaskScheduler() const { return m_pTaskScheduler; }

    protected:

        std::unordered_map<TypeIndex,
            tinystl::vector<Internal::BaseEventSubscriber*>> subscribers;
        bx::SpScUnboundedQueueT<Node>   m_qDestroyQueue;
        tinystl::vector<System*> systems;
        tinystl::vector<Entity*> Entities;
        ftl::TaskScheduler  *   m_pTaskScheduler;
        UpdateType              m_UpdateType;

        void CheckDestroyQueue();

    }; // World

} // ari
Includes
Included By
Classes
File WorldManager.hpp

Parent directory (include/ari/en)

Definition (include/ari/en/WorldManager.hpp)
Program Listing for File WorldManager.hpp

Return to documentation for file (include/ari/en/WorldManager.hpp)

#pragma once

namespace ari
{

} // ari
Namespaces

Indices and tables