chickadee » hypergiant » rectangle-mesh

(rectangle-mesh WIDTH HEIGHT [centered?: CENTERED?] [texture-width: TEXTURE-WIDTH] [texture-height: TEXTURE-HEIGHT] [texture-offset: TEXTURE-OFFSET] [texture: TEXTURE] [color: COLOR] [winding: WINDING] [mode: MODE] [texture-type: TEXTURE-TYPE] [color-type: COLOR-TYPE] [index-type: INDEX-TYPE])procedure

Create a rectangular mesh of WIDTH and HEIGHT. If CENTERED? is not #f, the centre of the rectangle with be at the origin, otherwise the bottom left corner will be (default is #t). When both TEXTURE-WIDTH and TEXTURE-HEIGHT are specified, two element texture coordinates are added to the mesh, with TEXTURE-OFFSET representing the upper left corner, defaulting to (0 0). Alternately, TEXTURE may be supplied, which expects a function of one argument: the index of a vertex. This texture function should return a two element list of the texture coordinate at that index. The rectangle mesh vertices are ordered as follows: (upper-left upper-right lower-left lower-right). Likewise, COLOR expects a similar function that accepts one index as an argument, but should return a three element list of colour values. WINDING controls the direction of the vertex winding, either counter-clockwise (#:ccw, the default), or clockwise (#:cw). MODE should be a valid argument to mode->gl, defaulting to #:triangles. TEXTURE-TYPE, COLOUR-TYPE, and INDEX-TYPE control the in-memory type of the texture attribute, the color attribute, and the index, and should be a valid argument to type->gl. These all default to #:ushort.