Skip to content

Instantly share code, notes, and snippets.

@matjam
Created June 16, 2020 01:28
Show Gist options
  • Save matjam/861fdfb70aa6a42dcc3c3c86714bd266 to your computer and use it in GitHub Desktop.
Save matjam/861fdfb70aa6a42dcc3c3c86714bd266 to your computer and use it in GitHub Desktop.
struct Quad {
sf::Vertex &a;
sf::Vertex &b;
sf::Vertex &c;
sf::Vertex &d;
};
inline Quad &
getQuadForScreenLocation(sf::Vector2i location)
{
return Quad
{
m_console_bg_vertices[(x + y * m_width) * 4],
m_console_bg_vertices[(x + y * m_width) * 4 + 1],
m_console_bg_vertices[(x + y * m_width) * 4 + 2],
m_console_bg_vertices[(x + y * m_width) * 4 + 3]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment