Beispiel #1
0
 public bool Equals(CgBool other)
 {
     return (Equals(this, other));
 }
Beispiel #2
0
        /// <summary>
        /// <para>cgGetBoolAnnotationValues allows the application to  retrieve the value(s) of a boolean typed annotation.</para>
        /// <para>ERROR: CG_INVALID_ANNOTATION_HANDLE_ERROR is generated if ann is not a valid annotation. CG_INVALID_PARAMETER_ERROR is generated if nvalues is NULL.</para>
        /// <para>VERSION: cgGetBoolAnnotationValues was introduced in Cg 1.5.</para>
        /// </summary>
        /// <param name="ann">The annotation.</param>
        /// <param name="nvalues">Pointer to integer where the number of returned values will be stored.</param>
        /// <returns>Returns a pointer to an array of CgBool values. The number of values in the array is returned via the nvalues param. Returns NULL if no values are available. nvalues will be 0.</returns>
        public static CgBool[] GetBoolAnnotationValues(CgAnnotation ann, out int nvalues)
        {
            var values = cgGetBoolAnnotationValues(ann, out nvalues);

            if (nvalues > 0)
            {
                var retValue = new CgBool[nvalues];
                unsafe
                {
                    var ii = (int*)values;
                    for (int i = 0; i < nvalues; i++)
                    {
                        retValue[i] = ii[i] == True;
                    }
                }
                return retValue;
            }
            return null;
        }
Beispiel #3
0
 /// <summary>
 /// <para>cgSetBoolStateAssignment sets the value of a state assignment of bool type.</para>
 /// <para>ERROR: CG_INVALID_STATE_ASSIGNMENT_HANDLE_ERROR is generated if sa is not a valid state assignment. CG_STATE_ASSIGNMENT_TYPE_MISMATCH_ERROR is generated if sa is not a state assignment of a bool type. CG_ARRAY_SIZE_MISMATCH_ERROR is generated if sa is an array and not a scalar.</para>
 /// <para>VERSION: cgSetBoolStateAssignment was introduced in Cg 1.5.</para>
 /// </summary>
 /// <param name="sa">A handle to a state assignment of type CG_BOOL.</param>
 /// <param name="value">The value to which sa will be set.</param>
 /// <returns>Returns CG_TRUE if it succeeds in setting the state assignment. Returns CG_FALSE otherwise.</returns>
 public static CgBool SetBoolStateAssignment(CgStateAssignment sa, CgBool value)
 {
     return cgSetBoolStateAssignment(sa, value);
 }
Beispiel #4
0
 /// <summary>
 /// <para>cgSetBoolAnnotation sets the value of an annotation of bool type.</para>
 /// <para>ERROR: CG_INVALID_ANNOTATION_HANDLE_ERROR is generated if ann is not a valid annotation. CG_INVALID_PARAMETER_TYPE_ERROR is generated if ann is not an annotation of bool type. CG_ARRAY_SIZE_MISMATCH_ERROR is generated if ann is not a scalar.</para>
 /// <para>VERSION: cgSetBoolAnnotation was introduced in Cg 1.5.</para>
 /// </summary>
 /// <param name="ann">The annotation that will be set.</param>
 /// <param name="value">The value to which ann will be set.</param>
 /// <returns>Returns CG_TRUE if it succeeds in setting the annotation. Returns CG_FALSE otherwise.</returns>
 public static CgBool SetBoolAnnotation(CgAnnotation ann, CgBool value)
 {
     return cgSetBoolAnnotation(ann, value);
 }
Beispiel #5
0
 private static extern CgBool cgSetBoolStateAssignment(CgStateAssignment stateassignment, CgBool value);
Beispiel #6
0
 private static extern CgBool cgSetBoolAnnotation(CgAnnotation annotation, CgBool value);