In file ./include/glmosaictext/Mosaic.hxx:

struct Mosaic::Rect

A class representing a rectangular region of a single texture.

Documentation

A class representing a rectangular region of a single texture. This is a struct because it has to be easily assignable and usable in many different ways without overhead.

To render this tile, make sure that the texture Id in tex is bound and then use the texture coordinates tx1, tx2, ty1 and ty2, or use the texcoord function.

Note that there are some not-so-fun artifacts of using multiple images per texture. Namely, when using linear interpolation, the texels outside the rectangle affect the final coloring.

It's a purposeful design decision that the class that contains information about the texture's width and height and type is not navigable from this class; for that, use MosaicTile or something else.

This class is simply a very low-level data structure to be used for rendering with low overheads.


[more]template<class T> void texcoord(T x, T y)
Call glTexCoord2f with the texture coordinates that are the given fraction from each corner.
[more]template<class T> void changeTexcoords(T &x, T &y)
Change (using the references) an x, y texture coordinate pair to be inside this rectangle

otemplate<class T> void texcoord(T x, T y)
Call glTexCoord2f with the texture coordinates that are the given fraction from each corner. Template just to make sure we get to use the most efficient evaluation...

Essentially, this function simulates what a call to glTexCoord2f would be like, if the image in this rectangle would be the full texture.

otemplate<class T> void changeTexcoords(T &x, T &y)
Change (using the references) an x, y texture coordinate pair to be inside this rectangle

Friends:
ostream& operator<<(ostream &o, const Rect& tile)

Alphabetic index Hierarchy of classes



This page was generated with the help of DOC++.