00001
00016 #ifndef __STDSHADER_H_INCLUDED__
00017 #define __STDSHADER_H_INCLUDED__
00018
00019
00020
00021
00022
00023
00026 #define INITIAL_VERTEX_SHADER_SOURCE \
00027 "// simple vertex shader\n" \
00028 "\n" \
00029 "void main()\n" \
00030 "{\n" \
00031 "\tgl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;\n" \
00032 "\tgl_FrontColor = gl_Color;\n" \
00033 "\tgl_TexCoord[0] = gl_MultiTexCoord0;\n" \
00034 "}\n"
00035
00036
00037
00038
00039
00040
00043 #define INITIAL_GEOMETRY_SHADER_SOURCE \
00044 "// simple geometry shader\n" \
00045 "\n" \
00046 "// these lines enable the geometry shader support.\n" \
00047 "#version 120\n" \
00048 "#extension GL_EXT_geometry_shader4 : enable\n" \
00049 "\n" \
00050 "void main( void )\n" \
00051 "{\n" \
00052 "\tfor( int i = 0 ; i < gl_VerticesIn ; i++ )\n" \
00053 "\t{\n" \
00054 "\t\tgl_FrontColor = gl_FrontColorIn[ i ];\n" \
00055 "\t\tgl_Position = gl_PositionIn [ i ];\n" \
00056 "\t\tgl_TexCoord[0] = gl_TexCoordIn [ i ][ 0 ];\n" \
00057 "\t\tEmitVertex();\n" \
00058 "\t}\n" \
00059 "}\n"
00060
00061
00062
00063
00064
00065
00068 #define INITIAL_FRAGMENT_SHADER_SOURCE \
00069 "// simple fragment shader\n" \
00070 "\n" \
00071 "// 'time' contains seconds since the program was linked.\n" \
00072 "uniform float time;\n" \
00073 "\n" \
00074 "void main()\n" \
00075 "{\n" \
00076 " gl_FragColor = gl_Color;\n" \
00077 "}\n"
00078
00079
00080
00081 #endif // __STDSHADER_H_INCLUDED__