glCoreTextureDraw - part-cw/lambdanative GitHub Wiki
(glCoreTextureDraw x y w0 h0 t x1 y1 x2 y2 r . colors)
glCoreTextureDraw draws a rectangular texture with support for basic clipping. Current clipping limitations are rotation & color gradient interpolation, and that polygons are not clipped at all.
Parameter | Description |
---|---|
x | Lower left x-coordinate of texture |
y | Lower left y-coordinate of texture |
w0 | Width of texture drawn |
h0 | Height of texture drawn |
x1 | Relative starting x position within the texture map |
y1 | Relative starting y position within the texture map |
x2 | Relative ending x position within the texture map |
y2 | Relative ending y position within the texture map |
r | Texture rotation angle |
colors | Optional: List of 4 colors that are then applied to each corner of the texture. |
Example
Example 1: Draw a box, as specified in modules/ln_glgui/primitives.scm
(define glgui:box (glCoreTextureCreate 4 4 (make-u8vector 16 #xff)))
(define (glgui:draw-box x y w h c)
(if (list? c)
(glCoreTextureDraw x y w h glgui:box 0.1 0.1 .9 .9 0. c)
(begin
(glCoreColor c)
(glCoreTextureDraw x y w h glgui:box 0.1 0.1 .9 .9 0.)
))
)