opengl/types
src/opengl/types.tur
defn
draw-usage->gl
(draw-usage->gl [usage :cstr] :int)
map a draw-usage keyword to the GL enum integer.
Parameters
| usage | :static-draw | :dynamic-draw | :stream-draw |
Returns
The GL_* constant as :int.
Example
(draw-usage->gl ":static-draw") ; => GL_STATIC_DRAW (35044)
Since: v0.1.0
defn
shader-stage->gl
(shader-stage->gl [stage :cstr] :int)
map a shader-stage keyword to the GL enum integer.
Parameters
| stage | :vertex | :fragment | :geometry | :compute |
Returns
The GL_*_SHADER constant as :int.
Example
(shader-stage->gl ":vertex") ; => GL_VERTEX_SHADER (shader-stage->gl ":fragment") ; => GL_FRAGMENT_SHADER
Since: v0.1.0
defn
draw-mode->gl
(draw-mode->gl [mode :cstr] :int)
map a draw-mode keyword to the GL enum integer.
Parameters
| mode | :triangles | :lines | :points | :triangle-strip | | |
| :triangle-fan | :line-strip | :line-loop |
Returns
The GL_* draw mode constant.
Since: v0.1.0
defn
index-type->gl
(index-type->gl [idx-type :cstr] :int)
map an index-type keyword to the GL enum integer.
Parameters
| idx-type | :unsigned-int | :unsigned-short | :unsigned-byte |
Returns
The GL_UNSIGNED_* constant.
Since: v0.1.0
defn
wrap-mode->gl
(wrap-mode->gl [mode :cstr] :int)
map a texture wrap-mode keyword to the GL enum integer.
Parameters
| mode | :repeat | :clamp-to-edge | :mirrored-repeat | :clamp-to-border |
Since: v0.1.0
defn
filter-mode->gl
(filter-mode->gl [mode :cstr] :int)
map a texture filter-mode keyword to the GL enum integer.
Parameters
| mode | :nearest | :linear | :nearest-mipmap-nearest | | |
| :linear-mipmap-nearest | :nearest-mipmap-linear | | ||
| :linear-mipmap-linear |
Since: v0.1.0
defn
attrib-type->gl
(attrib-type->gl [type :cstr] :int)
map a vertex attribute type keyword to the GL enum integer.
Parameters
| type | :float | :int | :uint | :byte | :ubyte | :short | :ushort |
Since: v0.1.0
defn
gl-cap->gl
(gl-cap->gl [cap :cstr] :int)
map a GL capability keyword to the GL enum integer.
Parameters
| cap | :depth-test | :blend | :cull-face | :stencil-test | | |
| :scissor-test | :multisample | :line-smooth | :polygon-smooth |
Since: v0.1.0