mirror of
https://github.com/curioustorvald/tsvm.git
synced 2026-03-07 11:51:49 +09:00
the GL part of the doc
This commit is contained in:
@@ -105,15 +105,15 @@ Functions:
|
||||
\namespaceis{Gzip}{gzip}
|
||||
|
||||
\begin{outline}
|
||||
\1\formalsynopsis{comp}{String}[UintArray]{Compresses the given string.}
|
||||
\1\formalsynopsis{comp}{UintArray}[UintArray]{Compresses the given bytes.}
|
||||
\1\formalsynopsis{comp}{String}[Uint8Array]{Compresses the given string.}
|
||||
\1\formalsynopsis{comp}{Uint8Array}[Uint8Array]{Compresses the given bytes.}
|
||||
\1\formalsynopsis{compTo}{str: String, outputptr: Int}[Int]{Compresses the given string onto the memory, then returns the size of the compressed bytes.}
|
||||
\1\formalsynopsis{compTo}{bytes: UintArray, outputptr: Int}[Int]{Compresses the given bytes onto the memory, then returns the size of the compressed bytes.}
|
||||
\1\formalsynopsis{compTo}{bytes: Uint8Array, outputptr: Int}[Int]{Compresses the given bytes onto the memory, then returns the size of the compressed bytes.}
|
||||
\1\formalsynopsis{compFromTo}{inputptr: Int, length: Int, outputptr: Int}[Int]{Compresses the bytes onto the memory, then returns the size of the compressed bytes.}
|
||||
\1\formalsynopsis{decomp}{String}[UintArray]{Decompresses the given string (compressed bytes represented as series of characters)}
|
||||
\1\formalsynopsis{decomp}{UintArray}[UintArray]{Decompresses the given bytes.}
|
||||
\1\formalsynopsis{decomp}{String}[Uint8Array]{Decompresses the given string (compressed bytes represented as series of characters)}
|
||||
\1\formalsynopsis{decomp}{Uint8Array}[Uint8Array]{Decompresses the given bytes.}
|
||||
\1\formalsynopsis{decompTo}{str: String, outputptr: Int}[Int]{Decompresses the given string onto the memory, then returns the size of the decompressed bytes.}
|
||||
\1\formalsynopsis{decompTo}{bytes: UintArray, outputptr: Int}[Int]{Decompresses the given bytes onto the memory, then returns the size of the decompressed bytes.}
|
||||
\1\formalsynopsis{decompTo}{bytes: Uint8Array, outputptr: Int}[Int]{Decompresses the given bytes onto the memory, then returns the size of the decompressed bytes.}
|
||||
\1\formalsynopsis{decompFromTo}{inputptr: Int, length: Int, outputptr: Int}[Int]{Decompresses the bytes onto the memory, then returns the size of the decompressed bytes.}
|
||||
\end{outline}
|
||||
|
||||
@@ -126,9 +126,9 @@ Functions:
|
||||
\namespaceis{Base64}{base64}
|
||||
|
||||
\begin{outline}
|
||||
\1\formalsynopsis{atob}{String}[UintArray]{Decodes the Base64 string to bytes.}
|
||||
\1\formalsynopsis{atob}{String}[Uint8Array]{Decodes the Base64 string to bytes.}
|
||||
\1\formalsynopsis{atostr}{String}[String]{Decodes the Base64 string to string.}
|
||||
\1\formalsynopsis{btoa}{UintArray}[String]{Encodes bytes to Base64 string.}
|
||||
\1\formalsynopsis{btoa}{Uint8Array}[String]{Encodes bytes to Base64 string.}
|
||||
\end{outline}
|
||||
|
||||
|
||||
|
||||
@@ -154,7 +154,7 @@ Functions:
|
||||
{Writes the bytes stored in the memory starting from the pointer to file.}
|
||||
\2\argsynopsis{count}{how many bytes to write}
|
||||
\2\argsynopsis{offset}{when writing to the file, how many bytes on the file to skip before writing a first byte.}
|
||||
\1\formalsynopsis{bwrite}{bytes: UintArray}{Writes the bytes to the file.}
|
||||
\1\formalsynopsis{bwrite}{bytes: Uint8Array}{Writes the bytes to the file.}
|
||||
\1\formalsynopsis{swrite}{string: String}{Writes the string to the file.}
|
||||
\1\formalsynopsis{flush}{}{Flush the contents on the write buffer to the file immediately. Will do nothing if there is no write buffer implemented --- a write operation will always be performed imemdiately in such cases.}
|
||||
\1\formalsynopsis{close}{}{Tells the underlying device (usually a disk drive) to close a file. When dealing with multiple files on a single disk drive (of which can only have a single active---or opened---file), the underlying filesystem driver will automatically swap the files around, so this function is normally unused.}
|
||||
@@ -229,5 +229,34 @@ Input events are Javascript array of: $$ [\mathrm{event\ name,\ arg_1,\ arg_2 \c
|
||||
|
||||
\dosnamespaceis{Graphics}{gl}
|
||||
|
||||
Classes:
|
||||
|
||||
\begin{outline}
|
||||
\1\inlinesynopsis[new GL]{Texture}{width: Int, height: Int, bytes: Uint8Array}{Creates an GL Texture.}
|
||||
\1\inlinesynopsis[new GL]{MonoTex}{width: Int, height: Int, bytes: Uint8Array}{Creates an 1bpp Texture.}
|
||||
\1\inlinesynopsis[new GL]{SpriteSheet}{tileWidth: Int, tileHeight: Int, texture: Texture or MonoTex}{Creates an Spritesheet backed by the given texture.}
|
||||
\end{outline}
|
||||
|
||||
Functions:
|
||||
|
||||
\begin{outline}
|
||||
\1\formalsynopsis{drawTexImage}{texture, x, y, framebuffer, fgcol, bgcol}{Draws the texture to the framebuffer. Transparency will be ignored.}
|
||||
\2\argsynopsis{texture}{A pattern to draw. Must be an instance of the GL.Texture or GL.MonoTex.}
|
||||
\2\argsynopsis{x, y}{Top-left position of the painting area}
|
||||
\2\argsynopsis{framebuffer}{The target framebuffer on which the patterns are to be painted}
|
||||
\2\argsynopsis{fgcol, bgcol}{Fore- and background colour for the GL.MonoTex.}
|
||||
\1\formalsynopsis{drawTexImageOver}{texture, x, y, framebuffer, fgcol}{Same as the \code{drawTexImage} except the transparency will be taken into account.}
|
||||
\1\formalsynopsis{drawTexPattern}{texture, x, y, width, height, framebuffer, fgcol, bgcol}{Fills the given area with the texture by tiling it. Transparency will be ignored.}
|
||||
\2\argsynopsis{texture}{A pattern to draw. Must be an instance of the GL.Texture or GL.MonoTex.}
|
||||
\2\argsynopsis{x, y}{Top-left position of the painting area}
|
||||
\2\argsynopsis{width, height}{Width and the height of the painting area}
|
||||
\2\argsynopsis{framebuffer}{The target framebuffer on which the patterns are to be painted}
|
||||
\2\argsynopsis{fgcol, bgcol}{Fore- and background colour for the GL.MonoTex.}
|
||||
\1\formalsynopsis{drawTexPatternOver}{texture, x, y, width, height, framebuffer, fgcol}{Same as the \code{drawTexPattern} except the transparency will be taken into account.}
|
||||
\1\formalsynopsis{drawSprite}{sheet, xi, yi, x, y, framebuffer, overrideFG, overrideBG}{Paints the sprite to the framebuffer. Transparency will be ignored.}
|
||||
\2\argsynopsis{xi, yi}{XY-index in the Spritesheet, zero-based.}
|
||||
\2\argsynopsis{x, y}{Top-left position on the framebuffer where the sprite will be drawn into.}
|
||||
\2\argsynopsis{overrideFG, overrideBG}{Optional; if specified, non-transparent pixel in the sprite will take the foreground, and the transparent ones will take the background colour instead of their original colours.}
|
||||
\1\formalsynopsis{drawSpriteOver}{sheet, xi, yi, x, y, framebuffer, overrideFG}{Same as the \code{drawSprite} except the transparency will be taken into account.}
|
||||
|
||||
\end{outline}
|
||||
|
||||
Reference in New Issue
Block a user