What it does
LoadShaderFromString writes to a 3D object: it loads rather than reads. It takes szVertexSource (a string) and szPixelSource (a string), and answers an integer. That is the first of 2 forms.
Syntax
1
LoadShaderFromString(szVertexSource string, szPixelSource string) → integer2
LoadShaderFromString(shaderID integer, szVertexSource string, szPixelSource string)Parameters
| Name | Type | In forms |
|---|---|---|
| szVertexSource | string | all |
| szPixelSource | string | all |
| shaderID | integer | 2 |
What each form returns
| 1 | shaderFromString = LoadShaderFromString("value", "value") | integer |
| 2 | LoadShaderFromString(1, "value", "value") | nothing |
Example · generated
Form 1, the command hands back the id
shaderFromString = LoadShaderFromString("value", "value")DO Sync()LOOPForm 2, you choose the id yourself
LoadShaderFromString(1, "value", "value")DO Sync()LOOPLoadShaderFromString is called and its answer is printed every frame. The DO … LOOP is not decoration: a classic BASIC program ends the moment it runs out of lines, and Sync() is what draws the frame.