annotate libvo/gl_common.c @ 13764:808dd35b6cc6

further translation by Carl Furstenberg <azatoth at gmail dot com>
author diego
date Mon, 25 Oct 2004 23:23:00 +0000
parents 799f81d3cb19
children 3f28d2a56758
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
13653
799f81d3cb19 added gl_common for code used by both vo_gl.c and vo_gl2.c.
reimar
parents:
diff changeset
1 #include "gl_common.h"
799f81d3cb19 added gl_common for code used by both vo_gl.c and vo_gl2.c.
reimar
parents:
diff changeset
2
799f81d3cb19 added gl_common for code used by both vo_gl.c and vo_gl2.c.
reimar
parents:
diff changeset
3 /**
799f81d3cb19 added gl_common for code used by both vo_gl.c and vo_gl2.c.
reimar
parents:
diff changeset
4 * \brief adjusts the GL_UNPACK_ALGNMENT to fit the stride.
799f81d3cb19 added gl_common for code used by both vo_gl.c and vo_gl2.c.
reimar
parents:
diff changeset
5 * \param stride number of bytes per line for which alignment should fit.
799f81d3cb19 added gl_common for code used by both vo_gl.c and vo_gl2.c.
reimar
parents:
diff changeset
6 */
799f81d3cb19 added gl_common for code used by both vo_gl.c and vo_gl2.c.
reimar
parents:
diff changeset
7 void glAdjustAlignment(int stride) {
799f81d3cb19 added gl_common for code used by both vo_gl.c and vo_gl2.c.
reimar
parents:
diff changeset
8 GLint gl_alignment;
799f81d3cb19 added gl_common for code used by both vo_gl.c and vo_gl2.c.
reimar
parents:
diff changeset
9 if (stride % 8 == 0)
799f81d3cb19 added gl_common for code used by both vo_gl.c and vo_gl2.c.
reimar
parents:
diff changeset
10 gl_alignment=8;
799f81d3cb19 added gl_common for code used by both vo_gl.c and vo_gl2.c.
reimar
parents:
diff changeset
11 else if (stride % 4 == 0)
799f81d3cb19 added gl_common for code used by both vo_gl.c and vo_gl2.c.
reimar
parents:
diff changeset
12 gl_alignment=4;
799f81d3cb19 added gl_common for code used by both vo_gl.c and vo_gl2.c.
reimar
parents:
diff changeset
13 else if (stride % 2 == 0)
799f81d3cb19 added gl_common for code used by both vo_gl.c and vo_gl2.c.
reimar
parents:
diff changeset
14 gl_alignment=2;
799f81d3cb19 added gl_common for code used by both vo_gl.c and vo_gl2.c.
reimar
parents:
diff changeset
15 else
799f81d3cb19 added gl_common for code used by both vo_gl.c and vo_gl2.c.
reimar
parents:
diff changeset
16 gl_alignment=1;
799f81d3cb19 added gl_common for code used by both vo_gl.c and vo_gl2.c.
reimar
parents:
diff changeset
17 glPixelStorei (GL_UNPACK_ALIGNMENT, gl_alignment);
799f81d3cb19 added gl_common for code used by both vo_gl.c and vo_gl2.c.
reimar
parents:
diff changeset
18 }
799f81d3cb19 added gl_common for code used by both vo_gl.c and vo_gl2.c.
reimar
parents:
diff changeset
19