add guMatrix3x3 and guMatrix4x4To3x3()

This commit is contained in:
Josh Holtrop 2011-05-13 15:05:25 -04:00
parent 4758ebab87
commit 50789dee61
2 changed files with 12 additions and 0 deletions

View File

@ -190,6 +190,15 @@ void guMatrixOrtho(guMatrix4x4 *m,
guMatrixMult(m, m, &mult);
}
void guMatrix4x4To3x3(guMatrix3x3 *out, const guMatrix4x4 *in)
{
int i;
for (i = 0; i < 3; i++)
{
memcpy(&(*out)[i], &(*in)[i], sizeof((*out)[0][0] * 3));
}
}
char *guGetShaderLog(GLuint id)
{
GLint log_length;

View File

@ -8,6 +8,7 @@
#include <GL/gl.h>
#endif
typedef GLfloat guMatrix3x3[3][3];
typedef GLfloat guMatrix4x4[4][4];
typedef struct {
GLuint index;
@ -35,6 +36,8 @@ void guMatrixOrtho(guMatrix4x4 *m,
GLfloat bottom, GLfloat top,
GLfloat near, GLfloat far);
void guMatrix4x4To3x3(guMatrix3x3 *out, const guMatrix4x4 *in);
char *guGetShaderLog(GLuint id);
char *guGetProgramLog(GLuint id);
GLuint guMakeShaderFromFile(GLenum shaderType, const char *fname);