No matching definitions.

opengl/textures

src/opengl/textures.tur
defn

make-texture

(make-texture :int)

generate a GL texture object.

Opaque :int texture handle.

(let [t (make-texture)] (bind-texture t) ...)

Since: v0.1.0

defn

bind-texture

(bind-texture [t :int] :void)

bind a 2D texture as the current GL_TEXTURE_2D target.

ttexture handle from make-texture, or 0 to unbind
(bind-texture t)

Since: v0.1.0

defn

upload-texture-rgba

(upload-texture-rgba [data :int w :int h :int] :void)

upload raw RGBA8 pixel data to the bound texture.

datapointer to RGBA pixel data (4 bytes per pixel, row-major)
wimage width in pixels
himage height in pixels
(upload-texture-rgba pixels 512 512)

Since: v0.1.0

defn

set-texture-wrap

(set-texture-wrap [s :cstr t :cstr] :void)

set the S and T wrap modes for the bound texture.

swrap mode for horizontal axis:
:repeat | :clamp-to-edge | :mirrored-repeat | :clamp-to-border
twrap mode for vertical axis (same keywords)
(set-texture-wrap ":repeat" ":repeat")

Since: v0.1.0

defn

set-texture-filter

(set-texture-filter [min-filter :cstr mag-filter :cstr] :void)

set the minification and magnification filter modes.

min-filterminification filter:
:nearest | :linear | :nearest-mipmap-nearest |
:linear-mipmap-nearest | :nearest-mipmap-linear |
:linear-mipmap-linear
mag-filtermagnification filter: :nearest | :linear
(set-texture-filter ":linear-mipmap-linear" ":linear")

Since: v0.1.0

defn

generate-mipmaps

(generate-mipmaps :void)

auto-generate mipmaps for the currently-bound texture.

(generate-mipmaps)

Since: v0.1.0

defn

active-texture

(active-texture [unit :int] :void)

select the active texture unit before binding.

unittexture unit index (0-based; most hardware supports 0-15)
(active-texture 0)
  (bind-texture diffuse-tex)
  (set-uniform-int prog "diffuse" 0)

Since: v0.1.0