summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian <brian.paul@tungstengraphics.com>2007-09-29 10:44:05 -0600
committerBrian <brian.paul@tungstengraphics.com>2007-09-29 10:44:05 -0600
commit2727cfddbf64add52181bed999938a90811f01a3 (patch)
tree8135b961b023b32b315c319f2aecd958bf72e5ef
parent78f3cd1e08d68111a2db308c000b94cc580b3cad (diff)
hack in some code to test loops, break
-rw-r--r--progs/demos/arbfslight.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/progs/demos/arbfslight.c b/progs/demos/arbfslight.c
index 39c9226b3d..d6363eafeb 100644
--- a/progs/demos/arbfslight.c
+++ b/progs/demos/arbfslight.c
@@ -210,7 +210,7 @@ static void Init (void)
" // Compute diffuse and specular contributions\n"
#if 0
" gl_FragColor = diffuse * dotProd + specular * pow (dotProd, 20.0);\n"
-#else
+#elif 1 /* test IF/ELSE/ENDIF */
" if (normal.y > 0.0) { \n"
" gl_FragColor = diffuse * dotProd + specular * pow (dotProd, 20.0);\n"
" } \n"
@@ -222,6 +222,16 @@ static void Init (void)
" gl_FragColor = vec4(1, 1, 0, 0); \n"
" } \n"
" } \n"
+#elif 1 /* test LOOP */
+ " while (1) { \n"
+ " if (normal.y >= 0.0) { \n"
+ " gl_FragColor = vec4(1, 0, 0, 0); \n"
+ " break; \n"
+ " } else { \n"
+ " gl_FragColor = diffuse * dotProd + specular * pow (dotProd, 20.0);\n"
+ " break; \n"
+ " } \n"
+ " } \n"
#endif
"}\n"
;