mirror of
https://github.com/mpv-player/mpv
synced 2024-12-23 23:32:26 +00:00
0164758aa8
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@13654 b3059339-0415-0410-9bf9-f77b7e298cf2
20 lines
447 B
C
20 lines
447 B
C
#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);
|
|
}
|
|
|