# namespace hiro

## Overview

Global engine namespace containing core definitions. More…

    namespace hiro {

    // namespaces

    namespace hiro::draw;
    namespace hiro::gui;
    namespace hiro::modules;
    namespace hiro::shader;

    // typedefs

    typedef std::shared_ptr<hiro::Gadget> PGadget;
    typedef std::function<void(const std::vector<std::string>&)> FileDropCallback;
    typedef std::function<void(const hiro::Key&, const hiro::ModKeys&)> KeyCallback;
    typedef std::shared_ptr<hiro::Resource> PResource;

    // enums

    enum BoolFunc;
    enum EventStatus;
    enum Key;
    enum Mod;
    enum MouseButton;

    // structs

    struct ActiveResourceInfo;
    struct ResourceId;

    // classes

    class Camera;
    class Debugger;
    class Exportable;
    class Gadget;
    class GuiGenerator;
    class GuiPanel;
    class ModKeys;
    class Resource;

    // global functions

    hiro::Camera::Pose Interpolate(const hiro::Camera::Pose& p0, const hiro::Camera::Pose& p1, float t);
    hiro::Camera::Pose InterpolateCubic(const hiro::Camera::Pose& p0, const hiro::Camera::Pose& p1, const hiro::Camera::Pose& p2, const hiro::Camera::Pose& p3, float t);
    HIRO_API utils::Version GetVersion();
    HIRO_API void SetIntermediateDirectory(const std::string& dir);
    HIRO_API void SetAssetDirectory(const std::string& dir);
    HIRO_API bool Initialize();
    HIRO_API bool Initialize(const std::string& custom_look);
    HIRO_API void Terminate();
    HIRO_API bool IsOpen();
    HIRO_API void Update();
    HIRO_API void AddResource(const hiro::PResource& resource);
    HIRO_API void RemoveAllResources();
    void RemoveResourcesWithPrefix(const std::string& prefix);
    HIRO_API std::vector<hiro::ActiveResourceInfo> GetActiveResources();
    HIRO_API hiro::Debugger& Debug();
    HIRO_API void SetFileDropCallback(const FileDropCallback&);
    HIRO_API void SetKeyDownCallback(const KeyCallback&);
    HIRO_API void SetKeyUpCallback(const KeyCallback&);
    HIRO_API bool IsAxesVisible(uint8_t viewarea_id);
    HIRO_API void SetAxesVisible(uint8_t viewarea_id, bool visible);

    } // namespace hiro

## Detailed Documentation

Global engine namespace containing core definitions.

### Typedefs

    typedef std::shared_ptr<hiro::Gadget> PGadget

Shared pointer to Gadget.

    typedef std::shared_ptr<hiro::Resource> PResource

Shared pointer to Resource.

### Global Functions

    hiro::Camera::Pose Interpolate(const hiro::Camera::Pose& p0, const hiro::Camera::Pose& p1, float t)

Interpolates two camera poses using linear interpolation.

Parameters:

p0 | Start pose.
p1 | End pose.
t | Interpolation factor in range <0,1>, where 0 returns p0 and 1 returns p1.

Returns:

Interpolated pose.

    hiro::Camera::Pose InterpolateCubic(const hiro::Camera::Pose& p0, const hiro::Camera::Pose& p1, const hiro::Camera::Pose& p2, const hiro::Camera::Pose& p3, float t)

Interpolates camera poses using cubic spline interpolation.

Parameters:

p0 | Pose before start pose.
p1 | Start pose.
p2 | End pose.
p3 | Pose after end pose.
t | Interpolation factor in range <0,1>.

Returns:

Interpolated pose.

    HIRO_API utils::Version GetVersion()

Returns current library version.

    HIRO_API void SetIntermediateDirectory(const std::string& dir)

Sets directory where hiro stores temporal cache data.

Needs to be called before initialization using hiro::Initialize().

    HIRO_API void SetAssetDirectory(const std::string& dir)

Sets directory where are sub-folders “resources” and “shaders” present.

Needs to be called before initialization using hiro::Initialize().

    HIRO_API bool Initialize()

Initializes the library. From this moment the library can be fully used.

    HIRO_API bool Initialize(const std::string& custom_look)

Initializes the library with custom look visuals of application on startup.

Not available in educational version of HIRO library.

    HIRO_API void Terminate()

Terminates the library. Call to release all HIRO related data.

    HIRO_API bool IsOpen()

Check whether hiro window has not been closed.

    HIRO_API void Update()

Updates window and redraws if required.

Ensure that this function is called regularly in your application. If not, it may cause window freezing and lag.

    HIRO_API void AddResource(const hiro::PResource& resource)

Add specified resource to the list of available resources.

    HIRO_API void RemoveAllResources()

Remove all resources from the list of available resources.

    void RemoveResourcesWithPrefix(const std::string& prefix)

Remove all resources whose name includes prefix from the list of available resources.

    HIRO_API std::vector<hiro::ActiveResourceInfo> GetActiveResources()

Returns information about all resources currently active in context.

Active Resource objects are the ones that were used to create at least one Gadget ant it still exists.

    HIRO_API hiro::Debugger& Debug()

Returns handle to visual debugger.

The visual debugger provides visualization of debug objects, useful fo visual feedback. When the library is not initialized yet, this function throws std::runtime_error.

    HIRO_API void SetFileDropCallback(const FileDropCallback&)

Sets a unique function called when files are dropped onto an active HIRO window.

    HIRO_API void SetKeyDownCallback(const KeyCallback&)

Sets a unique function called when a key is pressed in an active HIRO window.

    HIRO_API void SetKeyUpCallback(const KeyCallback&)

Sets a unique function called when a key is released in an active HIRO window.

    HIRO_API bool IsAxesVisible(uint8_t viewarea_id)

Returns axes visibility state in the viewarea with the given id.

    HIRO_API void SetAxesVisible(uint8_t viewarea_id, bool visible)

Sets axes visibility in the viewarea with the given id.