本文整理汇总了C++中GstGLFuncs::ColorPointer方法的典型用法代码示例。如果您正苦于以下问题:C++ GstGLFuncs::ColorPointer方法的具体用法?C++ GstGLFuncs::ColorPointer怎么用?C++ GstGLFuncs::ColorPointer使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GstGLFuncs
的用法示例。
在下文中一共展示了GstGLFuncs::ColorPointer方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: sizeof
static void
gst_gl_filter_glass_draw_video_plane (GstGLFilter * filter,
gint width, gint height, guint texture,
gfloat center_x, gfloat center_y,
gfloat start_alpha, gfloat stop_alpha, gboolean reversed, gfloat rotation)
{
GstGLFilterGlass *glass_filter = GST_GL_FILTER_GLASS (filter);
GstGLFuncs *gl = GST_GL_BASE_FILTER (filter)->context->gl_vtable;
gfloat topy = reversed ? center_y - 1.0f : center_y + 1.0f;
gfloat bottomy = reversed ? center_y + 1.0f : center_y - 1.0f;
/* *INDENT-OFF* */
gfloat mesh[] = {
/*| Vertex |TexCoord0| Colour |*/
center_x-1.6, topy, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0, start_alpha,
center_x+1.6, topy, 0.0, 1.0, 1.0, 1.0, 1.0, 1.0, start_alpha,
center_x+1.6, bottomy, 0.0, 1.0, 0.0, 1.0, 1.0, 1.0, stop_alpha,
center_x-1.6, bottomy, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, stop_alpha,
};
/* *INDENT-ON* */
GLushort indices[] = {
0, 1, 2,
0, 2, 3
};
gl->ActiveTexture (GL_TEXTURE0);
gl->BindTexture (GL_TEXTURE_2D, texture);
gst_gl_shader_set_uniform_1i (glass_filter->shader, "tex", 0);
gst_gl_shader_set_uniform_1f (glass_filter->shader, "yrot", rotation);
gst_gl_shader_set_uniform_1f (glass_filter->shader, "aspect",
(gfloat) width / (gfloat) height);
gl->ClientActiveTexture (GL_TEXTURE0);
gl->EnableClientState (GL_TEXTURE_COORD_ARRAY);
gl->EnableClientState (GL_VERTEX_ARRAY);
gl->EnableClientState (GL_COLOR_ARRAY);
gl->VertexPointer (3, GL_FLOAT, 9 * sizeof (gfloat), mesh);
gl->TexCoordPointer (2, GL_FLOAT, 9 * sizeof (gfloat), &mesh[3]);
gl->ColorPointer (4, GL_FLOAT, 9 * sizeof (gfloat), &mesh[5]);
gl->DrawElements (GL_TRIANGLES, 6, GL_UNSIGNED_SHORT, indices);
gl->DisableClientState (GL_TEXTURE_COORD_ARRAY);
gl->DisableClientState (GL_VERTEX_ARRAY);
gl->DisableClientState (GL_COLOR_ARRAY);
}