25 template<
class T, 
class V>
 
   46     void     set        (
const T v[2])          {
x=v[0]; 
y=v[1];}
 
   60                                       const SLRect& r){output<<
"["<<r.
x<<
","<<r.
y<<
","<<r.
width<<
","<<r.
height<<
"]"; 
return output;}
 
   63     void    tl          (V v)                   {
x = v.x; 
y = v.y;}              
 
   64     void    br          (V v)                   {
if (v.x < 
x) 
x = v.x;
 
   80     void    print       (
const char* str=
nullptr) 
 
Extension class with functions for quick line & point drawing.
 
vector< SLRecti > SLVRecti
 
SLRect< SLfloat, SLVec2f > SLRectf
 
vector< SLRectf > SLVRectf
 
SLRect< SLint, SLVec2i > SLRecti
 
vector< SLVec3f > SLVVec3f
 
SLVec3< SLfloat > SLVec3f
 
SLGLVertexArray adds Helper Functions for quick Line & Point Drawing.
 
void generateVertexPos(SLVVec2f *p)
Adds or updates & generates a position vertex attribute for colored line or point drawing.
 
void drawArrayAsColored(SLGLPrimitiveType primitiveType, SLCol4f color, SLfloat lineOrPointSize=1.0f, SLuint indexFirstVertex=0, SLuint countVertices=0)
Draws the array as the specified primitive with the color.
 
A rectangle template class.
 
void tl(V v)
top-left corner
 
SLbool operator!=(const SLRect &r) const
 
friend std::ostream & operator<<(std::ostream &output, const SLRect &r)
 
void set(const T X, const T Y, const T WIDTH, const T HEIGHT)
 
void set(const V tl, const V br)
 
SLRect(const T WIDTH, const T HEIGHT)
 
SLbool operator==(const SLRect &r) const
 
void print(const char *str=nullptr)
 
SLbool contains(T X, T Y)
 
SLbool contains(const SLRect &r)
 
void drawGL(const SLCol4f &color)
 
void br(V v)
bottom-right corner
 
SLRect(const T X, const T Y, const T WIDTH, const T HEIGHT)
 
SLRect(const V &tl, const V &br)
 
SLRect & operator=(const SLRect &r)
 
V br()
bottom-right corner