Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

ShSyntax.hpp File Reference

Sh syntactical definitions. More...

#include "ShDllExport.hpp"
#include "ShProgram.hpp"
#include "ShUtility.hpp"

Include dependency graph for ShSyntax.hpp:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  SH
#define SH_PUSH_ARG_QUEUE
#define SH_PUSH_ARG
#define SH_PROCESS_ARG(arg, internal_cond)

Shader definitions

#define SH_BEGIN_PROGRAM(target)
 Begin a new program block.
#define SH_END_PROGRAM
 End the current program definition.

If statements

#define SH_IF(cond)
 Begin an if statement.
#define SH_ELSE
 Indicate the start of the else-block of an if statement.
#define SH_ENDIF
 Indicate the end of an if-statement.

While loops

#define SH_WHILE(cond)
 Begin a while statement, iterating as long as cond is satisfied.
#define SH_ENDWHILE
 Indicate the end of a while-statement.

Do-until loops

#define SH_DO
 Indicate the start of a do-until statement.
#define SH_UNTIL(cond)
 End a do-until statement, iterating as long as cond is satisfied.

For loops

#define SH_FOR(init, cond, update)
 Begin a for statement.
#define SH_ENDFOR
 Indicate the end of a for statement.

Loop flow control

#define SH_BREAK
 Break out of a loop, terminating the loop.
#define SH_CONTINUE
 Break out of a loop, continuing with the next iteration.

Named Declaration macros

#define SH_NAME(var)
 Set the name of a variable to be its C++ name.
#define SH_DECL(var)
 Declare variable with the same name as var.
#define SH_NAMEDECL(var, varName)
 Declare variable with the given name Usage: Sh_Some_Type SH_NAMEDECL(var, "name"); or Sh_Some_Type SH_NAMEDECL(var, "name") = initial_value;.

Defines

#define SH_END
#define SH_BEGIN_VERTEX_PROGRAM
#define SH_BEGIN_FRAGMENT_PROGRAM
#define SH_BEGIN_SECTION(name)
 Starts a block grouping - for affine analysis and organization of code for visual languages.
#define SH_END_SECTION

Functions

bool SH::shProcessArg (const ShVariable &arg, bool *internal_cond)
bool SH::shPushArg ()
bool SH::shPushArgQueue ()
bool SH::shEvaluateCondition (const ShVariable &arg)
ShProgram SH::shBeginShader (const std::string &target)
void SH::shEndShader ()
void SH::shCompile (ShProgram &prg)
 Force (re)compilation of a program under its default target.
void SH::shCompile (ShProgram &prg, const std::string &target)
 Force (re)compilation of a program for a given target.
void SH::shCompileShader (ShProgram &prg)
SH_DLLEXPORT void SH::shCompileShader (ShProgram &prg, const std::string &target)
void SH::shBind (ShProgram &prg)
 Bind a program using the program's default target.
void SH::shBind (const std::string &target, ShProgram &prg)
 Bind a program with the given target.
void SH::shBindShader (ShProgram &shader)
void SH::shBindShader (const std::string &target, ShProgram &shader)
void SH::shBind (const ShProgramSet &s)
 Bind a set of programs.
void SH::shUnbind ()
 Unbind all currently bound programs.
void SH::shUnbind (ShProgram &prg)
 Unbind a program.
void SH::shUnbind (const std::string &target, ShProgram &prg)
 Unbind a program with the given target.
void SH::shUnbind (const ShProgramSet &s)
 Unbind a set of programs, if it's bound.
void SH::shLink (const ShProgramSet &s)
 Link a set of programs.
void SH::shUpdate ()
 Upload any textures and uniform parameters which are out-of-date but required on all compilation targets that have any programs bound.
bool SH::shSetBackend (const std::string &name)
 Switch to a particular backend.
bool SH::shUseBackend (const std::string &name)
 Add a backend to the list of selected backends.
bool SH::shHaveBackend (const std::string &name)
 Checks whether the backend is available.
void SH::shClearBackends ()
 Clear the list of selected backends.
std::string SH::shFindBackend (const std::string &target)
 Find the name of the best backend that handles the given target.
void SH::shInit ()
 SH Initialization Function.
void SH::shIf (bool)
void SH::shElse ()
void SH::shEndIf ()
void SH::shWhile (bool)
void SH::shEndWhile ()
void SH::shDo ()
void SH::shUntil (bool)
void SH::shFor (bool)
void SH::shEndFor ()
SH_DLLEXPORT void SH::shBreak ()
SH_DLLEXPORT void SH::shContinue ()
void SH::shBeginSection ()
void SH::shEndSection ()
void SH::shComment (const std::string &comment)


Detailed Description

Sh syntactical definitions.

Definition in file ShSyntax.hpp.


Define Documentation

#define SH_BEGIN_PROGRAM target   ) 
 

Begin a new program block.

Nesting programs is not allowed.

Return values:
ShProgram A reference to the new program.
See also:
SH_END_PROGRAM

Definition at line 50 of file ShSyntax.hpp.

Referenced by SH::access(), SH::ShDupNode::applyToInputs(), SH::ShLoseNode::applyToInputs(), SH::ShKeepNode::applyToInputs(), SH::ShDupNode::applyToOutputs(), SH::ShLoseNode::applyToOutputs(), ShUtil::ShKernelSurfMap::bump(), SH::cast(), SH::connect(), SH::dup(), SH::fillcast(), ShUtil::ShKernelSurface::gooch(), ShUtil::ShKernelLib::inputPass(), SH::keep(), SH::lose(), SH::max(), SH::namedConnect(), ShUtil::ShKernelSurface::null(), SH::FloatConverter::operator()(), SH::operator<<(), ShUtil::ShKernelLib::outputPass(), ShUtil::ShKernelSurface::phong(), ShUtil::ShKernelLight::pointLight(), SH::renameInput(), SH::renameOutput(), ShUtil::ShKernelLib::shChangeBasis(), ShUtil::shWorley(), ShUtil::ShKernelLight::spotLight(), ShUtil::ShKernelLight::texLight2D(), SH::transform(), and ShUtil::ShKernelSurfMap::vcsBump().

#define SH_BEGIN_SECTION name   ) 
 

Starts a block grouping - for affine analysis and organization of code for visual languages.

Todo:
range This interface is really quite crappy
Parameters:
name - String name of the block (this shouldn't be required.
.. This is only to keep me sane when debugging

Definition at line 201 of file ShSyntax.hpp.

#define SH_BREAK
 

Break out of a loop, terminating the loop.

See also:
SH_CONTINUE

SH_WHILE

SH_DO

SH_FOR

Definition at line 182 of file ShSyntax.hpp.

#define SH_CONTINUE
 

Break out of a loop, continuing with the next iteration.

See also:
SH_BREAK

SH_WHILE

SH_DO

SH_FOR

Definition at line 190 of file ShSyntax.hpp.

#define SH_DECL var   ) 
 

Declare variable with the same name as var.

Usage: Sh_Some_Type SH_DECL(var); or Sh_Some_TYPE SH_DECL(var) = initial_value;

See also:
SH_NAMEDDECL

Definition at line 232 of file ShSyntax.hpp.

Referenced by ShUtil::ShKernelSurfMap::bump(), ShUtil::ShKernelSurface::diffuse(), ShUtil::ShKernelSurface::gooch(), SH::max(), ShUtil::ShKernelSurface::null(), ShUtil::ShKernelSurface::phong(), ShUtil::ShKernelLight::pointLight(), ShUtil::shWorley(), ShUtil::ShKernelSurface::specular(), ShUtil::ShKernelLight::spotLight(), ShUtil::ShKernelLight::texLight2D(), and ShUtil::ShKernelSurfMap::vcsBump().

#define SH_DO
 

Indicate the start of a do-until statement.

See also:
SH_UNTIL

Definition at line 127 of file ShSyntax.hpp.

#define SH_ELSE
 

Indicate the start of the else-block of an if statement.

See also:
SH_IF

SH_ENDIF

Definition at line 83 of file ShSyntax.hpp.

#define SH_END_PROGRAM
 

End the current program definition.

If there is a backend and the program has a specified target (e.g. vertex or fragment), this will also compile the program.

See also:
SH_BEGIN_PROGRAM

Definition at line 59 of file ShSyntax.hpp.

Referenced by SH::connect(), SH::dup(), SH::keep(), SH::lose(), SH::operator<<(), and ShUtil::shWorley().

#define SH_ENDFOR
 

Indicate the end of a for statement.

See also:
SH_FOR

Definition at line 166 of file ShSyntax.hpp.

#define SH_ENDIF
 

Indicate the end of an if-statement.

See also:
SH_IF

SH_ELSE

Definition at line 92 of file ShSyntax.hpp.

#define SH_ENDWHILE
 

Indicate the end of a while-statement.

See also:
SH_WHILE

Definition at line 114 of file ShSyntax.hpp.

#define SH_FOR init,
cond,
update   ) 
 

Begin a for statement.

The semantics are mostly the same as for C++ for statements, but unlike in C++ declaring variables in init part is not allowed.

See also:
SH_ENDFOR

Definition at line 148 of file ShSyntax.hpp.

#define SH_IF cond   ) 
 

Begin an if statement.

See also:
SH_ELSE

SH_ENDIF

Definition at line 74 of file ShSyntax.hpp.

#define SH_NAME var   ) 
 

Set the name of a variable to be its C++ name.

See also:
SH_DECL

SH_NAMEDECL

Definition at line 221 of file ShSyntax.hpp.

#define SH_NAMEDECL var,
varName   ) 
 

Declare variable with the given name Usage: Sh_Some_Type SH_NAMEDECL(var, "name"); or Sh_Some_Type SH_NAMEDECL(var, "name") = initial_value;.

See also:
SH_DECL

Definition at line 242 of file ShSyntax.hpp.

Referenced by SH::access(), SH::cast(), SH::dup(), SH::fillcast(), SH::keep(), SH::lose(), SH::max(), ShUtil::ShKernelLib::shChangeBasis(), ShUtil::ShKernelLib::shVsh(), and SH::transform().

#define SH_UNTIL cond   ) 
 

End a do-until statement, iterating as long as cond is satisfied.

See also:
SH_DO

Definition at line 134 of file ShSyntax.hpp.

#define SH_WHILE cond   ) 
 

Begin a while statement, iterating as long as cond is satisfied.

See also:
SH_ENDWHILE

Definition at line 104 of file ShSyntax.hpp.


Generated on Wed Jun 15 18:14:04 2005 for Sh by  doxygen 1.4.3-20050530