Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
component:gpu [2020/05/18 11:44]
payonel
component:gpu [2021/07/11 19:54]
hawk777 setDepth returns a weird encoding of the old depth, not a boolean
Line 13: Line 13:
 - [[component:​gpu#​video_ram_buffers|Video Ram Buffers]] - [[component:​gpu#​video_ram_buffers|Video Ram Buffers]]
   This list of component api is getting long, so the new video ram api is listed below on this page in its own section   This list of component api is getting long, so the new video ram api is listed below on this page in its own section
-  - New in OC 1.7.5 Developer builds and expected in the next release (1.8)+  - New in OC 1.7.5 Developer builds and expected in the next release (OC 1.8)
 - `bind(address:​ string[, reset: boolean=true]):​ boolean[, string]`  ​ - `bind(address:​ string[, reset: boolean=true]):​ boolean[, string]`  ​
   Tries to bind the GPU to a screen with the specified address. Returns `true` on success, `false` and an error message on failure. Resets the screen'​s settings if reset is '​true'​.   Tries to bind the GPU to a screen with the specified address. Returns `true` on success, `false` and an error message on failure. Resets the screen'​s settings if reset is '​true'​.
Line 37: Line 37:
 - `getDepth():​ number`  ​ - `getDepth():​ number`  ​
   The currently set color depth of the GPU/screen, in bits. Can be 1, 4 or 8.   The currently set color depth of the GPU/screen, in bits. Can be 1, 4 or 8.
-- `setDepth(bit:​ number): ​boolean`   +- `setDepth(bit:​ number): ​string`   
-  Sets the color depth to use. Can be up to the maximum supported color depth. If a larger or invalid value is provided it will throw an error. Returns ​`true` if the depth was set, `falseotherwise.+  Sets the color depth to use. Can be up to the maximum supported color depth. If a larger or invalid value is provided it will throw an error. Returns the old depth as one of the strings `OneBit`, `FourBit`, or `EightBit`.
 - `maxResolution():​ number, number`  ​ - `maxResolution():​ number, number`  ​
   Gets the maximum resolution supported by the GPU and the screen it is bound to (minimum of the two).   Gets the maximum resolution supported by the GPU and the screen it is bound to (minimum of the two).