Mercurial > mplayer.hg
diff libvo/gl_common.c @ 13653:799f81d3cb19
added gl_common for code used by both vo_gl.c and vo_gl2.c.
author | reimar |
---|---|
date | Sun, 17 Oct 2004 13:28:22 +0000 |
parents | |
children | 3f28d2a56758 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libvo/gl_common.c Sun Oct 17 13:28:22 2004 +0000 @@ -0,0 +1,19 @@ +#include "gl_common.h" + +/** + * \brief adjusts the GL_UNPACK_ALGNMENT to fit the stride. + * \param stride number of bytes per line for which alignment should fit. + */ +void glAdjustAlignment(int stride) { + GLint gl_alignment; + if (stride % 8 == 0) + gl_alignment=8; + else if (stride % 4 == 0) + gl_alignment=4; + else if (stride % 2 == 0) + gl_alignment=2; + else + gl_alignment=1; + glPixelStorei (GL_UNPACK_ALIGNMENT, gl_alignment); +} +