Skip to content

glCoreTexturePolygonDraw

Chris Petersen edited this page Oct 16, 2014 · 1 revision

glCoreTexturePolygonDraw draws a polygon shaped texture made up of triangles. All points are referenced relative to the polygon center (_cx,_cy).

Parameter Description
_cx x value of the polygon center point
_cy y value of the polygon center point
points List of lists, where each inner list has 4 floats: x, y, texture mapped x, texture mapped y
t Texture to be bound
_r Texture Rotation angle

Example

Example 1: From modules/ln_glgui/button-arrow.scm sending the for 5 points of arrow pointing left

(glCoreTexturePolygonDraw cx cy (list 
  (list (fl+ x 10.) y2 0. 1.)   ;; Top left
  (list x2 y2 1. 1.)            ;; Top right
  (list x cy 0. 0.5)            ;; Point on the left
  (list x2 y 1. 0.)             ;; Bottom right
  (list (fl+ x 10.) y 0. 0.))   ;; Bottom left
  (caddr glgui_button_arrow.img) 0.)
Clone this wiki locally