OpenGL ES 2.0 / GLSL 1.0
Preprocessor
最終更新:
opengles
-
view
Preprocessor Directives
The number sign (#) can be immediately preceded or followed in its line by spaces or horizontal tabs.
# | #define | #undef | #if | #ifdef | #ifndef | #else |
#elif | #endif | #error | #pragma | #extension | #version | #line |
Examples of Preprocessor Directives
- “#version 100” in a shader program specifies that the program is written in GLSL ES version 1.00. It is optional. If used, it must occur before anything else in the program other than whitespace or comments.
- #extension extension_name : behavior, where behavior can be require, enable, warn, or disable; and where extension_name is the extension supported by the compiler
Predefined Macros
__LINE__ | Decimal integer constant that is one more than the number of preceding new-lines in the current source string |
__FILE__ | Decimal integer constant that says which source string number is currently being processed. |
__VERSION__ | Decimal integer, e.g.: 100 |
GL_ES | Defined and set to integer 1 if running on an OpenGL-ES Shading Language. |
GL_FRAGMENT_PRECISION_HIGH | 1 if highp is supported in the fragment language, else undefined [4.5.4] |