Difference between revisions of "GPU (API)"

From ComputerCraft Wiki
Jump to: navigation, search
Line 1: Line 1:
The GPU api provides interaction with and is part of the [[CCGPU]] peripheral.
+
The GPU api provides interaction with and is part of the [[CCGPU]] peripheral.<br>
 +
''Arguments surrounded with square brackets are optional.''
 +
 
 +
== API Methods ==
 +
''These methods can be used in any ComputerCraft program if the CCGPU api is installed.''
 
{| border="1" cellpadding="2" cellspacing="0"
 
{| border="1" cellpadding="2" cellspacing="0"
 
!style="background:#EEE" width="380px"|Method name
 
!style="background:#EEE" width="380px"|Method name
Line 6: Line 10:
 
|gpu.setRenderCode(<nowiki>[</nowiki>side<nowiki>]</nowiki>, renderCode)
 
|gpu.setRenderCode(<nowiki>[</nowiki>side<nowiki>]</nowiki>, renderCode)
 
|Sets the gpu rendering code, this code is ran every frame.<br />
 
|Sets the gpu rendering code, this code is ran every frame.<br />
''@param'' <nowiki>[</nowiki>'''side'''<nowiki>]</nowiki> the side the gpu is connected to<br />
+
''@param'' '''side''' the side the gpu is connected to<br />
 
''@param'' '''renderCode''' the code as a string<br />
 
''@param'' '''renderCode''' the code as a string<br />
 
''@return'' nil
 
''@return'' nil
 +
|}
 +
 +
== Render Methods ==
 +
''These methods can be used in the render code when set using '''gpu.setRenderCode'''.''
 +
{| border="1" cellpadding="2" cellspacing="0"
 +
!style="background:#EEE" width="380px"|Method name
 +
!style="background:#EEE" width="*"|Description
 +
|-
 +
|gpuCreateBuffer(width, height)
 +
|Coming soon
 +
|-
 +
|gpuClearBuffer()
 +
|Coming soon
 +
|-
 +
|gpuBindBuffer(id)
 +
|Coming soon
 +
|-
 +
|gpuBindOutputBuffer(id)
 +
|Coming soon
 
|}
 
|}

Revision as of 00:58, 18 March 2012

The GPU api provides interaction with and is part of the CCGPU peripheral.
Arguments surrounded with square brackets are optional.

API Methods

These methods can be used in any ComputerCraft program if the CCGPU api is installed.

Method name Description
gpu.setRenderCode([side], renderCode) Sets the gpu rendering code, this code is ran every frame.

@param side the side the gpu is connected to
@param renderCode the code as a string
@return nil

Render Methods

These methods can be used in the render code when set using gpu.setRenderCode.

Method name Description
gpuCreateBuffer(width, height) Coming soon
gpuClearBuffer() Coming soon
gpuBindBuffer(id) Coming soon
gpuBindOutputBuffer(id) Coming soon