Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

glui_internal.h File Reference

#include <cstdio>
#include <cmath>

Go to the source code of this file.

Defines

#define AND   &&
#define OR   ||
#define NOT   !
#define MAX(a, b)   ((a)>(b) ? (a) : (b))
#define MIN(a, b)   ((a)<(b) ? (a) : (b))
#define ABS(a)   ((a)>=0 ? (a) : (-(a)))
#define TEST_BIT(x, b)   (((x) & (1<<(b))) != 0 )
#define SET_BIT(x, b)   ((x) |= (1 << (b)))
#define CLEAR_BIT(x, b)   ((x) &= ~(1 << (b)))
#define TOGGLE_BIT(x, b)   ((TEST_BIT(x,b)) ?(CLEAR_BIT(x,b)):(SET_BIT(x,b)))
#define TEST_AND(a, b)   ((a&b)==b)
#define M_PI   3.141592654
#define flushout   fflush(stdout)
#define flusherr   fflush(stderr)
#define error_return(c)   ; {fprintf(stderr,c);return;}
#define randf()   ((float) rand() / (float)RAND_MAX )
#define SIGN(x)   ((x)>=0 ? 1 : -1)
#define DEG2RAD(x)   ((x)/180.0*M_PI)
#define RAD2DEG(x)   ((x)/M_PI*180.0)
#define CLAMP(x, lo, hi)   {if ((x) < (lo)) {(x)=(lo);} else if((x) > (hi)) {(x)=(hi);}}
#define IN_BOUNDS(x, lo, hi)   ( (x) >= (lo) AND (x) <= (hi) )
#define PT_IN_BOX(x, y, lo_x, hi_x, lo_y, hi_y)   ( IN_BOUNDS(x,lo_x,hi_x) AND IN_BOUNDS(y,lo_y,hi_y) )
#define CHECK_PROPER_SIDE(x, val, side)   ((side) > 0 ? (x) > (val) : (x) < (val))
#define FUDGE   .00001
#define SWAP2(a, b, t)   {t=a;a=b;b=t;}
#define VEC3_TO_ARRAY(v, a)   a[0]=v[0], a[1]=v[1], a[2]=v[2]
#define CTRL(c)   ( (c>=('a'-1)) ? (c-'a'+1) : (c-'A'+1) )


Define Documentation

#define ABS  )     ((a)>=0 ? (a) : (-(a)))
 

#define AND   &&
 

#define CHECK_PROPER_SIDE x,
val,
side   )     ((side) > 0 ? (x) > (val) : (x) < (val))
 

#define CLAMP x,
lo,
hi   )     {if ((x) < (lo)) {(x)=(lo);} else if((x) > (hi)) {(x)=(hi);}}
 

#define CLEAR_BIT x,
 )     ((x) &= ~(1 << (b)))
 

#define CTRL  )     ( (c>=('a'-1)) ? (c-'a'+1) : (c-'A'+1) )
 

#define DEG2RAD  )     ((x)/180.0*M_PI)
 

#define error_return  )     ; {fprintf(stderr,c);return;}
 

#define flusherr   fflush(stderr)
 

#define flushout   fflush(stdout)
 

#define FUDGE   .00001
 

#define IN_BOUNDS x,
lo,
hi   )     ( (x) >= (lo) AND (x) <= (hi) )
 

#define M_PI   3.141592654
 

#define MAX a,
 )     ((a)>(b) ? (a) : (b))
 

#define MIN a,
 )     ((a)<(b) ? (a) : (b))
 

#define NOT   !
 

#define OR   ||
 

#define PT_IN_BOX x,
y,
lo_x,
hi_x,
lo_y,
hi_y   )     ( IN_BOUNDS(x,lo_x,hi_x) AND IN_BOUNDS(y,lo_y,hi_y) )
 

#define RAD2DEG  )     ((x)/M_PI*180.0)
 

 
#define randf  )     ((float) rand() / (float)RAND_MAX )
 

#define SET_BIT x,
 )     ((x) |= (1 << (b)))
 

#define SIGN  )     ((x)>=0 ? 1 : -1)
 

#define SWAP2 a,
b,
 )     {t=a;a=b;b=t;}
 

#define TEST_AND a,
 )     ((a&b)==b)
 

#define TEST_BIT x,
 )     (((x) & (1<<(b))) != 0 )
 

#define TOGGLE_BIT x,
 )     ((TEST_BIT(x,b)) ?(CLEAR_BIT(x,b)):(SET_BIT(x,b)))
 

#define VEC3_TO_ARRAY v,
 )     a[0]=v[0], a[1]=v[1], a[2]=v[2]
 


Generated on Fri Sep 15 17:51:57 2006 for GLUI by doxygen 1.3.6