summaryrefslogtreecommitdiffstats
path: root/libvo/gl_common.c
diff options
context:
space:
mode:
authorreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2004-10-17 13:28:22 +0000
committerreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2004-10-17 13:28:22 +0000
commit0164758aa8879c8344d7191a9258f3aa32eb64d7 (patch)
treed8385a73af20cc68d9f5e8e3e4a3152f7bbb2f20 /libvo/gl_common.c
parent4a1200b8ea558aaafcd368b62b8b3f74c825d25c (diff)
downloadmpv-0164758aa8879c8344d7191a9258f3aa32eb64d7.tar.bz2
mpv-0164758aa8879c8344d7191a9258f3aa32eb64d7.tar.xz
added gl_common for code used by both vo_gl.c and vo_gl2.c.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@13654 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libvo/gl_common.c')
-rw-r--r--libvo/gl_common.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/libvo/gl_common.c b/libvo/gl_common.c
new file mode 100644
index 0000000000..900c8a3ec6
--- /dev/null
+++ b/libvo/gl_common.c
@@ -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);
+}
+