Home My Page Projects Code Snippets Project Openings 3D graphics for Standard ML
Summary Activity SCM

SCM Repository

[sml3d] Diff of /trunk/sml3d/src/sml3d/gl3/vertex-sig.sml
ViewVC logotype

Diff of /trunk/sml3d/src/sml3d/gl3/vertex-sig.sml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1411, Mon Apr 14 14:40:18 2014 UTC revision 1412, Mon Apr 14 21:01:06 2014 UTC
# Line 1  Line 1 
1  (* vertex-sig.sml  (* vertex-sig.sml
2   *   *
3   * COPYRIGHT (c) 2011 The SML3d Project (http://sml3d.cs.uchicago.edu)   * COPYRIGHT (c) 2013 The SML3d Project (http://sml3d.cs.uchicago.edu)
4   * All rights reserved.   * All rights reserved.
5   *   *
6   * This interface covers the Vertex Specification and Vertes Array parts of the OpenGL 3.2   * This interface covers the Vertex Specification and Vertes Array parts of the OpenGL 3.2
# Line 11  Line 11 
11  signature GL_VERTEX =  signature GL_VERTEX =
12    sig    sig
13    
14      (* attribute locations *)
15      eqtype attrib      eqtype attrib
16    
17      (* attribute locations can be specified as numeric values (corresponding to "layout"
18       * location specifications in shader programs).  These functions convert between the
19       * abstract type and the concrete numeric representation.
20       *)
21        val fromWord : word -> attrib
22        val toWord : attrib -> word
23    
24      val maxVertexAttribs : unit -> int      val maxVertexAttribs : unit -> int
25    
26    (***** Vertex specification *****)    (***** Vertex specification *****)
# Line 55  Line 63 
63    
64      val enableArray : attrib * bool -> unit      val enableArray : attrib * bool -> unit
65    
66      (* attribute arity phantom types *)
67        type one
68        type two
69        type three
70        type four
71        type bgra
72    
73        type ('arity, 'ty) attrib_fmt       (* floating-point attributes *)
74        type ('arity, 'ty) int_attrib_fmt   (* integer attributes *)
75    
76      (* attribute array formats *)
77        val array1b  : (one, SML3dTypes.byte) int_attrib_fmt
78        val array1ub : (one, SML3dTypes.ubyte) int_attrib_fmt
79        val array1s  : (one, SML3dTypes.short) int_attrib_fmt
80        val array1us : (one, SML3dTypes.ushort) int_attrib_fmt
81        val array1i  : (one, SML3dTypes.int) int_attrib_fmt
82        val array1ui : (one, SML3dTypes.uint) int_attrib_fmt
83        val array1h  : (one, SML3dTypes.half) attrib_fmt
84        val array1f  : (one, SML3dTypes.float) attrib_fmt
85        val array1d  : (one, SML3dTypes.double) attrib_fmt
86    
87        val array2b  : (two, SML3dTypes.byte) int_attrib_fmt
88        val array2ub : (two, SML3dTypes.ubyte) int_attrib_fmt
89        val array2s  : (two, SML3dTypes.short) int_attrib_fmt
90        val array2us : (two, SML3dTypes.ushort) int_attrib_fmt
91        val array2i  : (two, SML3dTypes.int) int_attrib_fmt
92        val array2ui : (two, SML3dTypes.uint) int_attrib_fmt
93        val array2h  : (two, SML3dTypes.half) attrib_fmt
94        val array2f  : (two, SML3dTypes.float) attrib_fmt
95        val array2d  : (two, SML3dTypes.double) attrib_fmt
96    
97        val array3b  : (three, SML3dTypes.byte) int_attrib_fmt
98        val array3ub : (three, SML3dTypes.ubyte) int_attrib_fmt
99        val array3s  : (three, SML3dTypes.short) int_attrib_fmt
100        val array3us : (three, SML3dTypes.ushort) int_attrib_fmt
101        val array3i  : (three, SML3dTypes.int) int_attrib_fmt
102        val array3ui : (three, SML3dTypes.uint) int_attrib_fmt
103        val array3h  : (three, SML3dTypes.half) attrib_fmt
104        val array3f  : (three, SML3dTypes.float) attrib_fmt
105        val array3d  : (three, SML3dTypes.double) attrib_fmt
106    
107        val array4b  : (four, SML3dTypes.byte) int_attrib_fmt
108        val array4ub : (four, SML3dTypes.ubyte) int_attrib_fmt
109        val array4s  : (four, SML3dTypes.short) int_attrib_fmt
110        val array4us : (four, SML3dTypes.ushort) int_attrib_fmt
111        val array4i  : (four, SML3dTypes.int) int_attrib_fmt
112        val array4ui : (four, SML3dTypes.uint) int_attrib_fmt
113        val array4h  : (four, SML3dTypes.half) attrib_fmt
114        val array4f  : (four, SML3dTypes.float) attrib_fmt
115        val array4d  : (four, SML3dTypes.double) attrib_fmt
116    
117      (* arrays with reverse-order components *)
118        val arrayBGRAb  : (bgra, SML3dTypes.byte) int_attrib_fmt
119        val arrayBGRAub : (bgra, SML3dTypes.ubyte) int_attrib_fmt
120        val arrayBGRAs  : (bgra, SML3dTypes.short) int_attrib_fmt
121        val arrayBGRAus : (bgra, SML3dTypes.ushort) int_attrib_fmt
122        val arrayBGRAi  : (bgra, SML3dTypes.int) int_attrib_fmt
123        val arrayBGRAui : (bgra, SML3dTypes.uint) int_attrib_fmt
124        val arrayBGRAh  : (bgra, SML3dTypes.half) attrib_fmt
125        val arrayBGRAf  : (bgra, SML3dTypes.float) attrib_fmt
126        val arrayBGRAd  : (bgra, SML3dTypes.double) attrib_fmt
127    
128    (* specifying floating-point attributes.  The bool argument specifies whether integer arguments    (* specifying floating-point attributes.  The bool argument specifies whether integer arguments
129     * should be mapped to a normalized range ([-1..1] for signed values and [0..1] for unsigned).     * should be mapped to a normalized range ([-1..1] for signed values and [0..1] for unsigned).
130     *)     *)
131      val attribArray1b  : attrib * bool * SML3dTypes.byte DataBuffer.buffer -> unit      val attribFltArray : attrib * ('arity, 'ty) attrib_fmt -> unit
132      val attribArray1ub : attrib * bool * SML3dTypes.ubyte DataBuffer.buffer -> unit      val attribArray : attrib * bool * ('arity, 'ty) int_attrib_fmt -> unit
133      val attribArray1s  : attrib * bool * SML3dTypes.short DataBuffer.buffer -> unit      val attribIntArray : attrib * ('arity, 'ty) int_attrib_fmt -> unit
134      val attribArray1us : attrib * bool * SML3dTypes.ushort DataBuffer.buffer -> unit  
135      val attribArray1i  : attrib * bool * SML3dTypes.int DataBuffer.buffer -> unit    (* like the previous three functions, but with stride and offset info too *)
136      val attribArray1ui : attrib * bool * SML3dTypes.uint DataBuffer.buffer -> unit      val attribFltArray' : attrib * ('arity, 'ty) attrib_fmt * GLsizei.int * C_Ptrdiff.t -> unit
137      val attribArray1h  : attrib * SML3dTypes.half DataBuffer.buffer -> unit      val attribArray' : attrib * bool * ('arity, 'ty) int_attrib_fmt * GLsizei.int * C_Ptrdiff.t -> unit
138      val attribArray1f  : attrib * SML3dTypes.float DataBuffer.buffer -> unit      val attribIntArray' : attrib * ('arity, 'ty) int_attrib_fmt * GLsizei.int * C_Ptrdiff.t -> unit
     val attribArray1d  : attrib * SML3dTypes.double DataBuffer.buffer -> unit  
     val attribArray2b  : attrib * bool * SML3dTypes.byte DataBuffer.buffer2 -> unit  
     val attribArray2ub : attrib * bool * SML3dTypes.ubyte DataBuffer.buffer2 -> unit  
     val attribArray2s  : attrib * bool * SML3dTypes.short DataBuffer.buffer2 -> unit  
     val attribArray2us : attrib * bool * SML3dTypes.ushort DataBuffer.buffer2 -> unit  
     val attribArray2i  : attrib * bool * SML3dTypes.int DataBuffer.buffer2 -> unit  
     val attribArray2ui : attrib * bool * SML3dTypes.uint DataBuffer.buffer2 -> unit  
     val attribArray2h  : attrib * SML3dTypes.half DataBuffer.buffer2 -> unit  
     val attribArray2f  : attrib * SML3dTypes.float DataBuffer.buffer2 -> unit  
     val attribArray2d  : attrib * SML3dTypes.double DataBuffer.buffer2 -> unit  
     val attribArray3b  : attrib * bool * SML3dTypes.byte DataBuffer.buffer3 -> unit  
     val attribArray3ub : attrib * bool * SML3dTypes.ubyte DataBuffer.buffer3 -> unit  
     val attribArray3s  : attrib * bool * SML3dTypes.short DataBuffer.buffer3 -> unit  
     val attribArray3us : attrib * bool * SML3dTypes.ushort DataBuffer.buffer3 -> unit  
     val attribArray3i  : attrib * bool * SML3dTypes.int DataBuffer.buffer3 -> unit  
     val attribArray3ui : attrib * bool * SML3dTypes.uint DataBuffer.buffer3 -> unit  
     val attribArray3h  : attrib * SML3dTypes.half DataBuffer.buffer3 -> unit  
     val attribArray3f  : attrib * SML3dTypes.float DataBuffer.buffer3 -> unit  
     val attribArray3d  : attrib * SML3dTypes.double DataBuffer.buffer3 -> unit  
     val attribArray4b  : attrib * bool * SML3dTypes.byte DataBuffer.buffer4 -> unit  
     val attribArray4ub : attrib * bool * SML3dTypes.ubyte DataBuffer.buffer4 -> unit  
     val attribArray4s  : attrib * bool * SML3dTypes.short DataBuffer.buffer4 -> unit  
     val attribArray4us : attrib * bool * SML3dTypes.ushort DataBuffer.buffer4 -> unit  
     val attribArray4i  : attrib * bool * SML3dTypes.int DataBuffer.buffer4 -> unit  
     val attribArray4ui : attrib * bool * SML3dTypes.uint DataBuffer.buffer4 -> unit  
     val attribArray4h  : attrib * SML3dTypes.half DataBuffer.buffer4 -> unit  
     val attribArray4f  : attrib * SML3dTypes.float DataBuffer.buffer4 -> unit  
     val attribArray4d  : attrib * SML3dTypes.double DataBuffer.buffer4 -> unit  
   
   (* arrays with reverse-order components *)  
     val attribArrayBGRAb  : attrib * bool * SML3dTypes.byte DataBuffer.buffer4 -> unit  
     val attribArrayBGRAub : attrib * bool * SML3dTypes.ubyte DataBuffer.buffer4 -> unit  
     val attribArrayBGRAs  : attrib * bool * SML3dTypes.short DataBuffer.buffer4 -> unit  
     val attribArrayBGRAus : attrib * bool * SML3dTypes.ushort DataBuffer.buffer4 -> unit  
     val attribArrayBGRAi  : attrib * bool * SML3dTypes.int DataBuffer.buffer4 -> unit  
     val attribArrayBGRAui : attrib * bool * SML3dTypes.uint DataBuffer.buffer4 -> unit  
     val attribArrayBGRAh  : attrib * SML3dTypes.half DataBuffer.buffer4 -> unit  
     val attribArrayBGRAf  : attrib * SML3dTypes.float DataBuffer.buffer4 -> unit  
     val attribArrayBGRAd  : attrib * SML3dTypes.double DataBuffer.buffer4 -> unit  
   
   (* pure integer arrays *)  
     val attribIArray1b  : attrib * SML3dTypes.byte DataBuffer.buffer -> unit  
     val attribIArray1ub : attrib * SML3dTypes.ubyte DataBuffer.buffer -> unit  
     val attribIArray1s  : attrib * SML3dTypes.short DataBuffer.buffer -> unit  
     val attribIArray1us : attrib * SML3dTypes.ushort DataBuffer.buffer -> unit  
     val attribIArray1i  : attrib * SML3dTypes.int DataBuffer.buffer -> unit  
     val attribIArray1ui : attrib * SML3dTypes.uint DataBuffer.buffer -> unit  
     val attribIArray2b  : attrib * SML3dTypes.byte DataBuffer.buffer2 -> unit  
     val attribIArray2ub : attrib * SML3dTypes.ubyte DataBuffer.buffer2 -> unit  
     val attribIArray2s  : attrib * SML3dTypes.short DataBuffer.buffer2 -> unit  
     val attribIArray2us : attrib * SML3dTypes.ushort DataBuffer.buffer2 -> unit  
     val attribIArray2i  : attrib * SML3dTypes.int DataBuffer.buffer2 -> unit  
     val attribIArray2ui : attrib * SML3dTypes.uint DataBuffer.buffer2 -> unit  
     val attribIArray3b  : attrib * SML3dTypes.byte DataBuffer.buffer3 -> unit  
     val attribIArray3ub : attrib * SML3dTypes.ubyte DataBuffer.buffer3 -> unit  
     val attribIArray3s  : attrib * SML3dTypes.short DataBuffer.buffer3 -> unit  
     val attribIArray3us : attrib * SML3dTypes.ushort DataBuffer.buffer3 -> unit  
     val attribIArray3i  : attrib * SML3dTypes.int DataBuffer.buffer3 -> unit  
     val attribIArray3ui : attrib * SML3dTypes.uint DataBuffer.buffer3 -> unit  
     val attribIArray4b  : attrib * SML3dTypes.byte DataBuffer.buffer4 -> unit  
     val attribIArray4ub : attrib * SML3dTypes.ubyte DataBuffer.buffer4 -> unit  
     val attribIArray4s  : attrib * SML3dTypes.short DataBuffer.buffer4 -> unit  
     val attribIArray4us : attrib * SML3dTypes.ushort DataBuffer.buffer4 -> unit  
     val attribIArray4i  : attrib * SML3dTypes.int DataBuffer.buffer4 -> unit  
     val attribIArray4ui : attrib * SML3dTypes.uint DataBuffer.buffer4 -> unit  
139    
140    end    end

Legend:
Removed from v.1411  
changed lines
  Added in v.1412

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0