+
+ /**
+ * Calculate texture coordinates for a tile at a certain index. Tiles
+ * are indexed start with zero as the top-left tile and moving across,
+ * then down.
+ * \param index The tile index.
+ * \param coords An array of scalars where the texture coordinates will
+ * be stored after this call. The first coordinate (u,v) will be in
+ * the first two places and so on until all four coordinates are
+ * stored, therefore requiring enough room for an array of eight
+ * scalars. The winding of the coordinates is always counter-clockwise
+ * (the GL default).
+ * \return True if index is valid, false otherwise.
+ */
+ bool tile_coordinates(int index, scalar coords[8]) const;
+
+
+ void bind() const;
+ static void reset_binding();