Make the material functions for setting the p wrap mode public
authorNeil Roberts <neil@linux.intel.com>
Fri, 2 Jul 2010 12:33:06 +0000 (13:33 +0100)
committerNeil Roberts <neil@linux.intel.com>
Tue, 13 Jul 2010 13:29:07 +0000 (14:29 +0100)
Now that we have 3D texture support it makes sense to expose the wrap
mode for the p coordinate.

clutter/cogl/cogl/cogl-material-private.h
clutter/cogl/cogl/cogl-material.c
clutter/cogl/cogl/cogl-material.h
clutter/cogl/cogl/cogl-vertex-buffer.c
doc/reference/cogl/cogl-sections.txt

index 9a52aaa..cb6b228 100644 (file)
@@ -814,16 +814,6 @@ _cogl_material_journal_ref (CoglMaterial *material);
 void
 _cogl_material_journal_unref (CoglMaterial *material);
 
-/* TODO: These should be made public once we add support for 3D
-   textures in Cogl */
-void
-_cogl_material_set_layer_wrap_mode_p (CoglMaterial *material,
-                                      int layer_index,
-                                      CoglMaterialWrapMode mode);
-
-CoglMaterialWrapMode
-_cogl_material_layer_get_wrap_mode_p (CoglMaterialLayer *layer);
-
 void
 _cogl_material_set_user_program (CoglMaterial *material,
                                  CoglHandle program);
index 82b50e3..6fc658c 100644 (file)
@@ -2356,8 +2356,6 @@ cogl_material_set_layer_wrap_mode_t (CoglMaterial        *material,
                                        authority->wrap_mode_p);
 }
 
-/* TODO: this should be made public once we add support for 3D
-   textures in Cogl */
 /* The rationale for naming the third texture coordinate 'p' instead
    of OpenGL's usual 'r' is that 'r' conflicts with the usual naming
    of the 'red' component when treating a vector as a color. Under
@@ -2371,9 +2369,9 @@ cogl_material_set_layer_wrap_mode_t (CoglMaterial        *material,
    the w component conflicts with the w component of a position
    vertex.  */
 void
-_cogl_material_set_layer_wrap_mode_p (CoglMaterial        *material,
-                                      int                  layer_index,
-                                      CoglMaterialWrapMode mode)
+cogl_material_set_layer_wrap_mode_p (CoglMaterial        *material,
+                                     int                  layer_index,
+                                     CoglMaterialWrapMode mode)
 {
   CoglMaterialLayerState       change = COGL_MATERIAL_LAYER_STATE_WRAP_MODES;
   CoglMaterialLayer           *layer;
@@ -2505,7 +2503,7 @@ cogl_material_get_layer_wrap_mode_t (CoglMaterial *material, int layer_index)
 }
 
 CoglMaterialWrapMode
-_cogl_material_layer_get_wrap_mode_p (CoglMaterialLayer *layer)
+cogl_material_layer_get_wrap_mode_p (CoglMaterialLayer *layer)
 {
   CoglMaterialLayerState change = COGL_MATERIAL_LAYER_STATE_WRAP_MODES;
   CoglMaterialLayer     *authority =
@@ -2514,9 +2512,8 @@ _cogl_material_layer_get_wrap_mode_p (CoglMaterialLayer *layer)
   return internal_to_public_wrap_mode (authority->wrap_mode_p);
 }
 
-/* TODO: make this public when we expose 3D textures. */
 CoglMaterialWrapMode
-_cogl_material_get_layer_wrap_mode_p (CoglMaterial *material, int layer_index)
+cogl_material_get_layer_wrap_mode_p (CoglMaterial *material, int layer_index)
 {
   CoglMaterialLayer *layer;
 
@@ -2530,7 +2527,7 @@ _cogl_material_get_layer_wrap_mode_p (CoglMaterial *material, int layer_index)
    * material. */
   layer = _cogl_material_get_layer (material, layer_index);
 
-  return _cogl_material_layer_get_wrap_mode_p (layer);
+  return cogl_material_layer_get_wrap_mode_p (layer);
 }
 
 static void
index f94eda6..b72ca32 100644 (file)
@@ -998,15 +998,32 @@ cogl_material_set_layer_wrap_mode_t (CoglMaterial        *material,
                                      CoglMaterialWrapMode mode);
 
 /**
+ * cogl_material_set_layer_wrap_mode_p:
+ * @material: A #CoglMaterial object
+ * @layer_index: the layer number to change.
+ * @mode: the new wrap mode
+ *
+ * Sets the wrap mode for the 'p' coordinate of texture lookups on
+ * this layer. 'p' is the third coordinate.
+ *
+ * Since: 1.4
+ */
+void
+cogl_material_set_layer_wrap_mode_p (CoglMaterial        *material,
+                                     int                  layer_index,
+                                     CoglMaterialWrapMode mode);
+
+/**
  * cogl_material_set_layer_wrap_mode:
  * @material: A #CoglMaterial object
  * @layer_index: the layer number to change.
  * @mode: the new wrap mode
  *
- * Sets the wrap mode for both coordinates of texture lookups on this
- * layer. This is equivalent to calling
- * cogl_material_set_layer_wrap_mode_s() and
- * cogl_material_set_layer_wrap_mode_t() separately.
+ * Sets the wrap mode for all three coordinates of texture lookups on
+ * this layer. This is equivalent to calling
+ * cogl_material_set_layer_wrap_mode_s(),
+ * cogl_material_set_layer_wrap_mode_t() and
+ * cogl_material_set_layer_wrap_mode_p() separately.
  *
  * Since: 1.4
  */
@@ -1041,6 +1058,19 @@ cogl_material_layer_get_wrap_mode_s (CoglMaterialLayer *layer);
 CoglMaterialWrapMode
 cogl_material_layer_get_wrap_mode_t (CoglMaterialLayer *layer);
 
+/**
+ * cogl_material_layer_get_wrap_mode_p:
+ * @layer: A #CoglMaterialLayer object
+ *
+ * Gets the wrap mode for the 'p' coordinate of texture lookups on
+ * this layer. 'p' is the third coordinate.
+ *
+ * Return value: the wrap mode value for the p coordinate.
+ *
+ * Since: 1.4
+ */
+CoglMaterialWrapMode
+cogl_material_layer_get_wrap_mode_p (CoglMaterialLayer *layer);
 
 /* XXX: should this be CoglMaterialDepthTestFunction?
  * It makes it very verbose but would be consistent with
index bea7288..54e4882 100644 (file)
@@ -1682,7 +1682,7 @@ enable_state_for_drawing_buffer (CoglVertexBuffer *buffer)
                 COGL_MATERIAL_WRAP_MODE_OVERRIDE_REPEAT;
               options.flags |= COGL_MATERIAL_FLUSH_WRAP_MODE_OVERRIDES;
             }
-          if (_cogl_material_layer_get_wrap_mode_p (layer) ==
+          if (cogl_material_layer_get_wrap_mode_p (layer) ==
               COGL_MATERIAL_WRAP_MODE_AUTOMATIC)
             {
               options.wrap_mode_overrides.values[i].p =
index e88d84d..fba207d 100644 (file)
@@ -517,8 +517,10 @@ CoglMaterialWrapMode
 cogl_material_set_layer_wrap_mode
 cogl_material_set_layer_wrap_mode_s
 cogl_material_set_layer_wrap_mode_t
+cogl_material_set_layer_wrap_mode_p
 cogl_material_layer_get_wrap_mode_s
 cogl_material_layer_get_wrap_mode_t
+cogl_material_layer_get_wrap_mode_p
 <SUBSECTION Private>
 cogl_blend_string_error_get_type
 cogl_blend_string_error_quark