Mercurial > mplayer.hg
comparison 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 |
comparison
equal
deleted
inserted
replaced
13652:3427a9f4b6e3 | 13653:799f81d3cb19 |
---|---|
1 #include "gl_common.h" | |
2 | |
3 /** | |
4 * \brief adjusts the GL_UNPACK_ALGNMENT to fit the stride. | |
5 * \param stride number of bytes per line for which alignment should fit. | |
6 */ | |
7 void glAdjustAlignment(int stride) { | |
8 GLint gl_alignment; | |
9 if (stride % 8 == 0) | |
10 gl_alignment=8; | |
11 else if (stride % 4 == 0) | |
12 gl_alignment=4; | |
13 else if (stride % 2 == 0) | |
14 gl_alignment=2; | |
15 else | |
16 gl_alignment=1; | |
17 glPixelStorei (GL_UNPACK_ALIGNMENT, gl_alignment); | |
18 } | |
19 |