pce_sdl_mesh_set(+Mesh,
+Vertices, +Indices)Replace the vertices and triangles of the sdl_mesh Mesh
in one call. This is much faster than using ‘sdl_mesh ->append’
and
‘sdl_mesh ->triangle’ and is intended for meshes that
change on every frame, e.g., particles. Vertices is a list of
terms
v(X,Y), v(X,Y,Colour), v(X,Y,U,V)
or
v(X,Y,U,V,Colour). X,Y is the position in the window and
U,V the position in the texture in its pixels, which is 0,0 if omitted.
Colour is either a term rgba(R,G,B,A), where the components
are integers 0..255, or an integer 0xRRGGBBAA. Note that
the integer includes the alpha channel: opaque red is
0xFF0000FF. The default colour is opaque white. Indices
is a list of indices in Vertices, counting from 0, three for
each triangle. If Indices is [],
each three consecutive vertices make a triangle. See the class
sdl_mesh for an
example.
- Introduced in 10.1.19 (👉b158034) class sdl_mesh: triangles with coloured corners that an sdl_layer draws, mapping its texture onto them