Define - Horizon-NTH/HorizonGUI GitHub Wiki

Introduction

In this section, we document various code constructs that include macros, enumerations (enums), typedefs, and associated constants used in the hgui library. All those definitions can be found mainly in the header file Define.h.

Table of Contents


TAG

  • Description: The HGUI_TAG_MAIN macro is used to define the main tag for the HorizonGUI library.
#define HGUI_TAG_MAIN "HGUI_TAG_MAIN"

COLOR

  • Description: The HGUI_COLOR_* macros define color presets for the HorizonGUI library.
#define HGUI_COLOR_BLACK hgui::color(0.f)
#define HGUI_COLOR_WHITE hgui::color(1.f)
#define HGUI_COLOR_RED hgui::color(1.f, 0.f, 0.f)
#define HGUI_COLOR_GREEN hgui::color(0.f, 1.f, 0.f)
#define HGUI_COLOR_BLUE hgui::color(0.f, 0.f, 1.f)

PRECISION

  • Description: The HGUI_PRECISION macro defines the precision used in the HorizonGUI library, with a default value of float.
#ifndef HGUI_PRECISION
#define HGUI_PRECISION float
#endif // !HGUI_PRECISION

keys

  • Description: The keys enumeration defines constants for keyboard keys and their corresponding keycodes.
enum class keys
{
    UNKNOWN,
    ESCAPE,
    F1,
    F2,
    F3,
    F4,
    F5,
    F6,
    F7,
    F8,
    F9,
    F10,
    F11,
    F12,
    PRINT_SCREEN,
    INSERT,
    BACKSPACE,
    SQUARE,
    AMPERSAND,
    E_WITH_ACUTE,
    QUOTATION,
    APOSTROPHE,
    LEFT_BRACKET,
    MINUS,
    E_WITH_GRAVE,
    UNDERSCORE,
    C_WITH_CEDILLA,
    A_WITH_GRAVE,
    RIGHT_BRACKET,
    EQUAL,
    REMOVE,
    TAB,
    A,
    Z,
    E,
    R,
    T,
    Y,
    U,
    I,
    O,
    P,
    CIRCUMFLEX,
    DOLLAR,
    ASTERISK,
    CAPS_LOCK,
    Q,
    S,
    D,
    F,
    G,
    H,
    J,
    K,
    L,
    M,
    U_WITH_GRAVE,
    ENTER,
    LEFT_SHIFT,
    SIGN,
    W,
    X,
    C,
    V,
    B,
    N,
    COMMA,
    SEMICOLON,
    COLON,
    EXCLAMATION_MARK,
    RIGHT_SHIFT,
    LEFT_CONTROL,
    WINDOWS,
    LEFT_ALT,
    SPACE,
    RIGHT_ALT,
    RIGHT_CONTROL,
    RIGHT,
    LEFT,
    DOWN,
    UP,
    PAGE_UP,
    PAGE_DOWN,
    HOME,
    END,
    PAUSE,
    SCROLL_LOCK,
    NUM_LOCK,
    KP_0,
    KP_1,
    KP_2,
    KP_3,
    KP_4,
    KP_5,
    KP_6,
    KP_7,
    KP_8,
    KP_9,
    KP_DECIMAL,
    KP_DIVIDE,
    KP_MULTIPLY,
    KP_SUBTRACT,
    KP_ADD,
    KP_ENTER,
    KP_EQUAL
};

buttons

  • Description: The buttons enumeration defines constants for mouse buttons.
enum class buttons
{
	LEFT,
	RIGHT,
	MIDDLE,
	BUTTON_3,
	BUTTON_4,
	BUTTON_5,
	BUTTON_6,
	BUTTON_7,
	BUTTON_8
};

inputs

  • Description: The inputs enumeration defines constants for various input events.
enum class inputs
{
    OVER,
	NOVER,
	MOTION,
	SCROLL,
	SCROLL_UP,
	SCROLL_DOWN
};

actions

  • Description: The actions enumeration defines constants for input actions, such as press, repeat, and release.
enum class actions
{
    PRESS,
	REPEAT,
	RELEASE
};

effects

  • Description: The effects enumeration defines constants for visual effects.
enum class effects
{
    CLASSIC,
	BLURRED,
	NEGATIVE
};

options

  • Description: The options enumeration defines constants for window options.
enum class options
{
    RESIZABLE,
	VISIBLE,
	DECORATED,
	FOCUSED,
	AUTO_ICONIFY,
	FLOATING,
	MAXIMIZED,
	CENTER_CURSOR,
	FOCUS_ON_SHOW,
	SCALE_TO_MONITOR
};

channels

  • Description: The channels enumeration defines constants for color channels.
enum class channels
{
    GREYSCALE,
	GREYSCALE_ALPHA,
	RGB,
	RGBA
};

state

  • Description: The state enumeration defines constants for the state of GUI elements.
enum class state
{
   	NORMAL,
	HOVER,
	PRESS
};

cursors

  • Description: The cursors enumeration defines constants for cursor types.
enum class cursors
{
    ARROW,
    IBEAM,
    CROSSHAIR,
    HAND,
    HRESIZE,
    VRESIZE
};

reference

  • Description: The reference enumeration is used to define which metrics the application's responsiveness should be relative to.
enum class reference
{
    WIDTH,
    HEIGHT,
    BOTH
};

  • Description: These are used to have the same name as the GLSL vectors.
typedef kernel::GLSLvec2<float> vec2;
typedef kernel::GLSLvec3<float> vec3;
typedef kernel::GLSLvec4<float> vec4;
typedef kernel::GLSLvec2<double> dvec2;
typedef kernel::GLSLvec3<double> dvec3;
typedef kernel::GLSLvec4<double> dvec4;
typedef kernel::GLSLvec2<int> ivec2;
typedef kernel::GLSLvec3<int> ivec3;
typedef kernel::GLSLvec4<int> ivec4;
typedef kernel::GLSLvec2<unsigned int> uvec2;
typedef kernel::GLSLvec3<unsigned int> uvec3;
typedef kernel::GLSLvec4<unsigned int> uvec4;
typedef kernel::Color<HGUI_PRECISION> color;
typedef kernel::Point<HGUI_PRECISION> point;
typedef kernel::Size<HGUI_PRECISION> size;
⚠️ **GitHub.com Fallback** ⚠️