Difference between revisions of "CCLights2"
From ComputerCraft Wiki
(not gif, png!) |
(sort docs) |
||
Line 112: | Line 112: | ||
</tr> | </tr> | ||
− | |||
− | |||
− | |||
− | |||
− | |||
<tr style="background-color: #FFFFFF;"> | <tr style="background-color: #FFFFFF;"> | ||
<td style="border-top: solid #C9C9C9 1px; padding: .4em;">{{type|nil}}</td> | <td style="border-top: solid #C9C9C9 1px; padding: .4em;">{{type|nil}}</td> | ||
<td style="border-top: solid #C9C9C9 1px; padding: .4em;">gpu.fill()</td> | <td style="border-top: solid #C9C9C9 1px; padding: .4em;">gpu.fill()</td> | ||
− | <td style="border-top: solid #C9C9C9 1px; padding: .4em;">Fills the current binded texture with the GPU color. NOTE: This method will fully replace the contents of the texture.</td> | + | <td style="border-top: solid #C9C9C9 1px; padding: .4em;">Fills the current binded texture with the GPU color. NOTE: This method will fully replace the contents of the texture.</td></tr> |
− | + | ||
− | + | <tr style="background-color: #FFFFFF;"> | |
<td style="border-top: solid #C9C9C9 1px; padding: .4em;">{{type|number}} textureid</td> | <td style="border-top: solid #C9C9C9 1px; padding: .4em;">{{type|number}} textureid</td> | ||
<td style="border-top: solid #C9C9C9 1px; padding: .4em;">gpu.createTexture({{type|number}} width, {{type|number}} height)</td> | <td style="border-top: solid #C9C9C9 1px; padding: .4em;">gpu.createTexture({{type|number}} width, {{type|number}} height)</td> | ||
<td style="border-top: solid #C9C9C9 1px; padding: .4em;">Creates a texture and returns the texture id. This function will error if there is no more room for the texture.</td> | <td style="border-top: solid #C9C9C9 1px; padding: .4em;">Creates a texture and returns the texture id. This function will error if there is no more room for the texture.</td> | ||
</tr> | </tr> | ||
− | + | <tr style="background-color: #FFFFFF;"> | |
<td style="border-top: solid #C9C9C9 1px; padding: .4em;">{{type|number}} freememory</td> | <td style="border-top: solid #C9C9C9 1px; padding: .4em;">{{type|number}} freememory</td> | ||
<td style="border-top: solid #C9C9C9 1px; padding: .4em;">gpu.getFreeMemory()</td> | <td style="border-top: solid #C9C9C9 1px; padding: .4em;">gpu.getFreeMemory()</td> | ||
− | <td style="border-top: solid #C9C9C9 1px; padding: .4em;">Returns the amount of free memory that the GPU has to use. This can be expanded by right clicking the GPU with RAM.</td> | + | <td style="border-top: solid #C9C9C9 1px; padding: .4em;">Returns the amount of free memory that the GPU has to use. This can be expanded by right clicking the GPU with RAM. </td> |
</tr> | </tr> | ||
<tr style="background-color: #FFFFFF;"> | <tr style="background-color: #FFFFFF;"> | ||
Line 142: | Line 137: | ||
<td style="border-top: solid #C9C9C9 1px; padding: .4em;">Returns the amount of memory that the GPU is using. This value is changed by allocating textures with gpu.createTexture and freeing textures with gpu.freeTexture.</td> | <td style="border-top: solid #C9C9C9 1px; padding: .4em;">Returns the amount of memory that the GPU is using. This value is changed by allocating textures with gpu.createTexture and freeing textures with gpu.freeTexture.</td> | ||
</tr> | </tr> | ||
− | + | <tr style="background-color: #FFFFFF;"> | |
<td style="border-top: solid #C9C9C9 1px; padding: .4em;">{{type|nil}}</td> | <td style="border-top: solid #C9C9C9 1px; padding: .4em;">{{type|nil}}</td> | ||
<td style="border-top: solid #C9C9C9 1px; padding: .4em;">gpu.bindTexture({{type|number}} textureid)</td> | <td style="border-top: solid #C9C9C9 1px; padding: .4em;">gpu.bindTexture({{type|number}} textureid)</td> | ||
<td style="border-top: solid #C9C9C9 1px; padding: .4em;">Bind the texture at textureid, this method will error if invalid values are used. Texture 0 is the screen.</td> | <td style="border-top: solid #C9C9C9 1px; padding: .4em;">Bind the texture at textureid, this method will error if invalid values are used. Texture 0 is the screen.</td> | ||
</tr> | </tr> | ||
− | + | <tr style="background-color: #FFFFFF;"> | |
<td style="border-top: solid #C9C9C9 1px; padding: .4em;">{{type|nil}}</td> | <td style="border-top: solid #C9C9C9 1px; padding: .4em;">{{type|nil}}</td> | ||
<td style="border-top: solid #C9C9C9 1px; padding: .4em;">gpu.setColorRGB({{type|number}} x, {{type|number}} y) and gpu.plot({{type|number}} x, {{type|number}} y)</td> | <td style="border-top: solid #C9C9C9 1px; padding: .4em;">gpu.setColorRGB({{type|number}} x, {{type|number}} y) and gpu.plot({{type|number}} x, {{type|number}} y)</td> | ||
<td style="border-top: solid #C9C9C9 1px; padding: .4em;">Sets the pixel at x and y to the the GPU's current color. (Remember, all drawing command work on the current binded texture)</td> | <td style="border-top: solid #C9C9C9 1px; padding: .4em;">Sets the pixel at x and y to the the GPU's current color. (Remember, all drawing command work on the current binded texture)</td> | ||
+ | |||
+ | <tr style="background-color: #FFFFFF;"> | ||
+ | <td style="border-top: solid #C9C9C9 1px; padding: .4em;">{{type|nil}}</td> | ||
+ | <td style="border-top: solid #C9C9C9 1px; padding: .4em;">gpu.plot({{type|number}} x, {{type|number}} y)</td> | ||
+ | <td style="border-top: solid #C9C9C9 1px; padding: .4em;">plots a line from x axis to y axis</td> | ||
+ | </tr> | ||
</tr> | </tr> | ||
<tr style="background-color: #FFFFFF;"> | <tr style="background-color: #FFFFFF;"> | ||
Line 196: | Line 197: | ||
<td style="border-top: solid #C9C9C9 1px; padding: .4em;">gpu.filledRectangle({{type|number}} x, {{type|number}} y, {{type|number}} width, {{type|number}} height)</td> | <td style="border-top: solid #C9C9C9 1px; padding: .4em;">gpu.filledRectangle({{type|number}} x, {{type|number}} y, {{type|number}} width, {{type|number}} height)</td> | ||
<td style="border-top: solid #C9C9C9 1px; padding: .4em;">Draws a filled rectangle from x, y to x+width, y+height.</td> | <td style="border-top: solid #C9C9C9 1px; padding: .4em;">Draws a filled rectangle from x, y to x+width, y+height.</td> | ||
+ | </tr> | ||
+ | <tr style="background-color: #FFFFFF;"> | ||
+ | <td style="border-top: solid #C9C9C9 1px; padding: .4em;">{{type|nil}}</td> | ||
+ | <td style="border-top: solid #C9C9C9 1px; padding: .4em;">gpu.setColor({{type|number}} red, {{type|number}} green, {{type|number}} blue[, {{type|number}} alpha])</td> | ||
+ | <td style="border-top: solid #C9C9C9 1px; padding: .4em;">Sets the GPU's current drawing color</td> | ||
</tr> | </tr> | ||
</table> | </table> | ||
[[Category:User Created Peripherals]] | [[Category:User Created Peripherals]] |
Revision as of 13:26, 21 January 2014
CCLights2 is an Open Source Minecraft mod that adds a GPU peripheral, and monitors to suit your need. Unlike CCGPU, this mod does not use OpenGL, but it is Multiplayer Compatible.
GPU Methods | ||
Returns | Method Name | Description |
nil | gpu.fill() | Fills the current binded texture with the GPU color. NOTE: This method will fully replace the contents of the texture. |
number textureid | gpu.createTexture(number width, number height) | Creates a texture and returns the texture id. This function will error if there is no more room for the texture. |
number freememory | gpu.getFreeMemory() | Returns the amount of free memory that the GPU has to use. This can be expanded by right clicking the GPU with RAM. |
number totalmemory | gpu.getTotalMemory() | Returns the amount of memory that the GPU has. This can be expanded by right clicking the GPU with RAM. |
number usedmemory | gpu.getUsedMemory() | Returns the amount of memory that the GPU is using. This value is changed by allocating textures with gpu.createTexture and freeing textures with gpu.freeTexture. |
nil | gpu.bindTexture(number textureid) | Bind the texture at textureid, this method will error if invalid values are used. Texture 0 is the screen. |
nil | gpu.setColorRGB(number x, number y) and gpu.plot(number x, number y) | Sets the pixel at x and y to the the GPU's current color. (Remember, all drawing command work on the current binded texture) |
nil | gpu.plot(number x, number y) | plots a line from x axis to y axis |
nil | gpu.drawTexture(number textureid, number x, number y[, number startX, number startY, number width, number height]) | Draws the texture textureid to x and y, and if startX, startY, width, and height is defined, it will render only that area of the texture. (Remember: You can render the texture to itself) |
nil | gpu.freeTexture(number textureid) | Frees the texture defined by textureid |
nil | gpu.line(number x0, number y0, number x1, number y1) | Draws a line from x0 and y0 to x1 and y1. |
number width, number height | (gpu.getSize and gpu.getTextureSize)([ number textureid]) | Returns the texture size of textureid or the current binded texture. Using texture 0 will give you the screen size. |
nil | gpu.setTransparent() | This method is depreciated. Any attempt to use it will result in an error. |
nil | gpu.setTransparencyColor() | This method is depreciated. Any attempt to use it will result in an error. |
number red, number green, number blue, number alpha | gpu.getColorRGB(number x, number y) and gpu.getPixel(number x, number y) | Returns the color of the pixel in the currently binded texture. Out of bound pixels have an undefined side effect. |
nil | gpu.rectangle(number x, number y, number width, number height) | Draws the outline of a rectangle from x, y to x+width, y+height. |
nil | gpu.filledRectangle(number x, number y, number width, number height) | Draws a filled rectangle from x, y to x+width, y+height. |
nil | gpu.setColor(number red, number green, number blue[, number alpha]) | Sets the GPU's current drawing color |