<div class="sub">about the <span class="code">{$CLASS}</span> token</div>
<div class="sub">about the <span class="code">{<a href="#ebnfClass">$CLASS</a>}</span> token</div>
</li>
<li>
<div>Methods:</div>
<ul>
<li>
<a class="link" href="#Procedure">Procedure</a>
<div class="sub">about the <span class="code">{$PROCEDURE}</span> token</div>
<div class="sub">about the <span class="code">{<a href="#ebnfProcedure">$PROC</a>}</span> token</div>
</li>
<li>
<a class="link" href="#Function">Function</a>
<div class="sub">about the <span class="code">{$FUNCTION}</span> token</div>
<div class="sub">about the <span class="code">{<a href="#ebnfFunction">$FUNC</a>}</span> token</div>
</li>
<li>
<a class="link" href="#Main">Main</a>
<div class="sub">about the <span class="code">{$MAIN}</span> token</div>
<div class="sub">about the <span class="code">{<a href="#ebnfMain">$MAIN</a>}</span> token</div>
</li>
<li>
<div>Calls:</div>
<ul>
<li>
<a class="link" href="#Call">Call</a>
<div class="sub">about the <span class="code">{$CALL}</span> token</div>
<div class="sub">about the <span class="code">{<a href="#ebnfCall">$CALL</a>}</span> token</div>
</li>
<li>
<a class="link" href="#Inherited">Inherited</a>
<div class="sub">about the <span class="code">{$INHERITED}</span> token</div>
<div class="sub">about the <span class="code">{<a href="#ebnfInherited">$INHERITED</a>}</span> token</div>
</li>
</ul>
</li>
@@ -152,19 +152,19 @@
<ul>
<li>
<a class="link" href="#Include">Include</a>
<div class="sub">about the <span class="code">{$INCLUDE}</span> token</div>
<div class="sub">about the <span class="code">{<a href="#ebnfInclude">$INCLUDE</a>}</span> token</div>
</li>
<li>
<a class="link" href="#Property">Property</a>
<div class="sub">about the <span class="code">{$PROPERTY}</span> token</div>
<div class="sub">about the <span class="code">{<a href="#ebnfProperty">$PROPERTY</a>}</span> token</div>
</li>
<li>
<a class="link" href="#Static">Static</a>
<div class="sub">about the <span class="code">{$STATIC}</span> token</div>
<div class="sub">about the <span class="code">{<a href="#ebnfStatic">$STATIC</a>}</span> token</div>
</li>
<li>
<a class="link" href="#If">If</a>
<div class="sub">about the <span class="code">{$IF}</span> token</div>
<div class="sub">about the <span class="code">{<a href="#ebnfIf">$IF</a>}</span> token</div>
</li>
</ul>
</li>
@@ -173,27 +173,27 @@
<ul>
<li>
<a class="link" href="#Meta">Meta</a>
<div class="sub">about the <span class="code">{$META}</span> token</div>
<div class="sub">about the <span class="code">{<a href="#ebnfMeta">$META</a>}</span> token</div>
</li>
<li>
<a class="link" href="#Echo">Echo</a>
<div class="sub">about the <span class="code">{$ECHO}</span> token</div>
<div class="sub">about the <span class="code">{<a href="#ebnfEcho">$ECHO</a>}</span> token</div>
</li>
<li>
<a class="link" href="#Varying">Varying</a>
<div class="sub">about the <span class="code">{$VARYING}</span> token</div>
<div class="sub">about the <span class="code">{<a href="#ebnfVarying">$VARYING</a>}</span> token</div>
</li>
<li>
<a class="link" href="#Uniform">Uniform</a>
<div class="sub">about the <span class="code">{$UNIFORM}</span> token</div>
<div class="sub">about the <span class="code">{<a href="#ebnfUniform">$UNIFORM</a>}</span> token</div>
</li>
<li>
<a class="link" href="#Var">Var</a>
<div class="sub">about the <span class="code">{$VAR}</span> token</div>
<div class="sub">about the <span class="code">{<a href="#ebnfVar">$VAR</a>}</span> token</div>
</li>
<li>
<a class="link" href="#Const">Const</a>
<div class="sub">about the <span class="code">{$CONST}</span> token</div>
<div class="sub">about the <span class="code">{<a href="#ebnfConst">$CONST</a>}</span> token</div>
</li>
<li>
<a class="link" href="#Messages">Messages</a>
@@ -220,7 +220,7 @@
<div class="content">
Inside the shader file you define every needed OpenGL shader code, meta information and precompiler instructions you need. The precompiler then interprets your code and generate the normal OpenGL shader code for you. It will take care, that only the needed code parts are added to the resulting code, so the shader code is always as simple and small as needed.<br/>
The shader file is also a code generator. It's name is a empty string. So if you pass the empty string to the code generator creator function you will get the code generator for the whole file.<br/>
A class does not need a <a href="#Main">{$MAIN}</a> method.
A class does not need a {<a href="#ebnfMain">$MAIN</a>} method.<br/>
A class is a logical wrapper to summarize OpenGL shader code, meta information and precompiler instructions. You can inherit a class from other classes using the $EXTENDS token. The precompiler then interprets your code and generate the normal OpenGL shader code for you. It will take care, that only the needed code parts are added to the resulting code, so the shader code is always as simple and small as needed.<br/>
A class is always a generator. If you use the name of class as parameter for the code generator creator function you will get a code generator for the requested class.<br/>
A class or one of its parent classes always needs a <a href="#Main">{$MAIN}</a> method.
A class or one of its parent classes always needs a {<a href="#ebnfMain">$MAIN</a>} method.<br/>
</div>
</div>
@@ -419,7 +419,7 @@
<span class="comment">/* you can also define code here. It will be added when the code for the class is generated */</span>
The procedure token will generate a normal procedure in the resulting code, when the procedure is at least used one time inside a <a href="#Call">{$CALL}</a>.
The procedure token will generate a normal procedure in the resulting code, when the procedure is at least used one time inside a {<a href="#ebnfCall">$CALL</a>}.<br/>
Inside a class you can add the $INLINE token. If the $INLINE token is added the code inside the procedure will be copied and pasted inside the resulting code.<br/>
Be careful with inlined methods, because the precompiler will not check the variable names inside the method, so you maybe have a duplicate variable when it is pasted inside the resulting code.
Be careful with inlined methods, because the precompiler will not check the variable names inside the method, so you maybe have a duplicate variable when it is pasted inside the resulting code.<br/>
The function token will generate a normal function in the resulting code, when the function is at least used one time inside a <a href="#Call">{$CALL}</a>.
The function token will generate a normal function in the resulting code, when the function is at least used one time inside a {<a href="#ebnfCall">$CALL</a>}.<br/>
Inside a class you can add the $INLINE token. If the $INLINE token is added the code inside the function will be copied and pasted inside the resulting code.<br/>
Be careful with inlined methods, because the precompiler will not check the variable names inside the method, so you maybe have a duplicate variable when it is pasted inside the resulting code.
Be careful with inlined methods, because the precompiler will not check the variable names inside the method, so you maybe have a duplicate variable when it is pasted inside the resulting code.<br/>
The $MAIN token is a special procedure without parameters that will be called automatically by the pre compiler, when the code is generated. The $MAIN token is necessary inside a class and optional inside a shader file.
The {<a href="#ebnfMain">$MAIN</a>} token is a special procedure without parameters that will be called automatically by the pre compiler, when the code is generated. The {<a href="#ebnfMain">$MAIN</a>} token is necessary inside a class and optional inside a shader file.<br/>
The {<a href="#ebnfCall">$CALL</a>} token tells the precompiler to execute a method.<br/>
If the method is marked with the $INLINE token the code of this method will be copied and pasted in the resulting code. Be careful with inlined methods, because the precompiler will not check the variable names inside the method, so you maybe have a duplicate variable when it is pasted inside the resulting code.<br/>
If the method is not marked with the $INLINE token a normal method will be generated in the resulting code.<br/>
The {<a href="#ebnfInherited">$INHERITED</a>} token is a special {<a href="#ebnfCall">$CALL</a>} token. It can only be used inside a {<a href="#ebnfClass">$CLASS</a>}. It will call a method inside a parent class. If you add the $INLINE token, the called method will be inlined. Be careful with inlined methods, because the precompiler will not check the variable names inside the method, so you maybe have a duplicate variable when it is pasted inside the resulting code.<br/>
The {<a href="#ebnfProperty">$PROPERTY</a>} token defines a property. The value of the property can be changed inside the application code, before generating the resulting shader code.
The {<a href="#ebnfEcho">$ECHO</a>} token will add the value of a {<a href="#ebnfStatic">$STATIC</a>} or {<a href="#ebnfProperty">$PROPERTY</a>} to the resulting code.
</div>
</div>
@@ -1836,8 +1942,17 @@
<div class="icon close">-</div>
<h4>Example:</h4>
</div>
<div class="content code area">
TODO
<div class="content">
simple example:
<div class="code area">
<span class="pre">{<a href="#ebnfProperty">$PROPERTY</a> MyProperty '/* this is a test */'}</span><br/>