-
Notifications
You must be signed in to change notification settings - Fork 0
Components
Note: When describing a CPUs specs, it should be done as nUPs-nt (where n is a number, UPs is updates per second, and t is threads). EX: 20UPs-1t, 60UPs-4t, 40UPs-2t, etc.
A CPUs speed is dependent on it's UPs (updates per second, spoken as the plural of the word "up") and the amount of threads it has. When upgrading a CPU, upgrading the UPs is what will have a direct improvement on the speed of the CPU. While in theory a 20UPs-2t CPU is the equivalent of a 40UPs-1t CPU, the speed gain will only be visible if one actually takes advantage of the second thread. Following this logic, a 60UPs-4t CPU can effectively be the same as a 240UPs-1t CPU, given one takes full advantage of all four threads.
It should be noted that all threads share the same memory, or _ENV.
20UPS -> 40UPs -> 60UPs
1t -> 2t -> 3t -> 4t
Once creating your GPU and popping it into your system, it will automatically be detected, and all functions will be put into a table called "gpu". By default, all GPUs will have the same functions as each other, with the only difference between them being the colors you have available.
In this mod, the color system is based on channels and the amount of bits given to them. For example, with 24bit color, the same thing your monitor is most likely using now, three channels, namely r, g, and b, each get 8bits, allowing for each rgb value to have a color between 0-255.
When there is a bit count that's not evenly dividable by three, then certain channels take priority over other ones. The g channel has the most priority, while the b channel has the least. This was chosen because of how our retinas work, as we have the highest sensitivity to green, and the lowest sensitivity to blue.
You'll never have to worry about the colors per channel unless you want to change it. Using the GPU, you can set the bits per channel. For example, if you have a 4 bit system, by default, the r and b channels will get 1 bit, while the g channel gets 2. Though this can be changed so that, for example, you can have all 4 bits in the r channel, leaving the g and b channels with none. This of course would make it so that there are 16 (2^4) colors, ranging from black to red, creating a sort of "colored" gray scale.
Note: Arrays refer to one-dimensional tables. Arguments enclosed in "<>" means they are optional.
Note: Functions which take an optional color value will not set the current color to the given one.
The GPU will attempt to bind to whatever peripheral the port given is connected to. In this case, only a monitor can really make use of a GPU, so the a port pointing to a monitor should be given.
Returns: number Width, number Height
Returns the resolution of the monitor the GPU is bound to.
Sets the current color to be used by the GPU. It's recommended to have the colors in hex format (0xRRGGBB) for increased readability.
Returns: number color
Returns the current color of the GPU. The color by default is 0x000000.
Clears the entire screen to the current color of the GPU, or to the color given.
Moves the entire contents of the screen horizontally, vertically, or both by the specified offset, with newly drawn parts of the screen being the current color or the specified color.
Note: offsetX and offsetY can only be positive numbers, meaning the screen can only be offset to the right or downwards.
Note: While offsetting the screen vertically will make pixels placed off screen disappear, offsetting horizontally will make the pixels wrap around the screen.
Draws a pixel at the given coordinates with the current color.
Draws a line from x1, y1 to x2, y2. The color of the line is the current color or the given color.
Draws a rectangle at the given coordinates of size width and height. The color of the rectangle is the current color or the given color.
Draws a texture at the given coordinates of size width and height. The texture must be a one-dimensional table with either number values or anything that does not evaluate to false. When placing any individual pixel, if the texture index of that pixel is a number, it will set the color of the pixel to that color. If it's a non-false value, it will use the current color instead.
Returns: number bits
Returns the number of bits the GPU has for color channel delegation.
Sets the amount of bits the channel channel has. The string channel can only be "r", "g", or "b".
Returns: number bits
Returns the amount of bits the channel channel has, where channel can only be "r", "g", or "b".