#include <math.h>
#include <allegro.h>
#include "alleggl.h"
#include "allglint.h"
Go to the source code of this file.
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.
|
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; \ } |
|
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]); \ } |