math.c File Reference
Converting mathematical structures from Allegro to OpenGL. More...
#include <math.h>
#include <allegro.h>
#include "alleggl.h"
#include "allglint.h"
Go to the source code of this file.
Defines
Functions
- void allegro_gl_MATRIX_to_GLfloat (MATRIX *m, GLfloat gl[16])
- Converts an Allegro fixed-point matrix to an array of floats suitable for OpenGL's matrix operations.
- void allegro_gl_MATRIX_to_GLdouble (MATRIX *m, GLdouble gl[16])
- Converts an Allegro fixed-point matrix to an array of doubles suitable for OpenGL's matrix operations.
- void allegro_gl_MATRIX_f_to_GLfloat (MATRIX_f *m, GLfloat gl[16])
- Converts an Allegro floating-point matrix to an array of floats suitable for OpenGL's matrix operations.
- void allegro_gl_MATRIX_f_to_GLdouble (MATRIX_f *m, GLdouble gl[16])
- Converts an Allegro floating-point matrix to an array of doubles suitable for OpenGL's matrix operations.
- void allegro_gl_GLfloat_to_MATRIX (GLfloat gl[16], MATRIX *m)
- Converts an OpenGL floating-point matrix issued from the matrix stack to an Allegro fixed-point matrix.
- void allegro_gl_GLdouble_to_MATRIX (GLdouble gl[16], MATRIX *m)
- Converts an OpenGL double precision floating-point matrix issued from the matrix stack to an Allegro fixed-point matrix.
- void allegro_gl_GLfloat_to_MATRIX_f (GLfloat gl[16], MATRIX_f *m)
- Converts an OpenGL floating-point matrix issued from the matrix stack to an Allegro floating-point matrix.
- void allegro_gl_GLdouble_to_MATRIX_f (GLdouble gl[16], MATRIX_f *m)
- Converts an OpenGL double precision floating-point matrix issued from the matrix stack to an Allegro single-precision floating-point matrix.
- void allegro_gl_apply_quat (QUAT *q)
- Multiplies the Quaternion to the current transformation matrix, by converting it to a call to glRotatef().
- void allegro_gl_quat_to_glrotatef (QUAT *q, float *angle, float *x, float *y, float *z)
- Converts a quaternion to a vector/angle, which can be used with glRotate*().
- void allegro_gl_quat_to_glrotated (QUAT *q, double *angle, double *x, double *y, double *z)
- Converts a quaternion to a vector/angle, which can be used with glRotate*().
Detailed Description
Converting mathematical structures from Allegro to OpenGL.
This file provides routines to make Allegro matrices from GL-style matrices, and vice versa. This also provides a QUAT to glRotate converter.
Note that Allegro matrices can only store affine transformations.
Definition in file math.c.
Define Documentation
#define TRANSLATE_AL_TO_GL |
( |
al_type, |
|
|
gl_type, |
|
|
convertor |
|
) |
|
Value:
void allegro_gl_##al_type##_to_##gl_type (al_type *m, gl_type gl[16]) \
{ \
int col, row; \
for (col = 0; col < 3; col++) \
for (row = 0; row < 3; row++) \
gl[col*4+row] = convertor (m->v[col][row]); \
for (row = 0; row < 3; row++) \
gl[12+row] = convertor (m->t[row]); \
for (col = 0; col < 3; col++) \
gl[4*col + 3] = 0; \
gl[15] = 1; \
}
Definition at line 28 of file math.c.
#define TRANSLATE_GL_TO_AL |
( |
gl_type, |
|
|
al_type, |
|
|
convertor |
|
) |
|
Value:
void allegro_gl_##gl_type##_to_##al_type (gl_type gl[16], al_type *m) \
{ \
int col, row; \
for (col = 0; col < 3; col++) \
for (row = 0; row < 3; row++) \
m->v[col][row] = convertor (gl[col*4+row]); \
for (row = 0; row < 3; row++) \
m->t[row] = convertor (gl[12+row]); \
}
Definition at line 118 of file math.c.
Generated on Sun Nov 11 15:52:55 2007 for AllegroGL by
1.5.2