mojoshader.h
branchtrunk
changeset 94 57adfb4769a0
parent 92 bc1bb138e855
child 97 4a41e3d17297
--- a/mojoshader.h	Fri Apr 04 09:48:55 2008 -0400
+++ b/mojoshader.h	Fri Apr 04 11:27:09 2008 -0400
@@ -46,18 +46,28 @@
     MOJOSHADER_TYPE_ANY = 0xFFFFFFFF   /* used for bitmasks */
 } MOJOSHADER_shaderType;
 
+/*
+ * Data types for uniforms. See MOJOSHADER_uniform for more information.
+ */
 typedef enum
 {
     MOJOSHADER_UNIFORM_FLOAT,
     MOJOSHADER_UNIFORM_INT,
     MOJOSHADER_UNIFORM_BOOL
-} MOJOSHADER_uniform_type;
+} MOJOSHADER_uniformType;
 
+/*
+ * These are the uniforms to be set for a shader. "Uniforms" are what Direct3D
+ *  calls "Constants" ... IDirect3DDevice::SetVertexShaderConstantF() would
+ *  need this data, for example. These integers are register indexes. So if
+ *  index==6 and type==MOJOSHADER_UNIFORM_FLOAT, that means we'd expect a
+ *  4-float vector to be specified for what would be register "c6" in D3D
+ *  assembly language, before drawing with the shader.
+ */
 typedef struct
 {
     int index;
-    const char *name;
-    MOJOSHADER_uniform_type type;
+    MOJOSHADER_uniformType type;
 } MOJOSHADER_uniform;
 
 
@@ -118,9 +128,8 @@
     int uniform_count;
 
     /*
-     * (uniform_count) elements of data on how to access uniforms to be
-     *  set by this shader. "Uniforms" are what Direct3D calls "Constants" ...
-     *  IDirect3DDevice::SetVertexShaderConstantF() would need this data.
+     * (uniform_count) elements of data that specify Uniforms to be set for
+     *  this shader. See discussion on MOJOSHADER_uniform for details.
      */
     MOJOSHADER_uniform *uniforms;