#pragma once #include #include namespace PW { enum Anchor { MID_LEFT, TOP_LEFT, TOP_MID, TOP_RIGHT, MID_RIGHT, BOTTOM_RIGHT, BOTTOM_MID, BOTTOM_LEFT, CENTER, TOP_NONE, MID_NONE, BOTTOM_NONE, NONE_LEFT, NONE_MID, NONE_RIGHT, }; /// Convert pixel-space x and y to relative-space (-1 -> 0 -> 1) coords std::array toRelative(GLfloat x, GLfloat y, Anchor anchor); /// Mid-Left `toRelative` inline std::array ml(GLfloat x, GLfloat y) { return PW::toRelative(x, y, PW::MID_LEFT); } /// Top-Left `toRelative` inline std::array tl(GLfloat x, GLfloat y) { return PW::toRelative(x, y, PW::TOP_LEFT); } /// Top-Mid `toRelative` inline std::array tm(GLfloat x, GLfloat y) { return PW::toRelative(x, y, PW::TOP_MID); } /// Top-Right `toRelative` inline std::array tr(GLfloat x, GLfloat y) { return PW::toRelative(x, y, PW::TOP_RIGHT); } /// Mid-Right `toRelative` inline std::array mr(GLfloat x, GLfloat y) { return PW::toRelative(x, y, PW::MID_RIGHT); } /// Bottom-Right `toRelative` inline std::array br(GLfloat x, GLfloat y) { return PW::toRelative(x, y, PW::BOTTOM_RIGHT); } /// Bottom-Mid `toRelative` inline std::array bm(GLfloat x, GLfloat y) { return PW::toRelative(x, y, PW::BOTTOM_MID); } /// Bottom-Left `toRelative` inline std::array bl(GLfloat x, GLfloat y) { return PW::toRelative(x, y, PW::BOTTOM_LEFT); } /// Center `toRelative` inline std::array c(GLfloat x, GLfloat y) { return PW::toRelative(x, y, PW::CENTER); } /// Top-None `toRelative` inline std::array tn(GLfloat x, GLfloat y) { return PW::toRelative(x, y, PW::TOP_NONE); } /// Mid-None `toRelative` inline std::array mn(GLfloat x, GLfloat y) { return PW::toRelative(x, y, PW::MID_NONE); } /// Bottom-None `toRelative` inline std::array bn(GLfloat x, GLfloat y) { return PW::toRelative(x, y, PW::BOTTOM_NONE); } /// None-Left `toRelative` inline std::array nl(GLfloat x, GLfloat y) { return PW::toRelative(x, y, PW::NONE_LEFT); } /// None-Mid `toRelative` inline std::array nm(GLfloat x, GLfloat y) { return PW::toRelative(x, y, PW::NONE_MID); } /// None-Right `toRelative` inline std::array nr(GLfloat x, GLfloat y) { return PW::toRelative(x, y, PW::NONE_RIGHT); } }