opengl/draw
src/opengl/draw.tur
defn
draw-arrays
(draw-arrays [mode :cstr first :int count :int] :void)
render primitives from currently-bound VAO vertex data.
Parameters
| mode | primitive type keyword: :triangles | :lines | :points | | |
| :triangle-strip | :triangle-fan | :line-strip | :line-loop | ||
| first | index of the first vertex to render | |
| count | number of vertices to render |
Example
(draw-arrays ":triangles" 0 3) ; render one triangle
Since: v0.1.0
defn
draw-elements
(draw-elements [mode :cstr count :int idx-type :cstr] :void)
render indexed primitives from the bound VAO and EBO.
Parameters
| mode | primitive type keyword (same as draw-arrays) | |
| count | number of indices to render | |
| idx-type | index element type keyword: | |
| :unsigned-int | :unsigned-short | :unsigned-byte |
Example
(draw-elements ":triangles" 36 ":unsigned-int") ; cube (12 tris)
Since: v0.1.0
defn
enable
(enable [cap :cstr] :void)
enable a GL server-side capability.
Parameters
| cap | capability keyword: | |
| :depth-test | :blend | :cull-face | :stencil-test | | ||
| :scissor-test | :multisample |
Example
(enable ":depth-test")
Since: v0.1.0
defn
disable
(disable [cap :cstr] :void)
disable a GL server-side capability.
Parameters
| cap | capability keyword (same as enable) |
Since: v0.1.0
defn
depth-test
(depth-test :void)
enable depth testing (GL_DEPTH_TEST with GL_LESS).
Example
(depth-test)
Since: v0.1.0
defn
blending
(blending :void)
enable standard alpha blending (src-alpha / one-minus-src-alpha).
Example
(blending)
Since: v0.1.0