ReactOS  0.4.14-dev-606-g14ebc0b
macros.h File Reference
#include <math.h>
#include <string.h>
Include dependency graph for macros.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define ASSERT(X)
 
#define MAX_GLUSHORT   0xffff
 
#define MAX_GLUINT   0xffffffff
 
#define COPY_2V(DST, SRC)
 
#define COPY_3V(DST, SRC)
 
#define COPY_4V(DST, SRC)
 
#define COPY_4UBV(DST, SRC)
 
#define ASSIGN_2V(V, V0, V1)   V[0] = V0; V[1] = V1;
 
#define ASSIGN_3V(V, V0, V1, V2)   V[0] = V0; V[1] = V1; V[2] = V2;
 
#define ASSIGN_4V(V, V0, V1, V2, V3)
 
#define INSIDE_BEGIN_END(CTX)   ((CTX)->Primitive!=GL_BITMAP)
 
#define ABSI(X)   ((X) < 0 ? -(X) : (X))
 
#define ABSF(X)   ((X) < 0.0F ? -(X) : (X))
 
#define ABSD(X)   ((X) < 0.0 ? -(X) : (X))
 
#define ROUNDF(X)   ( (X)<0.0F ? ((GLint) ((X)-0.5F)) : ((GLint) ((X)+0.5F)) )
 
#define CEILING(A, B)   ( (A) % (B) == 0 ? (A)/(B) : (A)/(B)+1 )
 
#define CLAMP(X, MIN, MAX)   ( (X)<(MIN) ? (MIN) : ((X)>(MAX) ? (MAX) : (X)) )
 
#define MIN2(A, B)   ( (A)<(B) ? (A) : (B) )
 
#define MAX2(A, B)   ( (A)>(B) ? (A) : (B) )
 
#define DOT3(a, b)   ( a[0]*b[0] + a[1]*b[1] + a[2]*b[2] )
 
#define DOT4(a, b)   ( a[0]*b[0] + a[1]*b[1] + a[2]*b[2] + a[3]*b[3] )
 
#define UBYTE_TO_FLOAT(B)   ((GLfloat) (B) * (1.0F / 255.0F))
 
#define FLOAT_TO_UBYTE(X)   ((GLubyte) (GLint) (((X)) * 255.0F))
 
#define BYTE_TO_FLOAT(B)   ((2.0F * (B) + 1.0F) * (1.0F/255.0F))
 
#define FLOAT_TO_BYTE(X)   ( (((GLint) (255.0F * (X))) - 1) / 2 )
 
#define USHORT_TO_FLOAT(S)   ((GLfloat) (S) * (1.0F / 65535.0F))
 
#define FLOAT_TO_USHORT(X)   ((GLushort) (GLint) ((X) * 65535.0F))
 
#define SHORT_TO_FLOAT(S)   ((2.0F * (S) + 1.0F) * (1.0F/65535.0F))
 
#define FLOAT_TO_SHORT(X)   ( (((GLint) (65535.0F * (X))) - 1) / 2 )
 
#define UINT_TO_FLOAT(U)   ((GLfloat) (U) * (1.0F / 4294967295.0F))
 
#define FLOAT_TO_UINT(X)   ((GLuint) ((X) * 4294967295.0))
 
#define INT_TO_FLOAT(I)   ((2.0F * (I) + 1.0F) * (1.0F/4294967294.0F))
 
#define FLOAT_TO_INT(X)   ( (GLint) (2147483647.0 * (X)) )
 
#define MEMCPY(DST, SRC, BYTES)   memcpy( (void *) (DST), (void *) (SRC), (size_t) (BYTES) )
 
#define MEMSET(DST, VAL, N)   memset( (void *) (DST), (int) (VAL), (size_t) (N) )
 
#define DEFARRAY(TYPE, NAME, SIZE)   TYPE NAME[SIZE]
 
#define UNDEFARRAY(NAME)
 
#define M_PI   (3.1415926)
 
#define DEG2RAD   (M_PI/180.0)
 
#define NULL   0
 

Macro Definition Documentation

◆ ABSD

#define ABSD (   X)    ((X) < 0.0 ? -(X) : (X))

Definition at line 142 of file macros.h.

◆ ABSF

#define ABSF (   X)    ((X) < 0.0F ? -(X) : (X))

Definition at line 141 of file macros.h.

◆ ABSI

#define ABSI (   X)    ((X) < 0 ? -(X) : (X))

Definition at line 140 of file macros.h.

◆ ASSERT

#define ASSERT (   X)

Definition at line 83 of file macros.h.

◆ ASSIGN_2V

#define ASSIGN_2V (   V,
  V0,
  V1 
)    V[0] = V0; V[1] = V1;

Definition at line 124 of file macros.h.

◆ ASSIGN_3V

#define ASSIGN_3V (   V,
  V0,
  V1,
  V2 
)    V[0] = V0; V[1] = V1; V[2] = V2;

Definition at line 126 of file macros.h.

◆ ASSIGN_4V

#define ASSIGN_4V (   V,
  V0,
  V1,
  V2,
  V3 
)
Value:
V[0] = V0; \
V[1] = V1; \
V[2] = V2; \
V[3] = V3;
static struct proto V0[]
Definition: mkg3states.c:68
SAMPR_REVISION_INFO_V1 V1
Definition: sam.idl:134

Definition at line 128 of file macros.h.

◆ BYTE_TO_FLOAT

#define BYTE_TO_FLOAT (   B)    ((2.0F * (B) + 1.0F) * (1.0F/255.0F))

Definition at line 187 of file macros.h.

◆ CEILING

#define CEILING (   A,
  B 
)    ( (A) % (B) == 0 ? (A)/(B) : (A)/(B)+1 )

Definition at line 151 of file macros.h.

◆ CLAMP

#define CLAMP (   X,
  MIN,
  MAX 
)    ( (X)<(MIN) ? (MIN) : ((X)>(MAX) ? (MAX) : (X)) )

Definition at line 155 of file macros.h.

◆ COPY_2V

#define COPY_2V (   DST,
  SRC 
)
Value:
DST[0] = SRC[0]; \
DST[1] = SRC[1];

Definition at line 95 of file macros.h.

◆ COPY_3V

#define COPY_3V (   DST,
  SRC 
)
Value:
DST[0] = SRC[0]; \
DST[1] = SRC[1]; \
DST[2] = SRC[2];

Definition at line 98 of file macros.h.

◆ COPY_4UBV

#define COPY_4UBV (   DST,
  SRC 
)
Value:
if (sizeof(GLuint)==4*sizeof(GLubyte)) { \
*((GLuint*)(DST)) = *((GLuint*)(SRC)); \
} \
else { \
(DST)[0] = (SRC)[0]; \
(DST)[1] = (SRC)[1]; \
(DST)[2] = (SRC)[2]; \
(DST)[3] = (SRC)[3]; \
}
unsigned char GLubyte
Definition: gl.h:157
unsigned int GLuint
Definition: gl.h:159

Definition at line 110 of file macros.h.

◆ COPY_4V

#define COPY_4V (   DST,
  SRC 
)
Value:
DST[0] = SRC[0]; \
DST[1] = SRC[1]; \
DST[2] = SRC[2]; \
DST[3] = SRC[3];

Definition at line 102 of file macros.h.

◆ DEFARRAY

#define DEFARRAY (   TYPE,
  NAME,
  SIZE 
)    TYPE NAME[SIZE]

Definition at line 256 of file macros.h.

◆ DEG2RAD

#define DEG2RAD   (M_PI/180.0)

Definition at line 268 of file macros.h.

◆ DOT3

#define DOT3 (   a,
  b 
)    ( a[0]*b[0] + a[1]*b[1] + a[2]*b[2] )

Definition at line 167 of file macros.h.

◆ DOT4

#define DOT4 (   a,
  b 
)    ( a[0]*b[0] + a[1]*b[1] + a[2]*b[2] + a[3]*b[3] )

Definition at line 171 of file macros.h.

◆ FLOAT_TO_BYTE

#define FLOAT_TO_BYTE (   X)    ( (((GLint) (255.0F * (X))) - 1) / 2 )

Definition at line 190 of file macros.h.

◆ FLOAT_TO_INT

#define FLOAT_TO_INT (   X)    ( (GLint) (2147483647.0 * (X)) )

Definition at line 222 of file macros.h.

◆ FLOAT_TO_SHORT

#define FLOAT_TO_SHORT (   X)    ( (((GLint) (65535.0F * (X))) - 1) / 2 )

Definition at line 204 of file macros.h.

◆ FLOAT_TO_UBYTE

#define FLOAT_TO_UBYTE (   X)    ((GLubyte) (GLint) (((X)) * 255.0F))

Definition at line 183 of file macros.h.

◆ FLOAT_TO_UINT

#define FLOAT_TO_UINT (   X)    ((GLuint) ((X) * 4294967295.0))

Definition at line 211 of file macros.h.

◆ FLOAT_TO_USHORT

#define FLOAT_TO_USHORT (   X)    ((GLushort) (GLint) ((X) * 65535.0F))

Definition at line 197 of file macros.h.

◆ INSIDE_BEGIN_END

#define INSIDE_BEGIN_END (   CTX)    ((CTX)->Primitive!=GL_BITMAP)

Definition at line 135 of file macros.h.

◆ INT_TO_FLOAT

#define INT_TO_FLOAT (   I)    ((2.0F * (I) + 1.0F) * (1.0F/4294967294.0F))

Definition at line 215 of file macros.h.

◆ M_PI

#define M_PI   (3.1415926)

Definition at line 263 of file macros.h.

◆ MAX2

#define MAX2 (   A,
  B 
)    ( (A)>(B) ? (A) : (B) )

Definition at line 163 of file macros.h.

◆ MAX_GLUINT

#define MAX_GLUINT   0xffffffff

Definition at line 89 of file macros.h.

◆ MAX_GLUSHORT

#define MAX_GLUSHORT   0xffff

Definition at line 88 of file macros.h.

◆ MEMCPY

#define MEMCPY (   DST,
  SRC,
  BYTES 
)    memcpy( (void *) (DST), (void *) (SRC), (size_t) (BYTES) )

Definition at line 231 of file macros.h.

◆ MEMSET

#define MEMSET (   DST,
  VAL,
 
)    memset( (void *) (DST), (int) (VAL), (size_t) (N) )

Definition at line 241 of file macros.h.

◆ MIN2

#define MIN2 (   A,
  B 
)    ( (A)<(B) ? (A) : (B) )

Definition at line 159 of file macros.h.

◆ NULL

#define NULL   0

Definition at line 272 of file macros.h.

◆ ROUNDF

#define ROUNDF (   X)    ( (X)<0.0F ? ((GLint) ((X)-0.5F)) : ((GLint) ((X)+0.5F)) )

Definition at line 147 of file macros.h.

◆ SHORT_TO_FLOAT

#define SHORT_TO_FLOAT (   S)    ((2.0F * (S) + 1.0F) * (1.0F/65535.0F))

Definition at line 201 of file macros.h.

◆ UBYTE_TO_FLOAT

#define UBYTE_TO_FLOAT (   B)    ((GLfloat) (B) * (1.0F / 255.0F))

Definition at line 180 of file macros.h.

◆ UINT_TO_FLOAT

#define UINT_TO_FLOAT (   U)    ((GLfloat) (U) * (1.0F / 4294967295.0F))

Definition at line 208 of file macros.h.

◆ UNDEFARRAY

#define UNDEFARRAY (   NAME)

Definition at line 257 of file macros.h.

◆ USHORT_TO_FLOAT

#define USHORT_TO_FLOAT (   S)    ((GLfloat) (S) * (1.0F / 65535.0F))

Definition at line 194 of file macros.h.