本文整理汇总了C++中CL_GraphicContext::get_blend_mode方法的典型用法代码示例。如果您正苦于以下问题:C++ CL_GraphicContext::get_blend_mode方法的具体用法?C++ CL_GraphicContext::get_blend_mode怎么用?C++ CL_GraphicContext::get_blend_mode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CL_GraphicContext
的用法示例。
在下文中一共展示了CL_GraphicContext::get_blend_mode方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: prim_array
void CL_RenderBatch3D::flush(CL_GraphicContext &gc)
{
if (position > 0)
{
gc.set_modelview(CL_Mat4f::identity());
gc.set_program_object(cl_program_sprite);
if (use_glyph_program)
{
CL_BlendMode old_blend_mode = gc.get_blend_mode();
CL_BlendMode blend_mode;
blend_mode.set_blend_color(constant_color);
blend_mode.set_blend_function(cl_blend_constant_color, cl_blend_one_minus_src_color, cl_blend_zero, cl_blend_one);
gc.set_blend_mode(blend_mode);
for (int i = 0; i < num_current_textures; i++)
gc.set_texture(i, current_textures[i]);
CL_PrimitivesArray prim_array(gc);
prim_array.set_attributes(0, &vertices[0].position, sizeof(SpriteVertex));
prim_array.set_attributes(1, &vertices[0].color, sizeof(SpriteVertex));
prim_array.set_attributes(2, &vertices[0].texcoord, sizeof(SpriteVertex));
prim_array.set_attributes(3, &vertices[0].texindex, sizeof(SpriteVertex));
gc.draw_primitives(cl_triangles, position, prim_array);
for (int i = 0; i < num_current_textures; i++)
gc.reset_texture(i);
gc.set_blend_mode(old_blend_mode);
}
else
{
for (int i = 0; i < num_current_textures; i++)
gc.set_texture(i, current_textures[i]);
CL_PrimitivesArray prim_array(gc);
prim_array.set_attributes(0, &vertices[0].position, sizeof(SpriteVertex));
prim_array.set_attributes(1, &vertices[0].color, sizeof(SpriteVertex));
prim_array.set_attributes(2, &vertices[0].texcoord, sizeof(SpriteVertex));
prim_array.set_attributes(3, &vertices[0].texindex, sizeof(SpriteVertex));
gc.draw_primitives(cl_triangles, position, prim_array);
for (int i = 0; i < num_current_textures; i++)
gc.reset_texture(i);
}
gc.reset_program_object();
gc.set_modelview(modelview);
position = 0;
for (int i = 0; i < num_current_textures; i++)
current_textures[i] = CL_Texture();
num_current_textures = 0;
}
}