stratgame
annotate gfx/src/opengl.cc @ 3:8d95187cb3ee
foo
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Wed, 23 May 2012 17:10:46 +0300 |
parents | |
children |
rev | line source |
---|---|
nuclear@3 | 1 #include "opengl.h" |
nuclear@3 | 2 |
nuclear@3 | 3 void load_gl_matrix(const Matrix4x4 &mat) |
nuclear@3 | 4 { |
nuclear@3 | 5 #ifdef SINGLE_PRECISION_MATH |
nuclear@3 | 6 if(glLoadTransposeMatrixfARB) { |
nuclear@3 | 7 glLoadTransposeMatrixfARB((float*)&mat); |
nuclear@3 | 8 } else { |
nuclear@3 | 9 Matrix4x4 tmat = mat.transposed(); |
nuclear@3 | 10 glLoadMatrixf((float*)&tmat); |
nuclear@3 | 11 } |
nuclear@3 | 12 #else |
nuclear@3 | 13 if(glLoadTransposeMatrixdARB) { |
nuclear@3 | 14 glLoadTransposeMatrixdARB((double*)&mat); |
nuclear@3 | 15 } else { |
nuclear@3 | 16 Matrix4x4 tmat = mat.transposed(); |
nuclear@3 | 17 glLoadMatrixd((double*)&tmat); |
nuclear@3 | 18 } |
nuclear@3 | 19 #endif |
nuclear@3 | 20 } |
nuclear@3 | 21 |
nuclear@3 | 22 void mult_gl_matrix(const Matrix4x4 &mat) |
nuclear@3 | 23 { |
nuclear@3 | 24 #ifdef SINGLE_PRECISION_MATH |
nuclear@3 | 25 if(glMultTransposeMatrixfARB) { |
nuclear@3 | 26 glMultTransposeMatrixfARB((float*)&mat); |
nuclear@3 | 27 } else { |
nuclear@3 | 28 Matrix4x4 tmat = mat.transposed(); |
nuclear@3 | 29 glMultMatrixf((float*)&tmat); |
nuclear@3 | 30 } |
nuclear@3 | 31 #else |
nuclear@3 | 32 if(glMultTransposeMatrixdARB) { |
nuclear@3 | 33 glMultTransposeMatrixdARB((double*)&mat); |
nuclear@3 | 34 } else { |
nuclear@3 | 35 Matrix4x4 tmat = mat.transposed(); |
nuclear@3 | 36 glMultMatrixd((double*)&tmat); |
nuclear@3 | 37 } |
nuclear@3 | 38 #endif |
nuclear@3 | 39 } |