All Lands programs start with a sole global object Lan
, we use this object to initialize the canvas and do animations.
We usually use Lan.canvas** to initialize the canvas before we start to render.
This method returns a Raw canvas object. You can then get a rendering context of the canvas as you wish.
This method returns a 2D canvas object.
This method returns a WebGL canvas object.
This method returns a Pixel Shader canvas object.
This method returns a Fragment Shader canvas object. You can then write GLSL shader programs to render.
This method returns a Compute Shader canvas object. It's based on WebGPU, and you just write Compute Shaders to render.
After the canvas is initialized, the returned canvas object has these possible properties:
This method is usually used for repeated jobs, such as animation. After the loop is ended, we call finish (if provided).
We can import third-party JS libraries to Lands. For example, Lan.import('three')
would import the three.js library.
We use this method to write runtime logs.