General macros |
| #define | NULL 0 |
[Pseudo] static array declaration. |
MACs and BeOS don't support static larger than 32kb, so ...
|
| #define | DEFARRAY(TYPE, NAME, SIZE) TYPE NAME[SIZE] |
| | Define a [static] unidimensional array. More...
|
| #define | DEFMARRAY(TYPE, NAME, SIZE1, SIZE2) TYPE NAME[SIZE1][SIZE2] |
| | Define a [static] bi-dimensional array. More...
|
| #define | DEFMNARRAY(TYPE, NAME, SIZE1, SIZE2, SIZE3) TYPE NAME[SIZE1][SIZE2][SIZE3] |
| | Define a [static] tri-dimensional array. More...
|
| #define | CHECKARRAY(NAME, CMD) do {} while(0) |
| | Verifies a [static] array was properly allocated. More...
|
| #define | UNDEFARRAY(NAME) |
| | Undefine (free) a [static] array. More...
|
External pixel buffer allocation. |
| If you want Mesa's depth/stencil/accum/etc buffers to be allocated with a specialized allocator you can define MESA_EXTERNAL_BUFFERALLOC and implement _ext_mesa_alloc_pixelbuffer() _ext_mesa_free_pixelbuffer() in your application.
-
Author:
-
Contributed by Gerk Huisma (gerk@five-d.demon.nl).
|
| #define | MESA_PBUFFER_ALLOC(BYTES) (void *) _mesa_align_malloc(BYTES, 512) |
| | Allocate a pixel buffer. More...
|
| #define | MESA_PBUFFER_FREE(PTR) _mesa_align_free(PTR) |
| | Free a pixel buffer. More...
|
Defines |
| #define | ADD_POINTERS(A, B) ( (A) + (unsigned long) (B) ) |
| #define | MAX_GLUSHORT 0xffff |
| #define | MAX_GLUINT 0xffffffff |
| #define | M_PI (3.1415926536) |
| #define | FLT_MIN (1.0e-37) |
| #define | DEG2RAD (M_PI/180.0) |
| #define | SQRTF(X) (float) sqrt((float) (X)) |
| #define | INV_SQRTF(X) (1.0F / SQRTF(X)) |
| #define | LOG2(x) ((GLfloat) (log(x) * 1.442695F)) |
| #define | IS_INF_OR_NAN(x) (!finite(x)) |
| #define | IS_NEGATIVE(x) (x < 0.0F) |
| #define | DIFFERENT_SIGNS(x, y) ((x) * (y) <= 0.0F && (x) - (y) != 0.0F) |
| #define | CEILF(x) ((GLfloat) ceil(x)) |
| #define | FLOORF(x) ((GLfloat) floor(x)) |
| #define | FABSF(x) ((GLfloat) fabs(x)) |
| #define | IROUND(f) ((int) (((f) >= 0.0F) ? ((f) + 0.5F) : ((f) - 0.5F))) |
| #define | IROUND_POS(f) (IROUND(f)) |
| #define | IFLOOR(x) ifloor(x) |
| #define | ICEIL(x) iceil(x) |
| #define | UNCLAMPED_FLOAT_TO_UBYTE(ub, f) ub = ((GLubyte) IROUND(CLAMP((f), 0.0F, 1.0F) * 255.0F)) |
| #define | CLAMPED_FLOAT_TO_UBYTE(ub, f) ub = ((GLubyte) IROUND((f) * 255.0F)) |
| #define | COPY_FLOAT(dst, src) (dst) = (src) |
| #define | START_FAST_MATH(x) x = 0 |
| #define | END_FAST_MATH(x) (void)(x) |
Functions |
| INLINE int | ifloor (float f) |
| INLINE int | iceil (float f) |
| void * | _mesa_malloc (size_t bytes) |
| | Wrapper around either malloc() or xf86malloc(). More...
|
| void * | _mesa_calloc (size_t bytes) |
| | Wrapper around either calloc() or xf86calloc(). More...
|
| void | _mesa_free (void *ptr) |
| | Wrapper around either free() or xf86free(). More...
|
| void * | _mesa_align_malloc (size_t bytes, unsigned long alignment) |
| | Allocate aligned memory. More...
|
| void * | _mesa_align_calloc (size_t bytes, unsigned long alignment) |
| | Same as _mesa_align_malloc(), but using _mesa_calloc() instead of _mesa_malloc(). More...
|
| void | _mesa_align_free (void *ptr) |
| | Free memory allocated with _mesa_align_malloc() or _mesa_align_calloc(). More...
|
| void * | _mesa_realloc (void *oldBuffer, size_t oldSize, size_t newSize) |
| | Wrapper around either memcpy() or xf86memcpy(). More...
|
| void * | _mesa_memcpy (void *dest, const void *src, size_t n) |
| void | _mesa_memset (void *dst, int val, size_t n) |
| | Wrapper around either memset() or xf86memset(). More...
|
| void | _mesa_memset16 (unsigned short *dst, unsigned short val, size_t n) |
| | Fill memory with a constant 16bit word. More...
|
| void | _mesa_bzero (void *dst, size_t n) |
| | Wrapper around either memcpy() or xf86memcpy() or bzero(). More...
|
| double | _mesa_sin (double a) |
| | Wrapper around either sin() or xf86sin(). More...
|
| double | _mesa_cos (double a) |
| | Wrapper around either cos() or xf86cos(). More...
|
| double | _mesa_sqrtd (double x) |
| | Wrapper around either sqrt() or xf86sqrt(). More...
|
| float | _mesa_sqrtf (float x) |
| | Single precision square root. More...
|
| float | _mesa_inv_sqrtf (float x) |
| | inv_sqrt - A single precision 1/sqrt routine for IEEE format floats. More...
|
| double | _mesa_pow (double x, double y) |
| | Wrapper around either pow() or xf86pow(). More...
|
| float | _mesa_log2 (float x) |
| unsigned int | _mesa_bitcount (unsigned int n) |
| | Return number of bits set in given GLuint. More...
|
| GLhalfARB | _mesa_float_to_half (float f) |
| | Convert a 4-byte float to a 2-byte half float. More...
|
| float | _mesa_half_to_float (GLhalfARB h) |
| | Convert a 2-byte half float to a 4-byte float. More...
|
| char * | _mesa_getenv (const char *var) |
| | Wrapper for getenv(). More...
|
| char * | _mesa_strstr (const char *haystack, const char *needle) |
| | Wrapper around either strstr() or xf86strstr(). More...
|
| char * | _mesa_strncat (char *dest, const char *src, size_t n) |
| | Wrapper around either strncat() or xf86strncat(). More...
|
| char * | _mesa_strcpy (char *dest, const char *src) |
| | Wrapper around either strcpy() or xf86strcpy(). More...
|
| char * | _mesa_strncpy (char *dest, const char *src, size_t n) |
| | Wrapper around either strncpy() or xf86strncpy(). More...
|
| size_t | _mesa_strlen (const char *s) |
| | Wrapper around either strlen() or xf86strlen(). More...
|
| int | _mesa_strcmp (const char *s1, const char *s2) |
| | Wrapper around either strcmp() or xf86strcmp(). More...
|
| int | _mesa_strncmp (const char *s1, const char *s2, size_t n) |
| | Wrapper around either strncmp() or xf86strncmp(). More...
|
| char * | _mesa_strdup (const char *s) |
| | Implemented using _mesa_malloc() and _mesa_strcpy. More...
|
| int | _mesa_atoi (const char *s) |
| | Wrapper around either atoi() or xf86atoi(). More...
|
| double | _mesa_strtod (const char *s, char **end) |
| | Wrapper around either strtod() or xf86strtod(). More...
|
| int | _mesa_sprintf (char *str, const char *fmt,...) |
| | Wrapper around either vsprintf() or xf86vsprintf(). More...
|
| void | _mesa_printf (const char *fmtString,...) |
| | Wrapper around either printf() or xf86printf(), using vsprintf() for the formatting. More...
|
| void | _mesa_warning (__GLcontext *gc, const char *fmtString,...) |
| void | _mesa_problem (const __GLcontext *ctx, const char *fmtString,...) |
| void | _mesa_error (__GLcontext *ctx, GLenum error, const char *fmtString,...) |
| void | _mesa_debug (const __GLcontext *ctx, const char *fmtString,...) |
| void | _mesa_init_default_imports (__GLimports *imports, void *driverCtx) |
| | Initialize a __GLimports object to point to the functions in this file. More...
|
This file provides wrappers for all the standard C library functions like malloc(), free(), printf(), getenv(), etc.