compile

open fun compile(renderer: Renderer): <Error class: unknown class><Boolean>

Tries to compile the @shader for the given @renderer.

If there is a problem, this function returns false and reports an error. You should use this function before relying on the shader for rendering and use a fallback with a simpler shader or without shaders if it fails.

Note that this will modify the rendering state (for example change the current GL context) and requires the renderer to be set up. This means that the widget has to be realized. Commonly you want to call this from the realize signal of a widget, or during widget snapshot.

Return

true on success, false if an error occurred

Parameters

renderer

a GskRenderer