* decide which of the above two to use. For cogl_rectangle(), it
* will use repeat mode if any of the texture coordinates are
* outside the range 0→1, otherwise it will use clamp to edge. For
- * cogl_polygon() and cogl_vertex_buffer_draw() it will always use
- * repeat mode. This is the default value.
+ * cogl_polygon() it will always use repeat mode. For
+ * cogl_vertex_buffer_draw() it will use repeat mode except for
+ * layers that have point sprite coordinate generation enabled. This
+ * is the default value.
*
* The wrap mode specifies what happens when texture coordinates
* outside the range 0→1 are used. Note that if the filter mode is
if (tex_handle == COGL_INVALID_HANDLE)
continue;
+ if (!cogl_material_get_layer_point_sprite_coords_enabled (source, i))
+ {
+ /* By default COGL_MATERIAL_WRAP_MODE_AUTOMATIC becomes
+ GL_CLAMP_TO_EDGE but we want GL_REPEAT to maintain
+ compatibility with older versions of Cogl so we'll
+ override it. We don't want to do this for point sprites
+ because in that case the whole texture is drawn so you
+ would usually want clamp-to-edge. */
+ if (cogl_material_layer_get_wrap_mode_s (layer) ==
+ COGL_MATERIAL_WRAP_MODE_AUTOMATIC)
+ {
+ options.wrap_mode_overrides.values[i].s =
+ COGL_MATERIAL_WRAP_MODE_OVERRIDE_REPEAT;
+ options.flags |= COGL_MATERIAL_FLUSH_WRAP_MODE_OVERRIDES;
+ }
+ if (cogl_material_layer_get_wrap_mode_t (layer) ==
+ COGL_MATERIAL_WRAP_MODE_AUTOMATIC)
+ {
+ options.wrap_mode_overrides.values[i].t =
+ COGL_MATERIAL_WRAP_MODE_OVERRIDE_REPEAT;
+ options.flags |= COGL_MATERIAL_FLUSH_WRAP_MODE_OVERRIDES;
+ }
+ if (_cogl_material_layer_get_wrap_mode_r (layer) ==
+ COGL_MATERIAL_WRAP_MODE_AUTOMATIC)
+ {
+ options.wrap_mode_overrides.values[i].r =
+ COGL_MATERIAL_WRAP_MODE_OVERRIDE_REPEAT;
+ options.flags |= COGL_MATERIAL_FLUSH_WRAP_MODE_OVERRIDES;
+ }
+ }
+
/* Give the texture a chance to know that we're rendering
non-quad shaped primitives. If the texture is in an atlas it
will be migrated */
*/
fallback_layers |= (1 << i);
}
-
- /* By default COGL_MATERIAL_WRAP_MODE_AUTOMATIC becomes
- GL_CLAMP_TO_EDGE but we want GL_REPEAT to maintain
- compatibility with older versions of Cogl so we'll override
- it */
- if (cogl_material_layer_get_wrap_mode_s (layer) ==
- COGL_MATERIAL_WRAP_MODE_AUTOMATIC)
- {
- options.wrap_mode_overrides.values[i].s =
- COGL_MATERIAL_WRAP_MODE_OVERRIDE_REPEAT;
- options.flags |= COGL_MATERIAL_FLUSH_WRAP_MODE_OVERRIDES;
- }
- if (cogl_material_layer_get_wrap_mode_t (layer) ==
- COGL_MATERIAL_WRAP_MODE_AUTOMATIC)
- {
- options.wrap_mode_overrides.values[i].t =
- COGL_MATERIAL_WRAP_MODE_OVERRIDE_REPEAT;
- options.flags |= COGL_MATERIAL_FLUSH_WRAP_MODE_OVERRIDES;
- }
- if (_cogl_material_layer_get_wrap_mode_r (layer) ==
- COGL_MATERIAL_WRAP_MODE_AUTOMATIC)
- {
- options.wrap_mode_overrides.values[i].r =
- COGL_MATERIAL_WRAP_MODE_OVERRIDE_REPEAT;
- options.flags |= COGL_MATERIAL_FLUSH_WRAP_MODE_OVERRIDES;
- }
}
/* Disable any tex coord arrays that we didn't use */