summaryrefslogtreecommitdiff
path: root/progs
diff options
context:
space:
mode:
Diffstat (limited to 'progs')
-rw-r--r--progs/SConscript6
-rw-r--r--progs/SConstruct65
-rw-r--r--progs/demos/.gitignore3
-rw-r--r--progs/demos/Makefile37
-rw-r--r--progs/demos/SConscript89
-rw-r--r--progs/demos/Windows/all.dsp202
-rw-r--r--progs/demos/Windows/bounce.dsp224
-rw-r--r--progs/demos/Windows/clearspd.dsp224
-rw-r--r--progs/demos/Windows/cubemap.dsp224
-rw-r--r--progs/demos/Windows/demos.dsw1564
-rw-r--r--progs/demos/Windows/drawpix.dsp224
-rw-r--r--progs/demos/Windows/fire.dsp224
-rw-r--r--progs/demos/Windows/gears.dsp224
-rw-r--r--progs/demos/Windows/geartrain.dsp224
-rw-r--r--progs/demos/Windows/glinfo.dsp224
-rw-r--r--progs/demos/Windows/gloss.dsp224
-rw-r--r--progs/demos/Windows/gltestperf.dsp224
-rw-r--r--progs/demos/Windows/glutfx.dsp224
-rw-r--r--progs/demos/Windows/ipers.dsp224
-rw-r--r--progs/demos/Windows/isosurf.dsp224
-rw-r--r--progs/demos/Windows/loadbias.dsp224
-rw-r--r--progs/demos/Windows/morph3d.dsp224
-rw-r--r--progs/demos/Windows/multiarb.dsp224
-rw-r--r--progs/demos/Windows/occlude.dsp224
-rw-r--r--progs/demos/Windows/osdemo.dsp224
-rw-r--r--progs/demos/Windows/paltex.dsp224
-rw-r--r--progs/demos/Windows/pixeltex.dsp224
-rw-r--r--progs/demos/Windows/pointblast.dsp224
-rw-r--r--progs/demos/Windows/rain.dsp224
-rw-r--r--progs/demos/Windows/ray.dsp224
-rw-r--r--progs/demos/Windows/readpix.dsp224
-rw-r--r--progs/demos/Windows/reflect.dsp224
-rw-r--r--progs/demos/Windows/renormal.dsp224
-rw-r--r--progs/demos/Windows/shadowtex.dsp224
-rw-r--r--progs/demos/Windows/spectex.dsp224
-rw-r--r--progs/demos/Windows/spriteblast.dsp224
-rw-r--r--progs/demos/Windows/stex3d.dsp224
-rw-r--r--progs/demos/Windows/teapot.dsp224
-rw-r--r--progs/demos/Windows/terrain.dsp224
-rw-r--r--progs/demos/Windows/tessdemo.dsp224
-rw-r--r--progs/demos/Windows/texcyl.dsp224
-rw-r--r--progs/demos/Windows/texdown.dsp224
-rw-r--r--progs/demos/Windows/texenv.dsp224
-rw-r--r--progs/demos/Windows/texobj.dsp224
-rw-r--r--progs/demos/Windows/trispd.dsp224
-rw-r--r--progs/demos/Windows/tunnel.dsp224
-rw-r--r--progs/demos/Windows/tunnel2.dsp224
-rw-r--r--progs/demos/Windows/winpos.dsp224
-rw-r--r--progs/demos/arbfplight.c33
-rw-r--r--progs/demos/arbfslight.c24
-rw-r--r--progs/demos/arbocclude.c3
-rw-r--r--progs/demos/copypix.c4
-rw-r--r--progs/demos/drawpix.c4
-rw-r--r--progs/demos/engine.c4
-rw-r--r--progs/demos/fbo_firecube.c3
-rw-r--r--progs/demos/fogcoord.c28
-rw-r--r--progs/demos/fplight.c3
-rw-r--r--progs/demos/fslight.c45
-rw-r--r--progs/demos/gloss.c2
-rw-r--r--progs/demos/isosurf.c11
-rw-r--r--progs/demos/lodbias.c5
-rw-r--r--progs/demos/multiarb.c2
-rw-r--r--progs/demos/paltex.c3
-rw-r--r--progs/demos/pointblast.c3
-rw-r--r--progs/demos/rain.cxx2
-rw-r--r--progs/demos/shadowtex.c3
-rw-r--r--progs/demos/spriteblast.c3
-rw-r--r--progs/demos/stex3d.c4
-rw-r--r--progs/demos/streaming_rect.c4
-rw-r--r--progs/demos/texcyl.c5
-rw-r--r--progs/demos/texenv.c7
-rw-r--r--progs/demos/textures.c374
-rw-r--r--progs/demos/tunnel2.c2
-rw-r--r--progs/demos/winpos.c18
-rw-r--r--progs/egl/.gitignore5
-rw-r--r--progs/egl/Makefile49
-rw-r--r--progs/egl/demo1.c7
-rw-r--r--progs/egl/demo2.c59
-rw-r--r--progs/egl/demo3.c8
-rw-r--r--progs/egl/eglgears.c11
-rw-r--r--progs/egl/eglinfo.c32
-rw-r--r--progs/egl/eglscreen.c119
-rw-r--r--progs/egl/egltri.c264
-rw-r--r--progs/egl/peglgears.c449
-rw-r--r--progs/egl/xegl_tri.c359
-rw-r--r--progs/egl/xeglgears.c608
-rw-r--r--progs/fbdev/Makefile1
-rw-r--r--progs/fp/.gitignore1
-rwxr-xr-x[-rw-r--r--]progs/fp/Makefile50
-rw-r--r--progs/fp/abs.txt5
-rw-r--r--progs/fp/add-swz.txt5
-rw-r--r--progs/fp/add.txt5
-rw-r--r--progs/fp/cmp.txt5
-rw-r--r--progs/fp/cos.txt8
-rw-r--r--progs/fp/dp3.txt4
-rw-r--r--progs/fp/dp4.txt4
-rw-r--r--progs/fp/dph.txt4
-rw-r--r--progs/fp/dst.txt3
-rw-r--r--progs/fp/ex2.txt5
-rw-r--r--progs/fp/flr.txt5
-rw-r--r--progs/fp/fp-tri.c171
-rw-r--r--progs/fp/frc.txt5
-rw-r--r--progs/fp/kil.txt6
-rw-r--r--progs/fp/lg2.txt5
-rw-r--r--progs/fp/lit.txt5
-rw-r--r--progs/fp/local.txt11
-rw-r--r--progs/fp/lrp.txt4
-rw-r--r--progs/fp/mad.txt4
-rw-r--r--progs/fp/max.txt3
-rw-r--r--progs/fp/min.txt3
-rw-r--r--progs/fp/mov.txt3
-rw-r--r--progs/fp/mul-swz.txt3
-rw-r--r--progs/fp/mul.txt3
-rw-r--r--progs/fp/negate.txt6
-rw-r--r--progs/fp/position.txt3
-rw-r--r--progs/fp/pow.txt4
-rw-r--r--progs/fp/rcp.txt5
-rw-r--r--progs/fp/rsq.txt5
-rwxr-xr-xprogs/fp/run.sh7
-rw-r--r--progs/fp/scs.txt5
-rw-r--r--progs/fp/sge.txt3
-rw-r--r--progs/fp/sge2.txt8
-rw-r--r--progs/fp/sin.txt8
-rw-r--r--progs/fp/slt.txt3
-rw-r--r--progs/fp/sub.txt3
-rw-r--r--progs/fp/swz.txt3
-rw-r--r--progs/fp/swz2.txt4
-rw-r--r--progs/fp/tri-abs.c107
-rw-r--r--progs/fp/tri-add.c110
-rw-r--r--progs/fp/tri-cmp.c110
-rw-r--r--progs/fp/tri-cos.c113
-rw-r--r--progs/fp/tri-dp3.c109
-rw-r--r--progs/fp/tri-dp4.c109
-rw-r--r--progs/fp/tri-dph.c109
-rw-r--r--progs/fp/tri-dst.c109
-rw-r--r--progs/fp/tri-ex2.c110
-rw-r--r--progs/fp/tri-flr.c110
-rw-r--r--progs/fp/tri-fp.c109
-rw-r--r--progs/fp/tri-frc.c111
-rw-r--r--progs/fp/tri-kil.c111
-rw-r--r--progs/fp/tri-lg2.c110
-rw-r--r--progs/fp/tri-lit.c111
-rw-r--r--progs/fp/tri-lrp.c109
-rw-r--r--progs/fp/tri-mad.c109
-rw-r--r--progs/fp/tri-max.c109
-rw-r--r--progs/fp/tri-min.c109
-rw-r--r--progs/fp/tri-mov.c102
-rw-r--r--progs/fp/tri-mul.c109
-rw-r--r--progs/fp/tri-position.c109
-rw-r--r--progs/fp/tri-pow.c109
-rw-r--r--progs/fp/tri-rcp.c110
-rw-r--r--progs/fp/tri-rsq.c110
-rw-r--r--progs/fp/tri-scs.c111
-rw-r--r--progs/fp/tri-sge.c109
-rw-r--r--progs/fp/tri-sge2.c114
-rw-r--r--progs/fp/tri-sin.c114
-rw-r--r--progs/fp/tri-slt.c109
-rw-r--r--progs/fp/tri-sub.c109
-rw-r--r--progs/fp/tri-swz.c109
-rw-r--r--progs/fp/tri-swz2.c109
-rw-r--r--progs/fp/tri-xpd.c108
-rw-r--r--progs/fp/xpd.txt3
-rw-r--r--progs/glsl/.gitignore9
-rw-r--r--progs/glsl/CH11-bumpmap.frag2
-rw-r--r--progs/glsl/Makefile98
-rw-r--r--progs/glsl/convolutions.c27
-rw-r--r--progs/glsl/identity.c208
-rw-r--r--progs/glsl/samplers.c12
-rw-r--r--progs/glsl/texdemo1.c4
-rw-r--r--progs/miniglx/Makefile1
-rw-r--r--progs/redbook/Makefile2
-rw-r--r--progs/redbook/Windows/redbook.dsw58
-rw-r--r--progs/redbook/Windows/teapots.dsp224
-rw-r--r--progs/samples/Makefile8
-rw-r--r--progs/samples/Makefile.DJ85
-rw-r--r--progs/samples/prim.c6
-rw-r--r--progs/slang/windows/vc60/cltest.dsp188
-rw-r--r--progs/slang/windows/vc60/framework.dsp184
-rw-r--r--progs/slang/windows/vc60/slang.dsw148
-rw-r--r--progs/slang/windows/vc60/sotest.dsp180
-rw-r--r--progs/slang/windows/vc60/vstest.dsp186
-rw-r--r--progs/tests/.gitignore9
-rw-r--r--progs/tests/Makefile55
-rw-r--r--progs/tests/bug_texstore_i8.c194
-rw-r--r--progs/tests/calibrate_rast.c395
-rw-r--r--progs/tests/copypixrate.c63
-rw-r--r--progs/tests/descrip.mms84
-rw-r--r--progs/tests/fillrate.c203
-rw-r--r--progs/tests/manytex.c14
-rw-r--r--progs/tests/mipmap_view.c251
-rw-r--r--progs/tests/quads.c258
-rw-r--r--progs/tests/stencil_twoside.c2
-rw-r--r--progs/tests/subtex.c223
-rw-r--r--progs/tests/zcomp.c223
-rw-r--r--progs/tests/zdrawpix.c192
-rw-r--r--progs/trivial/.gitignore70
-rw-r--r--progs/trivial/Makefile131
-rw-r--r--progs/trivial/SConscript164
-rw-r--r--progs/trivial/clear-fbo-tex.c222
-rw-r--r--progs/trivial/clear-fbo.c207
-rw-r--r--progs/trivial/clear-random.c132
-rw-r--r--progs/trivial/clear-repeat.c111
-rw-r--r--progs/trivial/clear-scissor.c118
-rw-r--r--progs/trivial/clear-undefined.c137
-rw-r--r--progs/trivial/clear.c9
-rw-r--r--progs/trivial/createwin.c120
-rw-r--r--progs/trivial/dlist-dangling.c2
-rw-r--r--progs/trivial/dlist-edgeflag-dangling.c2
-rw-r--r--progs/trivial/dlist-edgeflag.c2
-rw-r--r--progs/trivial/drawarrays.c3
-rw-r--r--progs/trivial/drawelements.c3
-rw-r--r--progs/trivial/drawrange.c3
-rw-r--r--progs/trivial/flat-clip.c151
-rw-r--r--progs/trivial/fs-tri.c209
-rw-r--r--progs/trivial/line-clip.c2
-rw-r--r--progs/trivial/line-cull.c2
-rw-r--r--progs/trivial/line-smooth.c172
-rw-r--r--progs/trivial/line-stipple-wide.c148
-rw-r--r--progs/trivial/line-userclip-clip.c2
-rw-r--r--progs/trivial/line-userclip-nop-clip.c2
-rw-r--r--progs/trivial/line-userclip-nop.c2
-rw-r--r--progs/trivial/line-userclip.c2
-rw-r--r--progs/trivial/line-wide.c147
-rw-r--r--progs/trivial/line.c11
-rw-r--r--progs/trivial/lineloop-clip.c2
-rw-r--r--progs/trivial/lineloop-elts.c121
-rw-r--r--progs/trivial/lineloop.c2
-rw-r--r--progs/trivial/linestrip-clip.c141
-rw-r--r--progs/trivial/linestrip-flat-stipple.c142
-rw-r--r--progs/trivial/linestrip-stipple-wide.c142
-rw-r--r--progs/trivial/linestrip-stipple.c141
-rw-r--r--progs/trivial/linestrip.c138
-rw-r--r--progs/trivial/long-fixed-func.c152
-rw-r--r--progs/trivial/pgon-mode.c136
-rw-r--r--progs/trivial/point-clip.c2
-rw-r--r--progs/trivial/point-param.c6
-rw-r--r--progs/trivial/point-sprite.c174
-rw-r--r--progs/trivial/point-wide-smooth.c145
-rw-r--r--progs/trivial/point-wide.c4
-rw-r--r--progs/trivial/point.c2
-rw-r--r--progs/trivial/poly-flat-clip.c140
-rw-r--r--progs/trivial/poly-flat-unfilled-clip.c144
-rw-r--r--progs/trivial/poly-flat.c2
-rw-r--r--progs/trivial/poly-unfilled.c2
-rw-r--r--progs/trivial/poly.c2
-rw-r--r--progs/trivial/psb_context.c0
-rw-r--r--progs/trivial/quad-clip-all-vertices.c2
-rw-r--r--progs/trivial/quad-clip-nearplane.c2
-rw-r--r--progs/trivial/quad-clip.c2
-rw-r--r--progs/trivial/quad-degenerate.c2
-rw-r--r--progs/trivial/quad-flat.c2
-rw-r--r--progs/trivial/quad-offset-factor.c23
-rw-r--r--progs/trivial/quad-offset-unfilled.c6
-rw-r--r--progs/trivial/quad-offset-units.c23
-rw-r--r--progs/trivial/quad-tex-2d.c89
-rw-r--r--progs/trivial/quad-tex-3d.c5
-rw-r--r--progs/trivial/quad-tex-alpha.c170
-rw-r--r--progs/trivial/quad-tex-pbo.c4
-rw-r--r--progs/trivial/quad-unfilled-clip.c139
-rw-r--r--progs/trivial/quad-unfilled-stipple.c142
-rw-r--r--progs/trivial/quad-unfilled.c2
-rw-r--r--progs/trivial/quads.c2
-rw-r--r--progs/trivial/quadstrip-cont.c162
-rw-r--r--progs/trivial/quadstrip-flat.c2
-rw-r--r--progs/trivial/quadstrip.c2
-rw-r--r--progs/trivial/readpixels.c103
-rw-r--r--progs/trivial/tri-alpha-tex.c179
-rw-r--r--progs/trivial/tri-alpha.c141
-rw-r--r--progs/trivial/tri-array-interleaved.c120
-rw-r--r--progs/trivial/tri-blend-color.c144
-rw-r--r--progs/trivial/tri-blend-max.c147
-rw-r--r--progs/trivial/tri-blend-min.c147
-rw-r--r--progs/trivial/tri-blend-revsub.c147
-rw-r--r--progs/trivial/tri-blend-sub.c147
-rw-r--r--progs/trivial/tri-blend.c2
-rw-r--r--progs/trivial/tri-clear.c143
-rw-r--r--progs/trivial/tri-clip.c45
-rw-r--r--progs/trivial/tri-cull-both.c141
-rw-r--r--progs/trivial/tri-cull.c86
-rw-r--r--progs/trivial/tri-dlist.c2
-rw-r--r--progs/trivial/tri-edgeflag.c34
-rw-r--r--progs/trivial/tri-fbo-tex.c268
-rw-r--r--progs/trivial/tri-fbo.c202
-rw-r--r--progs/trivial/tri-flat-clip.c2
-rw-r--r--progs/trivial/tri-flat.c2
-rw-r--r--progs/trivial/tri-fog.c152
-rw-r--r--progs/trivial/tri-fp-const-imm.c171
-rw-r--r--progs/trivial/tri-fp.c169
-rw-r--r--progs/trivial/tri-lit.c139
-rw-r--r--progs/trivial/tri-mask-tri.c153
-rw-r--r--progs/trivial/tri-orig.c136
-rw-r--r--progs/trivial/tri-query.c160
-rw-r--r--progs/trivial/tri-repeat.c118
-rw-r--r--progs/trivial/tri-scissor-tri.c151
-rw-r--r--progs/trivial/tri-square.c136
-rw-r--r--progs/trivial/tri-stencil.c158
-rw-r--r--progs/trivial/tri-stipple.c151
-rw-r--r--progs/trivial/tri-tex-3d.c5
-rw-r--r--progs/trivial/tri-tex.c168
-rw-r--r--progs/trivial/tri-tri.c145
-rw-r--r--progs/trivial/tri-unfilled-clip.c2
-rw-r--r--progs/trivial/tri-unfilled-edgeflag.c141
-rw-r--r--progs/trivial/tri-unfilled-point.c138
-rw-r--r--progs/trivial/tri-unfilled-smooth.c2
-rw-r--r--progs/trivial/tri-unfilled-tri-lit.c178
-rw-r--r--progs/trivial/tri-unfilled-tri.c175
-rw-r--r--progs/trivial/tri-unfilled-userclip-stip.c147
-rw-r--r--progs/trivial/tri-unfilled-userclip.c2
-rw-r--r--progs/trivial/tri-unfilled.c2
-rw-r--r--progs/trivial/tri-userclip.c2
-rw-r--r--progs/trivial/tri-z-9.c139
-rw-r--r--progs/trivial/tri-z-eq.c139
-rw-r--r--progs/trivial/tri-z.c174
-rw-r--r--progs/trivial/tri.c35
-rw-r--r--progs/trivial/trifan-flat-clip.c140
-rw-r--r--progs/trivial/trifan-flat-unfilled-clip.c144
-rw-r--r--progs/trivial/trifan-flat.c140
-rw-r--r--progs/trivial/trifan-unfilled.c139
-rw-r--r--progs/trivial/trifan.c138
-rw-r--r--progs/trivial/tristrip-flat.c148
-rw-r--r--progs/trivial/tristrip.c2
-rw-r--r--progs/trivial/vbo-drawarrays.c3
-rw-r--r--progs/trivial/vbo-drawelements.c3
-rw-r--r--progs/trivial/vbo-drawrange.c3
-rw-r--r--progs/trivial/vp-array-int.c118
-rw-r--r--progs/trivial/vp-array.c3
-rw-r--r--progs/trivial/vp-clip.c3
-rw-r--r--progs/trivial/vp-line-clip.c3
-rw-r--r--progs/trivial/vp-tri-cb-pos.c158
-rw-r--r--progs/trivial/vp-tri-cb-tex.c191
-rw-r--r--progs/trivial/vp-tri-cb.c108
-rw-r--r--progs/trivial/vp-tri-imm.c102
-rw-r--r--progs/trivial/vp-tri-swap.c104
-rw-r--r--progs/trivial/vp-tri-tex.c138
-rw-r--r--progs/trivial/vp-tri.c19
-rw-r--r--progs/trivial/vp-unfilled.c3
-rw-r--r--progs/util/SConscript15
-rw-r--r--progs/util/descrip.mms42
-rw-r--r--progs/vp/Makefile8
-rw-r--r--progs/vp/SConscript13
-rw-r--r--progs/vp/exp.txt6
-rw-r--r--progs/vp/log.txt7
-rwxr-xr-xprogs/vp/run.sh7
-rw-r--r--progs/vp/vp-tris.c85
-rw-r--r--progs/vp/windows/vp2003.sln21
-rw-r--r--progs/vp/windows/vp2003.vcproj121
-rw-r--r--progs/vp/xform.txt11
-rw-r--r--progs/vpglsl/.gitignore1
-rw-r--r--progs/vpglsl/Makefile52
-rw-r--r--progs/vpglsl/for.glsl7
-rw-r--r--progs/vpglsl/if.glsl7
-rw-r--r--progs/vpglsl/ifelse.glsl8
-rw-r--r--progs/vpglsl/nestedifs.glsl13
-rw-r--r--progs/vpglsl/nestedswizzle.glsl9
-rw-r--r--progs/vpglsl/off2f.glsl18
-rw-r--r--progs/vpglsl/varfor1f.glsl22
-rw-r--r--progs/vpglsl/varfor2f.glsl24
-rw-r--r--progs/vpglsl/varfor4f.glsl19
-rw-r--r--progs/vpglsl/vp-tris.c313
-rw-r--r--progs/xdemos/Makefile30
-rw-r--r--progs/xdemos/descrip.mms83
-rw-r--r--progs/xdemos/glthreads.c281
362 files changed, 24351 insertions, 10720 deletions
diff --git a/progs/SConscript b/progs/SConscript
new file mode 100644
index 00000000000..631923a38ff
--- /dev/null
+++ b/progs/SConscript
@@ -0,0 +1,6 @@
+SConscript([
+ 'util/SConscript',
+ 'demos/SConscript',
+ 'trivial/SConscript',
+ 'vp/SConscript',
+])
diff --git a/progs/SConstruct b/progs/SConstruct
new file mode 100644
index 00000000000..4d268cc6d7b
--- /dev/null
+++ b/progs/SConstruct
@@ -0,0 +1,65 @@
+import os
+import os.path
+import sys
+
+env = Environment(
+ tools = ['generic'],
+ toolpath = ['../scons'],
+ ENV = os.environ,
+)
+
+
+# Use Mesa's headers and libs
+if 1:
+ build_topdir = 'build'
+ build_subdir = env['platform']
+ if env['machine'] != 'generic':
+ build_subdir += '-' + env['machine']
+ if env['debug']:
+ build_subdir += "-debug"
+ if env['profile']:
+ build_subdir += "-profile"
+ build_dir = os.path.join(build_topdir, build_subdir)
+
+ env.Append(CPPDEFINES = ['GLEW_STATIC'])
+ env.Append(CPPPATH = ['#../include'])
+ env.Append(LIBPATH = [
+ '#../' + build_dir + '/glew/',
+ '#../' + build_dir + '/glut/glx',
+ ])
+
+
+conf = Configure(env)
+
+# OpenGL
+if env['platform'] == 'windows':
+ env.Prepend(LIBS = ['glu32', 'opengl32'])
+else:
+ env.Prepend(LIBS = ['GLU', 'GL'])
+
+# Glut
+env['GLUT'] = False
+if conf.CheckCHeader('GL/glut.h'):
+ if env['platform'] == 'windows':
+ env['GLUT_LIB'] = 'glut32'
+ else:
+ env['GLUT_LIB'] = 'glut'
+ env['GLUT'] = True
+
+# GLEW
+env['GLEW'] = False
+if conf.CheckCHeader('GL/glew.h'):
+ env['GLEW_LIB'] = 'glew'
+ env['GLEW'] = True
+ env.Prepend(LIBS = ['glew'])
+
+conf.Finish()
+
+
+Export('env')
+
+SConscript(
+ 'SConscript',
+ build_dir = env['build'],
+ duplicate = 0 # http://www.scons.org/doc/0.97/HTML/scons-user/x2261.html
+)
diff --git a/progs/demos/.gitignore b/progs/demos/.gitignore
index ab836eb8340..d59d1752124 100644
--- a/progs/demos/.gitignore
+++ b/progs/demos/.gitignore
@@ -1,4 +1,3 @@
-.cvsignore
arbfplight
arbfslight
arbocclude
@@ -9,6 +8,7 @@ cubemap
drawpix
engine
extfuncs.h
+fbo_firecube
fire
fogcoord
fplight
@@ -54,6 +54,7 @@ texcyl
texdown
texenv
texobj
+textures
trackball.c
trackball.h
trispd
diff --git a/progs/demos/Makefile b/progs/demos/Makefile
index 81d9ebed860..e636cbd9ad9 100644
--- a/progs/demos/Makefile
+++ b/progs/demos/Makefile
@@ -5,16 +5,16 @@ include $(TOP)/configs/current
INCDIR = $(TOP)/include
-OSMESA_LIBS = -L$(TOP)/$(LIB_DIR) -lglut -lOSMesa -lGLU -lGL $(APP_LIB_DEPS)
+OSMESA_LIBS = -L$(TOP)/$(LIB_DIR) -lglut -lglew -lOSMesa -lGLU -lGL $(APP_LIB_DEPS)
-OSMESA16_LIBS = -L$(TOP)/$(LIB_DIR) -lglut -lOSMesa16 -lGLU -lGL $(APP_LIB_DEPS)
+OSMESA16_LIBS = -L$(TOP)/$(LIB_DIR) -lglut -lglew -lOSMesa16 -lGLU -lGL $(APP_LIB_DEPS)
-OSMESA32_LIBS = -L$(TOP)/$(LIB_DIR) -lglut -lOSMesa32 -lGLU -lGL $(APP_LIB_DEPS)
+OSMESA32_LIBS = -L$(TOP)/$(LIB_DIR) -lglut -lglew -lOSMesa32 -lGLU -lGL $(APP_LIB_DEPS)
LIB_DEP = $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME) $(TOP)/$(LIB_DIR)/$(GLU_LIB_NAME) \
$(TOP)/$(LIB_DIR)/$(GLUT_LIB_NAME)
-LIBS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) \
+LIBS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLEW_LIB) -l$(GLU_LIB) -l$(GL_LIB) \
$(APP_LIB_DEPS)
PROGS = \
@@ -66,6 +66,7 @@ PROGS = \
texdown \
texenv \
texobj \
+ textures \
trispd \
tunnel \
tunnel2 \
@@ -81,7 +82,7 @@ PROGS = \
# make executable from .c file:
.c: $(LIB_DEP) readtex.o
- $(CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) $< readtex.o $(LIBS) -o $@
+ $(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) $< readtex.o $(LIBS) -o $@
##### TARGETS #####
@@ -97,7 +98,7 @@ readtex.h: $(TOP)/progs/util/readtex.h
cp $< .
readtex.o: readtex.c readtex.h
- $(CC) -c -I$(INCDIR) $(CFLAGS) readtex.c
+ $(APP_CC) -c -I$(INCDIR) $(CFLAGS) readtex.c
showbuffer.c: $(TOP)/progs/util/showbuffer.c
@@ -107,7 +108,7 @@ showbuffer.h: $(TOP)/progs/util/showbuffer.h
cp $< .
showbuffer.o: showbuffer.c showbuffer.h
- $(CC) -c -I$(INCDIR) $(CFLAGS) showbuffer.c
+ $(APP_CC) -c -I$(INCDIR) $(CFLAGS) showbuffer.c
trackball.c: $(TOP)/progs/util/trackball.c
@@ -117,7 +118,7 @@ trackball.h: $(TOP)/progs/util/trackball.h
cp $< .
trackball.o: trackball.c trackball.h
- $(CC) -c -I$(INCDIR) $(CFLAGS) trackball.c
+ $(APP_CC) -c -I$(INCDIR) $(CFLAGS) trackball.c
extfuncs.h: $(TOP)/progs/util/extfuncs.h
@@ -125,38 +126,38 @@ extfuncs.h: $(TOP)/progs/util/extfuncs.h
reflect: reflect.o showbuffer.o readtex.o
- $(CC) $(CFLAGS) $(LDFLAGS) reflect.o showbuffer.o readtex.o $(LIBS) -o $@
+ $(APP_CC) $(CFLAGS) $(LDFLAGS) reflect.o showbuffer.o readtex.o $(LIBS) -o $@
reflect.o: reflect.c showbuffer.h
- $(CC) -c -I$(INCDIR) $(CFLAGS) reflect.c
+ $(APP_CC) -c -I$(INCDIR) $(CFLAGS) reflect.c
shadowtex: shadowtex.o showbuffer.o
- $(CC) $(CFLAGS) $(LDFLAGS) shadowtex.o showbuffer.o $(LIBS) -o $@
+ $(APP_CC) $(CFLAGS) $(LDFLAGS) shadowtex.o showbuffer.o $(LIBS) -o $@
shadowtex.o: shadowtex.c showbuffer.h
- $(CC) -c -I$(INCDIR) $(CFLAGS) shadowtex.c
+ $(APP_CC) -c -I$(INCDIR) $(CFLAGS) shadowtex.c
gloss: gloss.o trackball.o readtex.o
- $(CC) $(CFLAGS) $(LDFLAGS) gloss.o trackball.o readtex.o $(LIBS) -o $@
+ $(APP_CC) $(CFLAGS) $(LDFLAGS) gloss.o trackball.o readtex.o $(LIBS) -o $@
gloss.o: gloss.c trackball.h
- $(CC) -c -I$(INCDIR) $(CFLAGS) gloss.c
+ $(APP_CC) -c -I$(INCDIR) $(CFLAGS) gloss.c
engine: engine.o trackball.o readtex.o
- $(CC) $(CFLAGS) $(LDFLAGS) engine.o trackball.o readtex.o $(LIBS) -o $@
+ $(APP_CC) $(CFLAGS) $(LDFLAGS) engine.o trackball.o readtex.o $(LIBS) -o $@
engine.o: engine.c trackball.h
- $(CC) -c -I$(INCDIR) $(CFLAGS) engine.c
+ $(APP_CC) -c -I$(INCDIR) $(CFLAGS) engine.c
fslight: fslight.o
- $(CC) $(CFLAGS) $(LDFLAGS) fslight.o $(LIBS) -o $@
+ $(APP_CC) $(CFLAGS) $(LDFLAGS) fslight.o $(LIBS) -o $@
fslight.o: fslight.c extfuncs.h
- $(CC) -c -I$(INCDIR) $(CFLAGS) fslight.c
+ $(APP_CC) -c -I$(INCDIR) $(CFLAGS) fslight.c
rain: particles.o rain.o readtex.o
$(CXX) $(CXXFLAGS) $(LDFLAGS) $^ $(LIBS) -o $@
diff --git a/progs/demos/SConscript b/progs/demos/SConscript
new file mode 100644
index 00000000000..bc166dd7895
--- /dev/null
+++ b/progs/demos/SConscript
@@ -0,0 +1,89 @@
+Import('*')
+
+if not env['GLUT']:
+ Return()
+
+env = env.Clone()
+
+env.Prepend(CPPPATH = [
+ '../util',
+])
+
+env.Prepend(LIBS = [
+ util,
+ '$GLUT_LIB'
+])
+
+if env['platform'] == 'windows':
+ env.Append(CPPDEFINES = ['NOMINMAX'])
+ env.Prepend(LIBS = ['winmm'])
+
+progs = [
+ 'arbfplight',
+ 'arbfslight',
+ 'arbocclude',
+ 'bounce',
+ 'clearspd',
+ 'copypix',
+ 'cubemap',
+ 'drawpix',
+ 'engine',
+ 'fbo_firecube',
+ 'fire',
+ 'fogcoord',
+ 'fplight',
+ 'fslight',
+ 'gamma',
+ 'gearbox',
+ 'gears',
+ 'geartrain',
+ 'glinfo',
+ 'gloss',
+ 'glslnoise',
+ 'gltestperf',
+ 'glutfx',
+ 'isosurf',
+ 'ipers',
+ 'lodbias',
+ 'morph3d',
+ 'multiarb',
+ 'paltex',
+ 'pointblast',
+ 'ray',
+ 'readpix',
+ 'reflect',
+ 'renormal',
+ 'shadowtex',
+ 'singlebuffer',
+ 'streaming_rect',
+ 'spectex',
+ 'spriteblast',
+ 'stex3d',
+ 'teapot',
+ 'terrain',
+ 'tessdemo',
+ 'texcyl',
+ 'texdown',
+ 'texenv',
+ 'texobj',
+ 'textures',
+ 'trispd',
+ 'tunnel',
+ 'tunnel2',
+ 'vao_demo',
+ 'winpos',
+]
+
+for prog in progs:
+ env.Program(
+ target = prog,
+ source = prog + '.c',
+ )
+
+env.Program(
+ target = 'rain',
+ source = [
+ 'rain.cxx',
+ 'particles.cxx',
+ ]
+)
diff --git a/progs/demos/Windows/all.dsp b/progs/demos/Windows/all.dsp
index b47283c5882..5c9b3450da1 100644
--- a/progs/demos/Windows/all.dsp
+++ b/progs/demos/Windows/all.dsp
@@ -1,101 +1,101 @@
-# Microsoft Developer Studio Project File - Name="all" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Application" 0x0101
-
-CFG=all - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "all.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "all.mak" CFG="all - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "all - Win32 Release" (based on "Win32 (x86) Application")
-!MESSAGE "all - Win32 Debug" (based on "Win32 (x86) Application")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-MTL=midl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "all - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386
-
-!ELSEIF "$(CFG)" == "all - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c
-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
-
-!ENDIF
-
-# Begin Target
-
-# Name "all - Win32 Release"
-# Name "all - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
+# Microsoft Developer Studio Project File - Name="all" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Application" 0x0101
+
+CFG=all - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "all.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "all.mak" CFG="all - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "all - Win32 Release" (based on "Win32 (x86) Application")
+!MESSAGE "all - Win32 Debug" (based on "Win32 (x86) Application")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+MTL=midl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "all - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386
+
+!ELSEIF "$(CFG)" == "all - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c
+# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
+# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
+
+!ENDIF
+
+# Begin Target
+
+# Name "all - Win32 Release"
+# Name "all - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# End Group
+# End Target
+# End Project
diff --git a/progs/demos/Windows/bounce.dsp b/progs/demos/Windows/bounce.dsp
index 0510e77d994..ff33ba6e13f 100644
--- a/progs/demos/Windows/bounce.dsp
+++ b/progs/demos/Windows/bounce.dsp
@@ -1,112 +1,112 @@
-# Microsoft Developer Studio Project File - Name="bounce" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=bounce - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "bounce.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "bounce.mak" CFG="bounce - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "bounce - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "bounce - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "bounce - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /W3 /GX /O2 /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../bounce.exe"
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ELSEIF "$(CFG)" == "bounce - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../bounce.exe" /pdbtype:sept
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ENDIF
-
-# Begin Target
-
-# Name "bounce - Win32 Release"
-# Name "bounce - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=..\bounce.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
+# Microsoft Developer Studio Project File - Name="bounce" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=bounce - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "bounce.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "bounce.mak" CFG="bounce - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "bounce - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "bounce - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "bounce - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /W3 /GX /O2 /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../bounce.exe"
+# Begin Special Build Tool
+SOURCE="$(InputPath)"
+PostBuild_Desc=Copy DLLs
+PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
+# End Special Build Tool
+
+!ELSEIF "$(CFG)" == "bounce - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../bounce.exe" /pdbtype:sept
+# Begin Special Build Tool
+SOURCE="$(InputPath)"
+PostBuild_Desc=Copy DLLs
+PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
+# End Special Build Tool
+
+!ENDIF
+
+# Begin Target
+
+# Name "bounce - Win32 Release"
+# Name "bounce - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=..\bounce.c
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# End Group
+# End Target
+# End Project
diff --git a/progs/demos/Windows/clearspd.dsp b/progs/demos/Windows/clearspd.dsp
index 440c7ae64e9..58fadcca2dc 100644
--- a/progs/demos/Windows/clearspd.dsp
+++ b/progs/demos/Windows/clearspd.dsp
@@ -1,112 +1,112 @@
-# Microsoft Developer Studio Project File - Name="clearspd" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=clearspd - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "clearspd.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "clearspd.mak" CFG="clearspd - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "clearspd - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "clearspd - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "clearspd - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /W3 /GX /O2 /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../clearspd.exe"
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ELSEIF "$(CFG)" == "clearspd - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../clearspd.exe" /pdbtype:sept
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ENDIF
-
-# Begin Target
-
-# Name "clearspd - Win32 Release"
-# Name "clearspd - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=..\clearspd.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
+# Microsoft Developer Studio Project File - Name="clearspd" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=clearspd - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "clearspd.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "clearspd.mak" CFG="clearspd - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "clearspd - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "clearspd - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "clearspd - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /W3 /GX /O2 /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../clearspd.exe"
+# Begin Special Build Tool
+SOURCE="$(InputPath)"
+PostBuild_Desc=Copy DLLs
+PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
+# End Special Build Tool
+
+!ELSEIF "$(CFG)" == "clearspd - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../clearspd.exe" /pdbtype:sept
+# Begin Special Build Tool
+SOURCE="$(InputPath)"
+PostBuild_Desc=Copy DLLs
+PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
+# End Special Build Tool
+
+!ENDIF
+
+# Begin Target
+
+# Name "clearspd - Win32 Release"
+# Name "clearspd - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=..\clearspd.c
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# End Group
+# End Target
+# End Project
diff --git a/progs/demos/Windows/cubemap.dsp b/progs/demos/Windows/cubemap.dsp
index 220a3a0df61..7c37b1b3ead 100644
--- a/progs/demos/Windows/cubemap.dsp
+++ b/progs/demos/Windows/cubemap.dsp
@@ -1,112 +1,112 @@
-# Microsoft Developer Studio Project File - Name="cubemap" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=cubemap - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "cubemap.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "cubemap.mak" CFG="cubemap - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "cubemap - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "cubemap - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "cubemap - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /W3 /GX /O2 /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../cubemap.exe"
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ELSEIF "$(CFG)" == "cubemap - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../cubemap.exe" /pdbtype:sept
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ENDIF
-
-# Begin Target
-
-# Name "cubemap - Win32 Release"
-# Name "cubemap - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=..\cubemap.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
+# Microsoft Developer Studio Project File - Name="cubemap" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=cubemap - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "cubemap.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "cubemap.mak" CFG="cubemap - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "cubemap - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "cubemap - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "cubemap - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /W3 /GX /O2 /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../cubemap.exe"
+# Begin Special Build Tool
+SOURCE="$(InputPath)"
+PostBuild_Desc=Copy DLLs
+PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
+# End Special Build Tool
+
+!ELSEIF "$(CFG)" == "cubemap - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../cubemap.exe" /pdbtype:sept
+# Begin Special Build Tool
+SOURCE="$(InputPath)"
+PostBuild_Desc=Copy DLLs
+PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
+# End Special Build Tool
+
+!ENDIF
+
+# Begin Target
+
+# Name "cubemap - Win32 Release"
+# Name "cubemap - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=..\cubemap.c
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# End Group
+# End Target
+# End Project
diff --git a/progs/demos/Windows/demos.dsw b/progs/demos/Windows/demos.dsw
index 2d6f629e07a..d989e736dea 100644
--- a/progs/demos/Windows/demos.dsw
+++ b/progs/demos/Windows/demos.dsw
@@ -1,782 +1,782 @@
-Microsoft Developer Studio Workspace File, Format Version 6.00
-# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
-
-###############################################################################
-
-Project: "all"=".\all.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name bounce
- End Project Dependency
- Begin Project Dependency
- Project_Dep_Name clearspd
- End Project Dependency
- Begin Project Dependency
- Project_Dep_Name cubemap
- End Project Dependency
- Begin Project Dependency
- Project_Dep_Name drawpix
- End Project Dependency
- Begin Project Dependency
- Project_Dep_Name fire
- End Project Dependency
- Begin Project Dependency
- Project_Dep_Name gears
- End Project Dependency
- Begin Project Dependency
- Project_Dep_Name geartrain
- End Project Dependency
- Begin Project Dependency
- Project_Dep_Name glinfo
- End Project Dependency
- Begin Project Dependency
- Project_Dep_Name gloss
- End Project Dependency
- Begin Project Dependency
- Project_Dep_Name gltestperf
- End Project Dependency
- Begin Project Dependency
- Project_Dep_Name glutfx
- End Project Dependency
- Begin Project Dependency
- Project_Dep_Name ipers
- End Project Dependency
- Begin Project Dependency
- Project_Dep_Name isosurf
- End Project Dependency
- Begin Project Dependency
- Project_Dep_Name lodbias
- End Project Dependency
- Begin Project Dependency
- Project_Dep_Name morph3d
- End Project Dependency
- Begin Project Dependency
- Project_Dep_Name multiarb
- End Project Dependency
- Begin Project Dependency
- Project_Dep_Name occlude
- End Project Dependency
- Begin Project Dependency
- Project_Dep_Name osdemo
- End Project Dependency
- Begin Project Dependency
- Project_Dep_Name paltex
- End Project Dependency
- Begin Project Dependency
- Project_Dep_Name pixeltex
- End Project Dependency
- Begin Project Dependency
- Project_Dep_Name pointblast
- End Project Dependency
- Begin Project Dependency
- Project_Dep_Name rain
- End Project Dependency
- Begin Project Dependency
- Project_Dep_Name ray
- End Project Dependency
- Begin Project Dependency
- Project_Dep_Name readpix
- End Project Dependency
- Begin Project Dependency
- Project_Dep_Name reflect
- End Project Dependency
- Begin Project Dependency
- Project_Dep_Name renormal
- End Project Dependency
- Begin Project Dependency
- Project_Dep_Name shadowtex
- End Project Dependency
- Begin Project Dependency
- Project_Dep_Name spectex
- End Project Dependency
- Begin Project Dependency
- Project_Dep_Name stex3d
- End Project Dependency
- Begin Project Dependency
- Project_Dep_Name teapot
- End Project Dependency
- Begin Project Dependency
- Project_Dep_Name terrain
- End Project Dependency
- Begin Project Dependency
- Project_Dep_Name tessdemo
- End Project Dependency
- Begin Project Dependency
- Project_Dep_Name texcyl
- End Project Dependency
- Begin Project Dependency
- Project_Dep_Name texdown
- End Project Dependency
- Begin Project Dependency
- Project_Dep_Name texenv
- End Project Dependency
- Begin Project Dependency
- Project_Dep_Name texobj
- End Project Dependency
- Begin Project Dependency
- Project_Dep_Name trispd
- End Project Dependency
- Begin Project Dependency
- Project_Dep_Name tunnel
- End Project Dependency
- Begin Project Dependency
- Project_Dep_Name tunnel2
- End Project Dependency
- Begin Project Dependency
- Project_Dep_Name winpos
- End Project Dependency
- Begin Project Dependency
- Project_Dep_Name spriteblast
- End Project Dependency
- Begin Project Dependency
- Project_Dep_Name glut
- End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "bounce"=".\bounce.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name glut
- End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "clearspd"=".\clearspd.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name glut
- End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "cubemap"=".\cubemap.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name glut
- End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "drawpix"=".\drawpix.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name glut
- End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "fire"=".\fire.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name glut
- End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "gears"=".\gears.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name glut
- End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "geartrain"=".\geartrain.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name glut
- End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "glinfo"=".\glinfo.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name glut
- End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "gloss"=".\gloss.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name glut
- End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "gltestperf"=".\gltestperf.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name glut
- End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "glut"="..\..\..\src\glut\glx\glut.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-}}}
-
-###############################################################################
-
-Project: "glutfx"=".\glutfx.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name glut
- End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "ipers"=".\ipers.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name glut
- End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "isosurf"=".\isosurf.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name glut
- End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "lodbias"=".\loadbias.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name glut
- End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "morph3d"=".\morph3d.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name glut
- End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "multiarb"=".\multiarb.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name glut
- End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "occlude"=".\occlude.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name glut
- End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "osdemo"=".\osdemo.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name glut
- End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "paltex"=".\paltex.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name glut
- End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "pixeltex"=".\pixeltex.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name glut
- End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "pointblast"=".\pointblast.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name glut
- End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "rain"=".\rain.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name glut
- End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "ray"=".\ray.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name glut
- End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "readpix"=".\readpix.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name glut
- End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "reflect"=".\reflect.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name glut
- End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "renormal"=".\renormal.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name glut
- End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "shadowtex"=".\shadowtex.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name glut
- End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "spectex"=".\spectex.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name glut
- End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "spriteblast"=".\spriteblast.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name glut
- End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "stex3d"=".\stex3d.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name glut
- End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "teapot"=".\teapot.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name glut
- End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "terrain"=".\terrain.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name glut
- End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "tessdemo"=".\tessdemo.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name glut
- End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "texcyl"=".\texcyl.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name glut
- End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "texdown"=".\texdown.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name glut
- End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "texenv"=".\texenv.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name glut
- End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "texobj"=".\texobj.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name glut
- End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "trispd"=".\trispd.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name glut
- End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "tunnel"=".\tunnel.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name glut
- End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "tunnel2"=".\tunnel2.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name glut
- End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "winpos"=".\winpos.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name glut
- End Project Dependency
-}}}
-
-###############################################################################
-
-Global:
-
-Package=<5>
-{{{
-}}}
-
-Package=<3>
-{{{
-}}}
-
-###############################################################################
-
+Microsoft Developer Studio Workspace File, Format Version 6.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "all"=".\all.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name bounce
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name clearspd
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name cubemap
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name drawpix
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name fire
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name gears
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name geartrain
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name glinfo
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name gloss
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name gltestperf
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name glutfx
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name ipers
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name isosurf
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name lodbias
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name morph3d
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name multiarb
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name occlude
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name osdemo
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name paltex
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name pixeltex
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name pointblast
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name rain
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name ray
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name readpix
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name reflect
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name renormal
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name shadowtex
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name spectex
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name stex3d
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name teapot
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name terrain
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name tessdemo
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name texcyl
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name texdown
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name texenv
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name texobj
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name trispd
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name tunnel
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name tunnel2
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name winpos
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name spriteblast
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name glut
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "bounce"=".\bounce.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name glut
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "clearspd"=".\clearspd.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name glut
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "cubemap"=".\cubemap.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name glut
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "drawpix"=".\drawpix.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name glut
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "fire"=".\fire.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name glut
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "gears"=".\gears.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name glut
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "geartrain"=".\geartrain.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name glut
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "glinfo"=".\glinfo.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name glut
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "gloss"=".\gloss.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name glut
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "gltestperf"=".\gltestperf.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name glut
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "glut"="..\..\..\src\glut\glx\glut.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Project: "glutfx"=".\glutfx.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name glut
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "ipers"=".\ipers.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name glut
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "isosurf"=".\isosurf.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name glut
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "lodbias"=".\loadbias.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name glut
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "morph3d"=".\morph3d.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name glut
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "multiarb"=".\multiarb.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name glut
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "occlude"=".\occlude.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name glut
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "osdemo"=".\osdemo.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name glut
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "paltex"=".\paltex.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name glut
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "pixeltex"=".\pixeltex.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name glut
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "pointblast"=".\pointblast.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name glut
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "rain"=".\rain.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name glut
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "ray"=".\ray.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name glut
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "readpix"=".\readpix.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name glut
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "reflect"=".\reflect.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name glut
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "renormal"=".\renormal.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name glut
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "shadowtex"=".\shadowtex.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name glut
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "spectex"=".\spectex.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name glut
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "spriteblast"=".\spriteblast.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name glut
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "stex3d"=".\stex3d.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name glut
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "teapot"=".\teapot.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name glut
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "terrain"=".\terrain.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name glut
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "tessdemo"=".\tessdemo.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name glut
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "texcyl"=".\texcyl.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name glut
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "texdown"=".\texdown.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name glut
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "texenv"=".\texenv.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name glut
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "texobj"=".\texobj.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name glut
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "trispd"=".\trispd.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name glut
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "tunnel"=".\tunnel.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name glut
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "tunnel2"=".\tunnel2.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name glut
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "winpos"=".\winpos.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name glut
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
diff --git a/progs/demos/Windows/drawpix.dsp b/progs/demos/Windows/drawpix.dsp
index 57003e616b4..f21be177921 100644
--- a/progs/demos/Windows/drawpix.dsp
+++ b/progs/demos/Windows/drawpix.dsp
@@ -1,112 +1,112 @@
-# Microsoft Developer Studio Project File - Name="drawpix" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=drawpix - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "drawpix.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "drawpix.mak" CFG="drawpix - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "drawpix - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "drawpix - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "drawpix - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /W3 /GX /O2 /I "../" /I "../../../include" /I "../../util" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../drawpix.exe"
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ELSEIF "$(CFG)" == "drawpix - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../util" /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../drawpix.exe" /pdbtype:sept
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ENDIF
-
-# Begin Target
-
-# Name "drawpix - Win32 Release"
-# Name "drawpix - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=..\drawpix.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
+# Microsoft Developer Studio Project File - Name="drawpix" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=drawpix - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "drawpix.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "drawpix.mak" CFG="drawpix - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "drawpix - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "drawpix - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "drawpix - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /W3 /GX /O2 /I "../" /I "../../../include" /I "../../util" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../drawpix.exe"
+# Begin Special Build Tool
+SOURCE="$(InputPath)"
+PostBuild_Desc=Copy DLLs
+PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
+# End Special Build Tool
+
+!ELSEIF "$(CFG)" == "drawpix - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../util" /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../drawpix.exe" /pdbtype:sept
+# Begin Special Build Tool
+SOURCE="$(InputPath)"
+PostBuild_Desc=Copy DLLs
+PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
+# End Special Build Tool
+
+!ENDIF
+
+# Begin Target
+
+# Name "drawpix - Win32 Release"
+# Name "drawpix - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=..\drawpix.c
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# End Group
+# End Target
+# End Project
diff --git a/progs/demos/Windows/fire.dsp b/progs/demos/Windows/fire.dsp
index f8a536d3349..9d046a4c6e8 100644
--- a/progs/demos/Windows/fire.dsp
+++ b/progs/demos/Windows/fire.dsp
@@ -1,112 +1,112 @@
-# Microsoft Developer Studio Project File - Name="fire" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=fire - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "fire.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "fire.mak" CFG="fire - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "fire - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "fire - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "fire - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /W3 /GX /O2 /I "../../util" /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../fire.exe"
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ELSEIF "$(CFG)" == "fire - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../util" /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../fire.exe" /pdbtype:sept
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ENDIF
-
-# Begin Target
-
-# Name "fire - Win32 Release"
-# Name "fire - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=..\fire.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
+# Microsoft Developer Studio Project File - Name="fire" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=fire - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "fire.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "fire.mak" CFG="fire - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "fire - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "fire - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "fire - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /W3 /GX /O2 /I "../../util" /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../fire.exe"
+# Begin Special Build Tool
+SOURCE="$(InputPath)"
+PostBuild_Desc=Copy DLLs
+PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
+# End Special Build Tool
+
+!ELSEIF "$(CFG)" == "fire - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../util" /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../fire.exe" /pdbtype:sept
+# Begin Special Build Tool
+SOURCE="$(InputPath)"
+PostBuild_Desc=Copy DLLs
+PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
+# End Special Build Tool
+
+!ENDIF
+
+# Begin Target
+
+# Name "fire - Win32 Release"
+# Name "fire - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=..\fire.c
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# End Group
+# End Target
+# End Project
diff --git a/progs/demos/Windows/gears.dsp b/progs/demos/Windows/gears.dsp
index 43a588dc68d..2cf6b1a8260 100644
--- a/progs/demos/Windows/gears.dsp
+++ b/progs/demos/Windows/gears.dsp
@@ -1,112 +1,112 @@
-# Microsoft Developer Studio Project File - Name="gears" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=gears - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "gears.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "gears.mak" CFG="gears - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "gears - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "gears - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "gears - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /W3 /GX /O2 /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../gears.exe"
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ELSEIF "$(CFG)" == "gears - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../gears.exe" /pdbtype:sept
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ENDIF
-
-# Begin Target
-
-# Name "gears - Win32 Release"
-# Name "gears - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=..\gears.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
+# Microsoft Developer Studio Project File - Name="gears" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=gears - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "gears.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "gears.mak" CFG="gears - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "gears - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "gears - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "gears - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /W3 /GX /O2 /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../gears.exe"
+# Begin Special Build Tool
+SOURCE="$(InputPath)"
+PostBuild_Desc=Copy DLLs
+PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
+# End Special Build Tool
+
+!ELSEIF "$(CFG)" == "gears - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../gears.exe" /pdbtype:sept
+# Begin Special Build Tool
+SOURCE="$(InputPath)"
+PostBuild_Desc=Copy DLLs
+PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
+# End Special Build Tool
+
+!ENDIF
+
+# Begin Target
+
+# Name "gears - Win32 Release"
+# Name "gears - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=..\gears.c
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# End Group
+# End Target
+# End Project
diff --git a/progs/demos/Windows/geartrain.dsp b/progs/demos/Windows/geartrain.dsp
index 8dee77de4d5..f3e499fea0b 100644
--- a/progs/demos/Windows/geartrain.dsp
+++ b/progs/demos/Windows/geartrain.dsp
@@ -1,112 +1,112 @@
-# Microsoft Developer Studio Project File - Name="geartrain" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=geartrain - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "geartrain.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "geartrain.mak" CFG="geartrain - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "geartrain - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "geartrain - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "geartrain - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /W3 /GX /O2 /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../geartrain.exe"
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ELSEIF "$(CFG)" == "geartrain - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../geartrain.exe" /pdbtype:sept
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ENDIF
-
-# Begin Target
-
-# Name "geartrain - Win32 Release"
-# Name "geartrain - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=..\geartrain.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
+# Microsoft Developer Studio Project File - Name="geartrain" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=geartrain - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "geartrain.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "geartrain.mak" CFG="geartrain - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "geartrain - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "geartrain - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "geartrain - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /W3 /GX /O2 /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../geartrain.exe"
+# Begin Special Build Tool
+SOURCE="$(InputPath)"
+PostBuild_Desc=Copy DLLs
+PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
+# End Special Build Tool
+
+!ELSEIF "$(CFG)" == "geartrain - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../geartrain.exe" /pdbtype:sept
+# Begin Special Build Tool
+SOURCE="$(InputPath)"
+PostBuild_Desc=Copy DLLs
+PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
+# End Special Build Tool
+
+!ENDIF
+
+# Begin Target
+
+# Name "geartrain - Win32 Release"
+# Name "geartrain - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=..\geartrain.c
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# End Group
+# End Target
+# End Project
diff --git a/progs/demos/Windows/glinfo.dsp b/progs/demos/Windows/glinfo.dsp
index d9d61eb424d..7a2c65a0d1e 100644
--- a/progs/demos/Windows/glinfo.dsp
+++ b/progs/demos/Windows/glinfo.dsp
@@ -1,112 +1,112 @@
-# Microsoft Developer Studio Project File - Name="glinfo" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=glinfo - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "glinfo.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "glinfo.mak" CFG="glinfo - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "glinfo - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "glinfo - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "glinfo - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /W3 /GX /O2 /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../glinfo.exe"
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ELSEIF "$(CFG)" == "glinfo - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../glinfo.exe" /pdbtype:sept
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ENDIF
-
-# Begin Target
-
-# Name "glinfo - Win32 Release"
-# Name "glinfo - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=..\glinfo.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
+# Microsoft Developer Studio Project File - Name="glinfo" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=glinfo - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "glinfo.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "glinfo.mak" CFG="glinfo - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "glinfo - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "glinfo - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "glinfo - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /W3 /GX /O2 /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../glinfo.exe"
+# Begin Special Build Tool
+SOURCE="$(InputPath)"
+PostBuild_Desc=Copy DLLs
+PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
+# End Special Build Tool
+
+!ELSEIF "$(CFG)" == "glinfo - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../glinfo.exe" /pdbtype:sept
+# Begin Special Build Tool
+SOURCE="$(InputPath)"
+PostBuild_Desc=Copy DLLs
+PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
+# End Special Build Tool
+
+!ENDIF
+
+# Begin Target
+
+# Name "glinfo - Win32 Release"
+# Name "glinfo - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=..\glinfo.c
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# End Group
+# End Target
+# End Project
diff --git a/progs/demos/Windows/gloss.dsp b/progs/demos/Windows/gloss.dsp
index 402d291f4dc..9a6edd79b1c 100644
--- a/progs/demos/Windows/gloss.dsp
+++ b/progs/demos/Windows/gloss.dsp
@@ -1,112 +1,112 @@
-# Microsoft Developer Studio Project File - Name="gloss" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=gloss - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "gloss.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "gloss.mak" CFG="gloss - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "gloss - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "gloss - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "gloss - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /W3 /GX /O2 /I "../../util" /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../gloss.exe"
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ELSEIF "$(CFG)" == "gloss - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../util" /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../gloss.exe" /pdbtype:sept
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ENDIF
-
-# Begin Target
-
-# Name "gloss - Win32 Release"
-# Name "gloss - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=..\gloss.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
+# Microsoft Developer Studio Project File - Name="gloss" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=gloss - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "gloss.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "gloss.mak" CFG="gloss - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "gloss - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "gloss - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "gloss - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /W3 /GX /O2 /I "../../util" /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../gloss.exe"
+# Begin Special Build Tool
+SOURCE="$(InputPath)"
+PostBuild_Desc=Copy DLLs
+PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
+# End Special Build Tool
+
+!ELSEIF "$(CFG)" == "gloss - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../util" /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../gloss.exe" /pdbtype:sept
+# Begin Special Build Tool
+SOURCE="$(InputPath)"
+PostBuild_Desc=Copy DLLs
+PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
+# End Special Build Tool
+
+!ENDIF
+
+# Begin Target
+
+# Name "gloss - Win32 Release"
+# Name "gloss - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=..\gloss.c
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# End Group
+# End Target
+# End Project
diff --git a/progs/demos/Windows/gltestperf.dsp b/progs/demos/Windows/gltestperf.dsp
index e5066201522..e3d8df6b983 100644
--- a/progs/demos/Windows/gltestperf.dsp
+++ b/progs/demos/Windows/gltestperf.dsp
@@ -1,112 +1,112 @@
-# Microsoft Developer Studio Project File - Name="gltestperf" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=gltestperf - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "gltestperf.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "gltestperf.mak" CFG="gltestperf - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "gltestperf - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "gltestperf - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "gltestperf - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /W3 /GX /O2 /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../gltestperf.exe"
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ELSEIF "$(CFG)" == "gltestperf - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../gltestperf.exe" /pdbtype:sept
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ENDIF
-
-# Begin Target
-
-# Name "gltestperf - Win32 Release"
-# Name "gltestperf - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=..\gltestperf.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
+# Microsoft Developer Studio Project File - Name="gltestperf" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=gltestperf - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "gltestperf.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "gltestperf.mak" CFG="gltestperf - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "gltestperf - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "gltestperf - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "gltestperf - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /W3 /GX /O2 /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../gltestperf.exe"
+# Begin Special Build Tool
+SOURCE="$(InputPath)"
+PostBuild_Desc=Copy DLLs
+PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
+# End Special Build Tool
+
+!ELSEIF "$(CFG)" == "gltestperf - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../gltestperf.exe" /pdbtype:sept
+# Begin Special Build Tool
+SOURCE="$(InputPath)"
+PostBuild_Desc=Copy DLLs
+PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
+# End Special Build Tool
+
+!ENDIF
+
+# Begin Target
+
+# Name "gltestperf - Win32 Release"
+# Name "gltestperf - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=..\gltestperf.c
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# End Group
+# End Target
+# End Project
diff --git a/progs/demos/Windows/glutfx.dsp b/progs/demos/Windows/glutfx.dsp
index 90eca930d22..39bc8574af8 100644
--- a/progs/demos/Windows/glutfx.dsp
+++ b/progs/demos/Windows/glutfx.dsp
@@ -1,112 +1,112 @@
-# Microsoft Developer Studio Project File - Name="glutfx" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=glutfx - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "glutfx.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "glutfx.mak" CFG="glutfx - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "glutfx - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "glutfx - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "glutfx - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /W3 /GX /O2 /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../glutfx.exe"
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ELSEIF "$(CFG)" == "glutfx - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../glutfx.exe" /pdbtype:sept
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ENDIF
-
-# Begin Target
-
-# Name "glutfx - Win32 Release"
-# Name "glutfx - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=..\glutfx.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
+# Microsoft Developer Studio Project File - Name="glutfx" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=glutfx - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "glutfx.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "glutfx.mak" CFG="glutfx - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "glutfx - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "glutfx - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "glutfx - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /W3 /GX /O2 /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../glutfx.exe"
+# Begin Special Build Tool
+SOURCE="$(InputPath)"
+PostBuild_Desc=Copy DLLs
+PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
+# End Special Build Tool
+
+!ELSEIF "$(CFG)" == "glutfx - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../glutfx.exe" /pdbtype:sept
+# Begin Special Build Tool
+SOURCE="$(InputPath)"
+PostBuild_Desc=Copy DLLs
+PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
+# End Special Build Tool
+
+!ENDIF
+
+# Begin Target
+
+# Name "glutfx - Win32 Release"
+# Name "glutfx - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=..\glutfx.c
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# End Group
+# End Target
+# End Project
diff --git a/progs/demos/Windows/ipers.dsp b/progs/demos/Windows/ipers.dsp
index 430f1b6258d..b5ccb82afb0 100644
--- a/progs/demos/Windows/ipers.dsp
+++ b/progs/demos/Windows/ipers.dsp
@@ -1,112 +1,112 @@
-# Microsoft Developer Studio Project File - Name="ipers" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=ipers - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "ipers.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "ipers.mak" CFG="ipers - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "ipers - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "ipers - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "ipers - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /W3 /GX /O2 /I "../../util" /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../ipers.exe"
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ELSEIF "$(CFG)" == "ipers - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../util" /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../ipers.exe" /pdbtype:sept
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ENDIF
-
-# Begin Target
-
-# Name "ipers - Win32 Release"
-# Name "ipers - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=..\ipers.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
+# Microsoft Developer Studio Project File - Name="ipers" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=ipers - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "ipers.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "ipers.mak" CFG="ipers - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "ipers - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "ipers - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "ipers - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /W3 /GX /O2 /I "../../util" /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../ipers.exe"
+# Begin Special Build Tool
+SOURCE="$(InputPath)"
+PostBuild_Desc=Copy DLLs
+PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
+# End Special Build Tool
+
+!ELSEIF "$(CFG)" == "ipers - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../util" /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../ipers.exe" /pdbtype:sept
+# Begin Special Build Tool
+SOURCE="$(InputPath)"
+PostBuild_Desc=Copy DLLs
+PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
+# End Special Build Tool
+
+!ENDIF
+
+# Begin Target
+
+# Name "ipers - Win32 Release"
+# Name "ipers - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=..\ipers.c
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# End Group
+# End Target
+# End Project
diff --git a/progs/demos/Windows/isosurf.dsp b/progs/demos/Windows/isosurf.dsp
index 1c59d40081e..5a112d457b8 100644
--- a/progs/demos/Windows/isosurf.dsp
+++ b/progs/demos/Windows/isosurf.dsp
@@ -1,112 +1,112 @@
-# Microsoft Developer Studio Project File - Name="isosurf" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=isosurf - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "isosurf.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "isosurf.mak" CFG="isosurf - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "isosurf - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "isosurf - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "isosurf - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /W3 /GX /O2 /I "../../util" /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../isosurf.exe"
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ELSEIF "$(CFG)" == "isosurf - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../util" /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../isosurf.exe" /pdbtype:sept
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ENDIF
-
-# Begin Target
-
-# Name "isosurf - Win32 Release"
-# Name "isosurf - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=..\isosurf.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
+# Microsoft Developer Studio Project File - Name="isosurf" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=isosurf - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "isosurf.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "isosurf.mak" CFG="isosurf - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "isosurf - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "isosurf - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "isosurf - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /W3 /GX /O2 /I "../../util" /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../isosurf.exe"
+# Begin Special Build Tool
+SOURCE="$(InputPath)"
+PostBuild_Desc=Copy DLLs
+PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
+# End Special Build Tool
+
+!ELSEIF "$(CFG)" == "isosurf - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../util" /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../isosurf.exe" /pdbtype:sept
+# Begin Special Build Tool
+SOURCE="$(InputPath)"
+PostBuild_Desc=Copy DLLs
+PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
+# End Special Build Tool
+
+!ENDIF
+
+# Begin Target
+
+# Name "isosurf - Win32 Release"
+# Name "isosurf - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=..\isosurf.c
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# End Group
+# End Target
+# End Project
diff --git a/progs/demos/Windows/loadbias.dsp b/progs/demos/Windows/loadbias.dsp
index ed51960e493..b7cfb5efcb3 100644
--- a/progs/demos/Windows/loadbias.dsp
+++ b/progs/demos/Windows/loadbias.dsp
@@ -1,112 +1,112 @@
-# Microsoft Developer Studio Project File - Name="lodbias" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=lodbias - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "lodbias.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "lodbias.mak" CFG="lodbias - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "lodbias - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "lodbias - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "lodbias - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /W3 /GX /O2 /I "../../util" /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../lodbias.exe"
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ELSEIF "$(CFG)" == "lodbias - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../util" /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../lodbias.exe" /pdbtype:sept
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ENDIF
-
-# Begin Target
-
-# Name "lodbias - Win32 Release"
-# Name "lodbias - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=..\lodbias.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
+# Microsoft Developer Studio Project File - Name="lodbias" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=lodbias - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "lodbias.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "lodbias.mak" CFG="lodbias - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "lodbias - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "lodbias - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "lodbias - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /W3 /GX /O2 /I "../../util" /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../lodbias.exe"
+# Begin Special Build Tool
+SOURCE="$(InputPath)"
+PostBuild_Desc=Copy DLLs
+PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
+# End Special Build Tool
+
+!ELSEIF "$(CFG)" == "lodbias - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../util" /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../lodbias.exe" /pdbtype:sept
+# Begin Special Build Tool
+SOURCE="$(InputPath)"
+PostBuild_Desc=Copy DLLs
+PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
+# End Special Build Tool
+
+!ENDIF
+
+# Begin Target
+
+# Name "lodbias - Win32 Release"
+# Name "lodbias - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=..\lodbias.c
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# End Group
+# End Target
+# End Project
diff --git a/progs/demos/Windows/morph3d.dsp b/progs/demos/Windows/morph3d.dsp
index 247dbf03d7a..05f7fea51a3 100644
--- a/progs/demos/Windows/morph3d.dsp
+++ b/progs/demos/Windows/morph3d.dsp
@@ -1,112 +1,112 @@
-# Microsoft Developer Studio Project File - Name="morph3d" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=morph3d - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "morph3d.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "morph3d.mak" CFG="morph3d - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "morph3d - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "morph3d - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "morph3d - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /W3 /GX /O2 /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../morph3d.exe"
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ELSEIF "$(CFG)" == "morph3d - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../morph3d.exe" /pdbtype:sept
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ENDIF
-
-# Begin Target
-
-# Name "morph3d - Win32 Release"
-# Name "morph3d - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=..\morph3d.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
+# Microsoft Developer Studio Project File - Name="morph3d" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=morph3d - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "morph3d.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "morph3d.mak" CFG="morph3d - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "morph3d - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "morph3d - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "morph3d - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /W3 /GX /O2 /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../morph3d.exe"
+# Begin Special Build Tool
+SOURCE="$(InputPath)"
+PostBuild_Desc=Copy DLLs
+PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
+# End Special Build Tool
+
+!ELSEIF "$(CFG)" == "morph3d - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../morph3d.exe" /pdbtype:sept
+# Begin Special Build Tool
+SOURCE="$(InputPath)"
+PostBuild_Desc=Copy DLLs
+PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
+# End Special Build Tool
+
+!ENDIF
+
+# Begin Target
+
+# Name "morph3d - Win32 Release"
+# Name "morph3d - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=..\morph3d.c
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# End Group
+# End Target
+# End Project
diff --git a/progs/demos/Windows/multiarb.dsp b/progs/demos/Windows/multiarb.dsp
index 57c32deb294..ff13579a41f 100644
--- a/progs/demos/Windows/multiarb.dsp
+++ b/progs/demos/Windows/multiarb.dsp
@@ -1,112 +1,112 @@
-# Microsoft Developer Studio Project File - Name="multiarb" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=multiarb - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "multiarb.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "multiarb.mak" CFG="multiarb - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "multiarb - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "multiarb - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "multiarb - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /W3 /GX /O2 /I "../../util" /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../multiarb.exe"
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ELSEIF "$(CFG)" == "multiarb - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../util" /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../multiarb.exe" /pdbtype:sept
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ENDIF
-
-# Begin Target
-
-# Name "multiarb - Win32 Release"
-# Name "multiarb - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=..\multiarb.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
+# Microsoft Developer Studio Project File - Name="multiarb" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=multiarb - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "multiarb.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "multiarb.mak" CFG="multiarb - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "multiarb - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "multiarb - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "multiarb - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /W3 /GX /O2 /I "../../util" /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../multiarb.exe"
+# Begin Special Build Tool
+SOURCE="$(InputPath)"
+PostBuild_Desc=Copy DLLs
+PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
+# End Special Build Tool
+
+!ELSEIF "$(CFG)" == "multiarb - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../util" /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../multiarb.exe" /pdbtype:sept
+# Begin Special Build Tool
+SOURCE="$(InputPath)"
+PostBuild_Desc=Copy DLLs
+PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
+# End Special Build Tool
+
+!ENDIF
+
+# Begin Target
+
+# Name "multiarb - Win32 Release"
+# Name "multiarb - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=..\multiarb.c
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# End Group
+# End Target
+# End Project
diff --git a/progs/demos/Windows/occlude.dsp b/progs/demos/Windows/occlude.dsp
index ca4afa579e1..98723303d96 100644
--- a/progs/demos/Windows/occlude.dsp
+++ b/progs/demos/Windows/occlude.dsp
@@ -1,112 +1,112 @@
-# Microsoft Developer Studio Project File - Name="occlude" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=occlude - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "occlude.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "occlude.mak" CFG="occlude - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "occlude - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "occlude - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "occlude - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /W3 /GX /O2 /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../occlude.exe"
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ELSEIF "$(CFG)" == "occlude - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../occlude.exe" /pdbtype:sept
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ENDIF
-
-# Begin Target
-
-# Name "occlude - Win32 Release"
-# Name "occlude - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=..\occlude.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
+# Microsoft Developer Studio Project File - Name="occlude" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=occlude - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "occlude.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "occlude.mak" CFG="occlude - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "occlude - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "occlude - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "occlude - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /W3 /GX /O2 /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../occlude.exe"
+# Begin Special Build Tool
+SOURCE="$(InputPath)"
+PostBuild_Desc=Copy DLLs
+PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
+# End Special Build Tool
+
+!ELSEIF "$(CFG)" == "occlude - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../occlude.exe" /pdbtype:sept
+# Begin Special Build Tool
+SOURCE="$(InputPath)"
+PostBuild_Desc=Copy DLLs
+PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
+# End Special Build Tool
+
+!ENDIF
+
+# Begin Target
+
+# Name "occlude - Win32 Release"
+# Name "occlude - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=..\occlude.c
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# End Group
+# End Target
+# End Project
diff --git a/progs/demos/Windows/osdemo.dsp b/progs/demos/Windows/osdemo.dsp
index ccaa6d2b42a..2d1d437f71d 100644
--- a/progs/demos/Windows/osdemo.dsp
+++ b/progs/demos/Windows/osdemo.dsp
@@ -1,112 +1,112 @@
-# Microsoft Developer Studio Project File - Name="osdemo" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=osdemo - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "osdemo.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "osdemo.mak" CFG="osdemo - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "osdemo - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "osdemo - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "osdemo - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /W3 /GX /O2 /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB ../../../lib/OSMESA32.LIB /nologo /subsystem:console /machine:I386 /out:"../osdemo.exe"
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ELSEIF "$(CFG)" == "osdemo - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB ../../../lib/OSMESA32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../osdemo.exe" /pdbtype:sept
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ENDIF
-
-# Begin Target
-
-# Name "osdemo - Win32 Release"
-# Name "osdemo - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=..\osdemo.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
+# Microsoft Developer Studio Project File - Name="osdemo" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=osdemo - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "osdemo.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "osdemo.mak" CFG="osdemo - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "osdemo - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "osdemo - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "osdemo - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /W3 /GX /O2 /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB ../../../lib/OSMESA32.LIB /nologo /subsystem:console /machine:I386 /out:"../osdemo.exe"
+# Begin Special Build Tool
+SOURCE="$(InputPath)"
+PostBuild_Desc=Copy DLLs
+PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
+# End Special Build Tool
+
+!ELSEIF "$(CFG)" == "osdemo - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB ../../../lib/OSMESA32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../osdemo.exe" /pdbtype:sept
+# Begin Special Build Tool
+SOURCE="$(InputPath)"
+PostBuild_Desc=Copy DLLs
+PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
+# End Special Build Tool
+
+!ENDIF
+
+# Begin Target
+
+# Name "osdemo - Win32 Release"
+# Name "osdemo - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=..\osdemo.c
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# End Group
+# End Target
+# End Project
diff --git a/progs/demos/Windows/paltex.dsp b/progs/demos/Windows/paltex.dsp
index efc63842115..6f43ff97cd2 100644
--- a/progs/demos/Windows/paltex.dsp
+++ b/progs/demos/Windows/paltex.dsp
@@ -1,112 +1,112 @@
-# Microsoft Developer Studio Project File - Name="paltex" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=paltex - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "paltex.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "paltex.mak" CFG="paltex - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "paltex - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "paltex - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "paltex - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /W3 /GX /O2 /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../paltex.exe"
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ELSEIF "$(CFG)" == "paltex - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../paltex.exe" /pdbtype:sept
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ENDIF
-
-# Begin Target
-
-# Name "paltex - Win32 Release"
-# Name "paltex - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=..\paltex.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
+# Microsoft Developer Studio Project File - Name="paltex" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=paltex - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "paltex.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "paltex.mak" CFG="paltex - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "paltex - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "paltex - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "paltex - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /W3 /GX /O2 /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../paltex.exe"
+# Begin Special Build Tool
+SOURCE="$(InputPath)"
+PostBuild_Desc=Copy DLLs
+PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
+# End Special Build Tool
+
+!ELSEIF "$(CFG)" == "paltex - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../paltex.exe" /pdbtype:sept
+# Begin Special Build Tool
+SOURCE="$(InputPath)"
+PostBuild_Desc=Copy DLLs
+PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
+# End Special Build Tool
+
+!ENDIF
+
+# Begin Target
+
+# Name "paltex - Win32 Release"
+# Name "paltex - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=..\paltex.c
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# End Group
+# End Target
+# End Project
diff --git a/progs/demos/Windows/pixeltex.dsp b/progs/demos/Windows/pixeltex.dsp
index d09f9f312cb..d6e66c821af 100644
--- a/progs/demos/Windows/pixeltex.dsp
+++ b/progs/demos/Windows/pixeltex.dsp
@@ -1,112 +1,112 @@
-# Microsoft Developer Studio Project File - Name="pixeltex" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=pixeltex - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "pixeltex.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "pixeltex.mak" CFG="pixeltex - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "pixeltex - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "pixeltex - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "pixeltex - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /W3 /GX /O2 /I "../../util" /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../pixeltex.exe"
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ELSEIF "$(CFG)" == "pixeltex - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../util" /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../pixeltex.exe" /pdbtype:sept
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ENDIF
-
-# Begin Target
-
-# Name "pixeltex - Win32 Release"
-# Name "pixeltex - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=..\pixeltex.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
+# Microsoft Developer Studio Project File - Name="pixeltex" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=pixeltex - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "pixeltex.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "pixeltex.mak" CFG="pixeltex - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "pixeltex - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "pixeltex - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "pixeltex - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /W3 /GX /O2 /I "../../util" /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../pixeltex.exe"
+# Begin Special Build Tool
+SOURCE="$(InputPath)"
+PostBuild_Desc=Copy DLLs
+PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
+# End Special Build Tool
+
+!ELSEIF "$(CFG)" == "pixeltex - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../util" /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../pixeltex.exe" /pdbtype:sept
+# Begin Special Build Tool
+SOURCE="$(InputPath)"
+PostBuild_Desc=Copy DLLs
+PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
+# End Special Build Tool
+
+!ENDIF
+
+# Begin Target
+
+# Name "pixeltex - Win32 Release"
+# Name "pixeltex - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=..\pixeltex.c
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# End Group
+# End Target
+# End Project
diff --git a/progs/demos/Windows/pointblast.dsp b/progs/demos/Windows/pointblast.dsp
index 7be695839fa..0c6f26ca026 100644
--- a/progs/demos/Windows/pointblast.dsp
+++ b/progs/demos/Windows/pointblast.dsp
@@ -1,112 +1,112 @@
-# Microsoft Developer Studio Project File - Name="pointblast" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=pointblast - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "pointblast.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "pointblast.mak" CFG="pointblast - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "pointblast - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "pointblast - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "pointblast - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /W3 /GX /O2 /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../pointblast.exe"
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ELSEIF "$(CFG)" == "pointblast - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../pointblast.exe" /pdbtype:sept
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ENDIF
-
-# Begin Target
-
-# Name "pointblast - Win32 Release"
-# Name "pointblast - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=..\pointblast.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
+# Microsoft Developer Studio Project File - Name="pointblast" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=pointblast - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "pointblast.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "pointblast.mak" CFG="pointblast - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "pointblast - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "pointblast - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "pointblast - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /W3 /GX /O2 /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../pointblast.exe"
+# Begin Special Build Tool
+SOURCE="$(InputPath)"
+PostBuild_Desc=Copy DLLs
+PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
+# End Special Build Tool
+
+!ELSEIF "$(CFG)" == "pointblast - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../pointblast.exe" /pdbtype:sept
+# Begin Special Build Tool
+SOURCE="$(InputPath)"
+PostBuild_Desc=Copy DLLs
+PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
+# End Special Build Tool
+
+!ENDIF
+
+# Begin Target
+
+# Name "pointblast - Win32 Release"
+# Name "pointblast - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=..\pointblast.c
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# End Group
+# End Target
+# End Project
diff --git a/progs/demos/Windows/rain.dsp b/progs/demos/Windows/rain.dsp
index 7e380e66aaf..63102f13a54 100644
--- a/progs/demos/Windows/rain.dsp
+++ b/progs/demos/Windows/rain.dsp
@@ -1,112 +1,112 @@
-# Microsoft Developer Studio Project File - Name="rain" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=rain - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "rain.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "rain.mak" CFG="rain - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "rain - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "rain - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "rain - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /W3 /GX /O2 /I "../../util" /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../rain.exe"
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ELSEIF "$(CFG)" == "rain - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../util" /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../rain.exe" /pdbtype:sept
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ENDIF
-
-# Begin Target
-
-# Name "rain - Win32 Release"
-# Name "rain - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=..\rain.cxx
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
+# Microsoft Developer Studio Project File - Name="rain" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=rain - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "rain.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "rain.mak" CFG="rain - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "rain - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "rain - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "rain - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /W3 /GX /O2 /I "../../util" /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../rain.exe"
+# Begin Special Build Tool
+SOURCE="$(InputPath)"
+PostBuild_Desc=Copy DLLs
+PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
+# End Special Build Tool
+
+!ELSEIF "$(CFG)" == "rain - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../util" /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../rain.exe" /pdbtype:sept
+# Begin Special Build Tool
+SOURCE="$(InputPath)"
+PostBuild_Desc=Copy DLLs
+PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
+# End Special Build Tool
+
+!ENDIF
+
+# Begin Target
+
+# Name "rain - Win32 Release"
+# Name "rain - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=..\rain.cxx
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# End Group
+# End Target
+# End Project
diff --git a/progs/demos/Windows/ray.dsp b/progs/demos/Windows/ray.dsp
index dfa26e7755c..425d4eb2581 100644
--- a/progs/demos/Windows/ray.dsp
+++ b/progs/demos/Windows/ray.dsp
@@ -1,112 +1,112 @@
-# Microsoft Developer Studio Project File - Name="ray" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=ray - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "ray.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "ray.mak" CFG="ray - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "ray - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "ray - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "ray - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /W3 /GX /O2 /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../ray.exe"
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ELSEIF "$(CFG)" == "ray - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../ray.exe" /pdbtype:sept
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ENDIF
-
-# Begin Target
-
-# Name "ray - Win32 Release"
-# Name "ray - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=..\ray.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
+# Microsoft Developer Studio Project File - Name="ray" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=ray - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "ray.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "ray.mak" CFG="ray - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "ray - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "ray - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "ray - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /W3 /GX /O2 /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../ray.exe"
+# Begin Special Build Tool
+SOURCE="$(InputPath)"
+PostBuild_Desc=Copy DLLs
+PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
+# End Special Build Tool
+
+!ELSEIF "$(CFG)" == "ray - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../ray.exe" /pdbtype:sept
+# Begin Special Build Tool
+SOURCE="$(InputPath)"
+PostBuild_Desc=Copy DLLs
+PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
+# End Special Build Tool
+
+!ENDIF
+
+# Begin Target
+
+# Name "ray - Win32 Release"
+# Name "ray - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=..\ray.c
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# End Group
+# End Target
+# End Project
diff --git a/progs/demos/Windows/readpix.dsp b/progs/demos/Windows/readpix.dsp
index 8097d10625b..ca0b30b6042 100644
--- a/progs/demos/Windows/readpix.dsp
+++ b/progs/demos/Windows/readpix.dsp
@@ -1,112 +1,112 @@
-# Microsoft Developer Studio Project File - Name="readpix" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=readpix - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "readpix.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "readpix.mak" CFG="readpix - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "readpix - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "readpix - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "readpix - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /W3 /GX /O2 /I "../../util" /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../readpix.exe"
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ELSEIF "$(CFG)" == "readpix - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../util" /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../readpix.exe" /pdbtype:sept
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ENDIF
-
-# Begin Target
-
-# Name "readpix - Win32 Release"
-# Name "readpix - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=..\readpix.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
+# Microsoft Developer Studio Project File - Name="readpix" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=readpix - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "readpix.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "readpix.mak" CFG="readpix - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "readpix - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "readpix - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "readpix - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /W3 /GX /O2 /I "../../util" /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../readpix.exe"
+# Begin Special Build Tool
+SOURCE="$(InputPath)"
+PostBuild_Desc=Copy DLLs
+PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
+# End Special Build Tool
+
+!ELSEIF "$(CFG)" == "readpix - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../util" /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../readpix.exe" /pdbtype:sept
+# Begin Special Build Tool
+SOURCE="$(InputPath)"
+PostBuild_Desc=Copy DLLs
+PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
+# End Special Build Tool
+
+!ENDIF
+
+# Begin Target
+
+# Name "readpix - Win32 Release"
+# Name "readpix - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=..\readpix.c
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# End Group
+# End Target
+# End Project
diff --git a/progs/demos/Windows/reflect.dsp b/progs/demos/Windows/reflect.dsp
index fa09700afe2..74f411a47e9 100644
--- a/progs/demos/Windows/reflect.dsp
+++ b/progs/demos/Windows/reflect.dsp
@@ -1,112 +1,112 @@
-# Microsoft Developer Studio Project File - Name="reflect" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=reflect - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "reflect.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "reflect.mak" CFG="reflect - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "reflect - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "reflect - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "reflect - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /W3 /GX /O2 /I "../../util" /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../reflect.exe"
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ELSEIF "$(CFG)" == "reflect - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../util" /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../reflect.exe" /pdbtype:sept
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ENDIF
-
-# Begin Target
-
-# Name "reflect - Win32 Release"
-# Name "reflect - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=..\reflect.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
+# Microsoft Developer Studio Project File - Name="reflect" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=reflect - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "reflect.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "reflect.mak" CFG="reflect - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "reflect - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "reflect - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "reflect - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /W3 /GX /O2 /I "../../util" /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../reflect.exe"
+# Begin Special Build Tool
+SOURCE="$(InputPath)"
+PostBuild_Desc=Copy DLLs
+PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
+# End Special Build Tool
+
+!ELSEIF "$(CFG)" == "reflect - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../util" /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../reflect.exe" /pdbtype:sept
+# Begin Special Build Tool
+SOURCE="$(InputPath)"
+PostBuild_Desc=Copy DLLs
+PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
+# End Special Build Tool
+
+!ENDIF
+
+# Begin Target
+
+# Name "reflect - Win32 Release"
+# Name "reflect - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=..\reflect.c
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# End Group
+# End Target
+# End Project
diff --git a/progs/demos/Windows/renormal.dsp b/progs/demos/Windows/renormal.dsp
index 4d72e88d8ed..e0059002b36 100644
--- a/progs/demos/Windows/renormal.dsp
+++ b/progs/demos/Windows/renormal.dsp
@@ -1,112 +1,112 @@
-# Microsoft Developer Studio Project File - Name="renormal" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=renormal - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "renormal.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "renormal.mak" CFG="bounce - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "renormal - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "renormal - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "renormal - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /W3 /GX /O2 /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../renormal.exe"
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ELSEIF "$(CFG)" == "renormal - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../renormal.exe" /pdbtype:sept
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ENDIF
-
-# Begin Target
-
-# Name "renormal - Win32 Release"
-# Name "renormal - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=..\renormal.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
+# Microsoft Developer Studio Project File - Name="renormal" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=renormal - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "renormal.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "renormal.mak" CFG="bounce - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "renormal - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "renormal - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "renormal - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /W3 /GX /O2 /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../renormal.exe"
+# Begin Special Build Tool
+SOURCE="$(InputPath)"
+PostBuild_Desc=Copy DLLs
+PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
+# End Special Build Tool
+
+!ELSEIF "$(CFG)" == "renormal - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../renormal.exe" /pdbtype:sept
+# Begin Special Build Tool
+SOURCE="$(InputPath)"
+PostBuild_Desc=Copy DLLs
+PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
+# End Special Build Tool
+
+!ENDIF
+
+# Begin Target
+
+# Name "renormal - Win32 Release"
+# Name "renormal - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=..\renormal.c
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# End Group
+# End Target
+# End Project
diff --git a/progs/demos/Windows/shadowtex.dsp b/progs/demos/Windows/shadowtex.dsp
index 419ec241386..2618431ae14 100644
--- a/progs/demos/Windows/shadowtex.dsp
+++ b/progs/demos/Windows/shadowtex.dsp
@@ -1,112 +1,112 @@
-# Microsoft Developer Studio Project File - Name="shadowtex" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=shadowtex - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "shadowtex.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "shadowtex.mak" CFG="bounce - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "shadowtex - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "shadowtex - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "shadowtex - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /W3 /GX /O2 /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../shadowtex.exe"
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ELSEIF "$(CFG)" == "shadowtex - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../shadowtex.exe" /pdbtype:sept
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ENDIF
-
-# Begin Target
-
-# Name "shadowtex - Win32 Release"
-# Name "shadowtex - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=..\shadowtex.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
+# Microsoft Developer Studio Project File - Name="shadowtex" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=shadowtex - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "shadowtex.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "shadowtex.mak" CFG="bounce - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "shadowtex - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "shadowtex - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "shadowtex - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /W3 /GX /O2 /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../shadowtex.exe"
+# Begin Special Build Tool
+SOURCE="$(InputPath)"
+PostBuild_Desc=Copy DLLs
+PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
+# End Special Build Tool
+
+!ELSEIF "$(CFG)" == "shadowtex - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../shadowtex.exe" /pdbtype:sept
+# Begin Special Build Tool
+SOURCE="$(InputPath)"
+PostBuild_Desc=Copy DLLs
+PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
+# End Special Build Tool
+
+!ENDIF
+
+# Begin Target
+
+# Name "shadowtex - Win32 Release"
+# Name "shadowtex - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=..\shadowtex.c
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# End Group
+# End Target
+# End Project
diff --git a/progs/demos/Windows/spectex.dsp b/progs/demos/Windows/spectex.dsp
index d1960b3d139..9d385b2dc74 100644
--- a/progs/demos/Windows/spectex.dsp
+++ b/progs/demos/Windows/spectex.dsp
@@ -1,112 +1,112 @@
-# Microsoft Developer Studio Project File - Name="spectex" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=spectex - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "spectex.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "spectex.mak" CFG="bounce - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "spectex - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "spectex - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "spectex - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /W3 /GX /O2 /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../spectex.exe"
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ELSEIF "$(CFG)" == "spectex - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../spectex.exe" /pdbtype:sept
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ENDIF
-
-# Begin Target
-
-# Name "spectex - Win32 Release"
-# Name "spectex - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=..\spectex.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
+# Microsoft Developer Studio Project File - Name="spectex" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=spectex - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "spectex.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "spectex.mak" CFG="bounce - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "spectex - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "spectex - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "spectex - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /W3 /GX /O2 /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../spectex.exe"
+# Begin Special Build Tool
+SOURCE="$(InputPath)"
+PostBuild_Desc=Copy DLLs
+PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
+# End Special Build Tool
+
+!ELSEIF "$(CFG)" == "spectex - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../spectex.exe" /pdbtype:sept
+# Begin Special Build Tool
+SOURCE="$(InputPath)"
+PostBuild_Desc=Copy DLLs
+PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
+# End Special Build Tool
+
+!ENDIF
+
+# Begin Target
+
+# Name "spectex - Win32 Release"
+# Name "spectex - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=..\spectex.c
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# End Group
+# End Target
+# End Project
diff --git a/progs/demos/Windows/spriteblast.dsp b/progs/demos/Windows/spriteblast.dsp
index 8a02ed50d30..0a8ea1af5ba 100644
--- a/progs/demos/Windows/spriteblast.dsp
+++ b/progs/demos/Windows/spriteblast.dsp
@@ -1,112 +1,112 @@
-# Microsoft Developer Studio Project File - Name="spriteblast" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=spriteblast - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "spriteblast.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "spriteblast.mak" CFG="bounce - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "spriteblast - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "spriteblast - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "spriteblast - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /W3 /GX /O2 /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../spriteblast.exe"
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ELSEIF "$(CFG)" == "spriteblast - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../spriteblast.exe" /pdbtype:sept
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ENDIF
-
-# Begin Target
-
-# Name "spriteblast - Win32 Release"
-# Name "spriteblast - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=..\spriteblast.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
+# Microsoft Developer Studio Project File - Name="spriteblast" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=spriteblast - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "spriteblast.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "spriteblast.mak" CFG="bounce - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "spriteblast - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "spriteblast - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "spriteblast - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /W3 /GX /O2 /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../spriteblast.exe"
+# Begin Special Build Tool
+SOURCE="$(InputPath)"
+PostBuild_Desc=Copy DLLs
+PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
+# End Special Build Tool
+
+!ELSEIF "$(CFG)" == "spriteblast - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../spriteblast.exe" /pdbtype:sept
+# Begin Special Build Tool
+SOURCE="$(InputPath)"
+PostBuild_Desc=Copy DLLs
+PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
+# End Special Build Tool
+
+!ENDIF
+
+# Begin Target
+
+# Name "spriteblast - Win32 Release"
+# Name "spriteblast - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=..\spriteblast.c
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# End Group
+# End Target
+# End Project
diff --git a/progs/demos/Windows/stex3d.dsp b/progs/demos/Windows/stex3d.dsp
index 7c112d62ca8..5d8c93b9e49 100644
--- a/progs/demos/Windows/stex3d.dsp
+++ b/progs/demos/Windows/stex3d.dsp
@@ -1,112 +1,112 @@
-# Microsoft Developer Studio Project File - Name="stex3d" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=stex3d - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "stex3d.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "stex3d.mak" CFG="bounce - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "stex3d - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "stex3d - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "stex3d - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /W3 /GX /O2 /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../stex3d.exe"
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ELSEIF "$(CFG)" == "stex3d - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../stex3d.exe" /pdbtype:sept
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ENDIF
-
-# Begin Target
-
-# Name "stex3d - Win32 Release"
-# Name "stex3d - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=..\stex3d.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
+# Microsoft Developer Studio Project File - Name="stex3d" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=stex3d - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "stex3d.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "stex3d.mak" CFG="bounce - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "stex3d - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "stex3d - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "stex3d - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /W3 /GX /O2 /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../stex3d.exe"
+# Begin Special Build Tool
+SOURCE="$(InputPath)"
+PostBuild_Desc=Copy DLLs
+PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
+# End Special Build Tool
+
+!ELSEIF "$(CFG)" == "stex3d - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../stex3d.exe" /pdbtype:sept
+# Begin Special Build Tool
+SOURCE="$(InputPath)"
+PostBuild_Desc=Copy DLLs
+PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
+# End Special Build Tool
+
+!ENDIF
+
+# Begin Target
+
+# Name "stex3d - Win32 Release"
+# Name "stex3d - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=..\stex3d.c
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# End Group
+# End Target
+# End Project
diff --git a/progs/demos/Windows/teapot.dsp b/progs/demos/Windows/teapot.dsp
index 3260e635a4b..63cea205044 100644
--- a/progs/demos/Windows/teapot.dsp
+++ b/progs/demos/Windows/teapot.dsp
@@ -1,112 +1,112 @@
-# Microsoft Developer Studio Project File - Name="teapot" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=teapot - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "teapot.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "teapot.mak" CFG="gloss - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "teapot - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "teapot - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "teapot - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /W3 /GX /O2 /I "../../util" /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../teapot.exe"
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ELSEIF "$(CFG)" == "teapot - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../util" /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../teapot.exe" /pdbtype:sept
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ENDIF
-
-# Begin Target
-
-# Name "teapot - Win32 Release"
-# Name "teapot - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=..\teapot.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
+# Microsoft Developer Studio Project File - Name="teapot" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=teapot - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "teapot.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "teapot.mak" CFG="gloss - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "teapot - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "teapot - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "teapot - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /W3 /GX /O2 /I "../../util" /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../teapot.exe"
+# Begin Special Build Tool
+SOURCE="$(InputPath)"
+PostBuild_Desc=Copy DLLs
+PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
+# End Special Build Tool
+
+!ELSEIF "$(CFG)" == "teapot - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../util" /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../teapot.exe" /pdbtype:sept
+# Begin Special Build Tool
+SOURCE="$(InputPath)"
+PostBuild_Desc=Copy DLLs
+PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
+# End Special Build Tool
+
+!ENDIF
+
+# Begin Target
+
+# Name "teapot - Win32 Release"
+# Name "teapot - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=..\teapot.c
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# End Group
+# End Target
+# End Project
diff --git a/progs/demos/Windows/terrain.dsp b/progs/demos/Windows/terrain.dsp
index 9fe490db81e..35c67a5f948 100644
--- a/progs/demos/Windows/terrain.dsp
+++ b/progs/demos/Windows/terrain.dsp
@@ -1,112 +1,112 @@
-# Microsoft Developer Studio Project File - Name="terrain" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=terrain - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "terrain.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "terrain.mak" CFG="bounce - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "terrain - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "terrain - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "terrain - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /W3 /GX /O2 /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../terrain.exe"
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ELSEIF "$(CFG)" == "terrain - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../terrain.exe" /pdbtype:sept
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ENDIF
-
-# Begin Target
-
-# Name "terrain - Win32 Release"
-# Name "terrain - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=..\terrain.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
+# Microsoft Developer Studio Project File - Name="terrain" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=terrain - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "terrain.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "terrain.mak" CFG="bounce - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "terrain - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "terrain - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "terrain - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /W3 /GX /O2 /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../terrain.exe"
+# Begin Special Build Tool
+SOURCE="$(InputPath)"
+PostBuild_Desc=Copy DLLs
+PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
+# End Special Build Tool
+
+!ELSEIF "$(CFG)" == "terrain - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../terrain.exe" /pdbtype:sept
+# Begin Special Build Tool
+SOURCE="$(InputPath)"
+PostBuild_Desc=Copy DLLs
+PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
+# End Special Build Tool
+
+!ENDIF
+
+# Begin Target
+
+# Name "terrain - Win32 Release"
+# Name "terrain - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=..\terrain.c
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# End Group
+# End Target
+# End Project
diff --git a/progs/demos/Windows/tessdemo.dsp b/progs/demos/Windows/tessdemo.dsp
index 61345c79e6a..62815ea8ac8 100644
--- a/progs/demos/Windows/tessdemo.dsp
+++ b/progs/demos/Windows/tessdemo.dsp
@@ -1,112 +1,112 @@
-# Microsoft Developer Studio Project File - Name="tessdemo" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=tessdemo - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "tessdemo.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "tessdemo.mak" CFG="bounce - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "tessdemo - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "tessdemo - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "tessdemo - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /W3 /GX /O2 /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../tessdemo.exe"
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ELSEIF "$(CFG)" == "tessdemo - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../tessdemo.exe" /pdbtype:sept
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ENDIF
-
-# Begin Target
-
-# Name "tessdemo - Win32 Release"
-# Name "tessdemo - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=..\tessdemo.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
+# Microsoft Developer Studio Project File - Name="tessdemo" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=tessdemo - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "tessdemo.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "tessdemo.mak" CFG="bounce - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "tessdemo - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "tessdemo - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "tessdemo - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /W3 /GX /O2 /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../tessdemo.exe"
+# Begin Special Build Tool
+SOURCE="$(InputPath)"
+PostBuild_Desc=Copy DLLs
+PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
+# End Special Build Tool
+
+!ELSEIF "$(CFG)" == "tessdemo - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../tessdemo.exe" /pdbtype:sept
+# Begin Special Build Tool
+SOURCE="$(InputPath)"
+PostBuild_Desc=Copy DLLs
+PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
+# End Special Build Tool
+
+!ENDIF
+
+# Begin Target
+
+# Name "tessdemo - Win32 Release"
+# Name "tessdemo - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=..\tessdemo.c
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# End Group
+# End Target
+# End Project
diff --git a/progs/demos/Windows/texcyl.dsp b/progs/demos/Windows/texcyl.dsp
index b227e02c297..326a2728ebe 100644
--- a/progs/demos/Windows/texcyl.dsp
+++ b/progs/demos/Windows/texcyl.dsp
@@ -1,112 +1,112 @@
-# Microsoft Developer Studio Project File - Name="texcyl" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=texcyl - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "texcyl.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "texcyl.mak" CFG="gloss - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "texcyl - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "texcyl - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "texcyl - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /W3 /GX /O2 /I "../../util" /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../texcyl.exe"
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ELSEIF "$(CFG)" == "texcyl - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../util" /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../texcyl.exe" /pdbtype:sept
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ENDIF
-
-# Begin Target
-
-# Name "texcyl - Win32 Release"
-# Name "texcyl - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=..\texcyl.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
+# Microsoft Developer Studio Project File - Name="texcyl" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=texcyl - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "texcyl.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "texcyl.mak" CFG="gloss - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "texcyl - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "texcyl - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "texcyl - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /W3 /GX /O2 /I "../../util" /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../texcyl.exe"
+# Begin Special Build Tool
+SOURCE="$(InputPath)"
+PostBuild_Desc=Copy DLLs
+PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
+# End Special Build Tool
+
+!ELSEIF "$(CFG)" == "texcyl - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../util" /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../texcyl.exe" /pdbtype:sept
+# Begin Special Build Tool
+SOURCE="$(InputPath)"
+PostBuild_Desc=Copy DLLs
+PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
+# End Special Build Tool
+
+!ENDIF
+
+# Begin Target
+
+# Name "texcyl - Win32 Release"
+# Name "texcyl - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=..\texcyl.c
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# End Group
+# End Target
+# End Project
diff --git a/progs/demos/Windows/texdown.dsp b/progs/demos/Windows/texdown.dsp
index acea7666afc..926e72408b3 100644
--- a/progs/demos/Windows/texdown.dsp
+++ b/progs/demos/Windows/texdown.dsp
@@ -1,112 +1,112 @@
-# Microsoft Developer Studio Project File - Name="texdown" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=texdown - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "texdown.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "texdown.mak" CFG="bounce - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "texdown - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "texdown - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "texdown - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /W3 /GX /O2 /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../texdown.exe"
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ELSEIF "$(CFG)" == "texdown - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../texdown.exe" /pdbtype:sept
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ENDIF
-
-# Begin Target
-
-# Name "texdown - Win32 Release"
-# Name "texdown - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=..\texdown.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
+# Microsoft Developer Studio Project File - Name="texdown" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=texdown - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "texdown.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "texdown.mak" CFG="bounce - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "texdown - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "texdown - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "texdown - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /W3 /GX /O2 /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../texdown.exe"
+# Begin Special Build Tool
+SOURCE="$(InputPath)"
+PostBuild_Desc=Copy DLLs
+PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
+# End Special Build Tool
+
+!ELSEIF "$(CFG)" == "texdown - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../texdown.exe" /pdbtype:sept
+# Begin Special Build Tool
+SOURCE="$(InputPath)"
+PostBuild_Desc=Copy DLLs
+PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
+# End Special Build Tool
+
+!ENDIF
+
+# Begin Target
+
+# Name "texdown - Win32 Release"
+# Name "texdown - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=..\texdown.c
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# End Group
+# End Target
+# End Project
diff --git a/progs/demos/Windows/texenv.dsp b/progs/demos/Windows/texenv.dsp
index 3eb7eecdb71..964c6d207e8 100644
--- a/progs/demos/Windows/texenv.dsp
+++ b/progs/demos/Windows/texenv.dsp
@@ -1,112 +1,112 @@
-# Microsoft Developer Studio Project File - Name="texenv" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=texenv - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "texenv.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "texenv.mak" CFG="bounce - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "texenv - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "texenv - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "texenv - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /W3 /GX /O2 /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../texenv.exe"
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ELSEIF "$(CFG)" == "texenv - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../texenv.exe" /pdbtype:sept
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ENDIF
-
-# Begin Target
-
-# Name "texenv - Win32 Release"
-# Name "texenv - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=..\texenv.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
+# Microsoft Developer Studio Project File - Name="texenv" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=texenv - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "texenv.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "texenv.mak" CFG="bounce - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "texenv - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "texenv - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "texenv - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /W3 /GX /O2 /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../texenv.exe"
+# Begin Special Build Tool
+SOURCE="$(InputPath)"
+PostBuild_Desc=Copy DLLs
+PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
+# End Special Build Tool
+
+!ELSEIF "$(CFG)" == "texenv - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../texenv.exe" /pdbtype:sept
+# Begin Special Build Tool
+SOURCE="$(InputPath)"
+PostBuild_Desc=Copy DLLs
+PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
+# End Special Build Tool
+
+!ENDIF
+
+# Begin Target
+
+# Name "texenv - Win32 Release"
+# Name "texenv - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=..\texenv.c
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# End Group
+# End Target
+# End Project
diff --git a/progs/demos/Windows/texobj.dsp b/progs/demos/Windows/texobj.dsp
index 5db5f2ee798..2a44dffd360 100644
--- a/progs/demos/Windows/texobj.dsp
+++ b/progs/demos/Windows/texobj.dsp
@@ -1,112 +1,112 @@
-# Microsoft Developer Studio Project File - Name="texobj" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=texobj - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "texobj.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "texobj.mak" CFG="bounce - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "texobj - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "texobj - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "texobj - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /W3 /GX /O2 /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../texobj.exe"
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ELSEIF "$(CFG)" == "texobj - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../texobj.exe" /pdbtype:sept
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ENDIF
-
-# Begin Target
-
-# Name "texobj - Win32 Release"
-# Name "texobj - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=..\texobj.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
+# Microsoft Developer Studio Project File - Name="texobj" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=texobj - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "texobj.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "texobj.mak" CFG="bounce - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "texobj - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "texobj - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "texobj - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /W3 /GX /O2 /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../texobj.exe"
+# Begin Special Build Tool
+SOURCE="$(InputPath)"
+PostBuild_Desc=Copy DLLs
+PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
+# End Special Build Tool
+
+!ELSEIF "$(CFG)" == "texobj - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../texobj.exe" /pdbtype:sept
+# Begin Special Build Tool
+SOURCE="$(InputPath)"
+PostBuild_Desc=Copy DLLs
+PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
+# End Special Build Tool
+
+!ENDIF
+
+# Begin Target
+
+# Name "texobj - Win32 Release"
+# Name "texobj - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=..\texobj.c
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# End Group
+# End Target
+# End Project
diff --git a/progs/demos/Windows/trispd.dsp b/progs/demos/Windows/trispd.dsp
index 7e27cf3d04b..2ba95dc634d 100644
--- a/progs/demos/Windows/trispd.dsp
+++ b/progs/demos/Windows/trispd.dsp
@@ -1,112 +1,112 @@
-# Microsoft Developer Studio Project File - Name="trispd" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=trispd - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "trispd.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "trispd.mak" CFG="bounce - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "trispd - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "trispd - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "trispd - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /W3 /GX /O2 /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../trispd.exe"
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ELSEIF "$(CFG)" == "trispd - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../trispd.exe" /pdbtype:sept
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ENDIF
-
-# Begin Target
-
-# Name "trispd - Win32 Release"
-# Name "trispd - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=..\trispd.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
+# Microsoft Developer Studio Project File - Name="trispd" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=trispd - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "trispd.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "trispd.mak" CFG="bounce - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "trispd - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "trispd - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "trispd - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /W3 /GX /O2 /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../trispd.exe"
+# Begin Special Build Tool
+SOURCE="$(InputPath)"
+PostBuild_Desc=Copy DLLs
+PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
+# End Special Build Tool
+
+!ELSEIF "$(CFG)" == "trispd - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../trispd.exe" /pdbtype:sept
+# Begin Special Build Tool
+SOURCE="$(InputPath)"
+PostBuild_Desc=Copy DLLs
+PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
+# End Special Build Tool
+
+!ENDIF
+
+# Begin Target
+
+# Name "trispd - Win32 Release"
+# Name "trispd - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=..\trispd.c
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# End Group
+# End Target
+# End Project
diff --git a/progs/demos/Windows/tunnel.dsp b/progs/demos/Windows/tunnel.dsp
index 965f109c33e..218d3728662 100644
--- a/progs/demos/Windows/tunnel.dsp
+++ b/progs/demos/Windows/tunnel.dsp
@@ -1,112 +1,112 @@
-# Microsoft Developer Studio Project File - Name="tunnel" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=tunnel - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "tunnel.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "tunnel.mak" CFG="gloss - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "tunnel - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "tunnel - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "tunnel - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /W3 /GX /O2 /I "../../util" /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../tunnel.exe"
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ELSEIF "$(CFG)" == "tunnel - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../util" /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../tunnel.exe" /pdbtype:sept
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ENDIF
-
-# Begin Target
-
-# Name "tunnel - Win32 Release"
-# Name "tunnel - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=..\tunnel.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
+# Microsoft Developer Studio Project File - Name="tunnel" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=tunnel - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "tunnel.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "tunnel.mak" CFG="gloss - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "tunnel - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "tunnel - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "tunnel - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /W3 /GX /O2 /I "../../util" /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../tunnel.exe"
+# Begin Special Build Tool
+SOURCE="$(InputPath)"
+PostBuild_Desc=Copy DLLs
+PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
+# End Special Build Tool
+
+!ELSEIF "$(CFG)" == "tunnel - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../util" /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../tunnel.exe" /pdbtype:sept
+# Begin Special Build Tool
+SOURCE="$(InputPath)"
+PostBuild_Desc=Copy DLLs
+PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
+# End Special Build Tool
+
+!ENDIF
+
+# Begin Target
+
+# Name "tunnel - Win32 Release"
+# Name "tunnel - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=..\tunnel.c
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# End Group
+# End Target
+# End Project
diff --git a/progs/demos/Windows/tunnel2.dsp b/progs/demos/Windows/tunnel2.dsp
index 3ae2800a04d..bd2b6c07f2a 100644
--- a/progs/demos/Windows/tunnel2.dsp
+++ b/progs/demos/Windows/tunnel2.dsp
@@ -1,112 +1,112 @@
-# Microsoft Developer Studio Project File - Name="tunnel2" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=tunnel2 - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "tunnel2.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "tunnel2.mak" CFG="gloss - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "tunnel2 - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "tunnel2 - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "tunnel2 - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /W3 /GX /O2 /I "../../util" /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../tunnel2.exe"
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ELSEIF "$(CFG)" == "tunnel2 - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../util" /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../tunnel2.exe" /pdbtype:sept
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ENDIF
-
-# Begin Target
-
-# Name "tunnel2 - Win32 Release"
-# Name "tunnel2 - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=..\tunnel2.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
+# Microsoft Developer Studio Project File - Name="tunnel2" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=tunnel2 - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "tunnel2.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "tunnel2.mak" CFG="gloss - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "tunnel2 - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "tunnel2 - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "tunnel2 - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /W3 /GX /O2 /I "../../util" /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../tunnel2.exe"
+# Begin Special Build Tool
+SOURCE="$(InputPath)"
+PostBuild_Desc=Copy DLLs
+PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
+# End Special Build Tool
+
+!ELSEIF "$(CFG)" == "tunnel2 - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../util" /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../tunnel2.exe" /pdbtype:sept
+# Begin Special Build Tool
+SOURCE="$(InputPath)"
+PostBuild_Desc=Copy DLLs
+PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
+# End Special Build Tool
+
+!ENDIF
+
+# Begin Target
+
+# Name "tunnel2 - Win32 Release"
+# Name "tunnel2 - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=..\tunnel2.c
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# End Group
+# End Target
+# End Project
diff --git a/progs/demos/Windows/winpos.dsp b/progs/demos/Windows/winpos.dsp
index b7b569e6402..a388a425e93 100644
--- a/progs/demos/Windows/winpos.dsp
+++ b/progs/demos/Windows/winpos.dsp
@@ -1,112 +1,112 @@
-# Microsoft Developer Studio Project File - Name="winpos" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=winpos - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "winpos.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "winpos.mak" CFG="gloss - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "winpos - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "winpos - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "winpos - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /W3 /GX /O2 /I "../../util" /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../winpos.exe"
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ELSEIF "$(CFG)" == "winpos - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../util" /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../winpos.exe" /pdbtype:sept
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ENDIF
-
-# Begin Target
-
-# Name "winpos - Win32 Release"
-# Name "winpos - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=..\winpos.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
+# Microsoft Developer Studio Project File - Name="winpos" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=winpos - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "winpos.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "winpos.mak" CFG="gloss - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "winpos - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "winpos - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "winpos - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /W3 /GX /O2 /I "../../util" /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../winpos.exe"
+# Begin Special Build Tool
+SOURCE="$(InputPath)"
+PostBuild_Desc=Copy DLLs
+PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
+# End Special Build Tool
+
+!ELSEIF "$(CFG)" == "winpos - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../util" /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../winpos.exe" /pdbtype:sept
+# Begin Special Build Tool
+SOURCE="$(InputPath)"
+PostBuild_Desc=Copy DLLs
+PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
+# End Special Build Tool
+
+!ENDIF
+
+# Begin Target
+
+# Name "winpos - Win32 Release"
+# Name "winpos - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=..\winpos.c
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# End Group
+# End Target
+# End Project
diff --git a/progs/demos/arbfplight.c b/progs/demos/arbfplight.c
index bc2c7e312ab..401bfb49684 100644
--- a/progs/demos/arbfplight.c
+++ b/progs/demos/arbfplight.c
@@ -46,14 +46,25 @@ static PFNGLDELETEPROGRAMSARBPROC glDeleteProgramsARB_func;
/* Set to one to test ARB_fog_linear program option */
#define DO_FRAGMENT_FOG 0
+static void normalize (GLfloat *dst, const GLfloat *src)
+{
+ GLfloat len = sqrt (src[0] * src[0] + src[1] * src[1] + src[2] * src[2]);
+ dst[0] = src[0] / len;
+ dst[1] = src[1] / len;
+ dst[2] = src[2] / len;
+}
static void Redisplay( void )
{
glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
if (PixelLight) {
+ GLfloat pos[4];
+
+ normalize( pos, LightPos );
+ pos[3] = LightPos[3];
glProgramLocalParameter4fvARB_func(GL_FRAGMENT_PROGRAM_ARB,
- LIGHTPOS, LightPos);
+ LIGHTPOS, pos);
glEnable(GL_FRAGMENT_PROGRAM_ARB);
glEnable(GL_VERTEX_PROGRAM_ARB);
glDisable(GL_LIGHTING);
@@ -204,35 +215,31 @@ static void Init( void )
"PARAM Diffuse = state.material.diffuse; \n"
"PARAM Specular = state.material.specular; \n"
"PARAM LightPos = program.local[3]; \n"
- "TEMP lightDir, normal, len; \n"
+ "TEMP normal, len; \n"
"TEMP dotProd, specAtten; \n"
"TEMP diffuseColor, specularColor; \n"
- "# Compute normalized light direction \n"
- "DP3 len.x, LightPos, LightPos; \n"
- "RSQ len.y, len.x; \n"
- "MUL lightDir, LightPos, len.y; \n"
-
"# Compute normalized normal \n"
"DP3 len.x, fragment.texcoord[0], fragment.texcoord[0]; \n"
"RSQ len.y, len.x; \n"
- "MUL normal, fragment.texcoord[0], len.y; \n"
+ "MUL normal.xyz, fragment.texcoord[0], len.y; \n"
"# Compute dot product of light direction and normal vector\n"
- "DP3_SAT dotProd, lightDir, normal; # limited to [0,1]\n"
+ "DP3_SAT dotProd.x, LightPos, normal; # limited to [0,1]\n"
- "MUL diffuseColor, Diffuse, dotProd; # diffuse attenuation\n"
+ "MUL diffuseColor.xyz, Diffuse, dotProd.x; # diffuse attenuation\n"
"POW specAtten.x, dotProd.x, {20.0}.x; # specular exponent\n"
- "MUL specularColor, Specular, specAtten.x; # specular attenuation\n"
+ "MUL specularColor.xyz, Specular, specAtten.x; # specular attenuation\n"
+ "MOV result.color.w, Diffuse; \n"
#if DO_FRAGMENT_FOG
"# need to clamp color to [0,1] before fogging \n"
- "ADD_SAT result.color, diffuseColor, specularColor; # add colors\n"
+ "ADD_SAT result.color.xyz, diffuseColor, specularColor; # add colors\n"
#else
"# clamping will be done after program's finished \n"
- "ADD result.color, diffuseColor, specularColor; # add colors\n"
+ "ADD result.color.xyz, diffuseColor, specularColor; # add colors\n"
#endif
"END \n"
;
diff --git a/progs/demos/arbfslight.c b/progs/demos/arbfslight.c
index 69575f06236..a84491d34fe 100644
--- a/progs/demos/arbfslight.c
+++ b/progs/demos/arbfslight.c
@@ -208,7 +208,31 @@ static void Init (void)
" // Compute dot product of light direction and normal vector\n"
" float dotProd = max (dot (lightPos, normalize (normal)), 0.0);\n"
" // Compute diffuse and specular contributions\n"
+#if 1
" gl_FragColor = diffuse * dotProd + specular * pow (dotProd, 20.0);\n"
+#elif 1 /* test IF/ELSE/ENDIF */
+ " if (normal.y > 0.0) { \n"
+ " gl_FragColor = diffuse * dotProd + specular * pow (dotProd, 20.0);\n"
+ " } \n"
+ " else { \n"
+ " if (normal.x < 0.0) { \n"
+ " gl_FragColor = vec4(1, 0, 0, 0); \n"
+ " } \n"
+ " else { \n"
+ " 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"
;
static const char *vertShaderText =
diff --git a/progs/demos/arbocclude.c b/progs/demos/arbocclude.c
index 6bf4fd218b9..9188ad5a565 100644
--- a/progs/demos/arbocclude.c
+++ b/progs/demos/arbocclude.c
@@ -29,7 +29,7 @@
#include <stdlib.h>
#include <string.h>
#include <math.h>
-#define GL_GLEXT_PROTOTYPES
+#include <GL/glew.h>
#include <GL/glut.h>
#define TEST_DISPLAY_LISTS 0
@@ -273,6 +273,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( 400, 400 );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
Win = glutCreateWindow(argv[0]);
+ glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutSpecialFunc( SpecialKey );
diff --git a/progs/demos/copypix.c b/progs/demos/copypix.c
index 15001e851be..51435acfa0f 100644
--- a/progs/demos/copypix.c
+++ b/progs/demos/copypix.c
@@ -6,11 +6,10 @@
*/
-#define GL_GLEXT_PROTOTYPES
-
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <GL/glew.h>
#include <GL/glut.h>
#include "readtex.h"
@@ -234,6 +233,7 @@ int main( int argc, char *argv[] )
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE);
glutCreateWindow(argv[0]);
+ glewInit();
Init(ciMode, filename);
Usage();
diff --git a/progs/demos/drawpix.c b/progs/demos/drawpix.c
index d2f57486744..5490bcc6355 100644
--- a/progs/demos/drawpix.c
+++ b/progs/demos/drawpix.c
@@ -28,6 +28,7 @@ static GLfloat Zpos = -1.0;
static float Xzoom, Yzoom;
static GLboolean DrawFront = GL_FALSE;
static GLboolean Dither = GL_TRUE;
+static int win = 0;
static void Reset( void )
@@ -215,6 +216,7 @@ static void Key( unsigned char key, int x, int y )
printf("glDrawBuffer(%s)\n", DrawFront ? "GL_FRONT" : "GL_BACK");
break;
case 27:
+ glutDestroyWindow(win);
exit(0);
break;
}
@@ -343,7 +345,7 @@ int main( int argc, char *argv[] )
else
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE);
- glutCreateWindow(argv[0]);
+ win = glutCreateWindow(argv[0]);
Init(ciMode, filename);
Usage();
diff --git a/progs/demos/engine.c b/progs/demos/engine.c
index d1c3237ac75..14fd1e68629 100644
--- a/progs/demos/engine.c
+++ b/progs/demos/engine.c
@@ -5,12 +5,11 @@
* June 2006
*/
-#define GL_GLEXT_PROTOTYPES
-
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
+#include <GL/glew.h>
#include <GL/glut.h>
#include "readtex.h"
#include "trackball.h"
@@ -1288,6 +1287,7 @@ main(int argc, char *argv[])
glutInitWindowSize(WinWidth, WinHeight);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
glutCreateWindow("OpenGL Engine Demo");
+ glewInit();
glutReshapeFunc(Reshape);
glutMouseFunc(Mouse);
glutMotionFunc(Motion);
diff --git a/progs/demos/fbo_firecube.c b/progs/demos/fbo_firecube.c
index f5ee82a2f11..4e42924a09e 100644
--- a/progs/demos/fbo_firecube.c
+++ b/progs/demos/fbo_firecube.c
@@ -29,11 +29,11 @@
*
*/
-#define GL_GLEXT_PROTOTYPES
#include <math.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
+#include <GL/glew.h>
#include <GL/glut.h>
#include "readtex.h"
@@ -1037,6 +1037,7 @@ main(int argc, char *argv[])
glutInitWindowSize(WinWidth, WinHeight);
Win = glutCreateWindow("fbo_firecube");
+ glewInit();
init(argc, argv);
glutDisplayFunc(draw);
diff --git a/progs/demos/fogcoord.c b/progs/demos/fogcoord.c
index 00c73c6f048..6f50993c98f 100644
--- a/progs/demos/fogcoord.c
+++ b/progs/demos/fogcoord.c
@@ -7,19 +7,16 @@
* Daniel Borca
*/
-#define GL_GLEXT_PROTOTYPES
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
+#include <GL/glew.h>
#include <GL/glut.h>
#define DEPTH 5.0f
-static PFNGLFOGCOORDFEXTPROC glFogCoordf_ext;
static PFNGLFOGCOORDPOINTEREXTPROC glFogCoordPointer_ext;
-static GLboolean have_fog_coord;
-
static GLfloat camz;
static GLint fogMode;
@@ -45,10 +42,11 @@ Reset(void)
}
-static void APIENTRY
-glFogCoordf_nop (GLfloat f)
+static void
+glFogCoordf_ext (GLfloat f)
{
- (void)f;
+ if (fogCoord)
+ glFogCoordfEXT(f);
}
@@ -120,14 +118,11 @@ SetFogMode(GLint fogMode)
static GLboolean
SetFogCoord(GLboolean fogCoord)
{
- glFogCoordf_ext = glFogCoordf_nop;
-
- if (!have_fog_coord) {
+ if (!GLEW_EXT_fog_coord) {
return GL_FALSE;
}
if (fogCoord) {
- glFogCoordf_ext = (PFNGLFOGCOORDFEXTPROC)glutGetProcAddress("glFogCoordfEXT");
glFogi(GL_FOG_COORDINATE_SOURCE_EXT, GL_FOG_COORDINATE_EXT);
}
else {
@@ -340,7 +335,7 @@ Key( unsigned char key, int x, int y )
SetFogMode(fogMode);
break;
case 'c':
- fogCoord = SetFogCoord(fogCoord ^ GL_TRUE);
+ fogCoord = SetFogCoord(fogCoord ^ GL_TRUE);
break;
case 't':
Texture = !Texture;
@@ -372,8 +367,7 @@ Init(void)
printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
- have_fog_coord = glutExtensionSupported("GL_EXT_fog_coord");
- if (!have_fog_coord) {
+ if (!GLEW_EXT_fog_coord) {
printf("GL_EXT_fog_coord not supported!\n");
}
@@ -400,10 +394,9 @@ Init(void)
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
glTexCoordPointer(2, GL_FLOAT, 0, texcoord_pointer);
- if (have_fog_coord) {
- glFogCoordPointer_ext = (PFNGLFOGCOORDPOINTEREXTPROC)glutGetProcAddress("glFogCoordPointerEXT");
+ if (GLEW_EXT_fog_coord) {
glEnableClientState(GL_FOG_COORDINATE_ARRAY_EXT);
- glFogCoordPointer_ext(GL_FLOAT, 0, fogcoord_pointer);
+ glFogCoordPointerEXT(GL_FLOAT, 0, fogcoord_pointer);
}
Reset();
@@ -417,6 +410,7 @@ main( int argc, char *argv[] )
glutInitWindowSize( 600, 600 );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
glutCreateWindow(argv[0]);
+ glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );
diff --git a/progs/demos/fplight.c b/progs/demos/fplight.c
index fb510cccc8a..c297354103f 100644
--- a/progs/demos/fplight.c
+++ b/progs/demos/fplight.c
@@ -10,7 +10,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#define GL_GLEXT_PROTOTYPES
+#include <GL/glew.h>
#include <GL/glut.h>
@@ -273,6 +273,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( 200, 200 );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
Win = glutCreateWindow(argv[0]);
+ glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutSpecialFunc( SpecialKey );
diff --git a/progs/demos/fslight.c b/progs/demos/fslight.c
index e6d83bf8fb3..e79b5cc1970 100644
--- a/progs/demos/fslight.c
+++ b/progs/demos/fslight.c
@@ -225,33 +225,6 @@ static void
TestFunctions(void)
{
printf("Error 0x%x at line %d\n", glGetError(), __LINE__);
- {
- GLfloat pos[3];
- printf("Error 0x%x at line %d\n", glGetError(), __LINE__);
- printf("Light pos %g %g %g\n", pos[0], pos[1], pos[2]);
- }
-
-
- {
- GLfloat m[16], result[16];
- GLint mPos;
- int i;
-
- for (i = 0; i < 16; i++)
- m[i] = (float) i;
-
- mPos = glGetUniformLocation_func(program, "m");
- printf("Error 0x%x at line %d\n", glGetError(), __LINE__);
- glUniformMatrix4fv_func(mPos, 1, GL_FALSE, m);
- printf("Error 0x%x at line %d\n", glGetError(), __LINE__);
-
- glGetUniformfv_func(program, mPos, result);
- printf("Error 0x%x at line %d\n", glGetError(), __LINE__);
-
- for (i = 0; i < 16; i++) {
- printf("%8g %8g\n", m[i], result[i]);
- }
- }
assert(glIsProgram_func(program));
assert(glIsShader_func(fragShader));
@@ -280,6 +253,22 @@ TestFunctions(void)
glGetProgramInfoLog_func(program, 1000, &len, log);
printf("Program Info Log: %s\n", log);
}
+
+ /* active uniforms */
+ {
+ GLint n, max, i;
+ glGetProgramiv_func(program, GL_ACTIVE_UNIFORMS, &n);
+ glGetProgramiv_func(program, GL_ACTIVE_UNIFORM_MAX_LENGTH, &max);
+ printf("Num uniforms: %d Max name length: %d\n", n, max);
+ for (i = 0; i < n; i++) {
+ GLint size, len;
+ GLenum type;
+ char name[100];
+ glGetActiveUniform_func(program, i, 100, &len, &size, &type, name);
+ printf(" %d: %s nameLen=%d size=%d type=0x%x\n",
+ i, name, len, size, type);
+ }
+ }
}
@@ -512,7 +501,9 @@ Init(void)
glUniform4fv_func(uDiffuse, 1, diffuse);
glUniform4fv_func(uSpecular, 1, specular);
/* assert(glGetError() == 0);*/
+#if TEXTURE
glUniform1i_func(uTexture, 2); /* use texture unit 2 */
+#endif
/*assert(glGetError() == 0);*/
if (CoordAttrib) {
diff --git a/progs/demos/gloss.c b/progs/demos/gloss.c
index 9974f0dab2e..b2126e32678 100644
--- a/progs/demos/gloss.c
+++ b/progs/demos/gloss.c
@@ -22,6 +22,7 @@
#include <stdlib.h>
#include <math.h>
#include <string.h>
+#include <GL/glew.h>
#include <GL/glut.h>
#include "readtex.h"
@@ -438,6 +439,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize(WinWidth, WinHeight);
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
glutCreateWindow(argv[0] );
+ glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );
diff --git a/progs/demos/isosurf.c b/progs/demos/isosurf.c
index 10f94b6ace2..393741cc9d6 100644
--- a/progs/demos/isosurf.c
+++ b/progs/demos/isosurf.c
@@ -33,7 +33,7 @@
#include <windows.h>
#undef CLIP_MASK
#endif
-#define GL_GLEXT_PROTOTYPES
+#include <GL/glew.h>
#include "GL/glut.h"
#include "readtex.h"
@@ -1033,7 +1033,6 @@ static GLint Args(int argc, char **argv)
int main(int argc, char **argv)
{
GLenum type;
- char *extensions;
GLuint arg_mode = Args(argc, argv);
@@ -1055,15 +1054,15 @@ int main(int argc, char **argv)
exit(0);
}
- /* Make sure server supports the vertex array extension */
- extensions = (char *) glGetString( GL_EXTENSIONS );
+ glewInit();
- if (!strstr( extensions, "GL_EXT_vertex_array" ))
+ /* Make sure server supports the vertex array extension */
+ if (!GLEW_EXT_vertex_array)
{
printf("Vertex arrays not supported by this renderer\n");
allowed &= ~(LOCKED|DRAW_ARRAYS|DRAW_ELTS|ARRAY_ELT);
}
- else if (!strstr( extensions, "GL_EXT_compiled_vertex_array" ))
+ else if (!GLEW_EXT_compiled_vertex_array)
{
printf("Compiled vertex arrays not supported by this renderer\n");
allowed &= ~LOCKED;
diff --git a/progs/demos/lodbias.c b/progs/demos/lodbias.c
index c5a2a1b4573..30b1ed13d5f 100644
--- a/progs/demos/lodbias.c
+++ b/progs/demos/lodbias.c
@@ -42,7 +42,7 @@ static GLfloat Xrot = 0, Yrot = -30, Zrot = 0;
static GLboolean Anim = GL_TRUE;
static GLint Bias = 0, BiasStepSign = +1; /* ints avoid fp precision problem */
static GLint BiasMin = -400, BiasMax = 400;
-
+static int win = 0;
static void
@@ -172,6 +172,7 @@ static void Key( unsigned char key, int x, int y )
Bias = 100.0 * (key - '0');
break;
case 27:
+ glutDestroyWindow(win);
exit(0);
break;
}
@@ -281,7 +282,7 @@ int main( int argc, char *argv[] )
glutInitWindowPosition( 0, 0 );
glutInitWindowSize( 350, 350 );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
- glutCreateWindow(argv[0]);
+ win = glutCreateWindow(argv[0]);
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutSpecialFunc( SpecialKey );
diff --git a/progs/demos/multiarb.c b/progs/demos/multiarb.c
index 451fd11efe1..85c4e3a266c 100644
--- a/progs/demos/multiarb.c
+++ b/progs/demos/multiarb.c
@@ -14,6 +14,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <GL/glew.h>
#include <GL/glut.h>
#include "readtex.h"
@@ -326,6 +327,7 @@ int main( int argc, char *argv[] )
glutInitWindowPosition( 0, 0 );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
glutCreateWindow(argv[0] );
+ glewInit();
Init( argc, argv );
diff --git a/progs/demos/paltex.c b/progs/demos/paltex.c
index aa9c0da36b7..d0cbcfb5e9a 100644
--- a/progs/demos/paltex.c
+++ b/progs/demos/paltex.c
@@ -11,7 +11,7 @@
#ifdef _WIN32
#include <windows.h>
#endif
-#define GL_GLEXT_PROTOTYPES
+#include <GL/glew.h>
#include <GL/glut.h>
@@ -255,6 +255,7 @@ int main( int argc, char *argv[] )
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
glutCreateWindow(argv[0]);
+ glewInit();
Init();
(void) Init2; /* silence warning */
diff --git a/progs/demos/pointblast.c b/progs/demos/pointblast.c
index dbbe2f35a28..2a91b76ad32 100644
--- a/progs/demos/pointblast.c
+++ b/progs/demos/pointblast.c
@@ -18,7 +18,7 @@
#ifdef _WIN32
#include <windows.h>
#endif
-#define GL_GLEXT_PROTOTYPES
+#include <GL/glew.h>
#include <GL/glut.h>
/* Some <math.h> files do not define M_PI... */
@@ -444,6 +444,7 @@ main(int argc, char **argv)
}
glutCreateWindow("point burst");
+ glewInit();
glutDisplayFunc(redraw);
glutMouseFunc(mouse);
glutMotionFunc(mouseMotion);
diff --git a/progs/demos/rain.cxx b/progs/demos/rain.cxx
index 59b6471ef8f..265d90cd95f 100644
--- a/progs/demos/rain.cxx
+++ b/progs/demos/rain.cxx
@@ -24,8 +24,6 @@ extern "C" {
#ifdef _WIN32
#include <windows.h>
#include <mmsystem.h>
-#include "particles.cxx"
-#include "readtex.c"
#endif
#ifdef XMESA
diff --git a/progs/demos/shadowtex.c b/progs/demos/shadowtex.c
index 4787f0f29d2..f10a01ec265 100644
--- a/progs/demos/shadowtex.c
+++ b/progs/demos/shadowtex.c
@@ -31,12 +31,12 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
-#define GL_GLEXT_PROTOTYPES
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
+#include <GL/glew.h>
#include <GL/glut.h>
#include "showbuffer.h"
@@ -1025,6 +1025,7 @@ main(int argc, char *argv[])
glutInitWindowSize(WindowWidth, WindowHeight);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH | GLUT_STENCIL);
glutCreateWindow(argv[0]);
+ glewInit();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutSpecialFunc(SpecialKey);
diff --git a/progs/demos/spriteblast.c b/progs/demos/spriteblast.c
index 5ad8e4d9a94..f6630c25d07 100644
--- a/progs/demos/spriteblast.c
+++ b/progs/demos/spriteblast.c
@@ -21,7 +21,7 @@
#ifdef _WIN32
#include <windows.h>
#endif
-#define GL_GLEXT_PROTOTYPES
+#include <GL/glew.h>
#include <GL/glut.h>
/* Some <math.h> files do not define M_PI... */
@@ -509,6 +509,7 @@ main(int argc, char **argv)
glutInitWindowPosition(0, 0);
glutInitWindowSize(600,300);
glutCreateWindow("sprite blast");
+ glewInit();
glutReshapeFunc(reshape);
glutDisplayFunc(redraw);
glutMouseFunc(mouse);
diff --git a/progs/demos/stex3d.c b/progs/demos/stex3d.c
index 83ae3684ae2..c0bbea0960f 100644
--- a/progs/demos/stex3d.c
+++ b/progs/demos/stex3d.c
@@ -18,7 +18,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#include <GL/gl.h>
+#include <GL/glew.h>
#include <GL/glut.h>
@@ -662,6 +662,8 @@ main(int argc, char **argv)
exit(0);
}
+ glewInit();
+
init();
printHelp();
diff --git a/progs/demos/streaming_rect.c b/progs/demos/streaming_rect.c
index 4c1d8535fd7..4d4656e722b 100644
--- a/progs/demos/streaming_rect.c
+++ b/progs/demos/streaming_rect.c
@@ -6,12 +6,11 @@
*
*/
-#define GL_GLEXT_PROTOTYPES
-
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <GL/glew.h>
#include <GL/glut.h>
#include "readtex.h"
@@ -303,6 +302,7 @@ int main( int argc, char *argv[] )
glutInitWindowPosition( 0, 0 );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
glutCreateWindow(argv[0] );
+ glewInit();
Init( argc, argv );
diff --git a/progs/demos/texcyl.c b/progs/demos/texcyl.c
index c04d5004e37..e3b03039759 100644
--- a/progs/demos/texcyl.c
+++ b/progs/demos/texcyl.c
@@ -27,6 +27,8 @@
#define LINEAR_FILTER 21
#define QUIT 100
+static GLint Win = -1;
+
static GLuint CylinderObj = 0;
static GLboolean Animate = GL_TRUE;
@@ -159,6 +161,7 @@ static void Key( unsigned char key, int x, int y )
glutIdleFunc(NULL);
break;
case 27:
+ glutDestroyWindow(Win);
exit(0);
break;
}
@@ -263,7 +266,7 @@ int main( int argc, char *argv[] )
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
- glutCreateWindow(argv[0] );
+ Win = glutCreateWindow(argv[0] );
Init(argc, argv);
diff --git a/progs/demos/texenv.c b/progs/demos/texenv.c
index c4174dc173d..c5a8b13f35f 100644
--- a/progs/demos/texenv.c
+++ b/progs/demos/texenv.c
@@ -76,7 +76,8 @@ int textureWidth = 64;
int textureHeight = 64;
int winWidth = 580, winHeight = 720;
-int win;
+static int Win;
+
struct formatInfo {
GLenum baseFormat;
@@ -289,7 +290,7 @@ static void keyboard( unsigned char c, int x, int y )
displayLevelInfo = !displayLevelInfo;
break;
case 27: /* Escape key should force exit. */
- glutDestroyWindow(win);
+ glutDestroyWindow(Win);
exit(0);
break;
default:
@@ -787,7 +788,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( winWidth, winHeight );
glutInitWindowPosition( 0, 0 );
- win = glutCreateWindow( "Texture Environment Test" );
+ Win = glutCreateWindow( "Texture Environment Test" );
initialize();
instructions();
diff --git a/progs/demos/textures.c b/progs/demos/textures.c
new file mode 100644
index 00000000000..b7bf135d219
--- /dev/null
+++ b/progs/demos/textures.c
@@ -0,0 +1,374 @@
+/*
+ * Simple test of multiple textures
+ */
+
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <GL/glut.h>
+#include "readtex.h"
+
+#define TEST_CLAMP 0
+#define TEST_MIPMAPS 0
+
+#define MAX_TEXTURES 8
+
+
+static int Win;
+static GLfloat Xrot = 0, Yrot = 0, Zrot = 0;
+static GLboolean Anim = GL_TRUE;
+static GLboolean Blend = GL_FALSE;
+static GLuint Filter = 0;
+static GLboolean Clamp = GL_FALSE;
+
+static GLuint NumTextures;
+static GLuint Textures[MAX_TEXTURES];
+static float TexRot[MAX_TEXTURES][3];
+static float TexPos[MAX_TEXTURES][3];
+static float TexAspect[MAX_TEXTURES];
+
+static const char *DefaultFiles[] = {
+ "../images/arch.rgb",
+ "../images/reflect.rgb",
+ "../images/tree2.rgba",
+ "../images/tile.rgb"
+};
+
+
+#define NUM_FILTERS 5
+static
+struct filter {
+ GLenum min, mag;
+ const char *name;
+} FilterModes[NUM_FILTERS] = {
+ { GL_NEAREST, GL_NEAREST, "Nearest,Nearest" },
+ { GL_LINEAR, GL_LINEAR, "Linear,Linear" },
+ { GL_NEAREST_MIPMAP_NEAREST, GL_NEAREST, "NearestMipmapNearest,Nearest" },
+ { GL_LINEAR_MIPMAP_NEAREST, GL_LINEAR, "LinearMipmapNearest,Linear" },
+ { GL_LINEAR_MIPMAP_LINEAR, GL_LINEAR, "LinearMipmapLinear,Linear" }
+};
+
+
+
+
+static void
+Idle(void)
+{
+ Xrot = glutGet(GLUT_ELAPSED_TIME) * 0.02;
+ Yrot = glutGet(GLUT_ELAPSED_TIME) * 0.04;
+ //Zrot += 2.0;
+ glutPostRedisplay();
+}
+
+
+static void
+DrawTextures(void)
+{
+ GLuint i;
+
+ for (i = 0; i < NumTextures; i++) {
+ GLfloat ar = TexAspect[i];
+
+ glPushMatrix();
+ glTranslatef(TexPos[i][0], TexPos[i][1], TexPos[i][2]);
+ glRotatef(TexRot[i][0], 1, 0, 0);
+ glRotatef(TexRot[i][1], 0, 1, 0);
+ glRotatef(TexRot[i][2], 0, 0, 1);
+
+ glBindTexture(GL_TEXTURE_2D, Textures[i]);
+ glBegin(GL_POLYGON);
+#if TEST_CLAMP
+ glTexCoord2f( -0.5, -0.5 ); glVertex2f( -ar, -1.0 );
+ glTexCoord2f( 1.5, -0.5 ); glVertex2f( ar, -1.0 );
+ glTexCoord2f( 1.5, 1.5 ); glVertex2f( ar, 1.0 );
+ glTexCoord2f( -0.5, 1.5 ); glVertex2f( -ar, 1.0 );
+#else
+ glTexCoord2f( 0.0, 0.0 ); glVertex2f( -ar, -1.0 );
+ glTexCoord2f( 1.0, 0.0 ); glVertex2f( ar, -1.0 );
+ glTexCoord2f( 1.0, 1.0 ); glVertex2f( ar, 1.0 );
+ glTexCoord2f( 0.0, 1.0 ); glVertex2f( -ar, 1.0 );
+#endif
+ glEnd();
+
+ glPopMatrix();
+ }
+}
+
+static void
+Draw(void)
+{
+ glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+
+ if (Blend) {
+ glEnable(GL_BLEND);
+ glDisable(GL_DEPTH_TEST);
+ }
+ else {
+ glDisable(GL_BLEND);
+ glEnable(GL_DEPTH_TEST);
+ }
+
+ glPushMatrix();
+ glRotatef(Xrot, 1, 0, 0);
+ glRotatef(Yrot, 0, 1, 0);
+ glRotatef(Zrot, 0, 0, 1);
+
+ DrawTextures();
+
+ glPopMatrix();
+
+ glutSwapBuffers();
+}
+
+
+static void
+Reshape(int width, int height)
+{
+ glViewport(0, 0, width, height);
+ glMatrixMode(GL_PROJECTION);
+ glLoadIdentity();
+ glFrustum(-1.0, 1.0, -1.0, 1.0, 5.0, 50.0);
+ glMatrixMode(GL_MODELVIEW);
+ glLoadIdentity();
+ glTranslatef(0.0, 0.0, -10.0);
+}
+
+
+static GLfloat
+RandFloat(float min, float max)
+{
+ float x = (float) (rand() % 1000) * 0.001;
+ x = x * (max - min) + min;
+ return x;
+}
+
+
+static void
+Randomize(void)
+{
+ GLfloat k = 1.0;
+ GLuint i;
+
+ srand(glutGet(GLUT_ELAPSED_TIME));
+
+ for (i = 0; i < NumTextures; i++) {
+ TexRot[i][0] = RandFloat(0.0, 360);
+ TexRot[i][1] = RandFloat(0.0, 360);
+ TexRot[i][2] = RandFloat(0.0, 360);
+ TexPos[i][0] = RandFloat(-k, k);
+ TexPos[i][1] = RandFloat(-k, k);
+ TexPos[i][2] = RandFloat(-k, k);
+ }
+}
+
+
+static void
+SetTexParams(void)
+{
+ GLuint i;
+ for (i = 0; i < NumTextures; i++) {
+ glBindTexture(GL_TEXTURE_2D, Textures[i]);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER,
+ FilterModes[Filter].min);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER,
+ FilterModes[Filter].mag);
+
+ if (Clamp) {
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
+ }
+ else {
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
+ }
+ }
+}
+
+
+static void
+Key(unsigned char key, int x, int y)
+{
+ const GLfloat step = 3.0;
+ (void) x;
+ (void) y;
+ switch (key) {
+ case 'a':
+ case ' ':
+ Anim = !Anim;
+ if (Anim)
+ glutIdleFunc(Idle);
+ else
+ glutIdleFunc(NULL);
+ break;
+ case 'b':
+ Blend = !Blend;
+ break;
+ case 'f':
+ Filter = (Filter + 1) % NUM_FILTERS;
+ SetTexParams();
+ break;
+ case 'r':
+ Randomize();
+ break;
+#if TEST_CLAMP
+ case 'c':
+ Clamp = !Clamp;
+ SetTexParams();
+ break;
+#endif
+ case 'z':
+ Zrot -= step;
+ break;
+ case 'Z':
+ Zrot += step;
+ break;
+ case 27:
+ glutDestroyWindow(Win);
+ exit(0);
+ break;
+ }
+
+ printf("Blend=%s Filter=%s\n",
+ Blend ? "Y" : "n",
+ FilterModes[Filter].name);
+
+ glutPostRedisplay();
+}
+
+
+static void
+SpecialKey(int key, int x, int y)
+{
+ const GLfloat step = 3.0;
+ (void) x;
+ (void) y;
+ switch (key) {
+ case GLUT_KEY_UP:
+ Xrot -= step;
+ break;
+ case GLUT_KEY_DOWN:
+ Xrot += step;
+ break;
+ case GLUT_KEY_LEFT:
+ Yrot -= step;
+ break;
+ case GLUT_KEY_RIGHT:
+ Yrot += step;
+ break;
+ }
+ glutPostRedisplay();
+}
+
+
+static void
+LoadTextures(GLuint n, const char *files[])
+{
+ GLuint i;
+
+ NumTextures = n < MAX_TEXTURES ? n : MAX_TEXTURES;
+
+ glGenTextures(n, Textures);
+
+ SetTexParams();
+
+ for (i = 0; i < n; i++) {
+ GLint w, h;
+ glBindTexture(GL_TEXTURE_2D, Textures[i]);
+#if TEST_MIPMAPS
+ {
+ static const GLubyte color[9][4] = {
+ {255, 0, 0},
+ {0, 255, 0},
+ {0, 0, 255},
+ {0, 255, 255},
+ {255, 0, 255},
+ {255, 255, 0},
+ {255, 128, 255},
+ {128, 128, 128},
+ {64, 64, 64}
+ };
+
+ GLubyte image[256*256*4];
+ int i, level;
+ w = h = 256;
+ for (level = 0; level <= 8; level++) {
+ for (i = 0; i < w * h; i++) {
+ image[i*4+0] = color[level][0];
+ image[i*4+1] = color[level][1];
+ image[i*4+2] = color[level][2];
+ image[i*4+3] = color[level][3];
+ }
+ printf("Load level %d: %d x %d\n", level, w>>level, h>>level);
+ glTexImage2D(GL_TEXTURE_2D, level, GL_RGBA, w>>level, h>>level, 0,
+ GL_RGBA, GL_UNSIGNED_BYTE, image);
+ }
+ }
+#else
+ if (!LoadRGBMipmaps2(files[i], GL_TEXTURE_2D, GL_RGB, &w, &h)) {
+ printf("Error: couldn't load %s\n", files[i]);
+ exit(1);
+ }
+#endif
+ TexAspect[i] = (float) w / (float) h;
+ printf("Loaded %s\n", files[i]);
+ }
+}
+
+
+static void
+Init(int argc, const char *argv[])
+{
+ if (argc == 1)
+ LoadTextures(4, DefaultFiles);
+ else
+ LoadTextures(argc - 1, argv + 1);
+
+ Randomize();
+
+ glEnable(GL_TEXTURE_2D);
+
+ glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+ glColor4f(1, 1, 1, 0.5);
+
+#if 0
+ /* setup lighting, etc */
+ glEnable(GL_LIGHTING);
+ glEnable(GL_LIGHT0);
+#endif
+}
+
+
+static void
+Usage(void)
+{
+ printf("Usage:\n");
+ printf(" textures [file.rgb] ...\n");
+ printf("Keys:\n");
+ printf(" a - toggle animation\n");
+ printf(" b - toggle blending\n");
+ printf(" f - change texture filter mode\n");
+ printf(" r - randomize\n");
+ printf(" ESC - exit\n");
+}
+
+
+int
+main(int argc, char *argv[])
+{
+ glutInit(&argc, argv);
+ glutInitWindowPosition(0, 0);
+ glutInitWindowSize(700, 700);
+ glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
+ Win = glutCreateWindow(argv[0]);
+ glutReshapeFunc(Reshape);
+ glutKeyboardFunc(Key);
+ glutSpecialFunc(SpecialKey);
+ glutDisplayFunc(Draw);
+ if (Anim)
+ glutIdleFunc(Idle);
+ Init(argc, (const char **) argv);
+ Usage();
+ glutMainLoop();
+ return 0;
+}
diff --git a/progs/demos/tunnel2.c b/progs/demos/tunnel2.c
index 75a199af5d3..f4171a8346d 100644
--- a/progs/demos/tunnel2.c
+++ b/progs/demos/tunnel2.c
@@ -205,6 +205,8 @@ key(unsigned char k, int x, int y)
{
switch (k) {
case 27:
+ glutDestroyWindow(channel[0]);
+ glutDestroyWindow(channel[1]);
exit(0);
break;
diff --git a/progs/demos/winpos.c b/progs/demos/winpos.c
index b58e3308643..13a9c7e9a8f 100644
--- a/progs/demos/winpos.c
+++ b/progs/demos/winpos.c
@@ -11,7 +11,7 @@
#ifdef _WIN32
#include <windows.h>
#endif
-#define GL_GLEXT_PROTOTYPES
+#include "GL/glew.h"
#include "GL/glut.h"
#include "readtex.h"
@@ -29,8 +29,7 @@ static GLubyte *Image;
static int ImgWidth, ImgHeight;
static GLenum ImgFormat;
-typedef void (APIENTRY * PFNWINDOWPOSFUNC)(GLfloat x, GLfloat y);
-static PFNWINDOWPOSFUNC WindowPosFunc;
+static PFNGLWINDOWPOS2FPROC WindowPosFunc;
static void draw( void )
{
@@ -71,19 +70,16 @@ static void reshape( int width, int height )
static void init( void )
{
-#ifdef GL_ARB_window_pos
- if (glutExtensionSupported("GL_ARB_window_pos")) {
+ if (GLEW_ARB_window_pos) {
printf("Using GL_ARB_window_pos\n");
- WindowPosFunc = &glWindowPos2fARB;
+ WindowPosFunc = glWindowPos2fARB;
}
else
-#elif defined(GL_MESA_window_pos)
- if (glutExtensionSupported("GL_MESA_window_pos")) {
+ if (GLEW_MESA_window_pos) {
printf("Using GL_MESA_window_pos\n");
- WindowPosFunc = &glWindowPos2fMESA;
+ WindowPosFunc = glWindowPos2fMESA;
}
else
-#endif
{
printf("Sorry, GL_ARB/MESA_window_pos extension not available.\n");
exit(1);
@@ -109,6 +105,8 @@ int main( int argc, char *argv[] )
exit(0);
}
+ glewInit();
+
init();
glutReshapeFunc( reshape );
diff --git a/progs/egl/.gitignore b/progs/egl/.gitignore
index 1751108235a..793c6c0f614 100644
--- a/progs/egl/.gitignore
+++ b/progs/egl/.gitignore
@@ -3,3 +3,8 @@ demo2
demo3
eglgears
eglinfo
+eglscreen
+egltri
+peglgears
+xeglgears
+xegl_tri
diff --git a/progs/egl/Makefile b/progs/egl/Makefile
index 416d2c04b22..e1fdb1ce63d 100644
--- a/progs/egl/Makefile
+++ b/progs/egl/Makefile
@@ -12,8 +12,13 @@ PROGRAMS = \
demo1 \
demo2 \
demo3 \
+ egltri \
eglinfo \
- eglgears
+ eglgears \
+ eglscreen \
+ peglgears \
+ xeglgears \
+ xegl_tri
.c.o:
@@ -32,34 +37,68 @@ demo1.o: demo1.c $(HEADERS)
demo2: demo2.o $(TOP)/$(LIB_DIR)/libEGL.so
- $(CC) $(CFLAGS) $(LDFLAGS) demo2.o -L$(TOP)/$(LIB_DIR) -lEGL $(LIBDRM_LIB) $(APP_LIB_DEPS) -o $@
+ $(CC) $(CFLAGS) $(LDFLAGS) demo2.o -L$(TOP)/$(LIB_DIR) -lEGL -lGL $(LIBDRM_LIB) $(APP_LIB_DEPS) -o $@
demo2.o: demo2.c $(HEADERS)
$(CC) -c $(CFLAGS) -I$(TOP)/include demo2.c
demo3: demo3.o $(TOP)/$(LIB_DIR)/libEGL.so
- $(CC) $(CFLAGS) $(LDFLAGS) demo3.o -L$(TOP)/$(LIB_DIR) -lEGL $(LIBDRM_LIB) $(APP_LIB_DEPS) -o $@
+ $(CC) $(CFLAGS) $(LDFLAGS) demo3.o -L$(TOP)/$(LIB_DIR) -lEGL -lGL $(LIBDRM_LIB) $(APP_LIB_DEPS) -o $@
demo3.o: demo3.c $(HEADERS)
$(CC) -c $(CFLAGS) -I$(TOP)/include demo3.c
+egltri: egltri.o $(TOP)/$(LIB_DIR)/libEGL.so
+ $(CC) $(CFLAGS) egltri.o -L$(TOP)/$(LIB_DIR) -lEGL -lGL $(LIBDRM_LIB) -o $@
+
+egltri.o: egltri.c $(HEADERS)
+ $(CC) -c $(CFLAGS) -I$(TOP)/include egltri.c
+
+
eglinfo: eglinfo.o $(TOP)/$(LIB_DIR)/libEGL.so
- $(CC) $(CFLAGS) $(LDFLAGS) eglinfo.o -L$(TOP)/$(LIB_DIR) -lEGL $(LIBDRM_LIB) -o $@
+ $(CC) $(CFLAGS) $(LDFLAGS) eglinfo.o -L$(TOP)/$(LIB_DIR) -lEGL -lGL $(LIBDRM_LIB) -o $@
eglinfo.o: eglinfo.c $(HEADERS)
$(CC) -c $(CFLAGS) -I$(TOP)/include eglinfo.c
eglgears: eglgears.o $(TOP)/$(LIB_DIR)/libEGL.so
- $(CC) $(CFLAGS) $(LDFLAGS) eglgears.o -L$(TOP)/$(LIB_DIR) -lEGL $(LIBDRM_LIB) $(APP_LIB_DEPS) -o $@
+ $(CC) $(CFLAGS) $(LDFLAGS) eglgears.o -L$(TOP)/$(LIB_DIR) -lEGL -lGL $(LIBDRM_LIB) $(APP_LIB_DEPS) -o $@
eglgears.o: eglgears.c $(HEADERS)
$(CC) -c $(CFLAGS) -I$(TOP)/include eglgears.c
+eglscreen: eglscreen.o $(TOP)/$(LIB_DIR)/libEGL.so
+ $(CC) $(CFLAGS) $(LDFLAGS) eglscreen.o -L$(TOP)/$(LIB_DIR) -lEGL -lGL $(LIBDRM_LIB) $(APP_LIB_DEPS) -o $@
+
+eglscreen.o: eglscreen.c $(HEADERS)
+ $(CC) -c $(CFLAGS) -I$(TOP)/include eglscreen.c
+
+peglgears: peglgears.o $(TOP)/$(LIB_DIR)/libEGL.so
+ $(CC) $(CFLAGS) peglgears.o -L$(TOP)/$(LIB_DIR) -lEGL -lGL $(LIBDRM_LIB) $(APP_LIB_DEPS) -o $@
+
+peglgears.o: peglgears.c $(HEADERS)
+ $(CC) -c $(CFLAGS) -I$(TOP)/include peglgears.c
+
+
+xeglgears: xeglgears.o $(TOP)/$(LIB_DIR)/libEGL.so
+ $(CC) $(CFLAGS) xeglgears.o -L$(TOP)/$(LIB_DIR) -lEGL -lGL $(LIBDRM_LIB) $(APP_LIB_DEPS) -o $@
+
+xeglgears.o: xeglgears.c $(HEADERS)
+ $(CC) -c $(CFLAGS) -I$(TOP)/include xeglgears.c
+
+
+xegl_tri: xegl_tri.o $(TOP)/$(LIB_DIR)/libEGL.so
+ $(CC) $(CFLAGS) xegl_tri.o -L$(TOP)/$(LIB_DIR) -lEGL -lGL $(LIBDRM_LIB) $(APP_LIB_DEPS) -o $@
+
+xegl_tri.o: xegl_tri.c $(HEADERS)
+ $(CC) -c $(CFLAGS) -I$(TOP)/include xegl_tri.c
+
clean:
-rm -f *.o *~
-rm -f *.so
-rm -f $(PROGRAMS)
+
diff --git a/progs/egl/demo1.c b/progs/egl/demo1.c
index 9ef17e38b7d..49b66245388 100644
--- a/progs/egl/demo1.c
+++ b/progs/egl/demo1.c
@@ -2,7 +2,10 @@
* Exercise EGL API functions
*/
-#include <GLES/egl.h>
+#define EGL_EGLEXT_PROTOTYPES
+
+#include <EGL/egl.h>
+#include <EGL/eglext.h>
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
@@ -102,7 +105,7 @@ main(int argc, char *argv[])
/*
EGLDisplay d = eglGetDisplay(EGL_DEFAULT_DISPLAY);
*/
- EGLDisplay d = eglGetDisplay("!fb_dri");
+ EGLDisplay d = eglGetDisplay((EGLNativeDisplayType) "!EGL_i915");
assert(d);
if (!eglInitialize(d, &maj, &min)) {
diff --git a/progs/egl/demo2.c b/progs/egl/demo2.c
index 17bbca61587..d7283e13bd3 100644
--- a/progs/egl/demo2.c
+++ b/progs/egl/demo2.c
@@ -2,35 +2,54 @@
* Exercise EGL API functions
*/
+#define EGL_EGLEXT_PROTOTYPES
+
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
-#include <GLES/egl.h>
+#include <EGL/egl.h>
+#include <EGL/eglext.h>
+#include <GLES/gl.h>
/*#define FRONTBUFFER*/
-static void _subset_Rectf(GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2)
+static void _subset_Rectf(GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2,
+ GLfloat r, GLfloat g, GLfloat b)
{
- glBegin( GL_QUADS );
- glVertex2f( x1, y1 );
- glVertex2f( x2, y1 );
- glVertex2f( x2, y2 );
- glVertex2f( x1, y2 );
- glEnd();
+ GLfloat v[4][2], c[4][4];
+ int i;
+
+ v[0][0] = x1; v[0][1] = y1;
+ v[1][0] = x2; v[1][1] = y1;
+ v[2][0] = x2; v[2][1] = y2;
+ v[3][0] = x1; v[3][1] = y2;
+
+ for (i = 0; i < 4; i++) {
+ c[i][0] = r;
+ c[i][1] = g;
+ c[i][2] = b;
+ c[i][3] = 1.0;
+ }
+
+ glVertexPointer(2, GL_FLOAT, 0, v);
+ glColorPointer(4, GL_FLOAT, 0, v);
+ glEnableClientState(GL_VERTEX_ARRAY);
+ glEnableClientState(GL_COLOR_ARRAY);
+
+ glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
+
+ glDisableClientState(GL_VERTEX_ARRAY);
+ glDisableClientState(GL_COLOR_ARRAY);
}
static void redraw(EGLDisplay dpy, EGLSurface surf, int rot)
{
- printf("Redraw event\n");
+ GLfloat r, g, b;
-#ifdef FRONTBUFFER
- glDrawBuffer( GL_FRONT );
-#else
- glDrawBuffer( GL_BACK );
-#endif
+ printf("Redraw event\n");
glClearColor( rand()/(float)RAND_MAX,
rand()/(float)RAND_MAX,
@@ -39,13 +58,14 @@ static void redraw(EGLDisplay dpy, EGLSurface surf, int rot)
glClear( GL_COLOR_BUFFER_BIT );
- glColor3f( rand()/(float)RAND_MAX,
- rand()/(float)RAND_MAX,
- rand()/(float)RAND_MAX );
+ r = rand()/(float)RAND_MAX;
+ g = rand()/(float)RAND_MAX;
+ b = rand()/(float)RAND_MAX;
+
glPushMatrix();
glRotatef(rot, 0, 0, 1);
glScalef(.5, .5, .5);
- _subset_Rectf( -1, -1, 1, 1 );
+ _subset_Rectf( -1, -1, 1, 1, r, g, b );
glPopMatrix();
#ifdef FRONTBUFFER
@@ -102,7 +122,7 @@ main(int argc, char *argv[])
/*
EGLDisplay d = eglGetDisplay(EGL_DEFAULT_DISPLAY);
*/
- EGLDisplay d = eglGetDisplay("!fb_dri");
+ EGLDisplay d = eglGetDisplay((EGLNativeDisplayType) "!EGL_i915");
assert(d);
if (!eglInitialize(d, &maj, &min)) {
@@ -161,7 +181,6 @@ main(int argc, char *argv[])
}
glViewport(0, 0, 1024, 768);
- glDrawBuffer( GL_FRONT );
glClearColor( 0,
1.0,
diff --git a/progs/egl/demo3.c b/progs/egl/demo3.c
index 9edf7c952b3..a6096a257ec 100644
--- a/progs/egl/demo3.c
+++ b/progs/egl/demo3.c
@@ -2,7 +2,11 @@
* Exercise EGL API functions
*/
-#include <GLES/egl.h>
+#define EGL_EGLEXT_PROTOTYPES
+
+#include <EGL/egl.h>
+#include <EGL/eglext.h>
+#include <GL/gl.h>
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
@@ -576,7 +580,7 @@ main(int argc, char *argv[])
/*
EGLDisplay d = eglGetDisplay(EGL_DEFAULT_DISPLAY);
*/
- EGLDisplay d = eglGetDisplay(":0");
+ EGLDisplay d = eglGetDisplay("!EGL_i915");
assert(d);
if (!eglInitialize(d, &maj, &min)) {
diff --git a/progs/egl/eglgears.c b/progs/egl/eglgears.c
index 9feee20d889..31346d95230 100644
--- a/progs/egl/eglgears.c
+++ b/progs/egl/eglgears.c
@@ -27,13 +27,16 @@
* Program runs for 5 seconds then exits, outputing framerate to console
*/
+#define EGL_EGLEXT_PROTOTYPES
+
+#include <assert.h>
#include <math.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <GL/gl.h>
-#include <GLES/egl.h>
-#include <assert.h>
+#include <EGL/egl.h>
+#include <EGL/eglext.h>
#define MAX_CONFIGS 10
#define MAX_MODES 100
@@ -385,7 +388,7 @@ main(int argc, char *argv[])
}
/* DBR : Create EGL context/surface etc */
- d = eglGetDisplay(":0");
+ d = eglGetDisplay((EGLNativeDisplayType)"!EGL_i915");
assert(d);
if (!eglInitialize(d, &maj, &min)) {
@@ -412,7 +415,7 @@ main(int argc, char *argv[])
eglGetModeAttribMESA(d, mode[i], EGL_WIDTH, &w);
eglGetModeAttribMESA(d, mode[i], EGL_HEIGHT, &h);
printf("%3d: %d x %d\n", i, w, h);
- if (w > width && h > height && w <= 1280 && h <= 1024) {
+ if (w > width && h > height) {
width = w;
height = h;
chosenMode = i;
diff --git a/progs/egl/eglinfo.c b/progs/egl/eglinfo.c
index f9c24754457..feae954b75a 100644
--- a/progs/egl/eglinfo.c
+++ b/progs/egl/eglinfo.c
@@ -24,8 +24,10 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
+#define EGL_EGLEXT_PROTOTYPES
-#include <GLES/egl.h>
+#include <EGL/egl.h>
+#include <EGL/eglext.h>
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
@@ -35,7 +37,6 @@
#define MAX_MODES 1000
#define MAX_SCREENS 10
-
/**
* Print table of all available configurations.
*/
@@ -48,15 +49,17 @@ PrintConfigs(EGLDisplay d)
eglGetConfigs(d, configs, MAX_CONFIGS, &numConfigs);
printf("Configurations:\n");
- printf(" bf lv d st colorbuffer dp st supported\n");
- printf(" id sz l b ro r g b a th cl surfaces \n");
- printf("---------------------------------------------------\n");
+ printf(" bf lv d st colorbuffer dp st ms vis supported\n");
+ printf(" id sz l b ro r g b a th cl ns b id surfaces \n");
+ printf("--------------------------------------------------------\n");
for (i = 0; i < numConfigs; i++) {
EGLint id, size, level;
EGLint red, green, blue, alpha;
EGLint depth, stencil;
EGLint surfaces;
EGLint doubleBuf = 1, stereo = 0;
+ EGLint vid;
+ EGLint samples, sampleBuffers;
char surfString[100] = "";
eglGetConfigAttrib(d, configs[i], EGL_CONFIG_ID, &id);
@@ -69,8 +72,12 @@ PrintConfigs(EGLDisplay d)
eglGetConfigAttrib(d, configs[i], EGL_ALPHA_SIZE, &alpha);
eglGetConfigAttrib(d, configs[i], EGL_DEPTH_SIZE, &depth);
eglGetConfigAttrib(d, configs[i], EGL_STENCIL_SIZE, &stencil);
+ eglGetConfigAttrib(d, configs[i], EGL_NATIVE_VISUAL_ID, &vid);
eglGetConfigAttrib(d, configs[i], EGL_SURFACE_TYPE, &surfaces);
+ eglGetConfigAttrib(d, configs[i], EGL_SAMPLES, &samples);
+ eglGetConfigAttrib(d, configs[i], EGL_SAMPLE_BUFFERS, &sampleBuffers);
+
if (surfaces & EGL_WINDOW_BIT)
strcat(surfString, "win,");
if (surfaces & EGL_PBUFFER_BIT)
@@ -84,12 +91,13 @@ PrintConfigs(EGLDisplay d)
if (strlen(surfString) > 0)
surfString[strlen(surfString) - 1] = 0;
- printf("0x%02x %2d %2d %c %c %2d %2d %2d %2d %2d %2d %-12s\n",
+ printf("0x%02x %2d %2d %c %c %2d %2d %2d %2d %2d %2d %2d%2d 0x%02x %-12s\n",
id, size, level,
doubleBuf ? 'y' : '.',
stereo ? 'y' : '.',
red, green, blue, alpha,
- depth, stencil, surfString);
+ depth, stencil,
+ samples, sampleBuffers, vid, surfString);
}
}
@@ -139,8 +147,8 @@ int
main(int argc, char *argv[])
{
int maj, min;
- /*EGLDisplay d = eglGetDisplay(EGL_DEFAULT_DISPLAY);*/
- EGLDisplay d = eglGetDisplay(":0");
+ //EGLDisplay d = eglGetDisplay((EGLNativeDisplayType)"!EGL_i915");
+ EGLDisplay d = eglGetDisplay((EGLNativeDisplayType)"!EGL_i915");
if (!eglInitialize(d, &maj, &min)) {
printf("eglinfo: eglInitialize failed\n");
@@ -150,14 +158,14 @@ main(int argc, char *argv[])
printf("EGL API version: %d.%d\n", maj, min);
printf("EGL vendor string: %s\n", eglQueryString(d, EGL_VENDOR));
printf("EGL version string: %s\n", eglQueryString(d, EGL_VERSION));
+#ifdef EGL_VERSION_1_2
+ printf("EGL client APIs: %s\n", eglQueryString(d, EGL_CLIENT_APIS));
+#endif
printf("EGL extensions string:\n");
printf(" %s\n", eglQueryString(d, EGL_EXTENSIONS));
- printf("\n");
PrintConfigs(d);
- printf("\n");
-
PrintModes(d);
eglTerminate(d);
diff --git a/progs/egl/eglscreen.c b/progs/egl/eglscreen.c
new file mode 100644
index 00000000000..c0b5a210a4a
--- /dev/null
+++ b/progs/egl/eglscreen.c
@@ -0,0 +1,119 @@
+/*
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/*
+ * Stolen from eglgears
+ *
+ * Creates a surface and show that on the first screen
+ */
+
+#define EGL_EGLEXT_PROTOTYPES
+
+#include <assert.h>
+#include <math.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
+#include <GL/gl.h>
+#include <EGL/egl.h>
+#include <EGL/eglext.h>
+
+#define MAX_CONFIGS 10
+#define MAX_MODES 100
+
+int
+main(int argc, char *argv[])
+{
+ int maj, min;
+ EGLSurface screen_surf;
+ EGLConfig configs[MAX_CONFIGS];
+ EGLint numConfigs, i;
+ EGLBoolean b;
+ EGLDisplay d;
+ EGLint screenAttribs[10];
+ EGLModeMESA mode[MAX_MODES];
+ EGLScreenMESA screen;
+ EGLint count, chosenMode;
+ EGLint width = 0, height = 0;
+
+ d = eglGetDisplay((EGLNativeDisplayType)"!EGL_i915");
+ assert(d);
+
+ if (!eglInitialize(d, &maj, &min)) {
+ printf("eglscreen: eglInitialize failed\n");
+ exit(1);
+ }
+
+ printf("eglscreen: EGL version = %d.%d\n", maj, min);
+ printf("eglscreen: EGL_VENDOR = %s\n", eglQueryString(d, EGL_VENDOR));
+
+ /* XXX use ChooseConfig */
+ eglGetConfigs(d, configs, MAX_CONFIGS, &numConfigs);
+ eglGetScreensMESA(d, &screen, 1, &count);
+
+ if (!eglGetModesMESA(d, screen, mode, MAX_MODES, &count) || count == 0) {
+ printf("eglscreen: eglGetModesMESA failed!\n");
+ return 0;
+ }
+
+ /* Print list of modes, and find the one to use */
+ printf("eglscreen: Found %d modes:\n", count);
+ for (i = 0; i < count; i++) {
+ EGLint w, h;
+ eglGetModeAttribMESA(d, mode[i], EGL_WIDTH, &w);
+ eglGetModeAttribMESA(d, mode[i], EGL_HEIGHT, &h);
+ printf("%3d: %d x %d\n", i, w, h);
+ if (w > width && h > height) {
+ width = w;
+ height = h;
+ chosenMode = i;
+ }
+ }
+ printf("eglscreen: Using screen mode/size %d: %d x %d\n", chosenMode, width, height);
+
+ /* build up screenAttribs array */
+ i = 0;
+ screenAttribs[i++] = EGL_WIDTH;
+ screenAttribs[i++] = width;
+ screenAttribs[i++] = EGL_HEIGHT;
+ screenAttribs[i++] = height;
+ screenAttribs[i++] = EGL_NONE;
+
+ screen_surf = eglCreateScreenSurfaceMESA(d, configs[0], screenAttribs);
+ if (screen_surf == EGL_NO_SURFACE) {
+ printf("eglscreen: Failed to create screen surface\n");
+ return 0;
+ }
+
+ b = eglShowScreenSurfaceMESA(d, screen, screen_surf, mode[chosenMode]);
+ if (!b) {
+ printf("eglscreen: Show surface failed\n");
+ return 0;
+ }
+
+ usleep(5000000);
+
+ eglDestroySurface(d, screen_surf);
+ eglTerminate(d);
+
+ return 0;
+}
diff --git a/progs/egl/egltri.c b/progs/egl/egltri.c
new file mode 100644
index 00000000000..44096d94a27
--- /dev/null
+++ b/progs/egl/egltri.c
@@ -0,0 +1,264 @@
+/*
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ * Copyright (C) 2008 Brian Paul All Rights Reserved.
+ * Copyright (C) 2008 Jakob Bornecrantz All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/*
+ * This program is based on eglgears and xegl_tri.
+ * Remixed by Jakob Bornecrantz
+ *
+ * No command line options.
+ * Program runs for 5 seconds then exits, outputing framerate to console
+ */
+
+#define EGL_EGLEXT_PROTOTYPES
+
+#include <assert.h>
+#include <math.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <GL/gl.h>
+#include <EGL/egl.h>
+#include <EGL/eglext.h>
+
+#define MAX_CONFIGS 10
+#define MAX_MODES 100
+
+
+/* XXX this probably isn't very portable */
+
+#include <sys/time.h>
+#include <unistd.h>
+
+/* return current time (in seconds) */
+static double
+current_time(void)
+{
+ struct timeval tv;
+#ifdef __VMS
+ (void) gettimeofday(&tv, NULL );
+#else
+ struct timezone tz;
+ (void) gettimeofday(&tv, &tz);
+#endif
+ return (double) tv.tv_sec + tv.tv_usec / 1000000.0;
+}
+
+
+static GLfloat view_rotx = 0.0, view_roty = 0.0, view_rotz = 0.0;
+
+static void draw()
+{
+ static const GLfloat verts[3][2] = {
+ { -1, -1 },
+ { 1, -1 },
+ { 0, 1 }
+ };
+ static const GLfloat colors[3][3] = {
+ { 1, 0, 0 },
+ { 0, 1, 0 },
+ { 0, 0, 1 }
+ };
+
+ glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+
+ glPushMatrix();
+ glRotatef(view_rotx, 1, 0, 0);
+ glRotatef(view_roty, 0, 1, 0);
+ glRotatef(view_rotz, 0, 0, 1);
+
+ {
+ glVertexPointer(2, GL_FLOAT, 0, verts);
+ glColorPointer(3, GL_FLOAT, 0, colors);
+ glEnableClientState(GL_VERTEX_ARRAY);
+ glEnableClientState(GL_COLOR_ARRAY);
+
+ glDrawArrays(GL_TRIANGLES, 0, 3);
+
+ glDisableClientState(GL_VERTEX_ARRAY);
+ glDisableClientState(GL_COLOR_ARRAY);
+ }
+
+ glPopMatrix();
+}
+
+static void init()
+{
+ glClearColor(0.4, 0.4, 0.4, 0.0);
+}
+
+/* new window size or exposure */
+static void reshape(int width, int height)
+{
+ GLfloat ar = (GLfloat) width / (GLfloat) height;
+
+ glViewport(0, 0, (GLint) width, (GLint) height);
+
+ glMatrixMode(GL_PROJECTION);
+ glLoadIdentity();
+ glFrustum(-ar, ar, -1, 1, 5.0, 60.0);
+
+ glMatrixMode(GL_MODELVIEW);
+ glLoadIdentity();
+ glTranslatef(0.0, 0.0, -10.0);
+}
+
+static void run(EGLDisplay dpy, EGLSurface surf, int ttr)
+{
+ double st = current_time();
+ double ct = st;
+ int frames = 0;
+
+ while (ct - st < ttr)
+ {
+ double tt = current_time();
+ double dt = tt - ct;
+ ct = tt;
+
+ draw();
+
+ eglSwapBuffers(dpy, surf);
+
+ frames++;
+ }
+
+ GLfloat seconds = ct - st;
+ GLfloat fps = frames / seconds;
+ printf("%d frames in %3.1f seconds = %6.3f FPS\n", frames, seconds, fps);
+}
+
+int main(int argc, char *argv[])
+{
+ int maj, min;
+ EGLContext ctx;
+ EGLSurface screen_surf;
+ EGLConfig configs[MAX_CONFIGS];
+ EGLint numConfigs, i;
+ EGLBoolean b;
+ EGLDisplay d;
+ EGLint screenAttribs[10];
+ EGLModeMESA mode[MAX_MODES];
+ EGLScreenMESA screen;
+ EGLint count, chosenMode = 0;
+ GLboolean printInfo = GL_FALSE;
+ EGLint width = 0, height = 0;
+
+ /* parse cmd line args */
+ for (i = 1; i < argc; i++)
+ {
+ if (strcmp(argv[i], "-info") == 0)
+ {
+ printInfo = GL_TRUE;
+ }
+ else
+ printf("Warning: unknown parameter: %s\n", argv[i]);
+ }
+
+ /* DBR : Create EGL context/surface etc */
+ d = eglGetDisplay((EGLNativeDisplayType)"!EGL_i915");
+ assert(d);
+
+ if (!eglInitialize(d, &maj, &min)) {
+ printf("egltri: eglInitialize failed\n");
+ exit(1);
+ }
+
+ printf("egltri: EGL version = %d.%d\n", maj, min);
+ printf("egltri: EGL_VENDOR = %s\n", eglQueryString(d, EGL_VENDOR));
+
+ /* XXX use ChooseConfig */
+ eglGetConfigs(d, configs, MAX_CONFIGS, &numConfigs);
+ eglGetScreensMESA(d, &screen, 1, &count);
+
+ if (!eglGetModesMESA(d, screen, mode, MAX_MODES, &count) || count == 0) {
+ printf("egltri: eglGetModesMESA failed!\n");
+ return 0;
+ }
+
+ /* Print list of modes, and find the one to use */
+ printf("egltri: Found %d modes:\n", count);
+ for (i = 0; i < count; i++) {
+ EGLint w, h;
+ eglGetModeAttribMESA(d, mode[i], EGL_WIDTH, &w);
+ eglGetModeAttribMESA(d, mode[i], EGL_HEIGHT, &h);
+ printf("%3d: %d x %d\n", i, w, h);
+ if (w > width && h > height) {
+ width = w;
+ height = h;
+ chosenMode = i;
+ }
+ }
+ printf("egltri: Using screen mode/size %d: %d x %d\n", chosenMode, width, height);
+
+ ctx = eglCreateContext(d, configs[0], EGL_NO_CONTEXT, NULL);
+ if (ctx == EGL_NO_CONTEXT) {
+ printf("egltri: failed to create context\n");
+ return 0;
+ }
+
+ /* build up screenAttribs array */
+ i = 0;
+ screenAttribs[i++] = EGL_WIDTH;
+ screenAttribs[i++] = width;
+ screenAttribs[i++] = EGL_HEIGHT;
+ screenAttribs[i++] = height;
+ screenAttribs[i++] = EGL_NONE;
+
+ screen_surf = eglCreateScreenSurfaceMESA(d, configs[0], screenAttribs);
+ if (screen_surf == EGL_NO_SURFACE) {
+ printf("egltri: failed to create screen surface\n");
+ return 0;
+ }
+
+ b = eglShowScreenSurfaceMESA(d, screen, screen_surf, mode[chosenMode]);
+ if (!b) {
+ printf("egltri: show surface failed\n");
+ return 0;
+ }
+
+ b = eglMakeCurrent(d, screen_surf, screen_surf, ctx);
+ if (!b) {
+ printf("egltri: make current failed\n");
+ return 0;
+ }
+
+ if (printInfo)
+ {
+ printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
+ printf("GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
+ printf("GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
+ printf("GL_EXTENSIONS = %s\n", (char *) glGetString(GL_EXTENSIONS));
+ }
+
+ init();
+ reshape(width, height);
+
+ glDrawBuffer( GL_BACK );
+
+ run(d, screen_surf, 5.0);
+
+ eglDestroySurface(d, screen_surf);
+ eglDestroyContext(d, ctx);
+ eglTerminate(d);
+
+ return 0;
+}
diff --git a/progs/egl/peglgears.c b/progs/egl/peglgears.c
new file mode 100644
index 00000000000..bac16453c16
--- /dev/null
+++ b/progs/egl/peglgears.c
@@ -0,0 +1,449 @@
+/*
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/*
+ * This is a port of the infamous "glxgears" demo to straight EGL
+ * Port by Dane Rushton 10 July 2005
+ *
+ * No command line options.
+ * Program runs for 5 seconds then exits, outputing framerate to console
+ */
+
+#define EGL_EGLEXT_PROTOTYPES
+
+#include <assert.h>
+#include <math.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <GL/gl.h>
+#include <EGL/egl.h>
+#include <EGL/eglext.h>
+
+#define MAX_CONFIGS 10
+#define MAX_MODES 100
+
+#define BENCHMARK
+
+#ifdef BENCHMARK
+
+/* XXX this probably isn't very portable */
+
+#include <sys/time.h>
+#include <unistd.h>
+
+/* return current time (in seconds) */
+static double
+current_time(void)
+{
+ struct timeval tv;
+#ifdef __VMS
+ (void) gettimeofday(&tv, NULL );
+#else
+ struct timezone tz;
+ (void) gettimeofday(&tv, &tz);
+#endif
+ return (double) tv.tv_sec + tv.tv_usec / 1000000.0;
+}
+
+#else /*BENCHMARK*/
+
+/* dummy */
+static double
+current_time(void)
+{
+ /* update this function for other platforms! */
+ static double t = 0.0;
+ static int warn = 1;
+ if (warn) {
+ fprintf(stderr, "Warning: current_time() not implemented!!\n");
+ warn = 0;
+ }
+ return t += 1.0;
+}
+
+#endif /*BENCHMARK*/
+
+
+#ifndef M_PI
+#define M_PI 3.14159265
+#endif
+
+
+static GLfloat view_rotx = 20.0, view_roty = 30.0, view_rotz = 0.0;
+static GLint gear1, gear2, gear3;
+static GLfloat angle = 0.0;
+
+#if 0
+static GLfloat eyesep = 5.0; /* Eye separation. */
+static GLfloat fix_point = 40.0; /* Fixation point distance. */
+static GLfloat left, right, asp; /* Stereo frustum params. */
+#endif
+
+
+/*
+ *
+ * Draw a gear wheel. You'll probably want to call this function when
+ * building a display list since we do a lot of trig here.
+ *
+ * Input: inner_radius - radius of hole at center
+ * outer_radius - radius at center of teeth
+ * width - width of gear
+ * teeth - number of teeth
+ * tooth_depth - depth of tooth
+ */
+static void
+gear(GLfloat inner_radius, GLfloat outer_radius, GLfloat width,
+ GLint teeth, GLfloat tooth_depth)
+{
+ GLint i;
+ GLfloat r0, r1, r2;
+ GLfloat angle, da;
+ GLfloat u, v, len;
+
+ r0 = inner_radius;
+ r1 = outer_radius - tooth_depth / 2.0;
+ r2 = outer_radius + tooth_depth / 2.0;
+
+ da = 2.0 * M_PI / teeth / 4.0;
+
+ glShadeModel(GL_FLAT);
+
+ glNormal3f(0.0, 0.0, 1.0);
+
+ /* draw front face */
+ glBegin(GL_QUAD_STRIP);
+ for (i = 0; i <= teeth; i++) {
+ angle = i * 2.0 * M_PI / teeth;
+ glVertex3f(r0 * cos(angle), r0 * sin(angle), width * 0.5);
+ glVertex3f(r1 * cos(angle), r1 * sin(angle), width * 0.5);
+ if (i < teeth) {
+ glVertex3f(r0 * cos(angle), r0 * sin(angle), width * 0.5);
+ glVertex3f(r1 * cos(angle + 3 * da), r1 * sin(angle + 3 * da),
+ width * 0.5);
+ }
+ }
+ glEnd();
+
+ /* draw front sides of teeth */
+ glBegin(GL_QUADS);
+ da = 2.0 * M_PI / teeth / 4.0;
+ for (i = 0; i < teeth; i++) {
+ angle = i * 2.0 * M_PI / teeth;
+
+ glVertex3f(r1 * cos(angle), r1 * sin(angle), width * 0.5);
+ glVertex3f(r2 * cos(angle + da), r2 * sin(angle + da), width * 0.5);
+ glVertex3f(r2 * cos(angle + 2 * da), r2 * sin(angle + 2 * da),
+ width * 0.5);
+ glVertex3f(r1 * cos(angle + 3 * da), r1 * sin(angle + 3 * da),
+ width * 0.5);
+ }
+ glEnd();
+
+ glNormal3f(0.0, 0.0, -1.0);
+
+ /* draw back face */
+ glBegin(GL_QUAD_STRIP);
+ for (i = 0; i <= teeth; i++) {
+ angle = i * 2.0 * M_PI / teeth;
+ glVertex3f(r1 * cos(angle), r1 * sin(angle), -width * 0.5);
+ glVertex3f(r0 * cos(angle), r0 * sin(angle), -width * 0.5);
+ if (i < teeth) {
+ glVertex3f(r1 * cos(angle + 3 * da), r1 * sin(angle + 3 * da),
+ -width * 0.5);
+ glVertex3f(r0 * cos(angle), r0 * sin(angle), -width * 0.5);
+ }
+ }
+ glEnd();
+
+ /* draw back sides of teeth */
+ glBegin(GL_QUADS);
+ da = 2.0 * M_PI / teeth / 4.0;
+ for (i = 0; i < teeth; i++) {
+ angle = i * 2.0 * M_PI / teeth;
+
+ glVertex3f(r1 * cos(angle + 3 * da), r1 * sin(angle + 3 * da),
+ -width * 0.5);
+ glVertex3f(r2 * cos(angle + 2 * da), r2 * sin(angle + 2 * da),
+ -width * 0.5);
+ glVertex3f(r2 * cos(angle + da), r2 * sin(angle + da), -width * 0.5);
+ glVertex3f(r1 * cos(angle), r1 * sin(angle), -width * 0.5);
+ }
+ glEnd();
+
+ /* draw outward faces of teeth */
+ glBegin(GL_QUAD_STRIP);
+ for (i = 0; i < teeth; i++) {
+ angle = i * 2.0 * M_PI / teeth;
+
+ glVertex3f(r1 * cos(angle), r1 * sin(angle), width * 0.5);
+ glVertex3f(r1 * cos(angle), r1 * sin(angle), -width * 0.5);
+ u = r2 * cos(angle + da) - r1 * cos(angle);
+ v = r2 * sin(angle + da) - r1 * sin(angle);
+ len = sqrt(u * u + v * v);
+ u /= len;
+ v /= len;
+ glNormal3f(v, -u, 0.0);
+ glVertex3f(r2 * cos(angle + da), r2 * sin(angle + da), width * 0.5);
+ glVertex3f(r2 * cos(angle + da), r2 * sin(angle + da), -width * 0.5);
+ glNormal3f(cos(angle), sin(angle), 0.0);
+ glVertex3f(r2 * cos(angle + 2 * da), r2 * sin(angle + 2 * da),
+ width * 0.5);
+ glVertex3f(r2 * cos(angle + 2 * da), r2 * sin(angle + 2 * da),
+ -width * 0.5);
+ u = r1 * cos(angle + 3 * da) - r2 * cos(angle + 2 * da);
+ v = r1 * sin(angle + 3 * da) - r2 * sin(angle + 2 * da);
+ glNormal3f(v, -u, 0.0);
+ glVertex3f(r1 * cos(angle + 3 * da), r1 * sin(angle + 3 * da),
+ width * 0.5);
+ glVertex3f(r1 * cos(angle + 3 * da), r1 * sin(angle + 3 * da),
+ -width * 0.5);
+ glNormal3f(cos(angle), sin(angle), 0.0);
+ }
+
+ glVertex3f(r1 * cos(0), r1 * sin(0), width * 0.5);
+ glVertex3f(r1 * cos(0), r1 * sin(0), -width * 0.5);
+
+ glEnd();
+
+ glShadeModel(GL_SMOOTH);
+
+ /* draw inside radius cylinder */
+ glBegin(GL_QUAD_STRIP);
+ for (i = 0; i <= teeth; i++) {
+ angle = i * 2.0 * M_PI / teeth;
+ glNormal3f(-cos(angle), -sin(angle), 0.0);
+ glVertex3f(r0 * cos(angle), r0 * sin(angle), -width * 0.5);
+ glVertex3f(r0 * cos(angle), r0 * sin(angle), width * 0.5);
+ }
+ glEnd();
+}
+
+
+static void
+draw(void)
+{
+ glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+
+ glPushMatrix();
+ glRotatef(view_rotx, 1.0, 0.0, 0.0);
+ glRotatef(view_roty, 0.0, 1.0, 0.0);
+ glRotatef(view_rotz, 0.0, 0.0, 1.0);
+
+ glPushMatrix();
+ glTranslatef(-3.0, -2.0, 0.0);
+ glRotatef(angle, 0.0, 0.0, 1.0);
+ glCallList(gear1);
+ glPopMatrix();
+
+ glPushMatrix();
+ glTranslatef(3.1, -2.0, 0.0);
+ glRotatef(-2.0 * angle - 9.0, 0.0, 0.0, 1.0);
+ glCallList(gear2);
+ glPopMatrix();
+
+ glPushMatrix();
+ glTranslatef(-3.1, 4.2, 0.0);
+ glRotatef(-2.0 * angle - 25.0, 0.0, 0.0, 1.0);
+ glCallList(gear3);
+ glPopMatrix();
+
+ glPopMatrix();
+}
+
+
+/* new window size or exposure */
+static void
+reshape(int width, int height)
+{
+ glViewport(0, 0, (GLint) width, (GLint) height);
+
+ GLfloat h = (GLfloat) height / (GLfloat) width;
+
+ glMatrixMode(GL_PROJECTION);
+ glLoadIdentity();
+ glFrustum(-1.0, 1.0, -h, h, 5.0, 60.0);
+
+ glMatrixMode(GL_MODELVIEW);
+ glLoadIdentity();
+ glTranslatef(0.0, 0.0, -40.0);
+}
+
+
+
+static void
+init(void)
+{
+ static GLfloat pos[4] = { 5.0, 5.0, 10.0, 0.0 };
+ static GLfloat red[4] = { 0.8, 0.1, 0.0, 1.0 };
+ static GLfloat green[4] = { 0.0, 0.8, 0.2, 1.0 };
+ static GLfloat blue[4] = { 0.2, 0.2, 1.0, 1.0 };
+
+ glLightfv(GL_LIGHT0, GL_POSITION, pos);
+ glEnable(GL_CULL_FACE);
+ glEnable(GL_LIGHTING);
+ glEnable(GL_LIGHT0);
+ glEnable(GL_DEPTH_TEST);
+
+ /* make the gears */
+ gear1 = glGenLists(1);
+ glNewList(gear1, GL_COMPILE);
+ glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, red);
+ gear(1.0, 4.0, 1.0, 20, 0.7);
+ glEndList();
+
+ gear2 = glGenLists(1);
+ glNewList(gear2, GL_COMPILE);
+ glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, green);
+ gear(0.5, 2.0, 2.0, 10, 0.7);
+ glEndList();
+
+ gear3 = glGenLists(1);
+ glNewList(gear3, GL_COMPILE);
+ glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, blue);
+ gear(1.3, 2.0, 0.5, 10, 0.7);
+ glEndList();
+
+ glEnable(GL_NORMALIZE);
+}
+
+
+
+
+static void run_gears(EGLDisplay dpy, EGLSurface surf, int ttr)
+{
+ double st = current_time();
+ double ct = st;
+ int frames = 0;
+ while (ct - st < ttr)
+ {
+ double tt = current_time();
+ double dt = tt - ct;
+ ct = tt;
+
+ /* advance rotation for next frame */
+ angle += 70.0 * dt; /* 70 degrees per second */
+ if (angle > 3600.0)
+ angle -= 3600.0;
+
+ draw();
+
+ eglSwapBuffers(dpy, surf);
+
+
+ frames++;
+ }
+
+ GLfloat seconds = ct - st;
+ GLfloat fps = frames / seconds;
+ printf("%d frames in %3.1f seconds = %6.3f FPS\n", frames, seconds, fps);
+
+}
+
+
+int
+main(int argc, char *argv[])
+{
+ int major, minor;
+ EGLContext ctx;
+ EGLSurface surface;
+ EGLConfig configs[MAX_CONFIGS];
+ EGLint numConfigs, i;
+ EGLBoolean b;
+ EGLDisplay d;
+ EGLint screenAttribs[10];
+ GLboolean printInfo = GL_FALSE;
+ EGLint width = 300, height = 300;
+
+ /* parse cmd line args */
+ for (i = 1; i < argc; i++)
+ {
+ if (strcmp(argv[i], "-info") == 0)
+ {
+ printInfo = GL_TRUE;
+ }
+ else
+ printf("Warning: unknown parameter: %s\n", argv[i]);
+ }
+
+ /* DBR : Create EGL context/surface etc */
+ d = eglGetDisplay((EGLNativeDisplayType)"!EGL_i915");
+ assert(d);
+
+ if (!eglInitialize(d, &major, &minor)) {
+ printf("peglgears: eglInitialize failed\n");
+ return 0;
+ }
+
+ printf("peglgears: EGL version = %d.%d\n", major, minor);
+ printf("peglgears: EGL_VENDOR = %s\n", eglQueryString(d, EGL_VENDOR));
+
+ eglGetConfigs(d, configs, MAX_CONFIGS, &numConfigs);
+
+ eglBindAPI(EGL_OPENGL_API);
+
+ ctx = eglCreateContext(d, configs[0], EGL_NO_CONTEXT, NULL);
+ if (ctx == EGL_NO_CONTEXT) {
+ printf("peglgears: failed to create context\n");
+ return 0;
+ }
+
+ /* build up screenAttribs array */
+ i = 0;
+ screenAttribs[i++] = EGL_WIDTH;
+ screenAttribs[i++] = width;
+ screenAttribs[i++] = EGL_HEIGHT;
+ screenAttribs[i++] = height;
+ screenAttribs[i++] = EGL_NONE;
+
+ surface = eglCreatePbufferSurface(d, configs[0], screenAttribs);
+ if (surface == EGL_NO_SURFACE) {
+ printf("peglgears: failed to create pbuffer surface\n");
+ return 0;
+ }
+
+ b = eglMakeCurrent(d, surface, surface, ctx);
+ if (!b) {
+ printf("peglgears: make current failed\n");
+ return 0;
+ }
+
+ if (printInfo)
+ {
+ printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
+ printf("GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
+ printf("GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
+ printf("GL_EXTENSIONS = %s\n", (char *) glGetString(GL_EXTENSIONS));
+ }
+
+ init();
+ reshape(width, height);
+
+ glDrawBuffer( GL_BACK );
+
+ run_gears(d, surface, 5.0);
+
+ eglDestroySurface(d, surface);
+ eglDestroyContext(d, ctx);
+ eglTerminate(d);
+
+ return 0;
+}
diff --git a/progs/egl/xegl_tri.c b/progs/egl/xegl_tri.c
new file mode 100644
index 00000000000..65f352ddfa9
--- /dev/null
+++ b/progs/egl/xegl_tri.c
@@ -0,0 +1,359 @@
+/*
+ * Copyright (C) 2008 Brian Paul All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/*
+ * Draw a triangle with X/EGL.
+ * Brian Paul
+ * 3 June 2008
+ */
+
+
+#include <assert.h>
+#include <math.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <X11/Xlib.h>
+#include <X11/Xutil.h>
+#include <X11/keysym.h>
+#include <GL/gl.h> /* using full OpenGL for now */
+#include <GLES/egl.h>
+
+
+static GLfloat view_rotx = 0.0, view_roty = 0.0, view_rotz = 0.0;
+
+
+static void
+draw(void)
+{
+ static const GLfloat verts[3][2] = {
+ { -1, -1 },
+ { 1, -1 },
+ { 0, 1 }
+ };
+ static const GLfloat colors[3][3] = {
+ { 1, 0, 0 },
+ { 0, 1, 0 },
+ { 0, 0, 1 }
+ };
+
+ glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+
+ glPushMatrix();
+ glRotatef(view_rotx, 1, 0, 0);
+ glRotatef(view_roty, 0, 1, 0);
+ glRotatef(view_rotz, 0, 0, 1);
+
+ {
+ glVertexPointer(2, GL_FLOAT, 0, verts);
+ glColorPointer(3, GL_FLOAT, 0, colors);
+ glEnableClientState(GL_VERTEX_ARRAY);
+ glEnableClientState(GL_COLOR_ARRAY);
+
+ glDrawArrays(GL_TRIANGLES, 0, 3);
+
+ glDisableClientState(GL_VERTEX_ARRAY);
+ glDisableClientState(GL_COLOR_ARRAY);
+ }
+
+ glPopMatrix();
+}
+
+
+/* new window size or exposure */
+static void
+reshape(int width, int height)
+{
+ GLfloat ar = (GLfloat) width / (GLfloat) height;
+
+ glViewport(0, 0, (GLint) width, (GLint) height);
+
+ glMatrixMode(GL_PROJECTION);
+ glLoadIdentity();
+ glFrustum(-ar, ar, -1, 1, 5.0, 60.0);
+
+ glMatrixMode(GL_MODELVIEW);
+ glLoadIdentity();
+ glTranslatef(0.0, 0.0, -10.0);
+}
+
+
+static void
+init(void)
+{
+ glClearColor(0.4, 0.4, 0.4, 0.0);
+}
+
+
+/*
+ * Create an RGB, double-buffered X window.
+ * Return the window and context handles.
+ */
+static void
+make_x_window(Display *x_dpy, EGLDisplay egl_dpy,
+ const char *name,
+ int x, int y, int width, int height,
+ Window *winRet,
+ EGLContext *ctxRet,
+ EGLSurface *surfRet)
+{
+ static const EGLint attribs[] = {
+ EGL_RED_SIZE, 1,
+ EGL_GREEN_SIZE, 1,
+ EGL_BLUE_SIZE, 1,
+ EGL_DEPTH_SIZE, 1,
+ EGL_NONE
+ };
+
+ int scrnum;
+ XSetWindowAttributes attr;
+ unsigned long mask;
+ Window root;
+ Window win;
+ XVisualInfo *visInfo, visTemplate;
+ int num_visuals;
+ EGLContext ctx;
+ EGLConfig config;
+ EGLint num_configs;
+ EGLint vid;
+
+ scrnum = DefaultScreen( x_dpy );
+ root = RootWindow( x_dpy, scrnum );
+
+ if (!eglChooseConfig( egl_dpy, attribs, &config, 1, &num_configs)) {
+ printf("Error: couldn't get an EGL visual config\n");
+ exit(1);
+ }
+
+ assert(config);
+ assert(num_configs > 0);
+
+ if (!eglGetConfigAttrib(egl_dpy, config, EGL_NATIVE_VISUAL_ID, &vid)) {
+ printf("Error: eglGetConfigAttrib() failed\n");
+ exit(1);
+ }
+
+ /* The X window visual must match the EGL config */
+ visTemplate.visualid = vid;
+ visInfo = XGetVisualInfo(x_dpy, VisualIDMask, &visTemplate, &num_visuals);
+ if (!visInfo) {
+ printf("Error: couldn't get X visual\n");
+ exit(1);
+ }
+
+ /* window attributes */
+ attr.background_pixel = 0;
+ attr.border_pixel = 0;
+ attr.colormap = XCreateColormap( x_dpy, root, visInfo->visual, AllocNone);
+ attr.event_mask = StructureNotifyMask | ExposureMask | KeyPressMask;
+ mask = CWBackPixel | CWBorderPixel | CWColormap | CWEventMask;
+
+ win = XCreateWindow( x_dpy, root, 0, 0, width, height,
+ 0, visInfo->depth, InputOutput,
+ visInfo->visual, mask, &attr );
+
+ /* set hints and properties */
+ {
+ XSizeHints sizehints;
+ sizehints.x = x;
+ sizehints.y = y;
+ sizehints.width = width;
+ sizehints.height = height;
+ sizehints.flags = USSize | USPosition;
+ XSetNormalHints(x_dpy, win, &sizehints);
+ XSetStandardProperties(x_dpy, win, name, name,
+ None, (char **)NULL, 0, &sizehints);
+ }
+
+ eglBindAPI(EGL_OPENGL_API);
+
+ ctx = eglCreateContext(egl_dpy, config, EGL_NO_CONTEXT, NULL );
+ if (!ctx) {
+ printf("Error: glXCreateContext failed\n");
+ exit(1);
+ }
+
+ *surfRet = eglCreateWindowSurface(egl_dpy, config, win, NULL);
+
+ if (!*surfRet) {
+ printf("Error: eglCreateWindowSurface failed\n");
+ exit(1);
+ }
+
+ XFree(visInfo);
+
+ *winRet = win;
+ *ctxRet = ctx;
+}
+
+
+static void
+event_loop(Display *dpy, Window win,
+ EGLDisplay egl_dpy, EGLSurface egl_surf)
+{
+ while (1) {
+ int redraw = 0;
+ XEvent event;
+
+ XNextEvent(dpy, &event);
+
+ switch (event.type) {
+ case Expose:
+ redraw = 1;
+ break;
+ case ConfigureNotify:
+ reshape(event.xconfigure.width, event.xconfigure.height);
+ break;
+ case KeyPress:
+ {
+ char buffer[10];
+ int r, code;
+ code = XLookupKeysym(&event.xkey, 0);
+ if (code == XK_Left) {
+ view_roty += 5.0;
+ }
+ else if (code == XK_Right) {
+ view_roty -= 5.0;
+ }
+ else if (code == XK_Up) {
+ view_rotx += 5.0;
+ }
+ else if (code == XK_Down) {
+ view_rotx -= 5.0;
+ }
+ else {
+ r = XLookupString(&event.xkey, buffer, sizeof(buffer),
+ NULL, NULL);
+ if (buffer[0] == 27) {
+ /* escape */
+ return;
+ }
+ }
+ }
+ redraw = 1;
+ break;
+ default:
+ ; /*no-op*/
+ }
+
+ if (redraw) {
+ draw();
+ eglSwapBuffers(egl_dpy, egl_surf);
+ }
+ }
+}
+
+
+static void
+usage(void)
+{
+ printf("Usage:\n");
+ printf(" -display <displayname> set the display to run on\n");
+ printf(" -info display OpenGL renderer info\n");
+}
+
+
+int
+main(int argc, char *argv[])
+{
+ const int winWidth = 300, winHeight = 300;
+ Display *x_dpy;
+ Window win;
+ EGLSurface egl_surf;
+ EGLContext egl_ctx;
+ EGLDisplay egl_dpy;
+ char *dpyName = NULL;
+ GLboolean printInfo = GL_FALSE;
+ EGLint egl_major, egl_minor;
+ int i;
+ const char *s;
+
+ for (i = 1; i < argc; i++) {
+ if (strcmp(argv[i], "-display") == 0) {
+ dpyName = argv[i+1];
+ i++;
+ }
+ else if (strcmp(argv[i], "-info") == 0) {
+ printInfo = GL_TRUE;
+ }
+ else {
+ usage();
+ return -1;
+ }
+ }
+
+ x_dpy = XOpenDisplay(dpyName);
+ if (!x_dpy) {
+ printf("Error: couldn't open display %s\n",
+ dpyName ? dpyName : getenv("DISPLAY"));
+ return -1;
+ }
+
+ egl_dpy = eglGetDisplay(x_dpy);
+ if (!egl_dpy) {
+ printf("Error: eglGetDisplay() failed\n");
+ return -1;
+ }
+
+ if (!eglInitialize(egl_dpy, &egl_major, &egl_minor)) {
+ printf("Error: eglInitialize() failed\n");
+ return -1;
+ }
+
+ s = eglQueryString(egl_dpy, EGL_VERSION);
+ printf("EGL_VERSION = %s\n", s);
+
+ make_x_window(x_dpy, egl_dpy,
+ "xegl_tri", 0, 0, winWidth, winHeight,
+ &win, &egl_ctx, &egl_surf);
+
+ XMapWindow(x_dpy, win);
+ if (!eglMakeCurrent(egl_dpy, egl_surf, egl_surf, egl_ctx)) {
+ printf("Error: eglMakeCurrent() failed\n");
+ return -1;
+ }
+
+ if (printInfo) {
+ printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
+ printf("GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
+ printf("GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
+ }
+
+ init();
+
+ /* Set initial projection/viewing transformation.
+ * We can't be sure we'll get a ConfigureNotify event when the window
+ * first appears.
+ */
+ reshape(winWidth, winHeight);
+
+ event_loop(x_dpy, win, egl_dpy, egl_surf);
+
+ eglDestroyContext(egl_dpy, egl_ctx);
+ eglDestroySurface(egl_dpy, egl_surf);
+ eglTerminate(egl_dpy);
+
+
+ XDestroyWindow(x_dpy, win);
+ XCloseDisplay(x_dpy);
+
+ return 0;
+}
diff --git a/progs/egl/xeglgears.c b/progs/egl/xeglgears.c
new file mode 100644
index 00000000000..72ed0052832
--- /dev/null
+++ b/progs/egl/xeglgears.c
@@ -0,0 +1,608 @@
+/*
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/*
+ * Ported to X/EGL/GLES. XXX Actually, uses full OpenGL ATM.
+ * Brian Paul
+ * 30 May 2008
+ */
+
+/*
+ * Command line options:
+ * -info print GL implementation information
+ *
+ */
+
+
+#include <math.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <X11/Xlib.h>
+#include <X11/Xutil.h>
+#include <X11/keysym.h>
+#include <GL/gl.h>
+#include <EGL/egl.h>
+
+
+#define BENCHMARK
+
+#ifdef BENCHMARK
+
+/* XXX this probably isn't very portable */
+
+#include <sys/time.h>
+#include <unistd.h>
+
+/* return current time (in seconds) */
+static double
+current_time(void)
+{
+ struct timeval tv;
+#ifdef __VMS
+ (void) gettimeofday(&tv, NULL );
+#else
+ struct timezone tz;
+ (void) gettimeofday(&tv, &tz);
+#endif
+ return (double) tv.tv_sec + tv.tv_usec / 1000000.0;
+}
+
+#else /*BENCHMARK*/
+
+/* dummy */
+static double
+current_time(void)
+{
+ /* update this function for other platforms! */
+ static double t = 0.0;
+ static int warn = 1;
+ if (warn) {
+ fprintf(stderr, "Warning: current_time() not implemented!!\n");
+ warn = 0;
+ }
+ return t += 1.0;
+}
+
+#endif /*BENCHMARK*/
+
+
+
+#ifndef M_PI
+#define M_PI 3.14159265
+#endif
+
+
+static GLfloat view_rotx = 20.0, view_roty = 30.0, view_rotz = 0.0;
+static GLint gear1, gear2, gear3;
+static GLfloat angle = 0.0;
+
+static GLboolean fullscreen = GL_FALSE; /* Create a single fullscreen window */
+
+
+/*
+ *
+ * Draw a gear wheel. You'll probably want to call this function when
+ * building a display list since we do a lot of trig here.
+ *
+ * Input: inner_radius - radius of hole at center
+ * outer_radius - radius at center of teeth
+ * width - width of gear
+ * teeth - number of teeth
+ * tooth_depth - depth of tooth
+ */
+static void
+gear(GLfloat inner_radius, GLfloat outer_radius, GLfloat width,
+ GLint teeth, GLfloat tooth_depth)
+{
+ GLint i;
+ GLfloat r0, r1, r2;
+ GLfloat angle, da;
+ GLfloat u, v, len;
+
+ r0 = inner_radius;
+ r1 = outer_radius - tooth_depth / 2.0;
+ r2 = outer_radius + tooth_depth / 2.0;
+
+ da = 2.0 * M_PI / teeth / 4.0;
+
+ glShadeModel(GL_FLAT);
+
+ glNormal3f(0.0, 0.0, 1.0);
+
+ /* draw front face */
+ glBegin(GL_QUAD_STRIP);
+ for (i = 0; i <= teeth; i++) {
+ angle = i * 2.0 * M_PI / teeth;
+ glVertex3f(r0 * cos(angle), r0 * sin(angle), width * 0.5);
+ glVertex3f(r1 * cos(angle), r1 * sin(angle), width * 0.5);
+ if (i < teeth) {
+ glVertex3f(r0 * cos(angle), r0 * sin(angle), width * 0.5);
+ glVertex3f(r1 * cos(angle + 3 * da), r1 * sin(angle + 3 * da),
+ width * 0.5);
+ }
+ }
+ glEnd();
+
+ /* draw front sides of teeth */
+ glBegin(GL_QUADS);
+ da = 2.0 * M_PI / teeth / 4.0;
+ for (i = 0; i < teeth; i++) {
+ angle = i * 2.0 * M_PI / teeth;
+
+ glVertex3f(r1 * cos(angle), r1 * sin(angle), width * 0.5);
+ glVertex3f(r2 * cos(angle + da), r2 * sin(angle + da), width * 0.5);
+ glVertex3f(r2 * cos(angle + 2 * da), r2 * sin(angle + 2 * da),
+ width * 0.5);
+ glVertex3f(r1 * cos(angle + 3 * da), r1 * sin(angle + 3 * da),
+ width * 0.5);
+ }
+ glEnd();
+
+ glNormal3f(0.0, 0.0, -1.0);
+
+ /* draw back face */
+ glBegin(GL_QUAD_STRIP);
+ for (i = 0; i <= teeth; i++) {
+ angle = i * 2.0 * M_PI / teeth;
+ glVertex3f(r1 * cos(angle), r1 * sin(angle), -width * 0.5);
+ glVertex3f(r0 * cos(angle), r0 * sin(angle), -width * 0.5);
+ if (i < teeth) {
+ glVertex3f(r1 * cos(angle + 3 * da), r1 * sin(angle + 3 * da),
+ -width * 0.5);
+ glVertex3f(r0 * cos(angle), r0 * sin(angle), -width * 0.5);
+ }
+ }
+ glEnd();
+
+ /* draw back sides of teeth */
+ glBegin(GL_QUADS);
+ da = 2.0 * M_PI / teeth / 4.0;
+ for (i = 0; i < teeth; i++) {
+ angle = i * 2.0 * M_PI / teeth;
+
+ glVertex3f(r1 * cos(angle + 3 * da), r1 * sin(angle + 3 * da),
+ -width * 0.5);
+ glVertex3f(r2 * cos(angle + 2 * da), r2 * sin(angle + 2 * da),
+ -width * 0.5);
+ glVertex3f(r2 * cos(angle + da), r2 * sin(angle + da), -width * 0.5);
+ glVertex3f(r1 * cos(angle), r1 * sin(angle), -width * 0.5);
+ }
+ glEnd();
+
+ /* draw outward faces of teeth */
+ glBegin(GL_QUAD_STRIP);
+ for (i = 0; i < teeth; i++) {
+ angle = i * 2.0 * M_PI / teeth;
+
+ glVertex3f(r1 * cos(angle), r1 * sin(angle), width * 0.5);
+ glVertex3f(r1 * cos(angle), r1 * sin(angle), -width * 0.5);
+ u = r2 * cos(angle + da) - r1 * cos(angle);
+ v = r2 * sin(angle + da) - r1 * sin(angle);
+ len = sqrt(u * u + v * v);
+ u /= len;
+ v /= len;
+ glNormal3f(v, -u, 0.0);
+ glVertex3f(r2 * cos(angle + da), r2 * sin(angle + da), width * 0.5);
+ glVertex3f(r2 * cos(angle + da), r2 * sin(angle + da), -width * 0.5);
+ glNormal3f(cos(angle), sin(angle), 0.0);
+ glVertex3f(r2 * cos(angle + 2 * da), r2 * sin(angle + 2 * da),
+ width * 0.5);
+ glVertex3f(r2 * cos(angle + 2 * da), r2 * sin(angle + 2 * da),
+ -width * 0.5);
+ u = r1 * cos(angle + 3 * da) - r2 * cos(angle + 2 * da);
+ v = r1 * sin(angle + 3 * da) - r2 * sin(angle + 2 * da);
+ glNormal3f(v, -u, 0.0);
+ glVertex3f(r1 * cos(angle + 3 * da), r1 * sin(angle + 3 * da),
+ width * 0.5);
+ glVertex3f(r1 * cos(angle + 3 * da), r1 * sin(angle + 3 * da),
+ -width * 0.5);
+ glNormal3f(cos(angle), sin(angle), 0.0);
+ }
+
+ glVertex3f(r1 * cos(0), r1 * sin(0), width * 0.5);
+ glVertex3f(r1 * cos(0), r1 * sin(0), -width * 0.5);
+
+ glEnd();
+
+ glShadeModel(GL_SMOOTH);
+
+ /* draw inside radius cylinder */
+ glBegin(GL_QUAD_STRIP);
+ for (i = 0; i <= teeth; i++) {
+ angle = i * 2.0 * M_PI / teeth;
+ glNormal3f(-cos(angle), -sin(angle), 0.0);
+ glVertex3f(r0 * cos(angle), r0 * sin(angle), -width * 0.5);
+ glVertex3f(r0 * cos(angle), r0 * sin(angle), width * 0.5);
+ }
+ glEnd();
+}
+
+
+static void
+draw(void)
+{
+ glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+
+ glPushMatrix();
+ glRotatef(view_rotx, 1.0, 0.0, 0.0);
+ glRotatef(view_roty, 0.0, 1.0, 0.0);
+ glRotatef(view_rotz, 0.0, 0.0, 1.0);
+
+ glPushMatrix();
+ glTranslatef(-3.0, -2.0, 0.0);
+ glRotatef(angle, 0.0, 0.0, 1.0);
+ glCallList(gear1);
+ glPopMatrix();
+
+ glPushMatrix();
+ glTranslatef(3.1, -2.0, 0.0);
+ glRotatef(-2.0 * angle - 9.0, 0.0, 0.0, 1.0);
+ glCallList(gear2);
+ glPopMatrix();
+
+ glPushMatrix();
+ glTranslatef(-3.1, 4.2, 0.0);
+ glRotatef(-2.0 * angle - 25.0, 0.0, 0.0, 1.0);
+ glCallList(gear3);
+ glPopMatrix();
+
+ glPopMatrix();
+}
+
+
+/* new window size or exposure */
+static void
+reshape(int width, int height)
+{
+ GLfloat ar = (GLfloat) width / (GLfloat) height;
+
+ glViewport(0, 0, (GLint) width, (GLint) height);
+
+ glMatrixMode(GL_PROJECTION);
+ glLoadIdentity();
+ glFrustum(-ar, ar, -1, 1, 5.0, 60.0);
+
+ glMatrixMode(GL_MODELVIEW);
+ glLoadIdentity();
+ glTranslatef(0.0, 0.0, -40.0);
+}
+
+
+
+static void
+init(void)
+{
+ static GLfloat pos[4] = { 5.0, 5.0, 10.0, 0.0 };
+ static GLfloat red[4] = { 0.8, 0.1, 0.0, 1.0 };
+ static GLfloat green[4] = { 0.0, 0.8, 0.2, 1.0 };
+ static GLfloat blue[4] = { 0.2, 0.2, 1.0, 1.0 };
+
+ glLightfv(GL_LIGHT0, GL_POSITION, pos);
+ glEnable(GL_CULL_FACE);
+ glEnable(GL_LIGHTING);
+ glEnable(GL_LIGHT0);
+ glEnable(GL_DEPTH_TEST);
+
+ /* make the gears */
+ gear1 = glGenLists(1);
+ glNewList(gear1, GL_COMPILE);
+ glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, red);
+ gear(1.0, 4.0, 1.0, 20, 0.7);
+ glEndList();
+
+ gear2 = glGenLists(1);
+ glNewList(gear2, GL_COMPILE);
+ glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, green);
+ gear(0.5, 2.0, 2.0, 10, 0.7);
+ glEndList();
+
+ gear3 = glGenLists(1);
+ glNewList(gear3, GL_COMPILE);
+ glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, blue);
+ gear(1.3, 2.0, 0.5, 10, 0.7);
+ glEndList();
+
+ glEnable(GL_NORMALIZE);
+
+ glClearColor(0.2, 0.2, 0.2, 0.0);
+}
+
+
+/*
+ * Create an RGB, double-buffered X window.
+ * Return the window and context handles.
+ */
+static void
+make_x_window(Display *x_dpy, EGLDisplay egl_dpy,
+ const char *name,
+ int x, int y, int width, int height,
+ Window *winRet,
+ EGLContext *ctxRet,
+ EGLSurface *surfRet)
+{
+ static const EGLint attribs[] = {
+ EGL_RED_SIZE, 1,
+ EGL_GREEN_SIZE, 1,
+ EGL_BLUE_SIZE, 1,
+ /*EGL_DOUBLEBUFFER,*/
+ EGL_DEPTH_SIZE, 1,
+ EGL_NONE
+ };
+
+ int scrnum;
+ XSetWindowAttributes attr;
+ unsigned long mask;
+ Window root;
+ Window win;
+ XVisualInfo *visInfo, visTemplate;
+ int num_visuals;
+ EGLContext ctx;
+ EGLConfig config;
+ EGLint num_configs, vid;
+
+ scrnum = DefaultScreen( x_dpy );
+ root = RootWindow( x_dpy, scrnum );
+
+ if (fullscreen) {
+ x = 0; y = 0;
+ width = DisplayWidth( x_dpy, scrnum );
+ height = DisplayHeight( x_dpy, scrnum );
+ }
+
+ if (!eglChooseConfig( egl_dpy, attribs, &config, 1, &num_configs)) {
+ printf("Error: couldn't get an EGL visual config\n");
+ exit(1);
+ }
+
+ if (!eglGetConfigAttrib(egl_dpy, config, EGL_NATIVE_VISUAL_ID, &vid)) {
+ printf("Error: eglGetConfigAttrib() failed\n");
+ exit(1);
+ }
+
+ /* The X window visual must match the EGL config */
+ visTemplate.visualid = vid;
+ visInfo = XGetVisualInfo(x_dpy, VisualIDMask, &visTemplate, &num_visuals);
+ if (!visInfo) {
+ printf("Error: couldn't get X visual\n");
+ exit(1);
+ }
+
+ /* window attributes */
+ attr.background_pixel = 0;
+ attr.border_pixel = 0;
+ attr.colormap = XCreateColormap( x_dpy, root, visInfo->visual, AllocNone);
+ attr.event_mask = StructureNotifyMask | ExposureMask | KeyPressMask;
+ attr.override_redirect = fullscreen;
+ mask = CWBackPixel | CWBorderPixel | CWColormap | CWEventMask | CWOverrideRedirect;
+
+ win = XCreateWindow( x_dpy, root, 0, 0, width, height,
+ 0, visInfo->depth, InputOutput,
+ visInfo->visual, mask, &attr );
+
+ /* set hints and properties */
+ {
+ XSizeHints sizehints;
+ sizehints.x = x;
+ sizehints.y = y;
+ sizehints.width = width;
+ sizehints.height = height;
+ sizehints.flags = USSize | USPosition;
+ XSetNormalHints(x_dpy, win, &sizehints);
+ XSetStandardProperties(x_dpy, win, name, name,
+ None, (char **)NULL, 0, &sizehints);
+ }
+
+ eglBindAPI(EGL_OPENGL_API);
+
+ ctx = eglCreateContext(egl_dpy, config, EGL_NO_CONTEXT, NULL );
+ if (!ctx) {
+ printf("Error: glXCreateContext failed\n");
+ exit(1);
+ }
+
+ *surfRet = eglCreateWindowSurface(egl_dpy, config, win, NULL);
+
+ XFree(visInfo);
+
+ *winRet = win;
+ *ctxRet = ctx;
+}
+
+
+static void
+event_loop(Display *dpy, Window win,
+ EGLDisplay egl_dpy, EGLSurface egl_surf)
+{
+ while (1) {
+ while (XPending(dpy) > 0) {
+ XEvent event;
+ XNextEvent(dpy, &event);
+ switch (event.type) {
+ case Expose:
+ /* we'll redraw below */
+ break;
+ case ConfigureNotify:
+ reshape(event.xconfigure.width, event.xconfigure.height);
+ break;
+ case KeyPress:
+ {
+ char buffer[10];
+ int r, code;
+ code = XLookupKeysym(&event.xkey, 0);
+ if (code == XK_Left) {
+ view_roty += 5.0;
+ }
+ else if (code == XK_Right) {
+ view_roty -= 5.0;
+ }
+ else if (code == XK_Up) {
+ view_rotx += 5.0;
+ }
+ else if (code == XK_Down) {
+ view_rotx -= 5.0;
+ }
+ else {
+ r = XLookupString(&event.xkey, buffer, sizeof(buffer),
+ NULL, NULL);
+ if (buffer[0] == 27) {
+ /* escape */
+ return;
+ }
+ }
+ }
+ }
+ }
+
+ {
+ static int frames = 0;
+ static double tRot0 = -1.0, tRate0 = -1.0;
+ double dt, t = current_time();
+ if (tRot0 < 0.0)
+ tRot0 = t;
+ dt = t - tRot0;
+ tRot0 = t;
+
+ /* advance rotation for next frame */
+ angle += 70.0 * dt; /* 70 degrees per second */
+ if (angle > 3600.0)
+ angle -= 3600.0;
+
+ draw();
+ eglSwapBuffers(egl_dpy, egl_surf);
+
+ frames++;
+
+ if (tRate0 < 0.0)
+ tRate0 = t;
+ if (t - tRate0 >= 5.0) {
+ GLfloat seconds = t - tRate0;
+ GLfloat fps = frames / seconds;
+ printf("%d frames in %3.1f seconds = %6.3f FPS\n", frames, seconds,
+ fps);
+ tRate0 = t;
+ frames = 0;
+ }
+ }
+ }
+}
+
+
+static void
+usage(void)
+{
+ printf("Usage:\n");
+ printf(" -display <displayname> set the display to run on\n");
+ printf(" -fullscreen run in fullscreen mode\n");
+ printf(" -info display OpenGL renderer info\n");
+}
+
+
+int
+main(int argc, char *argv[])
+{
+ const int winWidth = 300, winHeight = 300;
+ Display *x_dpy;
+ Window win;
+ EGLSurface egl_surf;
+ EGLContext egl_ctx;
+ EGLDisplay egl_dpy;
+ char *dpyName = NULL;
+ GLboolean printInfo = GL_FALSE;
+ EGLint egl_major, egl_minor;
+ int i;
+ const char *s;
+
+ for (i = 1; i < argc; i++) {
+ if (strcmp(argv[i], "-display") == 0) {
+ dpyName = argv[i+1];
+ i++;
+ }
+ else if (strcmp(argv[i], "-info") == 0) {
+ printInfo = GL_TRUE;
+ }
+ else if (strcmp(argv[i], "-fullscreen") == 0) {
+ fullscreen = GL_TRUE;
+ }
+ else {
+ usage();
+ return -1;
+ }
+ }
+
+ x_dpy = XOpenDisplay(dpyName);
+ if (!x_dpy) {
+ printf("Error: couldn't open display %s\n",
+ dpyName ? dpyName : getenv("DISPLAY"));
+ return -1;
+ }
+
+ egl_dpy = eglGetDisplay(x_dpy);
+ if (!egl_dpy) {
+ printf("Error: eglGetDisplay() failed\n");
+ return -1;
+ }
+
+ if (!eglInitialize(egl_dpy, &egl_major, &egl_minor)) {
+ printf("Error: eglInitialize() failed\n");
+ return -1;
+ }
+
+ s = eglQueryString(egl_dpy, EGL_VERSION);
+ printf("EGL_VERSION = %s\n", s);
+
+ make_x_window(x_dpy, egl_dpy,
+ "glxgears", 0, 0, winWidth, winHeight,
+ &win, &egl_ctx, &egl_surf);
+
+ XMapWindow(x_dpy, win);
+ eglMakeCurrent(egl_dpy, egl_surf, egl_surf, egl_ctx);
+
+ if (printInfo) {
+ printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
+ printf("GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
+ printf("GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
+ }
+
+ init();
+
+ /* Set initial projection/viewing transformation.
+ * We can't be sure we'll get a ConfigureNotify event when the window
+ * first appears.
+ */
+ reshape(winWidth, winHeight);
+
+ event_loop(x_dpy, win, egl_dpy, egl_surf);
+
+ glDeleteLists(gear1, 1);
+ glDeleteLists(gear2, 1);
+ glDeleteLists(gear3, 1);
+
+ eglDestroyContext(egl_dpy, egl_ctx);
+ eglDestroySurface(egl_dpy, egl_surf);
+ eglTerminate(egl_dpy);
+
+
+ XDestroyWindow(x_dpy, win);
+ XCloseDisplay(x_dpy);
+
+ return 0;
+}
diff --git a/progs/fbdev/Makefile b/progs/fbdev/Makefile
index 39401243e50..e935a519c36 100644
--- a/progs/fbdev/Makefile
+++ b/progs/fbdev/Makefile
@@ -42,6 +42,7 @@ clean:
depend: $(SOURCES)
+ rm -f depend
touch depend
$(MKDEP) $(MKDEP_OPTIONS) $(INCLUDES) $(SOURCES) > /dev/null
diff --git a/progs/fp/.gitignore b/progs/fp/.gitignore
index b265f1fed76..aa51f76c9bd 100644
--- a/progs/fp/.gitignore
+++ b/progs/fp/.gitignore
@@ -40,3 +40,4 @@ tri-swz
tri-swz2
tri-tex
tri-xpd
+fp-tri
diff --git a/progs/fp/Makefile b/progs/fp/Makefile
index 3e524747770..ef6644cce27 100644..100755
--- a/progs/fp/Makefile
+++ b/progs/fp/Makefile
@@ -11,46 +11,14 @@ include $(TOP)/configs/current
LIBS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) $(APP_LIB_DEPS)
SOURCES = \
- tri-abs.c \
- tri-add.c \
- tri-cmp.c \
- tri-cos.c \
- tri-dp3.c \
- tri-dp4.c \
- tri-dph.c \
- tri-dst.c \
- tri-ex2.c \
- tri-flr.c \
- tri-frc.c \
- tri-kil.c \
- tri-lg2.c \
- tri-lit.c \
- tri-lrp.c \
- tri-mad.c \
- tri-max.c \
- tri-min.c \
- tri-mov.c \
- tri-mul.c \
- tri-pow.c \
- tri-param.c \
- tri-rcp.c \
- tri-rsq.c \
- tri-scs.c \
- tri-sge.c \
- tri-sge2.c \
- tri-sin.c \
- tri-slt.c \
- tri-sub.c \
- tri-swz.c \
- tri-swz2.c \
tri-tex.c \
- tri-xpd.c \
- tri-position.c \
point-position.c \
tri-depth.c \
tri-depth2.c \
tri-depthwrite.c \
tri-depthwrite2.c \
+ tri-param.c \
+ fp-tri.c
NOTDONE=\
tri-txb.c \
@@ -72,13 +40,13 @@ UTIL_FILES = readtex.h readtex.c
.SUFFIXES: .c
.c:
- $(CC) $(INCLUDES) $(CFLAGS) $(LDFLAGS) $< $(LIBS) -o $@
+ $(APP_CC) $(INCLUDES) $(CFLAGS) $(LDFLAGS) $< $(LIBS) -o $@
.c.o:
- $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
+ $(APP_CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
.S.o:
- $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
+ $(APP_CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
##### TARGETS #####
@@ -100,18 +68,20 @@ getproclist.h: $(TOP)/src/mesa/glapi/gl_API.xml getprocaddress.c getprocaddress.
texrect: texrect.o readtex.o
$(CC) $(CFLAGS) $(LDFLAGS) texrect.o readtex.o $(LIBS) -o $@
+# $(APP_CC) texrect.o readtex.o $(LIBS) -o $@
texrect.o: texrect.c readtex.h
- $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
+ $(APP_CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
invert: invert.o readtex.o
$(CC) $(CFLAGS) $(LDFLAGS) invert.o readtex.o $(LIBS) -o $@
+# $(APP_CC) invert.o readtex.o $(LIBS) -o $@
invert.o: invert.c readtex.h
- $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
+ $(APP_CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
readtex.o: readtex.c
- $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
+ $(APP_CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
readtex.h: $(TOP)/progs/util/readtex.h
diff --git a/progs/fp/abs.txt b/progs/fp/abs.txt
new file mode 100644
index 00000000000..61ef952b053
--- /dev/null
+++ b/progs/fp/abs.txt
@@ -0,0 +1,5 @@
+!!ARBfp1.0
+TEMP R0;
+SUB R0, {0.5}.x, fragment.color;
+ABS result.color, R0;
+END
diff --git a/progs/fp/add-swz.txt b/progs/fp/add-swz.txt
new file mode 100644
index 00000000000..5ec51bcb84a
--- /dev/null
+++ b/progs/fp/add-swz.txt
@@ -0,0 +1,5 @@
+!!ARBfp1.0
+TEMP R0;
+ADD R0, fragment.color, fragment.color;
+ADD result.color, R0.xxxx, R0;
+END
diff --git a/progs/fp/add.txt b/progs/fp/add.txt
new file mode 100644
index 00000000000..031076df0fc
--- /dev/null
+++ b/progs/fp/add.txt
@@ -0,0 +1,5 @@
+!!ARBfp1.0
+TEMP R0;
+ADD R0, fragment.color, fragment.color;
+ADD result.color, R0, R0;
+END
diff --git a/progs/fp/cmp.txt b/progs/fp/cmp.txt
new file mode 100644
index 00000000000..78451609a3f
--- /dev/null
+++ b/progs/fp/cmp.txt
@@ -0,0 +1,5 @@
+!!ARBfp1.0
+TEMP R0;
+SUB R0, {0.5}.x, fragment.color;
+CMP result.color, R0, fragment.color, {0.0}.x;
+END
diff --git a/progs/fp/cos.txt b/progs/fp/cos.txt
new file mode 100644
index 00000000000..d51b13b63a7
--- /dev/null
+++ b/progs/fp/cos.txt
@@ -0,0 +1,8 @@
+!!ARBfp1.0
+TEMP R0;
+MUL R0, fragment.color, {3.14}.x;
+COS result.color.x, R0.x;
+COS result.color.y, R0.y;
+COS result.color.z, R0.z;
+END
+
diff --git a/progs/fp/dp3.txt b/progs/fp/dp3.txt
new file mode 100644
index 00000000000..75532f88a70
--- /dev/null
+++ b/progs/fp/dp3.txt
@@ -0,0 +1,4 @@
+!!ARBfp1.0
+TEMP R0;
+DP3 result.color, fragment.color, fragment.color;
+END
diff --git a/progs/fp/dp4.txt b/progs/fp/dp4.txt
new file mode 100644
index 00000000000..8d09c8dbf67
--- /dev/null
+++ b/progs/fp/dp4.txt
@@ -0,0 +1,4 @@
+!!ARBfp1.0
+TEMP R0;
+DP4 result.color, fragment.color.xxxx, fragment.color;
+END
diff --git a/progs/fp/dph.txt b/progs/fp/dph.txt
new file mode 100644
index 00000000000..6eb59a410d7
--- /dev/null
+++ b/progs/fp/dph.txt
@@ -0,0 +1,4 @@
+!!ARBfp1.0
+TEMP R0;
+DPH result.color, fragment.color, fragment.color.xyzx;
+END
diff --git a/progs/fp/dst.txt b/progs/fp/dst.txt
new file mode 100644
index 00000000000..6ebabbd5ea6
--- /dev/null
+++ b/progs/fp/dst.txt
@@ -0,0 +1,3 @@
+!!ARBfp1.0
+DST result.color, fragment.color, fragment.color;
+END
diff --git a/progs/fp/ex2.txt b/progs/fp/ex2.txt
new file mode 100644
index 00000000000..b540f7b1929
--- /dev/null
+++ b/progs/fp/ex2.txt
@@ -0,0 +1,5 @@
+!!ARBfp1.0
+TEMP R0;
+EX2 R0, fragment.color.x;
+SUB result.color, R0, {1.0}.x;
+END
diff --git a/progs/fp/flr.txt b/progs/fp/flr.txt
new file mode 100644
index 00000000000..c3479c7bd5e
--- /dev/null
+++ b/progs/fp/flr.txt
@@ -0,0 +1,5 @@
+!!ARBfp1.0
+TEMP R0;
+ADD R0, fragment.color, {0.5}.x;
+FLR result.color, R0;
+END
diff --git a/progs/fp/fp-tri.c b/progs/fp/fp-tri.c
new file mode 100644
index 00000000000..843f897871b
--- /dev/null
+++ b/progs/fp/fp-tri.c
@@ -0,0 +1,171 @@
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#define GL_GLEXT_PROTOTYPES
+#include <GL/glut.h>
+#include <unistd.h>
+#include <signal.h>
+
+unsigned show_fps = 0;
+unsigned int frame_cnt = 0;
+void alarmhandler(int);
+static const char *filename = NULL;
+
+static void usage(char *name)
+{
+ fprintf(stderr, "usage: %s [ options ] shader_filename\n", name);
+ fprintf(stderr, "\n" );
+ fprintf(stderr, "options:\n");
+ fprintf(stderr, " -fps show frames per second\n");
+}
+
+void alarmhandler (int sig)
+{
+ if (sig == SIGALRM) {
+ printf("%d frames in 5.0 seconds = %.3f FPS\n", frame_cnt,
+ frame_cnt / 5.0);
+
+ frame_cnt = 0;
+ }
+ signal(SIGALRM, alarmhandler);
+ alarm(5);
+}
+
+static void args(int argc, char *argv[])
+{
+ GLint i;
+
+ for (i = 1; i < argc; i++) {
+ if (strcmp(argv[i], "-fps") == 0) {
+ show_fps = 1;
+ }
+ else if (i == argc - 1) {
+ filename = argv[i];
+ }
+ else {
+ usage(argv[0]);
+ exit(1);
+ }
+ }
+
+ if (!filename) {
+ usage(argv[0]);
+ exit(1);
+ }
+}
+
+static void Init( void )
+{
+ GLint errno;
+ GLuint prognum;
+ char buf[4096];
+ GLuint sz;
+ FILE *f;
+
+ if ((f = fopen(filename, "r")) == NULL) {
+ fprintf(stderr, "Couldn't open %s\n", filename);
+ exit(1);
+ }
+
+ sz = fread(buf, 1, sizeof(buf), f);
+ if (!feof(f)) {
+ fprintf(stderr, "file too long\n");
+ exit(1);
+ }
+ fprintf(stderr, "%.*s\n", sz, buf);
+
+ if (!glutExtensionSupported("GL_ARB_fragment_program")) {
+ printf("Error: GL_ARB_fragment_program not supported!\n");
+ exit(1);
+ }
+ printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
+
+ /* Setup the fragment program */
+ glGenProgramsARB(1, &prognum);
+ glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, prognum);
+ glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB,
+ sz, (const GLubyte *)buf);
+
+ errno = glGetError();
+ printf("glGetError = 0x%x\n", errno);
+ if (errno != GL_NO_ERROR) {
+ GLint errorpos;
+
+ glGetIntegerv(GL_PROGRAM_ERROR_POSITION_ARB, &errorpos);
+ printf("errorpos: %d\n", errorpos);
+ printf("glError(GL_PROGRAM_ERROR_STRING_ARB) = %s\n",
+ (char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB));
+ }
+ glEnable(GL_FRAGMENT_PROGRAM_ARB);
+
+ glClearColor(.3, .3, .3, 0);
+}
+
+static void Reshape(int width, int height)
+{
+
+ glViewport(0, 0, (GLint)width, (GLint)height);
+
+ glMatrixMode(GL_PROJECTION);
+ glLoadIdentity();
+ glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
+ glMatrixMode(GL_MODELVIEW);
+}
+
+static void Key(unsigned char key, int x, int y)
+{
+
+ switch (key) {
+ case 27:
+ exit(1);
+ default:
+ return;
+ }
+
+ glutPostRedisplay();
+}
+
+static void Display(void)
+{
+ glClear(GL_COLOR_BUFFER_BIT);
+
+ glProgramLocalParameter4fARB(GL_FRAGMENT_PROGRAM_ARB, 0, 1.0, 1.0, 0.0, 0.0);
+ glProgramLocalParameter4fARB(GL_FRAGMENT_PROGRAM_ARB, 1, 0.0, 0.0, 1.0, 1.0);
+ glBegin(GL_TRIANGLES);
+ glColor3f(0,0,1);
+ glVertex3f( 0.9, -0.9, -30.0);
+ glColor3f(1,0,0);
+ glVertex3f( 0.9, 0.9, -30.0);
+ glColor3f(0,1,0);
+ glVertex3f(-0.9, 0.0, -30.0);
+ glEnd();
+
+ glFlush();
+
+ if (show_fps) {
+ ++frame_cnt;
+ glutPostRedisplay();
+ }
+}
+
+
+int main(int argc, char **argv)
+{
+ glutInit(&argc, argv);
+ glutInitWindowPosition(0, 0);
+ glutInitWindowSize(250, 250);
+ glutInitDisplayMode(GLUT_RGB | GLUT_SINGLE | GLUT_DEPTH);
+ args(argc, argv);
+ glutCreateWindow(filename);
+ glutReshapeFunc(Reshape);
+ glutKeyboardFunc(Key);
+ glutDisplayFunc(Display);
+ Init();
+ if (show_fps) {
+ signal(SIGALRM, alarmhandler);
+ alarm(5);
+ }
+ glutMainLoop();
+ return 0;
+}
diff --git a/progs/fp/frc.txt b/progs/fp/frc.txt
new file mode 100644
index 00000000000..efacaa8f927
--- /dev/null
+++ b/progs/fp/frc.txt
@@ -0,0 +1,5 @@
+!!ARBfp1.0
+TEMP R0;
+MUL R0, fragment.color, {3.0}.x;
+FRC result.color, R0;
+END
diff --git a/progs/fp/kil.txt b/progs/fp/kil.txt
new file mode 100644
index 00000000000..d95deb0a9e9
--- /dev/null
+++ b/progs/fp/kil.txt
@@ -0,0 +1,6 @@
+!!ARBfp1.0
+TEMP R0;
+SUB R0, fragment.color, {0.5,0,0,0};
+KIL R0;
+MOV result.color, R0;
+END
diff --git a/progs/fp/lg2.txt b/progs/fp/lg2.txt
new file mode 100644
index 00000000000..6707d7cb6d5
--- /dev/null
+++ b/progs/fp/lg2.txt
@@ -0,0 +1,5 @@
+!!ARBfp1.0
+TEMP R0;
+MUL R0, fragment.color, {4.0}.x;
+LG2 result.color, R0.x;
+END
diff --git a/progs/fp/lit.txt b/progs/fp/lit.txt
new file mode 100644
index 00000000000..333c50d3cca
--- /dev/null
+++ b/progs/fp/lit.txt
@@ -0,0 +1,5 @@
+!!ARBfp1.0
+TEMP R0;
+SUB R0, {0.5}.x, fragment.color;
+LIT result.color, R0;
+END
diff --git a/progs/fp/local.txt b/progs/fp/local.txt
new file mode 100644
index 00000000000..6cb2a2f13cc
--- /dev/null
+++ b/progs/fp/local.txt
@@ -0,0 +1,11 @@
+!!ARBfp1.0
+TEMP R0;
+PARAM c[4] = { { 0, 0, 0, 0 },
+ program.local[0..1],
+ { 1, 1, 1, 1 } };
+MOV R0, c[1];
+SUB R0, R0, c[0];
+ADD R0, R0, c[2];
+MUL R0, R0, c[3];
+MOV result.color, R0;
+END
diff --git a/progs/fp/lrp.txt b/progs/fp/lrp.txt
new file mode 100644
index 00000000000..56cb5f51528
--- /dev/null
+++ b/progs/fp/lrp.txt
@@ -0,0 +1,4 @@
+!!ARBfp1.0
+TEMP R0, R1;
+LRP result.color, fragment.color.z, {1,0,0,1}, {0,1,0,1};
+END
diff --git a/progs/fp/mad.txt b/progs/fp/mad.txt
new file mode 100644
index 00000000000..77ffac49cf1
--- /dev/null
+++ b/progs/fp/mad.txt
@@ -0,0 +1,4 @@
+!!ARBfp1.0
+TEMP R0, R1;
+MAD result.color, fragment.color.z, {1,0,0,1}, fragment.color;
+END
diff --git a/progs/fp/max.txt b/progs/fp/max.txt
new file mode 100644
index 00000000000..0f3bffd6a50
--- /dev/null
+++ b/progs/fp/max.txt
@@ -0,0 +1,3 @@
+!!ARBfp1.0
+MAX result.color, {0.5}.x, fragment.color;
+END
diff --git a/progs/fp/min.txt b/progs/fp/min.txt
new file mode 100644
index 00000000000..06d8f911c37
--- /dev/null
+++ b/progs/fp/min.txt
@@ -0,0 +1,3 @@
+!!ARBfp1.0
+MIN result.color, {0.5}.x, fragment.color;
+END
diff --git a/progs/fp/mov.txt b/progs/fp/mov.txt
new file mode 100644
index 00000000000..4c67baec5e5
--- /dev/null
+++ b/progs/fp/mov.txt
@@ -0,0 +1,3 @@
+!!ARBfp1.0
+MOV result.color, fragment.color;
+END
diff --git a/progs/fp/mul-swz.txt b/progs/fp/mul-swz.txt
new file mode 100644
index 00000000000..7ef2f58633f
--- /dev/null
+++ b/progs/fp/mul-swz.txt
@@ -0,0 +1,3 @@
+!!ARBfp1.0
+MUL result.color, fragment.color.zyxw, fragment.color;
+END
diff --git a/progs/fp/mul.txt b/progs/fp/mul.txt
new file mode 100644
index 00000000000..907155de783
--- /dev/null
+++ b/progs/fp/mul.txt
@@ -0,0 +1,3 @@
+!!ARBfp1.0
+MUL result.color, fragment.color, fragment.color;
+END
diff --git a/progs/fp/negate.txt b/progs/fp/negate.txt
new file mode 100644
index 00000000000..3d00a04a587
--- /dev/null
+++ b/progs/fp/negate.txt
@@ -0,0 +1,6 @@
+!!ARBfp1.0
+# this should result in fragment color passing through unchanged
+TEMP R0;
+ADD R0, fragment.color, fragment.color;
+ADD result.color, R0, -fragment.color;
+END
diff --git a/progs/fp/position.txt b/progs/fp/position.txt
new file mode 100644
index 00000000000..27fac12a3a5
--- /dev/null
+++ b/progs/fp/position.txt
@@ -0,0 +1,3 @@
+!!ARBfp1.0
+MUL result.color, fragment.position, {.005}.x;
+END
diff --git a/progs/fp/pow.txt b/progs/fp/pow.txt
new file mode 100644
index 00000000000..35c738556ea
--- /dev/null
+++ b/progs/fp/pow.txt
@@ -0,0 +1,4 @@
+!!ARBfp1.0
+TEMP R0;
+POW result.color, fragment.color.x, fragment.color.y;
+END
diff --git a/progs/fp/rcp.txt b/progs/fp/rcp.txt
new file mode 100644
index 00000000000..122161c49e5
--- /dev/null
+++ b/progs/fp/rcp.txt
@@ -0,0 +1,5 @@
+!!ARBfp1.0
+TEMP R0;
+ADD R0, fragment.color.x, fragment.color.x;
+RCP result.color, R0.x;
+END
diff --git a/progs/fp/rsq.txt b/progs/fp/rsq.txt
new file mode 100644
index 00000000000..b28de4bdb6c
--- /dev/null
+++ b/progs/fp/rsq.txt
@@ -0,0 +1,5 @@
+!!ARBfp1.0
+TEMP R0;
+MUL R0, fragment.color, {3.0}.x;
+RSQ result.color, R0.x;
+END
diff --git a/progs/fp/run.sh b/progs/fp/run.sh
new file mode 100755
index 00000000000..480f8108a35
--- /dev/null
+++ b/progs/fp/run.sh
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+for i in *.txt ; do
+echo $i
+./fp-tri $i
+done
+
diff --git a/progs/fp/scs.txt b/progs/fp/scs.txt
new file mode 100644
index 00000000000..5a8c9f16e9e
--- /dev/null
+++ b/progs/fp/scs.txt
@@ -0,0 +1,5 @@
+!!ARBfp1.0
+TEMP R0;
+MUL R0, fragment.color, {3.14}.x;
+SCS result.color, R0.x;
+END
diff --git a/progs/fp/sge.txt b/progs/fp/sge.txt
new file mode 100644
index 00000000000..53856924676
--- /dev/null
+++ b/progs/fp/sge.txt
@@ -0,0 +1,3 @@
+!!ARBfp1.0
+SGE result.color, {0.5}.x, fragment.color;
+END
diff --git a/progs/fp/sge2.txt b/progs/fp/sge2.txt
new file mode 100644
index 00000000000..e02a50d4772
--- /dev/null
+++ b/progs/fp/sge2.txt
@@ -0,0 +1,8 @@
+!!ARBfp1.0
+TEMP R0;
+TEMP R1;
+SGE R0, fragment.color, fragment.color.yzxw;
+SGE R1, fragment.color, fragment.color.zxyw;
+MUL R0, R0, R1;
+MUL result.color, R0, fragment.color;
+END
diff --git a/progs/fp/sin.txt b/progs/fp/sin.txt
new file mode 100644
index 00000000000..4a8cdb69f98
--- /dev/null
+++ b/progs/fp/sin.txt
@@ -0,0 +1,8 @@
+!!ARBfp1.0
+TEMP R0;
+MUL R0, fragment.color, {3.14}.x;
+MOV result.color, {0.0}.x;
+SIN result.color.x, R0.x;
+SIN result.color.y, R0.y;
+SIN result.color.z, R0.z;
+END
diff --git a/progs/fp/slt.txt b/progs/fp/slt.txt
new file mode 100644
index 00000000000..a3b3ff5656a
--- /dev/null
+++ b/progs/fp/slt.txt
@@ -0,0 +1,3 @@
+!!ARBfp1.0
+SLT result.color, {0.5}.x, fragment.color;
+END
diff --git a/progs/fp/sub.txt b/progs/fp/sub.txt
new file mode 100644
index 00000000000..b4e5cc0e9f8
--- /dev/null
+++ b/progs/fp/sub.txt
@@ -0,0 +1,3 @@
+!!ARBfp1.0
+SUB result.color, fragment.color.yzxw, fragment.color;
+END
diff --git a/progs/fp/swz.txt b/progs/fp/swz.txt
new file mode 100644
index 00000000000..e28f112b14e
--- /dev/null
+++ b/progs/fp/swz.txt
@@ -0,0 +1,3 @@
+!!ARBfp1.0
+SWZ result.color, fragment.color, 1,x,y,z;
+END
diff --git a/progs/fp/swz2.txt b/progs/fp/swz2.txt
new file mode 100644
index 00000000000..5c12b848154
--- /dev/null
+++ b/progs/fp/swz2.txt
@@ -0,0 +1,4 @@
+!!ARBfp1.0
+TEMP R0, R1;
+SWZ result.color, fragment.color, 1, 0, 0, 1;
+END
diff --git a/progs/fp/tri-abs.c b/progs/fp/tri-abs.c
deleted file mode 100644
index 44aa2cfa3ad..00000000000
--- a/progs/fp/tri-abs.c
+++ /dev/null
@@ -1,107 +0,0 @@
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#define GL_GLEXT_PROTOTYPES
-#include <GL/glut.h>
-
-
-
-static void Init( void )
-{
- static const char *modulate2D =
- "!!ARBfp1.0\n"
- "TEMP R0;\n"
- "SUB R0, {0.5}.x, fragment.color; \n"
- "ABS result.color, R0; \n"
- "END"
- ;
- GLuint modulateProg;
-
- if (!glutExtensionSupported("GL_ARB_fragment_program")) {
- printf("Error: GL_ARB_fragment_program not supported!\n");
- exit(1);
- }
- printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
-
- /* Setup the fragment program */
- glGenProgramsARB(1, &modulateProg);
- glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, modulateProg);
- glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB,
- strlen(modulate2D), (const GLubyte *)modulate2D);
-
- printf("glGetError = 0x%x\n", (int) glGetError());
- printf("glError(GL_PROGRAM_ERROR_STRING_ARB) = %s\n",
- (char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB));
-
- glEnable(GL_FRAGMENT_PROGRAM_ARB);
-
- glClearColor(.3, .3, .3, 0);
-}
-
-static void Reshape(int width, int height)
-{
-
- glViewport(0, 0, (GLint)width, (GLint)height);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
- glMatrixMode(GL_MODELVIEW);
-}
-
-static void Key(unsigned char key, int x, int y)
-{
-
- switch (key) {
- case 27:
- exit(1);
- default:
- return;
- }
-
- glutPostRedisplay();
-}
-
-static void Draw(void)
-{
- glClear(GL_COLOR_BUFFER_BIT);
-
- glBegin(GL_TRIANGLES);
- glColor3f(0,0,1);
- glVertex3f( 0.9, -0.9, -30.0);
- glColor3f(1,0,0);
- glVertex3f( 0.9, 0.9, -30.0);
- glColor3f(0,1,0);
- glVertex3f(-0.9, 0.0, -30.0);
- glEnd();
-
- glFlush();
-
-}
-
-
-
-int main(int argc, char **argv)
-{
- GLenum type;
-
- glutInit(&argc, argv);
- glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
-
- type = GLUT_RGB;
- type |= GLUT_SINGLE;
- glutInitDisplayMode(type);
-
- if (glutCreateWindow("First Tri") == GL_FALSE) {
- exit(1);
- }
-
- Init();
-
- glutReshapeFunc(Reshape);
- glutKeyboardFunc(Key);
- glutDisplayFunc(Draw);
- glutMainLoop();
- return 0;
-}
diff --git a/progs/fp/tri-add.c b/progs/fp/tri-add.c
deleted file mode 100644
index b086126c867..00000000000
--- a/progs/fp/tri-add.c
+++ /dev/null
@@ -1,110 +0,0 @@
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#define GL_GLEXT_PROTOTYPES
-#include <GL/glut.h>
-
-
-
-static void Init( void )
-{
- static const char *modulate2D =
- "!!ARBfp1.0\n"
- "TEMP R0;\n"
- "ADD R0, fragment.color, fragment.color; \n"
- "ADD result.color, R0, R0; \n"
- "END"
- ;
- GLuint modulateProg;
-
- if (!glutExtensionSupported("GL_ARB_fragment_program")) {
- printf("Error: GL_ARB_fragment_program not supported!\n");
- exit(1);
- }
- printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
-
- /* Setup the fragment program */
- glGenProgramsARB(1, &modulateProg);
- glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, modulateProg);
- glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB,
- strlen(modulate2D), (const GLubyte *)modulate2D);
-
- printf("glGetError = 0x%x\n", (int) glGetError());
- printf("glError(GL_PROGRAM_ERROR_STRING_ARB) = %s\n",
- (char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB));
-
- glEnable(GL_FRAGMENT_PROGRAM_ARB);
-
- glClearColor(.3, .3, .3, 0);
-}
-
-static void Reshape(int width, int height)
-{
-
- glViewport(0, 0, (GLint)width, (GLint)height);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
- glMatrixMode(GL_MODELVIEW);
-}
-
-static void Key(unsigned char key, int x, int y)
-{
-
- switch (key) {
- case 27:
- exit(1);
- default:
- return;
- }
-
- glutPostRedisplay();
-}
-
-static void Draw(void)
-{
- glClear(GL_COLOR_BUFFER_BIT);
-
- glBegin(GL_TRIANGLES);
- glColor3f(0,0,1);
- glVertex3f( 0.9, -0.9, -30.0);
- glColor3f(1,0,0);
- glVertex3f( 0.9, 0.9, -30.0);
- glColor3f(0,1,0);
- glVertex3f(-0.9, 0.0, -30.0);
- glEnd();
-
- glFlush();
-
-
-}
-
-
-
-int main(int argc, char **argv)
-{
- GLenum type;
-
- glutInit(&argc, argv);
-
-
- glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
-
- type = GLUT_RGB;
- type |= GLUT_SINGLE;
- glutInitDisplayMode(type);
-
- if (glutCreateWindow("First Tri") == GL_FALSE) {
- exit(1);
- }
-
- Init();
-
- glutReshapeFunc(Reshape);
- glutKeyboardFunc(Key);
- glutDisplayFunc(Draw);
- glutMainLoop();
- return 0;
-}
diff --git a/progs/fp/tri-cmp.c b/progs/fp/tri-cmp.c
deleted file mode 100644
index 968b67f3d91..00000000000
--- a/progs/fp/tri-cmp.c
+++ /dev/null
@@ -1,110 +0,0 @@
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#define GL_GLEXT_PROTOTYPES
-#include <GL/glut.h>
-
-
-
-static void Init( void )
-{
- static const char *modulate2D =
- "!!ARBfp1.0\n"
- "TEMP R0;\n"
- "SUB R0, {0.5}.x, fragment.color; \n"
- "CMP result.color, R0, fragment.color, {0.0}.x; \n"
- "END"
- ;
- GLuint modulateProg;
-
- if (!glutExtensionSupported("GL_ARB_fragment_program")) {
- printf("Error: GL_ARB_fragment_program not supported!\n");
- exit(1);
- }
- printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
-
- /* Setup the fragment program */
- glGenProgramsARB(1, &modulateProg);
- glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, modulateProg);
- glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB,
- strlen(modulate2D), (const GLubyte *)modulate2D);
-
- printf("glGetError = 0x%x\n", (int) glGetError());
- printf("glError(GL_PROGRAM_ERROR_STRING_ARB) = %s\n",
- (char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB));
-
- glEnable(GL_FRAGMENT_PROGRAM_ARB);
-
- glClearColor(.3, .3, .3, 0);
-}
-
-static void Reshape(int width, int height)
-{
-
- glViewport(0, 0, (GLint)width, (GLint)height);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
- glMatrixMode(GL_MODELVIEW);
-}
-
-static void Key(unsigned char key, int x, int y)
-{
-
- switch (key) {
- case 27:
- exit(1);
- default:
- return;
- }
-
- glutPostRedisplay();
-}
-
-static void Draw(void)
-{
- glClear(GL_COLOR_BUFFER_BIT);
-
- glBegin(GL_TRIANGLES);
- glColor3f(0,0,1);
- glVertex3f( 0.9, -0.9, -30.0);
- glColor3f(1,0,0);
- glVertex3f( 0.9, 0.9, -30.0);
- glColor3f(0,1,0);
- glVertex3f(-0.9, 0.0, -30.0);
- glEnd();
-
- glFlush();
-
-
-}
-
-
-
-int main(int argc, char **argv)
-{
- GLenum type;
-
- glutInit(&argc, argv);
-
-
- glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
-
- type = GLUT_RGB;
- type |= GLUT_SINGLE;
- glutInitDisplayMode(type);
-
- if (glutCreateWindow("First Tri") == GL_FALSE) {
- exit(1);
- }
-
- Init();
-
- glutReshapeFunc(Reshape);
- glutKeyboardFunc(Key);
- glutDisplayFunc(Draw);
- glutMainLoop();
- return 0;
-}
diff --git a/progs/fp/tri-cos.c b/progs/fp/tri-cos.c
deleted file mode 100644
index 7ea24532189..00000000000
--- a/progs/fp/tri-cos.c
+++ /dev/null
@@ -1,113 +0,0 @@
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#define GL_GLEXT_PROTOTYPES
-#include <GL/glut.h>
-#include "GL/gl.h"
-
-
-
-static void Init( void )
-{
- static const char *modulate2D =
- "!!ARBfp1.0\n"
- "TEMP R0; \n"
- "MUL R0, fragment.color, {3.14}.x; \n"
- "COS result.color.x, R0.x; \n"
- "COS result.color.y, R0.y; \n"
- "COS result.color.z, R0.z; \n"
- "END"
- ;
- GLuint modulateProg;
-
- if (!glutExtensionSupported("GL_ARB_fragment_program")) {
- printf("Error: GL_ARB_fragment_program not supported!\n");
- exit(1);
- }
- printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
-
- /* Setup the fragment program */
- glGenProgramsARB(1, &modulateProg);
- glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, modulateProg);
- glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB,
- strlen(modulate2D), (const GLubyte *)modulate2D);
-
- printf("glGetError = 0x%x\n", (int) glGetError());
- printf("glError(GL_PROGRAM_ERROR_STRING_ARB) = %s\n",
- (char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB));
-
- glEnable(GL_FRAGMENT_PROGRAM_ARB);
-
- glClearColor(.3, .3, .3, 0);
-}
-
-static void Reshape(int width, int height)
-{
-
- glViewport(0, 0, (GLint)width, (GLint)height);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
- glMatrixMode(GL_MODELVIEW);
-}
-
-static void Key(unsigned char key, int x, int y)
-{
-
- switch (key) {
- case 27:
- exit(1);
- default:
- return;
- }
-
- glutPostRedisplay();
-}
-
-static void Draw(void)
-{
- glClear(GL_COLOR_BUFFER_BIT);
-
- glBegin(GL_TRIANGLES);
- glColor3f(0,0,1);
- glVertex3f( 0.9, -0.9, -30.0);
- glColor3f(1,0,0);
- glVertex3f( 0.9, 0.9, -30.0);
- glColor3f(0,1,0);
- glVertex3f(-0.9, 0.0, -30.0);
- glEnd();
-
- glFlush();
-
-
-}
-
-
-
-int main(int argc, char **argv)
-{
- GLenum type;
-
- glutInit(&argc, argv);
-
-
- glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
-
- type = GLUT_RGB;
- type |= GLUT_SINGLE;
- glutInitDisplayMode(type);
-
- if (glutCreateWindow("First Tri") == GL_FALSE) {
- exit(1);
- }
-
- Init();
-
- glutReshapeFunc(Reshape);
- glutKeyboardFunc(Key);
- glutDisplayFunc(Draw);
- glutMainLoop();
- return 0;
-}
diff --git a/progs/fp/tri-dp3.c b/progs/fp/tri-dp3.c
deleted file mode 100644
index 0e18de2dc46..00000000000
--- a/progs/fp/tri-dp3.c
+++ /dev/null
@@ -1,109 +0,0 @@
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#define GL_GLEXT_PROTOTYPES
-#include <GL/glut.h>
-
-
-
-static void Init( void )
-{
- static const char *modulate2D =
- "!!ARBfp1.0\n"
- "TEMP R0;\n"
- "DP3 result.color, fragment.color, fragment.color; \n"
- "END"
- ;
- GLuint modulateProg;
-
- if (!glutExtensionSupported("GL_ARB_fragment_program")) {
- printf("Error: GL_ARB_fragment_program not supported!\n");
- exit(1);
- }
- printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
-
- /* Setup the fragment program */
- glGenProgramsARB(1, &modulateProg);
- glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, modulateProg);
- glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB,
- strlen(modulate2D), (const GLubyte *)modulate2D);
-
- printf("glGetError = 0x%x\n", (int) glGetError());
- printf("glError(GL_PROGRAM_ERROR_STRING_ARB) = %s\n",
- (char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB));
-
- glEnable(GL_FRAGMENT_PROGRAM_ARB);
-
- glClearColor(.3, .3, .3, 0);
-}
-
-static void Reshape(int width, int height)
-{
-
- glViewport(0, 0, (GLint)width, (GLint)height);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
- glMatrixMode(GL_MODELVIEW);
-}
-
-static void Key(unsigned char key, int x, int y)
-{
-
- switch (key) {
- case 27:
- exit(1);
- default:
- return;
- }
-
- glutPostRedisplay();
-}
-
-static void Draw(void)
-{
- glClear(GL_COLOR_BUFFER_BIT);
-
- glBegin(GL_TRIANGLES);
- glColor3f(0,0,1);
- glVertex3f( 0.9, -0.9, -30.0);
- glColor3f(1,0,0);
- glVertex3f( 0.9, 0.9, -30.0);
- glColor3f(0,1,0);
- glVertex3f(-0.9, 0.0, -30.0);
- glEnd();
-
- glFlush();
-
-
-}
-
-
-
-int main(int argc, char **argv)
-{
- GLenum type;
-
- glutInit(&argc, argv);
-
-
- glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
-
- type = GLUT_RGB;
- type |= GLUT_SINGLE;
- glutInitDisplayMode(type);
-
- if (glutCreateWindow("First Tri") == GL_FALSE) {
- exit(1);
- }
-
- Init();
-
- glutReshapeFunc(Reshape);
- glutKeyboardFunc(Key);
- glutDisplayFunc(Draw);
- glutMainLoop();
- return 0;
-}
diff --git a/progs/fp/tri-dp4.c b/progs/fp/tri-dp4.c
deleted file mode 100644
index 400bbf4da2d..00000000000
--- a/progs/fp/tri-dp4.c
+++ /dev/null
@@ -1,109 +0,0 @@
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#define GL_GLEXT_PROTOTYPES
-#include <GL/glut.h>
-
-
-
-static void Init( void )
-{
- static const char *modulate2D =
- "!!ARBfp1.0\n"
- "TEMP R0;\n"
- "DP4 result.color, fragment.color.xxxx, fragment.color; \n"
- "END"
- ;
- GLuint modulateProg;
-
- if (!glutExtensionSupported("GL_ARB_fragment_program")) {
- printf("Error: GL_ARB_fragment_program not supported!\n");
- exit(1);
- }
- printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
-
- /* Setup the fragment program */
- glGenProgramsARB(1, &modulateProg);
- glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, modulateProg);
- glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB,
- strlen(modulate2D), (const GLubyte *)modulate2D);
-
- printf("glGetError = 0x%x\n", (int) glGetError());
- printf("glError(GL_PROGRAM_ERROR_STRING_ARB) = %s\n",
- (char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB));
-
- glEnable(GL_FRAGMENT_PROGRAM_ARB);
-
- glClearColor(.3, .3, .3, 0);
-}
-
-static void Reshape(int width, int height)
-{
-
- glViewport(0, 0, (GLint)width, (GLint)height);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
- glMatrixMode(GL_MODELVIEW);
-}
-
-static void Key(unsigned char key, int x, int y)
-{
-
- switch (key) {
- case 27:
- exit(1);
- default:
- return;
- }
-
- glutPostRedisplay();
-}
-
-static void Draw(void)
-{
- glClear(GL_COLOR_BUFFER_BIT);
-
- glBegin(GL_TRIANGLES);
- glColor3f(0,0,1);
- glVertex3f( 0.9, -0.9, -30.0);
- glColor3f(1,0,0);
- glVertex3f( 0.9, 0.9, -30.0);
- glColor3f(0,1,0);
- glVertex3f(-0.9, 0.0, -30.0);
- glEnd();
-
- glFlush();
-
-
-}
-
-
-
-int main(int argc, char **argv)
-{
- GLenum type;
-
- glutInit(&argc, argv);
-
-
- glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
-
- type = GLUT_RGB;
- type |= GLUT_SINGLE;
- glutInitDisplayMode(type);
-
- if (glutCreateWindow("First Tri") == GL_FALSE) {
- exit(1);
- }
-
- Init();
-
- glutReshapeFunc(Reshape);
- glutKeyboardFunc(Key);
- glutDisplayFunc(Draw);
- glutMainLoop();
- return 0;
-}
diff --git a/progs/fp/tri-dph.c b/progs/fp/tri-dph.c
deleted file mode 100644
index 958073c4131..00000000000
--- a/progs/fp/tri-dph.c
+++ /dev/null
@@ -1,109 +0,0 @@
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#define GL_GLEXT_PROTOTYPES
-#include <GL/glut.h>
-
-
-
-static void Init( void )
-{
- static const char *modulate2D =
- "!!ARBfp1.0\n"
- "TEMP R0;\n"
- "DPH result.color, fragment.color, fragment.color.xyzx; \n"
- "END"
- ;
- GLuint modulateProg;
-
- if (!glutExtensionSupported("GL_ARB_fragment_program")) {
- printf("Error: GL_ARB_fragment_program not supported!\n");
- exit(1);
- }
- printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
-
- /* Setup the fragment program */
- glGenProgramsARB(1, &modulateProg);
- glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, modulateProg);
- glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB,
- strlen(modulate2D), (const GLubyte *)modulate2D);
-
- printf("glGetError = 0x%x\n", (int) glGetError());
- printf("glError(GL_PROGRAM_ERROR_STRING_ARB) = %s\n",
- (char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB));
-
- glEnable(GL_FRAGMENT_PROGRAM_ARB);
-
- glClearColor(.3, .3, .3, 0);
-}
-
-static void Reshape(int width, int height)
-{
-
- glViewport(0, 0, (GLint)width, (GLint)height);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
- glMatrixMode(GL_MODELVIEW);
-}
-
-static void Key(unsigned char key, int x, int y)
-{
-
- switch (key) {
- case 27:
- exit(1);
- default:
- return;
- }
-
- glutPostRedisplay();
-}
-
-static void Draw(void)
-{
- glClear(GL_COLOR_BUFFER_BIT);
-
- glBegin(GL_TRIANGLES);
- glColor3f(0,0,1);
- glVertex3f( 0.9, -0.9, -30.0);
- glColor3f(1,0,0);
- glVertex3f( 0.9, 0.9, -30.0);
- glColor3f(0,1,0);
- glVertex3f(-0.9, 0.0, -30.0);
- glEnd();
-
- glFlush();
-
-
-}
-
-
-
-int main(int argc, char **argv)
-{
- GLenum type;
-
- glutInit(&argc, argv);
-
-
- glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
-
- type = GLUT_RGB;
- type |= GLUT_SINGLE;
- glutInitDisplayMode(type);
-
- if (glutCreateWindow("First Tri") == GL_FALSE) {
- exit(1);
- }
-
- Init();
-
- glutReshapeFunc(Reshape);
- glutKeyboardFunc(Key);
- glutDisplayFunc(Draw);
- glutMainLoop();
- return 0;
-}
diff --git a/progs/fp/tri-dst.c b/progs/fp/tri-dst.c
deleted file mode 100644
index 3d85e85643c..00000000000
--- a/progs/fp/tri-dst.c
+++ /dev/null
@@ -1,109 +0,0 @@
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#define GL_GLEXT_PROTOTYPES
-#include <GL/glut.h>
-#include "GL/gl.h"
-
-
-
-static void Init( void )
-{
- static const char *modulate2D =
- "!!ARBfp1.0\n"
- "DST result.color, fragment.color, fragment.color; \n"
- "END"
- ;
- GLuint modulateProg;
-
- if (!glutExtensionSupported("GL_ARB_fragment_program")) {
- printf("Error: GL_ARB_fragment_program not supported!\n");
- exit(1);
- }
- printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
-
- /* Setup the fragment program */
- glGenProgramsARB(1, &modulateProg);
- glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, modulateProg);
- glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB,
- strlen(modulate2D), (const GLubyte *)modulate2D);
-
- printf("glGetError = 0x%x\n", (int) glGetError());
- printf("glError(GL_PROGRAM_ERROR_STRING_ARB) = %s\n",
- (char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB));
-
- glEnable(GL_FRAGMENT_PROGRAM_ARB);
-
- glClearColor(.3, .3, .3, 0);
-}
-
-static void Reshape(int width, int height)
-{
-
- glViewport(0, 0, (GLint)width, (GLint)height);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
- glMatrixMode(GL_MODELVIEW);
-}
-
-static void Key(unsigned char key, int x, int y)
-{
-
- switch (key) {
- case 27:
- exit(1);
- default:
- return;
- }
-
- glutPostRedisplay();
-}
-
-static void Draw(void)
-{
- glClear(GL_COLOR_BUFFER_BIT);
-
- glBegin(GL_TRIANGLES);
- glColor3f(0,0,1);
- glVertex3f( 0.9, -0.9, -30.0);
- glColor3f(1,0,0);
- glVertex3f( 0.9, 0.9, -30.0);
- glColor3f(0,1,0);
- glVertex3f(-0.9, 0.0, -30.0);
- glEnd();
-
- glFlush();
-
-
-}
-
-
-
-int main(int argc, char **argv)
-{
- GLenum type;
-
- glutInit(&argc, argv);
-
-
- glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
-
- type = GLUT_RGB;
- type |= GLUT_SINGLE;
- glutInitDisplayMode(type);
-
- if (glutCreateWindow("First Tri") == GL_FALSE) {
- exit(1);
- }
-
- Init();
-
- glutReshapeFunc(Reshape);
- glutKeyboardFunc(Key);
- glutDisplayFunc(Draw);
- glutMainLoop();
- return 0;
-}
diff --git a/progs/fp/tri-ex2.c b/progs/fp/tri-ex2.c
deleted file mode 100644
index f09b1d78469..00000000000
--- a/progs/fp/tri-ex2.c
+++ /dev/null
@@ -1,110 +0,0 @@
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#define GL_GLEXT_PROTOTYPES
-#include <GL/glut.h>
-
-
-
-static void Init( void )
-{
- static const char *modulate2D =
- "!!ARBfp1.0\n"
- "TEMP R0;\n"
- "EX2 R0, fragment.color.x; \n"
- "SUB result.color, R0, {1.0}.x; \n"
- "END"
- ;
- GLuint modulateProg;
-
- if (!glutExtensionSupported("GL_ARB_fragment_program")) {
- printf("Error: GL_ARB_fragment_program not supported!\n");
- exit(1);
- }
- printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
-
- /* Setup the fragment program */
- glGenProgramsARB(1, &modulateProg);
- glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, modulateProg);
- glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB,
- strlen(modulate2D), (const GLubyte *)modulate2D);
-
- printf("glGetError = 0x%x\n", (int) glGetError());
- printf("glError(GL_PROGRAM_ERROR_STRING_ARB) = %s\n",
- (char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB));
-
- glEnable(GL_FRAGMENT_PROGRAM_ARB);
-
- glClearColor(.3, .3, .3, 0);
-}
-
-static void Reshape(int width, int height)
-{
-
- glViewport(0, 0, (GLint)width, (GLint)height);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
- glMatrixMode(GL_MODELVIEW);
-}
-
-static void Key(unsigned char key, int x, int y)
-{
-
- switch (key) {
- case 27:
- exit(1);
- default:
- return;
- }
-
- glutPostRedisplay();
-}
-
-static void Draw(void)
-{
- glClear(GL_COLOR_BUFFER_BIT);
-
- glBegin(GL_TRIANGLES);
- glColor3f(0,0,1);
- glVertex3f( 0.9, -0.9, -30.0);
- glColor3f(1,0,0);
- glVertex3f( 0.9, 0.9, -30.0);
- glColor3f(0,1,0);
- glVertex3f(-0.9, 0.0, -30.0);
- glEnd();
-
- glFlush();
-
-
-}
-
-
-int main(int argc, char **argv)
-{
- GLenum type;
-
- glutInit(&argc, argv);
-
-
-
- glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
-
- type = GLUT_RGB;
- type |= GLUT_SINGLE;
- glutInitDisplayMode(type);
-
- if (glutCreateWindow("First Tri") == GL_FALSE) {
- exit(1);
- }
-
- Init();
-
- glutReshapeFunc(Reshape);
- glutKeyboardFunc(Key);
- glutDisplayFunc(Draw);
- glutMainLoop();
- return 0;
-}
diff --git a/progs/fp/tri-flr.c b/progs/fp/tri-flr.c
deleted file mode 100644
index 059f6b67541..00000000000
--- a/progs/fp/tri-flr.c
+++ /dev/null
@@ -1,110 +0,0 @@
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#define GL_GLEXT_PROTOTYPES
-#include <GL/glut.h>
-
-
-
-static void Init( void )
-{
- static const char *modulate2D =
- "!!ARBfp1.0\n"
- "TEMP R0;\n"
- "ADD R0, fragment.color, {0.5}.x; \n"
- "FLR result.color, R0; \n"
- "END"
- ;
- GLuint modulateProg;
-
- if (!glutExtensionSupported("GL_ARB_fragment_program")) {
- printf("Error: GL_ARB_fragment_program not supported!\n");
- exit(1);
- }
- printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
-
- /* Setup the fragment program */
- glGenProgramsARB(1, &modulateProg);
- glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, modulateProg);
- glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB,
- strlen(modulate2D), (const GLubyte *)modulate2D);
-
- printf("glGetError = 0x%x\n", (int) glGetError());
- printf("glError(GL_PROGRAM_ERROR_STRING_ARB) = %s\n",
- (char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB));
-
- glEnable(GL_FRAGMENT_PROGRAM_ARB);
-
- glClearColor(.3, .3, .3, 0);
-}
-
-static void Reshape(int width, int height)
-{
-
- glViewport(0, 0, (GLint)width, (GLint)height);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
- glMatrixMode(GL_MODELVIEW);
-}
-
-static void Key(unsigned char key, int x, int y)
-{
-
- switch (key) {
- case 27:
- exit(1);
- default:
- return;
- }
-
- glutPostRedisplay();
-}
-
-static void Draw(void)
-{
- glClear(GL_COLOR_BUFFER_BIT);
-
- glBegin(GL_TRIANGLES);
- glColor3f(0,0,1);
- glVertex3f( 0.9, -0.9, -30.0);
- glColor3f(1,0,0);
- glVertex3f( 0.9, 0.9, -30.0);
- glColor3f(0,1,0);
- glVertex3f(-0.9, 0.0, -30.0);
- glEnd();
-
- glFlush();
-
-
-}
-
-
-int main(int argc, char **argv)
-{
- GLenum type;
-
- glutInit(&argc, argv);
-
-
-
- glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
-
- type = GLUT_RGB;
- type |= GLUT_SINGLE;
- glutInitDisplayMode(type);
-
- if (glutCreateWindow("First Tri") == GL_FALSE) {
- exit(1);
- }
-
- Init();
-
- glutReshapeFunc(Reshape);
- glutKeyboardFunc(Key);
- glutDisplayFunc(Draw);
- glutMainLoop();
- return 0;
-}
diff --git a/progs/fp/tri-fp.c b/progs/fp/tri-fp.c
deleted file mode 100644
index 4148a8def34..00000000000
--- a/progs/fp/tri-fp.c
+++ /dev/null
@@ -1,109 +0,0 @@
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#define GL_GLEXT_PROTOTYPES
-#include <GL/glut.h>
-#include "GL/gl.h"
-
-
-
-static void Init( void )
-{
- static const char *modulate2D =
- "!!ARBfp1.0\n"
- "SLT result.color, {0.5}.x, fragment.color; \n"
- "END"
- ;
- GLuint modulateProg;
-
- if (!glutExtensionSupported("GL_ARB_fragment_program")) {
- printf("Error: GL_ARB_fragment_program not supported!\n");
- exit(1);
- }
- printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
-
- /* Setup the fragment program */
- glGenProgramsARB(1, &modulateProg);
- glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, modulateProg);
- glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB,
- strlen(modulate2D), (const GLubyte *)modulate2D);
-
- printf("glGetError = 0x%x\n", (int) glGetError());
- printf("glError(GL_PROGRAM_ERROR_STRING_ARB) = %s\n",
- (char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB));
-
- glEnable(GL_FRAGMENT_PROGRAM_ARB);
-
- glClearColor(.3, .3, .3, 0);
-}
-
-static void Reshape(int width, int height)
-{
-
- glViewport(0, 0, (GLint)width, (GLint)height);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
- glMatrixMode(GL_MODELVIEW);
-}
-
-static void Key(unsigned char key, int x, int y)
-{
-
- switch (key) {
- case 27:
- exit(1);
- default:
- return;
- }
-
- glutPostRedisplay();
-}
-
-static void Draw(void)
-{
- glClear(GL_COLOR_BUFFER_BIT);
-
- glBegin(GL_TRIANGLES);
- glColor3f(0,0,1);
- glVertex3f( 0.9, -0.9, -30.0);
- glColor3f(1,0,0);
- glVertex3f( 0.9, 0.9, -30.0);
- glColor3f(0,1,0);
- glVertex3f(-0.9, 0.0, -30.0);
- glEnd();
-
- glFlush();
-
-
-}
-
-
-int main(int argc, char **argv)
-{
- GLenum type;
-
- glutInit(&argc, argv);
-
-
-
- glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
-
- type = GLUT_RGB;
- type |= GLUT_SINGLE;
- glutInitDisplayMode(type);
-
- if (glutCreateWindow("First Tri") == GL_FALSE) {
- exit(1);
- }
-
- Init();
-
- glutReshapeFunc(Reshape);
- glutKeyboardFunc(Key);
- glutDisplayFunc(Draw);
- glutMainLoop();
- return 0;
-}
diff --git a/progs/fp/tri-frc.c b/progs/fp/tri-frc.c
deleted file mode 100644
index 8d60c9dc201..00000000000
--- a/progs/fp/tri-frc.c
+++ /dev/null
@@ -1,111 +0,0 @@
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#define GL_GLEXT_PROTOTYPES
-#include <GL/glut.h>
-#include "GL/gl.h"
-
-
-
-static void Init( void )
-{
- static const char *modulate2D =
- "!!ARBfp1.0\n"
- "TEMP R0; \n"
- "MUL R0, fragment.color, {3.0}.x; \n"
- "FRC result.color, R0; \n"
- "END"
- ;
- GLuint modulateProg;
-
- if (!glutExtensionSupported("GL_ARB_fragment_program")) {
- printf("Error: GL_ARB_fragment_program not supported!\n");
- exit(1);
- }
- printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
-
- /* Setup the fragment program */
- glGenProgramsARB(1, &modulateProg);
- glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, modulateProg);
- glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB,
- strlen(modulate2D), (const GLubyte *)modulate2D);
-
- printf("glGetError = 0x%x\n", (int) glGetError());
- printf("glError(GL_PROGRAM_ERROR_STRING_ARB) = %s\n",
- (char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB));
-
- glEnable(GL_FRAGMENT_PROGRAM_ARB);
-
- glClearColor(.3, .3, .3, 0);
-}
-
-static void Reshape(int width, int height)
-{
-
- glViewport(0, 0, (GLint)width, (GLint)height);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
- glMatrixMode(GL_MODELVIEW);
-}
-
-static void Key(unsigned char key, int x, int y)
-{
-
- switch (key) {
- case 27:
- exit(1);
- default:
- return;
- }
-
- glutPostRedisplay();
-}
-
-static void Draw(void)
-{
- glClear(GL_COLOR_BUFFER_BIT);
-
- glBegin(GL_TRIANGLES);
- glColor3f(0,0,1);
- glVertex3f( 0.9, -0.9, -30.0);
- glColor3f(1,0,0);
- glVertex3f( 0.9, 0.9, -30.0);
- glColor3f(0,1,0);
- glVertex3f(-0.9, 0.0, -30.0);
- glEnd();
-
- glFlush();
-
-
-}
-
-
-int main(int argc, char **argv)
-{
- GLenum type;
-
- glutInit(&argc, argv);
-
-
-
- glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
-
- type = GLUT_RGB;
- type |= GLUT_SINGLE;
- glutInitDisplayMode(type);
-
- if (glutCreateWindow("First Tri") == GL_FALSE) {
- exit(1);
- }
-
- Init();
-
- glutReshapeFunc(Reshape);
- glutKeyboardFunc(Key);
- glutDisplayFunc(Draw);
- glutMainLoop();
- return 0;
-}
diff --git a/progs/fp/tri-kil.c b/progs/fp/tri-kil.c
deleted file mode 100644
index 47dbd049644..00000000000
--- a/progs/fp/tri-kil.c
+++ /dev/null
@@ -1,111 +0,0 @@
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#define GL_GLEXT_PROTOTYPES
-#include <GL/glut.h>
-
-
-
-static void Init( void )
-{
- static const char *modulate2D =
- "!!ARBfp1.0\n"
- "TEMP R0;\n"
- "SUB R0, fragment.color, {0.5,0,0,0}; \n"
- "KIL R0;"
- "MOV result.color, R0;"
- "END"
- ;
- GLuint modulateProg;
-
- if (!glutExtensionSupported("GL_ARB_fragment_program")) {
- printf("Error: GL_ARB_fragment_program not supported!\n");
- exit(1);
- }
- printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
-
- /* Setup the fragment program */
- glGenProgramsARB(1, &modulateProg);
- glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, modulateProg);
- glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB,
- strlen(modulate2D), (const GLubyte *)modulate2D);
-
- printf("glGetError = 0x%x\n", (int) glGetError());
- printf("glError(GL_PROGRAM_ERROR_STRING_ARB) = %s\n",
- (char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB));
-
- glEnable(GL_FRAGMENT_PROGRAM_ARB);
-
- glClearColor(.3, .3, .3, 0);
-}
-
-static void Reshape(int width, int height)
-{
-
- glViewport(0, 0, (GLint)width, (GLint)height);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
- glMatrixMode(GL_MODELVIEW);
-}
-
-static void Key(unsigned char key, int x, int y)
-{
-
- switch (key) {
- case 27:
- exit(1);
- default:
- return;
- }
-
- glutPostRedisplay();
-}
-
-static void Draw(void)
-{
- glClear(GL_COLOR_BUFFER_BIT);
-
- glBegin(GL_TRIANGLES);
- glColor3f(0,0,1);
- glVertex3f( 0.9, -0.9, -30.0);
- glColor3f(1,0,0);
- glVertex3f( 0.9, 0.9, -30.0);
- glColor3f(0,1,0);
- glVertex3f(-0.9, 0.0, -30.0);
- glEnd();
-
- glFlush();
-
-
-}
-
-
-int main(int argc, char **argv)
-{
- GLenum type;
-
- glutInit(&argc, argv);
-
-
-
- glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
-
- type = GLUT_RGB;
- type |= GLUT_SINGLE;
- glutInitDisplayMode(type);
-
- if (glutCreateWindow("First Tri") == GL_FALSE) {
- exit(1);
- }
-
- Init();
-
- glutReshapeFunc(Reshape);
- glutKeyboardFunc(Key);
- glutDisplayFunc(Draw);
- glutMainLoop();
- return 0;
-}
diff --git a/progs/fp/tri-lg2.c b/progs/fp/tri-lg2.c
deleted file mode 100644
index c7eec469741..00000000000
--- a/progs/fp/tri-lg2.c
+++ /dev/null
@@ -1,110 +0,0 @@
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#define GL_GLEXT_PROTOTYPES
-#include <GL/glut.h>
-
-
-
-static void Init( void )
-{
- static const char *modulate2D =
- "!!ARBfp1.0\n"
- "TEMP R0;\n"
- "MUL R0, fragment.color, {4.0}.x; \n"
- "LG2 result.color, R0.x; \n"
- "END"
- ;
- GLuint modulateProg;
-
- if (!glutExtensionSupported("GL_ARB_fragment_program")) {
- printf("Error: GL_ARB_fragment_program not supported!\n");
- exit(1);
- }
- printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
-
- /* Setup the fragment program */
- glGenProgramsARB(1, &modulateProg);
- glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, modulateProg);
- glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB,
- strlen(modulate2D), (const GLubyte *)modulate2D);
-
- printf("glGetError = 0x%x\n", (int) glGetError());
- printf("glError(GL_PROGRAM_ERROR_STRING_ARB) = %s\n",
- (char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB));
-
- glEnable(GL_FRAGMENT_PROGRAM_ARB);
-
- glClearColor(.3, .3, .3, 0);
-}
-
-static void Reshape(int width, int height)
-{
-
- glViewport(0, 0, (GLint)width, (GLint)height);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
- glMatrixMode(GL_MODELVIEW);
-}
-
-static void Key(unsigned char key, int x, int y)
-{
-
- switch (key) {
- case 27:
- exit(1);
- default:
- return;
- }
-
- glutPostRedisplay();
-}
-
-static void Draw(void)
-{
- glClear(GL_COLOR_BUFFER_BIT);
-
- glBegin(GL_TRIANGLES);
- glColor3f(0,0,1);
- glVertex3f( 0.9, -0.9, -30.0);
- glColor3f(1,0,0);
- glVertex3f( 0.9, 0.9, -30.0);
- glColor3f(0,1,0);
- glVertex3f(-0.9, 0.0, -30.0);
- glEnd();
-
- glFlush();
-
-
-}
-
-
-int main(int argc, char **argv)
-{
- GLenum type;
-
- glutInit(&argc, argv);
-
-
-
- glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
-
- type = GLUT_RGB;
- type |= GLUT_SINGLE;
- glutInitDisplayMode(type);
-
- if (glutCreateWindow("First Tri") == GL_FALSE) {
- exit(1);
- }
-
- Init();
-
- glutReshapeFunc(Reshape);
- glutKeyboardFunc(Key);
- glutDisplayFunc(Draw);
- glutMainLoop();
- return 0;
-}
diff --git a/progs/fp/tri-lit.c b/progs/fp/tri-lit.c
deleted file mode 100644
index 21e3b6f2169..00000000000
--- a/progs/fp/tri-lit.c
+++ /dev/null
@@ -1,111 +0,0 @@
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#define GL_GLEXT_PROTOTYPES
-#include <GL/glut.h>
-#include "GL/gl.h"
-
-
-
-static void Init( void )
-{
- static const char *modulate2D =
- "!!ARBfp1.0\n"
- "TEMP R0;\n"
- "SUB R0, {0.5}.x, fragment.color; \n"
- "LIT result.color, R0; \n"
- "END"
- ;
- GLuint modulateProg;
-
- if (!glutExtensionSupported("GL_ARB_fragment_program")) {
- printf("Error: GL_ARB_fragment_program not supported!\n");
- exit(1);
- }
- printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
-
- /* Setup the fragment program */
- glGenProgramsARB(1, &modulateProg);
- glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, modulateProg);
- glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB,
- strlen(modulate2D), (const GLubyte *)modulate2D);
-
- printf("glGetError = 0x%x\n", (int) glGetError());
- printf("glError(GL_PROGRAM_ERROR_STRING_ARB) = %s\n",
- (char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB));
-
- glEnable(GL_FRAGMENT_PROGRAM_ARB);
-
- glClearColor(.3, .3, .3, 0);
-}
-
-static void Reshape(int width, int height)
-{
-
- glViewport(0, 0, (GLint)width, (GLint)height);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
- glMatrixMode(GL_MODELVIEW);
-}
-
-static void Key(unsigned char key, int x, int y)
-{
-
- switch (key) {
- case 27:
- exit(1);
- default:
- return;
- }
-
- glutPostRedisplay();
-}
-
-static void Draw(void)
-{
- glClear(GL_COLOR_BUFFER_BIT);
-
- glBegin(GL_TRIANGLES);
- glColor3f(0,0,1);
- glVertex3f( 0.9, -0.9, -30.0);
- glColor3f(1,0,0);
- glVertex3f( 0.9, 0.9, -30.0);
- glColor3f(0,1,0);
- glVertex3f(-0.9, 0.0, -30.0);
- glEnd();
-
- glFlush();
-
-
-}
-
-
-int main(int argc, char **argv)
-{
- GLenum type;
-
- glutInit(&argc, argv);
-
-
-
- glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
-
- type = GLUT_RGB;
- type |= GLUT_SINGLE;
- glutInitDisplayMode(type);
-
- if (glutCreateWindow("First Tri") == GL_FALSE) {
- exit(1);
- }
-
- Init();
-
- glutReshapeFunc(Reshape);
- glutKeyboardFunc(Key);
- glutDisplayFunc(Draw);
- glutMainLoop();
- return 0;
-}
diff --git a/progs/fp/tri-lrp.c b/progs/fp/tri-lrp.c
deleted file mode 100644
index a5659eed60d..00000000000
--- a/progs/fp/tri-lrp.c
+++ /dev/null
@@ -1,109 +0,0 @@
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#define GL_GLEXT_PROTOTYPES
-#include <GL/glut.h>
-
-
-
-static void Init( void )
-{
- static const char *modulate2D =
- "!!ARBfp1.0\n"
- "TEMP R0, R1;\n"
- "LRP result.color, fragment.color.z, {1,0,0,1}, {0,1,0,1}; \n"
- "END"
- ;
- GLuint modulateProg;
-
- if (!glutExtensionSupported("GL_ARB_fragment_program")) {
- printf("Error: GL_ARB_fragment_program not supported!\n");
- exit(1);
- }
- printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
-
- /* Setup the fragment program */
- glGenProgramsARB(1, &modulateProg);
- glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, modulateProg);
- glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB,
- strlen(modulate2D), (const GLubyte *)modulate2D);
-
- printf("glGetError = 0x%x\n", (int) glGetError());
- printf("glError(GL_PROGRAM_ERROR_STRING_ARB) = %s\n",
- (char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB));
-
- glEnable(GL_FRAGMENT_PROGRAM_ARB);
-
- glClearColor(.3, .3, .3, 0);
-}
-
-static void Reshape(int width, int height)
-{
-
- glViewport(0, 0, (GLint)width, (GLint)height);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
- glMatrixMode(GL_MODELVIEW);
-}
-
-static void Key(unsigned char key, int x, int y)
-{
-
- switch (key) {
- case 27:
- exit(1);
- default:
- return;
- }
-
- glutPostRedisplay();
-}
-
-static void Draw(void)
-{
- glClear(GL_COLOR_BUFFER_BIT);
-
- glBegin(GL_TRIANGLES);
- glColor3f(0,0,1);
- glVertex3f( 0.9, -0.9, -30.0);
- glColor3f(1,0,0);
- glVertex3f( 0.9, 0.9, -30.0);
- glColor3f(0,1,0);
- glVertex3f(-0.9, 0.0, -30.0);
- glEnd();
-
- glFlush();
-
-
-}
-
-
-int main(int argc, char **argv)
-{
- GLenum type;
-
- glutInit(&argc, argv);
-
-
-
- glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
-
- type = GLUT_RGB;
- type |= GLUT_SINGLE;
- glutInitDisplayMode(type);
-
- if (glutCreateWindow("First Tri") == GL_FALSE) {
- exit(1);
- }
-
- Init();
-
- glutReshapeFunc(Reshape);
- glutKeyboardFunc(Key);
- glutDisplayFunc(Draw);
- glutMainLoop();
- return 0;
-}
diff --git a/progs/fp/tri-mad.c b/progs/fp/tri-mad.c
deleted file mode 100644
index b46d139fb3c..00000000000
--- a/progs/fp/tri-mad.c
+++ /dev/null
@@ -1,109 +0,0 @@
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#define GL_GLEXT_PROTOTYPES
-#include <GL/glut.h>
-
-
-
-static void Init( void )
-{
- static const char *modulate2D =
- "!!ARBfp1.0\n"
- "TEMP R0, R1;\n"
- "MAD result.color, fragment.color.z, {1,0,0,1}, fragment.color; \n"
- "END"
- ;
- GLuint modulateProg;
-
- if (!glutExtensionSupported("GL_ARB_fragment_program")) {
- printf("Error: GL_ARB_fragment_program not supported!\n");
- exit(1);
- }
- printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
-
- /* Setup the fragment program */
- glGenProgramsARB(1, &modulateProg);
- glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, modulateProg);
- glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB,
- strlen(modulate2D), (const GLubyte *)modulate2D);
-
- printf("glGetError = 0x%x\n", (int) glGetError());
- printf("glError(GL_PROGRAM_ERROR_STRING_ARB) = %s\n",
- (char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB));
-
- glEnable(GL_FRAGMENT_PROGRAM_ARB);
-
- glClearColor(.3, .3, .3, 0);
-}
-
-static void Reshape(int width, int height)
-{
-
- glViewport(0, 0, (GLint)width, (GLint)height);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
- glMatrixMode(GL_MODELVIEW);
-}
-
-static void Key(unsigned char key, int x, int y)
-{
-
- switch (key) {
- case 27:
- exit(1);
- default:
- return;
- }
-
- glutPostRedisplay();
-}
-
-static void Draw(void)
-{
- glClear(GL_COLOR_BUFFER_BIT);
-
- glBegin(GL_TRIANGLES);
- glColor3f(0,0,1);
- glVertex3f( 0.9, -0.9, -30.0);
- glColor3f(1,0,0);
- glVertex3f( 0.9, 0.9, -30.0);
- glColor3f(0,1,0);
- glVertex3f(-0.9, 0.0, -30.0);
- glEnd();
-
- glFlush();
-
-
-}
-
-
-int main(int argc, char **argv)
-{
- GLenum type;
-
- glutInit(&argc, argv);
-
-
-
- glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
-
- type = GLUT_RGB;
- type |= GLUT_SINGLE;
- glutInitDisplayMode(type);
-
- if (glutCreateWindow("First Tri") == GL_FALSE) {
- exit(1);
- }
-
- Init();
-
- glutReshapeFunc(Reshape);
- glutKeyboardFunc(Key);
- glutDisplayFunc(Draw);
- glutMainLoop();
- return 0;
-}
diff --git a/progs/fp/tri-max.c b/progs/fp/tri-max.c
deleted file mode 100644
index 481a0679165..00000000000
--- a/progs/fp/tri-max.c
+++ /dev/null
@@ -1,109 +0,0 @@
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#define GL_GLEXT_PROTOTYPES
-#include <GL/glut.h>
-#include "GL/gl.h"
-
-
-
-static void Init( void )
-{
- static const char *modulate2D =
- "!!ARBfp1.0\n"
- "MAX result.color, {0.5}.x, fragment.color; \n"
- "END"
- ;
- GLuint modulateProg;
-
- if (!glutExtensionSupported("GL_ARB_fragment_program")) {
- printf("Error: GL_ARB_fragment_program not supported!\n");
- exit(1);
- }
- printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
-
- /* Setup the fragment program */
- glGenProgramsARB(1, &modulateProg);
- glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, modulateProg);
- glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB,
- strlen(modulate2D), (const GLubyte *)modulate2D);
-
- printf("glGetError = 0x%x\n", (int) glGetError());
- printf("glError(GL_PROGRAM_ERROR_STRING_ARB) = %s\n",
- (char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB));
-
- glEnable(GL_FRAGMENT_PROGRAM_ARB);
-
- glClearColor(.3, .3, .3, 0);
-}
-
-static void Reshape(int width, int height)
-{
-
- glViewport(0, 0, (GLint)width, (GLint)height);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
- glMatrixMode(GL_MODELVIEW);
-}
-
-static void Key(unsigned char key, int x, int y)
-{
-
- switch (key) {
- case 27:
- exit(1);
- default:
- return;
- }
-
- glutPostRedisplay();
-}
-
-static void Draw(void)
-{
- glClear(GL_COLOR_BUFFER_BIT);
-
- glBegin(GL_TRIANGLES);
- glColor3f(0,0,1);
- glVertex3f( 0.9, -0.9, -30.0);
- glColor3f(1,0,0);
- glVertex3f( 0.9, 0.9, -30.0);
- glColor3f(0,1,0);
- glVertex3f(-0.9, 0.0, -30.0);
- glEnd();
-
- glFlush();
-
-
-}
-
-
-int main(int argc, char **argv)
-{
- GLenum type;
-
- glutInit(&argc, argv);
-
-
-
- glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
-
- type = GLUT_RGB;
- type |= GLUT_SINGLE;
- glutInitDisplayMode(type);
-
- if (glutCreateWindow("First Tri") == GL_FALSE) {
- exit(1);
- }
-
- Init();
-
- glutReshapeFunc(Reshape);
- glutKeyboardFunc(Key);
- glutDisplayFunc(Draw);
- glutMainLoop();
- return 0;
-}
diff --git a/progs/fp/tri-min.c b/progs/fp/tri-min.c
deleted file mode 100644
index 7bb722f85ff..00000000000
--- a/progs/fp/tri-min.c
+++ /dev/null
@@ -1,109 +0,0 @@
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#define GL_GLEXT_PROTOTYPES
-#include <GL/glut.h>
-#include "GL/gl.h"
-
-
-
-static void Init( void )
-{
- static const char *modulate2D =
- "!!ARBfp1.0\n"
- "MIN result.color, {0.5}.x, fragment.color; \n"
- "END"
- ;
- GLuint modulateProg;
-
- if (!glutExtensionSupported("GL_ARB_fragment_program")) {
- printf("Error: GL_ARB_fragment_program not supported!\n");
- exit(1);
- }
- printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
-
- /* Setup the fragment program */
- glGenProgramsARB(1, &modulateProg);
- glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, modulateProg);
- glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB,
- strlen(modulate2D), (const GLubyte *)modulate2D);
-
- printf("glGetError = 0x%x\n", (int) glGetError());
- printf("glError(GL_PROGRAM_ERROR_STRING_ARB) = %s\n",
- (char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB));
-
- glEnable(GL_FRAGMENT_PROGRAM_ARB);
-
- glClearColor(.3, .3, .3, 0);
-}
-
-static void Reshape(int width, int height)
-{
-
- glViewport(0, 0, (GLint)width, (GLint)height);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
- glMatrixMode(GL_MODELVIEW);
-}
-
-static void Key(unsigned char key, int x, int y)
-{
-
- switch (key) {
- case 27:
- exit(1);
- default:
- return;
- }
-
- glutPostRedisplay();
-}
-
-static void Draw(void)
-{
- glClear(GL_COLOR_BUFFER_BIT);
-
- glBegin(GL_TRIANGLES);
- glColor3f(0,0,1);
- glVertex3f( 0.9, -0.9, -30.0);
- glColor3f(1,0,0);
- glVertex3f( 0.9, 0.9, -30.0);
- glColor3f(0,1,0);
- glVertex3f(-0.9, 0.0, -30.0);
- glEnd();
-
- glFlush();
-
-
-}
-
-
-int main(int argc, char **argv)
-{
- GLenum type;
-
- glutInit(&argc, argv);
-
-
-
- glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
-
- type = GLUT_RGB;
- type |= GLUT_SINGLE;
- glutInitDisplayMode(type);
-
- if (glutCreateWindow("First Tri") == GL_FALSE) {
- exit(1);
- }
-
- Init();
-
- glutReshapeFunc(Reshape);
- glutKeyboardFunc(Key);
- glutDisplayFunc(Draw);
- glutMainLoop();
- return 0;
-}
diff --git a/progs/fp/tri-mov.c b/progs/fp/tri-mov.c
deleted file mode 100644
index 40b5b66f5cc..00000000000
--- a/progs/fp/tri-mov.c
+++ /dev/null
@@ -1,102 +0,0 @@
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#define GL_GLEXT_PROTOTYPES
-#include <GL/glut.h>
-#include "GL/gl.h"
-
-static void Init( void )
-{
- static const char *modulate2D =
- "!!ARBfp1.0\n"
- "MOV result.color, fragment.color; \n"
- "END"
- ;
- GLuint modulateProg;
-
- if (!glutExtensionSupported("GL_ARB_fragment_program")) {
- printf("Error: GL_ARB_fragment_program not supported!\n");
- exit(1);
- }
- printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
-
- /* Setup the fragment program */
- glGenProgramsARB(1, &modulateProg);
- glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, modulateProg);
- glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB,
- strlen(modulate2D), (const GLubyte *)modulate2D);
-
- printf("glGetError = 0x%x\n", (int) glGetError());
- printf("glError(GL_PROGRAM_ERROR_STRING_ARB) = %s\n",
- (char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB));
-
- glEnable(GL_FRAGMENT_PROGRAM_ARB);
-
- glClearColor(.3, .3, .3, 0);
-}
-
-static void Reshape(int width, int height)
-{
-
- glViewport(0, 0, (GLint)width, (GLint)height);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
- glMatrixMode(GL_MODELVIEW);
-}
-
-static void Key(unsigned char key, int x, int y)
-{
-
- switch (key) {
- case 27:
- exit(1);
- default:
- return;
- }
-
- glutPostRedisplay();
-}
-
-static void Draw(void)
-{
- glClear(GL_COLOR_BUFFER_BIT);
-
- glBegin(GL_TRIANGLES);
- glColor3f(0,0,1);
- glVertex3f( 0.9, -0.9, -30.0);
- glColor3f(1,0,0);
- glVertex3f( 0.9, 0.9, -30.0);
- glColor3f(0,1,0);
- glVertex3f(-0.9, 0.0, -30.0);
- glEnd();
-
- glFlush();
-}
-
-
-int main(int argc, char **argv)
-{
- GLenum type;
-
- glutInit(&argc, argv);
-
- glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
-
- type = GLUT_RGB | GLUT_SINGLE;
- glutInitDisplayMode(type);
-
- if (glutCreateWindow("First Tri") == GL_FALSE) {
- exit(1);
- }
-
- Init();
-
- glutReshapeFunc(Reshape);
- glutKeyboardFunc(Key);
- glutDisplayFunc(Draw);
- glutMainLoop();
- return 0;
-}
diff --git a/progs/fp/tri-mul.c b/progs/fp/tri-mul.c
deleted file mode 100644
index 61dd3e0458c..00000000000
--- a/progs/fp/tri-mul.c
+++ /dev/null
@@ -1,109 +0,0 @@
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#define GL_GLEXT_PROTOTYPES
-#include <GL/glut.h>
-#include "GL/gl.h"
-
-
-
-static void Init( void )
-{
- static const char *modulate2D =
- "!!ARBfp1.0\n"
- "MUL result.color, fragment.color, fragment.color; \n"
- "END"
- ;
- GLuint modulateProg;
-
- if (!glutExtensionSupported("GL_ARB_fragment_program")) {
- printf("Error: GL_ARB_fragment_program not supported!\n");
- exit(1);
- }
- printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
-
- /* Setup the fragment program */
- glGenProgramsARB(1, &modulateProg);
- glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, modulateProg);
- glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB,
- strlen(modulate2D), (const GLubyte *)modulate2D);
-
- printf("glGetError = 0x%x\n", (int) glGetError());
- printf("glError(GL_PROGRAM_ERROR_STRING_ARB) = %s\n",
- (char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB));
-
- glEnable(GL_FRAGMENT_PROGRAM_ARB);
-
- glClearColor(.3, .3, .3, 0);
-}
-
-static void Reshape(int width, int height)
-{
-
- glViewport(0, 0, (GLint)width, (GLint)height);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
- glMatrixMode(GL_MODELVIEW);
-}
-
-static void Key(unsigned char key, int x, int y)
-{
-
- switch (key) {
- case 27:
- exit(1);
- default:
- return;
- }
-
- glutPostRedisplay();
-}
-
-static void Draw(void)
-{
- glClear(GL_COLOR_BUFFER_BIT);
-
- glBegin(GL_TRIANGLES);
- glColor3f(0,0,1);
- glVertex3f( 0.9, -0.9, -30.0);
- glColor3f(1,0,0);
- glVertex3f( 0.9, 0.9, -30.0);
- glColor3f(0,1,0);
- glVertex3f(-0.9, 0.0, -30.0);
- glEnd();
-
- glFlush();
-
-
-}
-
-
-int main(int argc, char **argv)
-{
- GLenum type;
-
- glutInit(&argc, argv);
-
-
-
- glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
-
- type = GLUT_RGB;
- type |= GLUT_SINGLE;
- glutInitDisplayMode(type);
-
- if (glutCreateWindow("First Tri") == GL_FALSE) {
- exit(1);
- }
-
- Init();
-
- glutReshapeFunc(Reshape);
- glutKeyboardFunc(Key);
- glutDisplayFunc(Draw);
- glutMainLoop();
- return 0;
-}
diff --git a/progs/fp/tri-position.c b/progs/fp/tri-position.c
deleted file mode 100644
index 18e8182a684..00000000000
--- a/progs/fp/tri-position.c
+++ /dev/null
@@ -1,109 +0,0 @@
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#define GL_GLEXT_PROTOTYPES
-#include <GL/glut.h>
-#include "GL/gl.h"
-
-
-
-static void Init( void )
-{
- static const char *modulate2D =
- "!!ARBfp1.0\n"
- "MUL result.color, fragment.position, {.005}.x; \n"
- "END"
- ;
- GLuint modulateProg;
-
- if (!glutExtensionSupported("GL_ARB_fragment_program")) {
- printf("Error: GL_ARB_fragment_program not supported!\n");
- exit(1);
- }
- printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
-
- /* Setup the fragment program */
- glGenProgramsARB(1, &modulateProg);
- glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, modulateProg);
- glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB,
- strlen(modulate2D), (const GLubyte *)modulate2D);
-
- printf("glGetError = 0x%x\n", (int) glGetError());
- printf("glError(GL_PROGRAM_ERROR_STRING_ARB) = %s\n",
- (char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB));
-
- glEnable(GL_FRAGMENT_PROGRAM_ARB);
-
- glClearColor(.3, .3, .3, 0);
-}
-
-static void Reshape(int width, int height)
-{
-
- glViewport(0, 0, (GLint)width, (GLint)height);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
- glMatrixMode(GL_MODELVIEW);
-}
-
-static void Key(unsigned char key, int x, int y)
-{
-
- switch (key) {
- case 27:
- exit(1);
- default:
- return;
- }
-
- glutPostRedisplay();
-}
-
-static void Draw(void)
-{
- glClear(GL_COLOR_BUFFER_BIT);
-
- glBegin(GL_TRIANGLES);
- glColor3f(0,0,1);
- glVertex3f( 0.9, -0.9, -30.0);
- glColor3f(1,0,0);
- glVertex3f( 0.9, 0.9, -30.0);
- glColor3f(0,1,0);
- glVertex3f(-0.9, 0.0, -30.0);
- glEnd();
-
- glFlush();
-
-
-}
-
-
-int main(int argc, char **argv)
-{
- GLenum type;
-
- glutInit(&argc, argv);
-
-
-
- glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
-
- type = GLUT_RGB;
- type |= GLUT_SINGLE;
- glutInitDisplayMode(type);
-
- if (glutCreateWindow("First Tri") == GL_FALSE) {
- exit(1);
- }
-
- Init();
-
- glutReshapeFunc(Reshape);
- glutKeyboardFunc(Key);
- glutDisplayFunc(Draw);
- glutMainLoop();
- return 0;
-}
diff --git a/progs/fp/tri-pow.c b/progs/fp/tri-pow.c
deleted file mode 100644
index ef91e43e997..00000000000
--- a/progs/fp/tri-pow.c
+++ /dev/null
@@ -1,109 +0,0 @@
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#define GL_GLEXT_PROTOTYPES
-#include <GL/glut.h>
-
-
-
-static void Init( void )
-{
- static const char *modulate2D =
- "!!ARBfp1.0\n"
- "TEMP R0;\n"
- "POW result.color, fragment.color.x, fragment.color.y; \n"
- "END"
- ;
- GLuint modulateProg;
-
- if (!glutExtensionSupported("GL_ARB_fragment_program")) {
- printf("Error: GL_ARB_fragment_program not supported!\n");
- exit(1);
- }
- printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
-
- /* Setup the fragment program */
- glGenProgramsARB(1, &modulateProg);
- glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, modulateProg);
- glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB,
- strlen(modulate2D), (const GLubyte *)modulate2D);
-
- printf("glGetError = 0x%x\n", (int) glGetError());
- printf("glError(GL_PROGRAM_ERROR_STRING_ARB) = %s\n",
- (char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB));
-
- glEnable(GL_FRAGMENT_PROGRAM_ARB);
-
- glClearColor(.3, .3, .3, 0);
-}
-
-static void Reshape(int width, int height)
-{
-
- glViewport(0, 0, (GLint)width, (GLint)height);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
- glMatrixMode(GL_MODELVIEW);
-}
-
-static void Key(unsigned char key, int x, int y)
-{
-
- switch (key) {
- case 27:
- exit(1);
- default:
- return;
- }
-
- glutPostRedisplay();
-}
-
-static void Draw(void)
-{
- glClear(GL_COLOR_BUFFER_BIT);
-
- glBegin(GL_TRIANGLES);
- glColor3f(0,0,1);
- glVertex3f( 0.9, -0.9, -30.0);
- glColor3f(1,0,0);
- glVertex3f( 0.9, 0.9, -30.0);
- glColor3f(0,1,0);
- glVertex3f(-0.9, 0.0, -30.0);
- glEnd();
-
- glFlush();
-
-
-}
-
-
-int main(int argc, char **argv)
-{
- GLenum type;
-
- glutInit(&argc, argv);
-
-
-
- glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
-
- type = GLUT_RGB;
- type |= GLUT_SINGLE;
- glutInitDisplayMode(type);
-
- if (glutCreateWindow("First Tri") == GL_FALSE) {
- exit(1);
- }
-
- Init();
-
- glutReshapeFunc(Reshape);
- glutKeyboardFunc(Key);
- glutDisplayFunc(Draw);
- glutMainLoop();
- return 0;
-}
diff --git a/progs/fp/tri-rcp.c b/progs/fp/tri-rcp.c
deleted file mode 100644
index e2a27049343..00000000000
--- a/progs/fp/tri-rcp.c
+++ /dev/null
@@ -1,110 +0,0 @@
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#define GL_GLEXT_PROTOTYPES
-#include <GL/glut.h>
-
-
-
-static void Init( void )
-{
- static const char *modulate2D =
- "!!ARBfp1.0\n"
- "TEMP R0;\n"
- "ADD R0, fragment.color.x, fragment.color.x; \n"
- "RCP result.color, R0.x; \n"
- "END"
- ;
- GLuint modulateProg;
-
- if (!glutExtensionSupported("GL_ARB_fragment_program")) {
- printf("Error: GL_ARB_fragment_program not supported!\n");
- exit(1);
- }
- printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
-
- /* Setup the fragment program */
- glGenProgramsARB(1, &modulateProg);
- glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, modulateProg);
- glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB,
- strlen(modulate2D), (const GLubyte *)modulate2D);
-
- printf("glGetError = 0x%x\n", (int) glGetError());
- printf("glError(GL_PROGRAM_ERROR_STRING_ARB) = %s\n",
- (char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB));
-
- glEnable(GL_FRAGMENT_PROGRAM_ARB);
-
- glClearColor(.3, .3, .3, 0);
-}
-
-static void Reshape(int width, int height)
-{
-
- glViewport(0, 0, (GLint)width, (GLint)height);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
- glMatrixMode(GL_MODELVIEW);
-}
-
-static void Key(unsigned char key, int x, int y)
-{
-
- switch (key) {
- case 27:
- exit(1);
- default:
- return;
- }
-
- glutPostRedisplay();
-}
-
-static void Draw(void)
-{
- glClear(GL_COLOR_BUFFER_BIT);
-
- glBegin(GL_TRIANGLES);
- glColor3f(0,0,1);
- glVertex3f( 0.9, -0.9, -30.0);
- glColor3f(1,0,0);
- glVertex3f( 0.9, 0.9, -30.0);
- glColor3f(0,1,0);
- glVertex3f(-0.9, 0.0, -30.0);
- glEnd();
-
- glFlush();
-
-
-}
-
-
-int main(int argc, char **argv)
-{
- GLenum type;
-
- glutInit(&argc, argv);
-
-
-
- glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
-
- type = GLUT_RGB;
- type |= GLUT_SINGLE;
- glutInitDisplayMode(type);
-
- if (glutCreateWindow("First Tri") == GL_FALSE) {
- exit(1);
- }
-
- Init();
-
- glutReshapeFunc(Reshape);
- glutKeyboardFunc(Key);
- glutDisplayFunc(Draw);
- glutMainLoop();
- return 0;
-}
diff --git a/progs/fp/tri-rsq.c b/progs/fp/tri-rsq.c
deleted file mode 100644
index c5b2c1b32e8..00000000000
--- a/progs/fp/tri-rsq.c
+++ /dev/null
@@ -1,110 +0,0 @@
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#define GL_GLEXT_PROTOTYPES
-#include <GL/glut.h>
-
-
-
-static void Init( void )
-{
- static const char *modulate2D =
- "!!ARBfp1.0\n"
- "TEMP R0;\n"
- "MUL R0, fragment.color, {3.0}.x; \n"
- "RSQ result.color, R0.x; \n"
- "END"
- ;
- GLuint modulateProg;
-
- if (!glutExtensionSupported("GL_ARB_fragment_program")) {
- printf("Error: GL_ARB_fragment_program not supported!\n");
- exit(1);
- }
- printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
-
- /* Setup the fragment program */
- glGenProgramsARB(1, &modulateProg);
- glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, modulateProg);
- glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB,
- strlen(modulate2D), (const GLubyte *)modulate2D);
-
- printf("glGetError = 0x%x\n", (int) glGetError());
- printf("glError(GL_PROGRAM_ERROR_STRING_ARB) = %s\n",
- (char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB));
-
- glEnable(GL_FRAGMENT_PROGRAM_ARB);
-
- glClearColor(.3, .3, .3, 0);
-}
-
-static void Reshape(int width, int height)
-{
-
- glViewport(0, 0, (GLint)width, (GLint)height);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
- glMatrixMode(GL_MODELVIEW);
-}
-
-static void Key(unsigned char key, int x, int y)
-{
-
- switch (key) {
- case 27:
- exit(1);
- default:
- return;
- }
-
- glutPostRedisplay();
-}
-
-static void Draw(void)
-{
- glClear(GL_COLOR_BUFFER_BIT);
-
- glBegin(GL_TRIANGLES);
- glColor3f(0,0,1);
- glVertex3f( 0.9, -0.9, -30.0);
- glColor3f(1,0,0);
- glVertex3f( 0.9, 0.9, -30.0);
- glColor3f(0,1,0);
- glVertex3f(-0.9, 0.0, -30.0);
- glEnd();
-
- glFlush();
-
-
-}
-
-
-int main(int argc, char **argv)
-{
- GLenum type;
-
- glutInit(&argc, argv);
-
-
-
- glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
-
- type = GLUT_RGB;
- type |= GLUT_SINGLE;
- glutInitDisplayMode(type);
-
- if (glutCreateWindow("First Tri") == GL_FALSE) {
- exit(1);
- }
-
- Init();
-
- glutReshapeFunc(Reshape);
- glutKeyboardFunc(Key);
- glutDisplayFunc(Draw);
- glutMainLoop();
- return 0;
-}
diff --git a/progs/fp/tri-scs.c b/progs/fp/tri-scs.c
deleted file mode 100644
index ce7c0062c33..00000000000
--- a/progs/fp/tri-scs.c
+++ /dev/null
@@ -1,111 +0,0 @@
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#define GL_GLEXT_PROTOTYPES
-#include <GL/glut.h>
-#include "GL/gl.h"
-
-
-
-static void Init( void )
-{
- static const char *modulate2D =
- "!!ARBfp1.0\n"
- "TEMP R0; \n"
- "MUL R0, fragment.color, {3.14}.x; \n"
- "SCS result.color, R0.x; \n"
- "END"
- ;
- GLuint modulateProg;
-
- if (!glutExtensionSupported("GL_ARB_fragment_program")) {
- printf("Error: GL_ARB_fragment_program not supported!\n");
- exit(1);
- }
- printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
-
- /* Setup the fragment program */
- glGenProgramsARB(1, &modulateProg);
- glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, modulateProg);
- glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB,
- strlen(modulate2D), (const GLubyte *)modulate2D);
-
- printf("glGetError = 0x%x\n", (int) glGetError());
- printf("glError(GL_PROGRAM_ERROR_STRING_ARB) = %s\n",
- (char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB));
-
- glEnable(GL_FRAGMENT_PROGRAM_ARB);
-
- glClearColor(.3, .3, .3, 0);
-}
-
-static void Reshape(int width, int height)
-{
-
- glViewport(0, 0, (GLint)width, (GLint)height);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
- glMatrixMode(GL_MODELVIEW);
-}
-
-static void Key(unsigned char key, int x, int y)
-{
-
- switch (key) {
- case 27:
- exit(1);
- default:
- return;
- }
-
- glutPostRedisplay();
-}
-
-static void Draw(void)
-{
- glClear(GL_COLOR_BUFFER_BIT);
-
- glBegin(GL_TRIANGLES);
- glColor3f(0,0,1);
- glVertex3f( 0.9, -0.9, -30.0);
- glColor3f(1,0,0);
- glVertex3f( 0.9, 0.9, -30.0);
- glColor3f(0,1,0);
- glVertex3f(-0.9, 0.0, -30.0);
- glEnd();
-
- glFlush();
-
-
-}
-
-
-int main(int argc, char **argv)
-{
- GLenum type;
-
- glutInit(&argc, argv);
-
-
-
- glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
-
- type = GLUT_RGB;
- type |= GLUT_SINGLE;
- glutInitDisplayMode(type);
-
- if (glutCreateWindow("First Tri") == GL_FALSE) {
- exit(1);
- }
-
- Init();
-
- glutReshapeFunc(Reshape);
- glutKeyboardFunc(Key);
- glutDisplayFunc(Draw);
- glutMainLoop();
- return 0;
-}
diff --git a/progs/fp/tri-sge.c b/progs/fp/tri-sge.c
deleted file mode 100644
index 6a360ca9328..00000000000
--- a/progs/fp/tri-sge.c
+++ /dev/null
@@ -1,109 +0,0 @@
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#define GL_GLEXT_PROTOTYPES
-#include <GL/glut.h>
-#include "GL/gl.h"
-
-
-
-static void Init( void )
-{
- static const char *modulate2D =
- "!!ARBfp1.0\n"
- "SGE result.color, {0.5}.x, fragment.color; \n"
- "END"
- ;
- GLuint modulateProg;
-
- if (!glutExtensionSupported("GL_ARB_fragment_program")) {
- printf("Error: GL_ARB_fragment_program not supported!\n");
- exit(1);
- }
- printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
-
- /* Setup the fragment program */
- glGenProgramsARB(1, &modulateProg);
- glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, modulateProg);
- glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB,
- strlen(modulate2D), (const GLubyte *)modulate2D);
-
- printf("glGetError = 0x%x\n", (int) glGetError());
- printf("glError(GL_PROGRAM_ERROR_STRING_ARB) = %s\n",
- (char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB));
-
- glEnable(GL_FRAGMENT_PROGRAM_ARB);
-
- glClearColor(.3, .3, .3, 0);
-}
-
-static void Reshape(int width, int height)
-{
-
- glViewport(0, 0, (GLint)width, (GLint)height);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
- glMatrixMode(GL_MODELVIEW);
-}
-
-static void Key(unsigned char key, int x, int y)
-{
-
- switch (key) {
- case 27:
- exit(1);
- default:
- return;
- }
-
- glutPostRedisplay();
-}
-
-static void Draw(void)
-{
- glClear(GL_COLOR_BUFFER_BIT);
-
- glBegin(GL_TRIANGLES);
- glColor3f(0,0,1);
- glVertex3f( 0.9, -0.9, -30.0);
- glColor3f(1,0,0);
- glVertex3f( 0.9, 0.9, -30.0);
- glColor3f(0,1,0);
- glVertex3f(-0.9, 0.0, -30.0);
- glEnd();
-
- glFlush();
-
-
-}
-
-
-int main(int argc, char **argv)
-{
- GLenum type;
-
- glutInit(&argc, argv);
-
-
-
- glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
-
- type = GLUT_RGB;
- type |= GLUT_SINGLE;
- glutInitDisplayMode(type);
-
- if (glutCreateWindow("First Tri") == GL_FALSE) {
- exit(1);
- }
-
- Init();
-
- glutReshapeFunc(Reshape);
- glutKeyboardFunc(Key);
- glutDisplayFunc(Draw);
- glutMainLoop();
- return 0;
-}
diff --git a/progs/fp/tri-sge2.c b/progs/fp/tri-sge2.c
deleted file mode 100644
index c4330098ed4..00000000000
--- a/progs/fp/tri-sge2.c
+++ /dev/null
@@ -1,114 +0,0 @@
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#define GL_GLEXT_PROTOTYPES
-#include <GL/glut.h>
-#include "GL/gl.h"
-
-
-
-static void Init( void )
-{
- static const char *modulate2D =
- "!!ARBfp1.0\n"
- "TEMP R0;\n"
- "TEMP R1;\n"
- "SGE R0, fragment.color, fragment.color.yzxw; \n"
- "SGE R1, fragment.color, fragment.color.zxyw; \n"
- "MUL R0, R0, R1; \n"
- "MUL result.color, R0, fragment.color; \n"
- "END"
- ;
- GLuint modulateProg;
-
- if (!glutExtensionSupported("GL_ARB_fragment_program")) {
- printf("Error: GL_ARB_fragment_program not supported!\n");
- exit(1);
- }
- printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
-
- /* Setup the fragment program */
- glGenProgramsARB(1, &modulateProg);
- glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, modulateProg);
- glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB,
- strlen(modulate2D), (const GLubyte *)modulate2D);
-
- printf("glGetError = 0x%x\n", (int) glGetError());
- printf("glError(GL_PROGRAM_ERROR_STRING_ARB) = %s\n",
- (char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB));
-
- glEnable(GL_FRAGMENT_PROGRAM_ARB);
-
- glClearColor(.3, .3, .3, 0);
-}
-
-static void Reshape(int width, int height)
-{
-
- glViewport(0, 0, (GLint)width, (GLint)height);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
- glMatrixMode(GL_MODELVIEW);
-}
-
-static void Key(unsigned char key, int x, int y)
-{
-
- switch (key) {
- case 27:
- exit(1);
- default:
- return;
- }
-
- glutPostRedisplay();
-}
-
-static void Draw(void)
-{
- glClear(GL_COLOR_BUFFER_BIT);
-
- glBegin(GL_TRIANGLES);
- glColor3f(0,0,1);
- glVertex3f( 0.9, -0.9, -30.0);
- glColor3f(1,0,0);
- glVertex3f( 0.9, 0.9, -30.0);
- glColor3f(0,1,0);
- glVertex3f(-0.9, 0.0, -30.0);
- glEnd();
-
- glFlush();
-
-
-}
-
-
-int main(int argc, char **argv)
-{
- GLenum type;
-
- glutInit(&argc, argv);
-
-
-
- glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
-
- type = GLUT_RGB;
- type |= GLUT_SINGLE;
- glutInitDisplayMode(type);
-
- if (glutCreateWindow("First Tri") == GL_FALSE) {
- exit(1);
- }
-
- Init();
-
- glutReshapeFunc(Reshape);
- glutKeyboardFunc(Key);
- glutDisplayFunc(Draw);
- glutMainLoop();
- return 0;
-}
diff --git a/progs/fp/tri-sin.c b/progs/fp/tri-sin.c
deleted file mode 100644
index 772903e4b23..00000000000
--- a/progs/fp/tri-sin.c
+++ /dev/null
@@ -1,114 +0,0 @@
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#define GL_GLEXT_PROTOTYPES
-#include <GL/glut.h>
-#include "GL/gl.h"
-
-
-
-static void Init( void )
-{
- static const char *modulate2D =
- "!!ARBfp1.0\n"
- "TEMP R0; \n"
- "MUL R0, fragment.color, {3.14}.x; \n"
- "MOV result.color, {0.0}.x; \n"
- "SIN result.color.x, R0.x; \n"
- "SIN result.color.y, R0.y; \n"
- "SIN result.color.z, R0.z; \n"
- "END"
- ;
- GLuint modulateProg;
-
- if (!glutExtensionSupported("GL_ARB_fragment_program")) {
- printf("Error: GL_ARB_fragment_program not supported!\n");
- exit(1);
- }
- printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
-
- /* Setup the fragment program */
- glGenProgramsARB(1, &modulateProg);
- glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, modulateProg);
- glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB,
- strlen(modulate2D), (const GLubyte *)modulate2D);
-
- printf("glGetError = 0x%x\n", (int) glGetError());
- printf("glError(GL_PROGRAM_ERROR_STRING_ARB) = %s\n",
- (char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB));
-
- glEnable(GL_FRAGMENT_PROGRAM_ARB);
-
- glClearColor(.3, .3, .3, 0);
-}
-
-static void Reshape(int width, int height)
-{
-
- glViewport(0, 0, (GLint)width, (GLint)height);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
- glMatrixMode(GL_MODELVIEW);
-}
-
-static void Key(unsigned char key, int x, int y)
-{
-
- switch (key) {
- case 27:
- exit(1);
- default:
- return;
- }
-
- glutPostRedisplay();
-}
-
-static void Draw(void)
-{
- glClear(GL_COLOR_BUFFER_BIT);
-
- glBegin(GL_TRIANGLES);
- glColor3f(0,0,1);
- glVertex3f( 0.9, -0.9, -30.0);
- glColor3f(1,0,0);
- glVertex3f( 0.9, 0.9, -30.0);
- glColor3f(0,1,0);
- glVertex3f(-0.9, 0.0, -30.0);
- glEnd();
-
- glFlush();
-
-
-}
-
-
-int main(int argc, char **argv)
-{
- GLenum type;
-
- glutInit(&argc, argv);
-
-
-
- glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
-
- type = GLUT_RGB;
- type |= GLUT_SINGLE;
- glutInitDisplayMode(type);
-
- if (glutCreateWindow("First Tri") == GL_FALSE) {
- exit(1);
- }
-
- Init();
-
- glutReshapeFunc(Reshape);
- glutKeyboardFunc(Key);
- glutDisplayFunc(Draw);
- glutMainLoop();
- return 0;
-}
diff --git a/progs/fp/tri-slt.c b/progs/fp/tri-slt.c
deleted file mode 100644
index 4148a8def34..00000000000
--- a/progs/fp/tri-slt.c
+++ /dev/null
@@ -1,109 +0,0 @@
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#define GL_GLEXT_PROTOTYPES
-#include <GL/glut.h>
-#include "GL/gl.h"
-
-
-
-static void Init( void )
-{
- static const char *modulate2D =
- "!!ARBfp1.0\n"
- "SLT result.color, {0.5}.x, fragment.color; \n"
- "END"
- ;
- GLuint modulateProg;
-
- if (!glutExtensionSupported("GL_ARB_fragment_program")) {
- printf("Error: GL_ARB_fragment_program not supported!\n");
- exit(1);
- }
- printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
-
- /* Setup the fragment program */
- glGenProgramsARB(1, &modulateProg);
- glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, modulateProg);
- glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB,
- strlen(modulate2D), (const GLubyte *)modulate2D);
-
- printf("glGetError = 0x%x\n", (int) glGetError());
- printf("glError(GL_PROGRAM_ERROR_STRING_ARB) = %s\n",
- (char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB));
-
- glEnable(GL_FRAGMENT_PROGRAM_ARB);
-
- glClearColor(.3, .3, .3, 0);
-}
-
-static void Reshape(int width, int height)
-{
-
- glViewport(0, 0, (GLint)width, (GLint)height);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
- glMatrixMode(GL_MODELVIEW);
-}
-
-static void Key(unsigned char key, int x, int y)
-{
-
- switch (key) {
- case 27:
- exit(1);
- default:
- return;
- }
-
- glutPostRedisplay();
-}
-
-static void Draw(void)
-{
- glClear(GL_COLOR_BUFFER_BIT);
-
- glBegin(GL_TRIANGLES);
- glColor3f(0,0,1);
- glVertex3f( 0.9, -0.9, -30.0);
- glColor3f(1,0,0);
- glVertex3f( 0.9, 0.9, -30.0);
- glColor3f(0,1,0);
- glVertex3f(-0.9, 0.0, -30.0);
- glEnd();
-
- glFlush();
-
-
-}
-
-
-int main(int argc, char **argv)
-{
- GLenum type;
-
- glutInit(&argc, argv);
-
-
-
- glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
-
- type = GLUT_RGB;
- type |= GLUT_SINGLE;
- glutInitDisplayMode(type);
-
- if (glutCreateWindow("First Tri") == GL_FALSE) {
- exit(1);
- }
-
- Init();
-
- glutReshapeFunc(Reshape);
- glutKeyboardFunc(Key);
- glutDisplayFunc(Draw);
- glutMainLoop();
- return 0;
-}
diff --git a/progs/fp/tri-sub.c b/progs/fp/tri-sub.c
deleted file mode 100644
index 6faa4145501..00000000000
--- a/progs/fp/tri-sub.c
+++ /dev/null
@@ -1,109 +0,0 @@
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#define GL_GLEXT_PROTOTYPES
-#include <GL/glut.h>
-#include "GL/gl.h"
-
-
-
-static void Init( void )
-{
- static const char *modulate2D =
- "!!ARBfp1.0\n"
- "SUB result.color, fragment.color.yzxw, fragment.color; \n"
- "END"
- ;
- GLuint modulateProg;
-
- if (!glutExtensionSupported("GL_ARB_fragment_program")) {
- printf("Error: GL_ARB_fragment_program not supported!\n");
- exit(1);
- }
- printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
-
- /* Setup the fragment program */
- glGenProgramsARB(1, &modulateProg);
- glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, modulateProg);
- glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB,
- strlen(modulate2D), (const GLubyte *)modulate2D);
-
- printf("glGetError = 0x%x\n", (int) glGetError());
- printf("glError(GL_PROGRAM_ERROR_STRING_ARB) = %s\n",
- (char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB));
-
- glEnable(GL_FRAGMENT_PROGRAM_ARB);
-
- glClearColor(.3, .3, .3, 0);
-}
-
-static void Reshape(int width, int height)
-{
-
- glViewport(0, 0, (GLint)width, (GLint)height);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
- glMatrixMode(GL_MODELVIEW);
-}
-
-static void Key(unsigned char key, int x, int y)
-{
-
- switch (key) {
- case 27:
- exit(1);
- default:
- return;
- }
-
- glutPostRedisplay();
-}
-
-static void Draw(void)
-{
- glClear(GL_COLOR_BUFFER_BIT);
-
- glBegin(GL_TRIANGLES);
- glColor3f(0,0,1);
- glVertex3f( 0.9, -0.9, -30.0);
- glColor3f(1,0,0);
- glVertex3f( 0.9, 0.9, -30.0);
- glColor3f(0,1,0);
- glVertex3f(-0.9, 0.0, -30.0);
- glEnd();
-
- glFlush();
-
-
-}
-
-
-int main(int argc, char **argv)
-{
- GLenum type;
-
- glutInit(&argc, argv);
-
-
-
- glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
-
- type = GLUT_RGB;
- type |= GLUT_SINGLE;
- glutInitDisplayMode(type);
-
- if (glutCreateWindow("First Tri") == GL_FALSE) {
- exit(1);
- }
-
- Init();
-
- glutReshapeFunc(Reshape);
- glutKeyboardFunc(Key);
- glutDisplayFunc(Draw);
- glutMainLoop();
- return 0;
-}
diff --git a/progs/fp/tri-swz.c b/progs/fp/tri-swz.c
deleted file mode 100644
index 5f34f7a3222..00000000000
--- a/progs/fp/tri-swz.c
+++ /dev/null
@@ -1,109 +0,0 @@
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#define GL_GLEXT_PROTOTYPES
-#include <GL/glut.h>
-#include "GL/gl.h"
-
-
-
-static void Init( void )
-{
- static const char *modulate2D =
- "!!ARBfp1.0\n"
- "SWZ result.color, fragment.color, 1,x,y,z; \n"
- "END"
- ;
- GLuint modulateProg;
-
- if (!glutExtensionSupported("GL_ARB_fragment_program")) {
- printf("Error: GL_ARB_fragment_program not supported!\n");
- exit(1);
- }
- printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
-
- /* Setup the fragment program */
- glGenProgramsARB(1, &modulateProg);
- glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, modulateProg);
- glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB,
- strlen(modulate2D), (const GLubyte *)modulate2D);
-
- printf("glGetError = 0x%x\n", (int) glGetError());
- printf("glError(GL_PROGRAM_ERROR_STRING_ARB) = %s\n",
- (char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB));
-
- glEnable(GL_FRAGMENT_PROGRAM_ARB);
-
- glClearColor(.3, .3, .3, 0);
-}
-
-static void Reshape(int width, int height)
-{
-
- glViewport(0, 0, (GLint)width, (GLint)height);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
- glMatrixMode(GL_MODELVIEW);
-}
-
-static void Key(unsigned char key, int x, int y)
-{
-
- switch (key) {
- case 27:
- exit(1);
- default:
- return;
- }
-
- glutPostRedisplay();
-}
-
-static void Draw(void)
-{
- glClear(GL_COLOR_BUFFER_BIT);
-
- glBegin(GL_TRIANGLES);
- glColor3f(0,0,1);
- glVertex3f( 0.9, -0.9, -30.0);
- glColor3f(1,0,0);
- glVertex3f( 0.9, 0.9, -30.0);
- glColor3f(0,1,0);
- glVertex3f(-0.9, 0.0, -30.0);
- glEnd();
-
- glFlush();
-
-
-}
-
-
-int main(int argc, char **argv)
-{
- GLenum type;
-
- glutInit(&argc, argv);
-
-
-
- glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
-
- type = GLUT_RGB;
- type |= GLUT_SINGLE;
- glutInitDisplayMode(type);
-
- if (glutCreateWindow("First Tri") == GL_FALSE) {
- exit(1);
- }
-
- Init();
-
- glutReshapeFunc(Reshape);
- glutKeyboardFunc(Key);
- glutDisplayFunc(Draw);
- glutMainLoop();
- return 0;
-}
diff --git a/progs/fp/tri-swz2.c b/progs/fp/tri-swz2.c
deleted file mode 100644
index fd76b58f539..00000000000
--- a/progs/fp/tri-swz2.c
+++ /dev/null
@@ -1,109 +0,0 @@
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#define GL_GLEXT_PROTOTYPES
-#include <GL/glut.h>
-
-
-
-static void Init( void )
-{
- static const char *modulate2D =
- "!!ARBfp1.0\n"
- "TEMP R0, R1;\n"
- "SWZ result.color, fragment.color, 1, 0, 0, 1; \n"
- "END"
- ;
- GLuint modulateProg;
-
- if (!glutExtensionSupported("GL_ARB_fragment_program")) {
- printf("Error: GL_ARB_fragment_program not supported!\n");
- exit(1);
- }
- printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
-
- /* Setup the fragment program */
- glGenProgramsARB(1, &modulateProg);
- glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, modulateProg);
- glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB,
- strlen(modulate2D), (const GLubyte *)modulate2D);
-
- printf("glGetError = 0x%x\n", (int) glGetError());
- printf("glError(GL_PROGRAM_ERROR_STRING_ARB) = %s\n",
- (char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB));
-
- glEnable(GL_FRAGMENT_PROGRAM_ARB);
-
- glClearColor(.3, .3, .3, 0);
-}
-
-static void Reshape(int width, int height)
-{
-
- glViewport(0, 0, (GLint)width, (GLint)height);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
- glMatrixMode(GL_MODELVIEW);
-}
-
-static void Key(unsigned char key, int x, int y)
-{
-
- switch (key) {
- case 27:
- exit(1);
- default:
- return;
- }
-
- glutPostRedisplay();
-}
-
-static void Draw(void)
-{
- glClear(GL_COLOR_BUFFER_BIT);
-
- glBegin(GL_TRIANGLES);
- glColor3f(0,0,1);
- glVertex3f( 0.9, -0.9, -30.0);
- glColor3f(1,0,0);
- glVertex3f( 0.9, 0.9, -30.0);
- glColor3f(0,1,0);
- glVertex3f(-0.9, 0.0, -30.0);
- glEnd();
-
- glFlush();
-
-
-}
-
-
-int main(int argc, char **argv)
-{
- GLenum type;
-
- glutInit(&argc, argv);
-
-
-
- glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
-
- type = GLUT_RGB;
- type |= GLUT_SINGLE;
- glutInitDisplayMode(type);
-
- if (glutCreateWindow("First Tri") == GL_FALSE) {
- exit(1);
- }
-
- Init();
-
- glutReshapeFunc(Reshape);
- glutKeyboardFunc(Key);
- glutDisplayFunc(Draw);
- glutMainLoop();
- return 0;
-}
diff --git a/progs/fp/tri-xpd.c b/progs/fp/tri-xpd.c
deleted file mode 100644
index 9aca46b2faa..00000000000
--- a/progs/fp/tri-xpd.c
+++ /dev/null
@@ -1,108 +0,0 @@
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#define GL_GLEXT_PROTOTYPES
-#include <GL/glut.h>
-#include "GL/gl.h"
-
-
-
-static void Init( void )
-{
- static const char *modulate2D =
- "!!ARBfp1.0\n"
- "XPD result.color, fragment.color, {2,2,2,0}; \n"
- "END"
- ;
- GLuint modulateProg;
-
- if (!glutExtensionSupported("GL_ARB_fragment_program")) {
- printf("Error: GL_ARB_fragment_program not supported!\n");
- exit(1);
- }
- printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
-
- /* Setup the fragment program */
- glGenProgramsARB(1, &modulateProg);
- glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, modulateProg);
- glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB,
- strlen(modulate2D), (const GLubyte *)modulate2D);
-
- printf("glGetError = 0x%x\n", (int) glGetError());
- printf("glError(GL_PROGRAM_ERROR_STRING_ARB) = %s\n",
- (char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB));
-
- glEnable(GL_FRAGMENT_PROGRAM_ARB);
-
- glClearColor(.3, .3, .3, 0);
-}
-
-static void Reshape(int width, int height)
-{
-
- glViewport(0, 0, (GLint)width, (GLint)height);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
- glMatrixMode(GL_MODELVIEW);
-}
-
-static void Key(unsigned char key, int x, int y)
-{
-
- switch (key) {
- case 27:
- exit(1);
- default:
- return;
- }
-
- glutPostRedisplay();
-}
-
-static void Draw(void)
-{
- glClear(GL_COLOR_BUFFER_BIT);
-
- glBegin(GL_TRIANGLES);
- glColor3f(0,0,1);
- glVertex3f( 0.9, -0.9, -30.0);
- glColor3f(1,0,0);
- glVertex3f( 0.9, 0.9, -30.0);
- glColor3f(0,1,0);
- glVertex3f(-0.9, 0.0, -30.0);
- glEnd();
-
- glFlush();
-
-
-}
-
-
-int main(int argc, char **argv)
-{
- GLenum type;
-
- glutInit(&argc, argv);
-
-
- glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
-
- type = GLUT_RGB;
- type |= GLUT_SINGLE;
- glutInitDisplayMode(type);
-
- if (glutCreateWindow("First Tri") == GL_FALSE) {
- exit(1);
- }
-
- Init();
-
- glutReshapeFunc(Reshape);
- glutKeyboardFunc(Key);
- glutDisplayFunc(Draw);
- glutMainLoop();
- return 0;
-}
diff --git a/progs/fp/xpd.txt b/progs/fp/xpd.txt
new file mode 100644
index 00000000000..d8dc08dcf7f
--- /dev/null
+++ b/progs/fp/xpd.txt
@@ -0,0 +1,3 @@
+!!ARBfp1.0
+XPD result.color, fragment.color, {2,2,2,0};
+END
diff --git a/progs/glsl/.gitignore b/progs/glsl/.gitignore
index 21c41da0cd5..7a51c8cf6f9 100644
--- a/progs/glsl/.gitignore
+++ b/progs/glsl/.gitignore
@@ -1,18 +1,27 @@
bitmap
brick
bump
+convolutions
deriv
extfuncs.h
+fragcoord
+identity
mandelbrot
multinoise
multitex
noise
+pointcoord
points
readtex.c
readtex.h
+samplers
+samplers_array
shaderutil.c
shaderutil.h
+skinning
texdemo1
toyball
trirast
twoside
+vert-or-frag-only
+vert-tex
diff --git a/progs/glsl/CH11-bumpmap.frag b/progs/glsl/CH11-bumpmap.frag
index 063576f5a3c..e12c5d374cd 100644
--- a/progs/glsl/CH11-bumpmap.frag
+++ b/progs/glsl/CH11-bumpmap.frag
@@ -24,7 +24,7 @@ void main()
float d, f;
d = p.x * p.x + p.y * p.y;
- f = 1.0 / sqrt(d + 1.0);
+ f = inversesqrt(d + 1.0);
if (d >= BumpSize)
{ p = vec2(0.0); f = 1.0; }
diff --git a/progs/glsl/Makefile b/progs/glsl/Makefile
index 6ba24feade5..7099eeadbd9 100644
--- a/progs/glsl/Makefile
+++ b/progs/glsl/Makefile
@@ -15,6 +15,7 @@ PROGS = \
bump \
convolutions \
deriv \
+ identity \
fragcoord \
mandelbrot \
multinoise \
@@ -23,6 +24,7 @@ PROGS = \
points \
pointcoord \
samplers \
+ samplers_array \
skinning \
texdemo1 \
toyball \
@@ -40,7 +42,7 @@ PROGS = \
# make executable from .c file:
.c: $(LIB_DEP)
- $(CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) $< $(LIBS) -o $@
+ $(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) $< $(LIBS) -o $@
##### TARGETS #####
@@ -62,7 +64,7 @@ readtex.h: $(TOP)/progs/util/readtex.h
cp $< .
readtex.o: readtex.c readtex.h
- $(CC) -c -I$(INCDIR) $(CFLAGS) readtex.c
+ $(APP_CC) -c -I$(INCDIR) $(CFLAGS) readtex.c
shaderutil.c: $(TOP)/progs/util/shaderutil.c
@@ -72,142 +74,152 @@ shaderutil.h: $(TOP)/progs/util/shaderutil.h
cp $< .
shaderutil.o: shaderutil.c shaderutil.h
- $(CC) -c -I$(INCDIR) $(CFLAGS) shaderutil.c
+ $(APP_CC) -c -I$(INCDIR) $(CFLAGS) shaderutil.c
bitmap.o: bitmap.c extfuncs.h shaderutil.h
- $(CC) -c -I$(INCDIR) $(CFLAGS) bitmap.c
+ $(APP_CC) -c -I$(INCDIR) $(CFLAGS) bitmap.c
bitmap: bitmap.o shaderutil.o
- $(CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) bitmap.o shaderutil.o $(LIBS) -o $@
+ $(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) bitmap.o shaderutil.o $(LIBS) -o $@
brick.o: brick.c extfuncs.h shaderutil.h
- $(CC) -c -I$(INCDIR) $(CFLAGS) brick.c
+ $(APP_CC) -c -I$(INCDIR) $(CFLAGS) brick.c
brick: brick.o shaderutil.o
- $(CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) brick.o shaderutil.o $(LIBS) -o $@
+ $(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) brick.o shaderutil.o $(LIBS) -o $@
bump.o: bump.c extfuncs.h shaderutil.h
- $(CC) -c -I$(INCDIR) $(CFLAGS) bump.c
+ $(APP_CC) -c -I$(INCDIR) $(CFLAGS) bump.c
bump: bump.o shaderutil.o
- $(CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) bump.o shaderutil.o $(LIBS) -o $@
+ $(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) bump.o shaderutil.o $(LIBS) -o $@
convolutions.o: convolutions.c readtex.h
- $(CC) -c -I$(INCDIR) $(CFLAGS) convolutions.c
+ $(APP_CC) -c -I$(INCDIR) $(CFLAGS) convolutions.c
convolutions: convolutions.o readtex.o
- $(CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) convolutions.o readtex.o $(LIBS) -o $@
+ $(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) convolutions.o readtex.o $(LIBS) -o $@
deriv.o: deriv.c extfuncs.h shaderutil.h
- $(CC) -c -I$(INCDIR) $(CFLAGS) deriv.c
+ $(APP_CC) -c -I$(INCDIR) $(CFLAGS) deriv.c
deriv: deriv.o shaderutil.o
- $(CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) deriv.o shaderutil.o $(LIBS) -o $@
+ $(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) deriv.o shaderutil.o $(LIBS) -o $@
+
+
+identity.o: identity.c extfuncs.h shaderutil.h
+ $(APP_CC) -c -I$(INCDIR) $(CFLAGS) identity.c
+
+identity: identity.o shaderutil.o
+ $(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) identity.o shaderutil.o $(LIBS) -o $@
fragcoord.o: fragcoord.c extfuncs.h shaderutil.h
- $(CC) -c -I$(INCDIR) $(CFLAGS) fragcoord.c
+ $(APP_CC) -c -I$(INCDIR) $(CFLAGS) fragcoord.c
fragcoord: fragcoord.o shaderutil.o
- $(CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) fragcoord.o shaderutil.o $(LIBS) -o $@
+ $(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) fragcoord.o shaderutil.o $(LIBS) -o $@
mandelbrot.o: mandelbrot.c extfuncs.h shaderutil.h
- $(CC) -c -I$(INCDIR) $(CFLAGS) mandelbrot.c
+ $(APP_CC) -c -I$(INCDIR) $(CFLAGS) mandelbrot.c
mandelbrot: mandelbrot.o shaderutil.o
- $(CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) mandelbrot.o shaderutil.o $(LIBS) -o $@
-
+ $(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) mandelbrot.o shaderutil.o $(LIBS) -o $@
multitex.o: multitex.c extfuncs.h readtex.h shaderutil.h
- $(CC) -c -I$(INCDIR) $(CFLAGS) multitex.c
+ $(APP_CC) -c -I$(INCDIR) $(CFLAGS) multitex.c
multitex: multitex.o readtex.o shaderutil.o
- $(CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) multitex.o readtex.o shaderutil.o $(LIBS) -o $@
+ $(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) multitex.o readtex.o shaderutil.o $(LIBS) -o $@
noise.o: noise.c extfuncs.h shaderutil.h
- $(CC) -c -I$(INCDIR) $(CFLAGS) noise.c
+ $(APP_CC) -c -I$(INCDIR) $(CFLAGS) noise.c
noise: noise.o shaderutil.o
- $(CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) noise.o shaderutil.o $(LIBS) -o $@
+ $(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) noise.o shaderutil.o $(LIBS) -o $@
points.o: points.c extfuncs.h shaderutil.h
- $(CC) -c -I$(INCDIR) $(CFLAGS) points.c
+ $(APP_CC) -c -I$(INCDIR) $(CFLAGS) points.c
points: points.o shaderutil.o
- $(CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) points.o shaderutil.o $(LIBS) -o $@
+ $(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) points.o shaderutil.o $(LIBS) -o $@
pointcoord.o: pointcoord.c readtex.h extfuncs.h shaderutil.h
- $(CC) -c -I$(INCDIR) $(CFLAGS) pointcoord.c
+ $(APP_CC) -c -I$(INCDIR) $(CFLAGS) pointcoord.c
pointcoord: pointcoord.o readtex.o shaderutil.o
- $(CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) pointcoord.o readtex.o shaderutil.o $(LIBS) -o $@
+ $(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) pointcoord.o readtex.o shaderutil.o $(LIBS) -o $@
samplers.o: samplers.c readtex.h extfuncs.h shaderutil.h
- $(CC) -c -I$(INCDIR) $(CFLAGS) samplers.c
+ $(APP_CC) -c -I$(INCDIR) $(CFLAGS) samplers.c
samplers: samplers.o readtex.o shaderutil.o
- $(CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) samplers.o readtex.o shaderutil.o $(LIBS) -o $@
+ $(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) samplers.o readtex.o shaderutil.o $(LIBS) -o $@
+
+samplers_array.o: samplers.c readtex.h extfuncs.h shaderutil.h
+ $(APP_CC) -c -DSAMPLERS_ARRAY -I$(INCDIR) $(CFLAGS) samplers.c -o samplers_array.o
+samplers_array: samplers_array.o readtex.o shaderutil.o
+ $(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) samplers_array.o readtex.o shaderutil.o $(LIBS) -o $@
skinning.o: skinning.c readtex.h extfuncs.h shaderutil.h
- $(CC) -c -I$(INCDIR) $(CFLAGS) skinning.c
+ $(APP_CC) -c -I$(INCDIR) $(CFLAGS) skinning.c
skinning: skinning.o readtex.o shaderutil.o
- $(CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) skinning.o readtex.o shaderutil.o $(LIBS) -o $@
+ $(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) skinning.o readtex.o shaderutil.o $(LIBS) -o $@
texdemo1.o: texdemo1.c readtex.h extfuncs.h shaderutil.h
- $(CC) -c -I$(INCDIR) $(CFLAGS) texdemo1.c
+ $(APP_CC) -c -I$(INCDIR) $(CFLAGS) texdemo1.c
texdemo1: texdemo1.o readtex.o shaderutil.o
- $(CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) texdemo1.o readtex.o shaderutil.o $(LIBS) -o $@
+ $(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) texdemo1.o readtex.o shaderutil.o $(LIBS) -o $@
toyball.o: toyball.c extfuncs.h shaderutil.h
- $(CC) -c -I$(INCDIR) $(CFLAGS) toyball.c
+ $(APP_CC) -c -I$(INCDIR) $(CFLAGS) toyball.c
toyball: toyball.o shaderutil.o
- $(CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) toyball.o shaderutil.o $(LIBS) -o $@
+ $(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) toyball.o shaderutil.o $(LIBS) -o $@
twoside.o: twoside.c extfuncs.h shaderutil.h
- $(CC) -c -I$(INCDIR) $(CFLAGS) twoside.c
+ $(APP_CC) -c -I$(INCDIR) $(CFLAGS) twoside.c
twoside: twoside.o shaderutil.o
- $(CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) twoside.o shaderutil.o $(LIBS) -o $@
+ $(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) twoside.o shaderutil.o $(LIBS) -o $@
trirast.o: trirast.c extfuncs.h shaderutil.h
- $(CC) -c -I$(INCDIR) $(CFLAGS) trirast.c
+ $(APP_CC) -c -I$(INCDIR) $(CFLAGS) trirast.c
trirast: trirast.o shaderutil.o
- $(CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) trirast.o shaderutil.o $(LIBS) -o $@
+ $(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) trirast.o shaderutil.o $(LIBS) -o $@
vert-or-frag-only.o: vert-or-frag-only.c extfuncs.h shaderutil.h
- $(CC) -c -I$(INCDIR) $(CFLAGS) vert-or-frag-only.c
+ $(APP_CC) -c -I$(INCDIR) $(CFLAGS) vert-or-frag-only.c
vert-or-frag-only: vert-or-frag-only.o shaderutil.o
- $(CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) vert-or-frag-only.o shaderutil.o $(LIBS) -o $@
-
+ $(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) vert-or-frag-only.o shaderutil.o $(LIBS) -o $@
vert-tex.o: vert-tex.c extfuncs.h shaderutil.h
- $(CC) -c -I$(INCDIR) $(CFLAGS) vert-tex.c
+ $(APP_CC) -c -I$(INCDIR) $(CFLAGS) vert-tex.c
vert-tex: vert-tex.o shaderutil.o
- $(CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) vert-tex.o shaderutil.o $(LIBS) -o $@
+ $(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) vert-tex.o shaderutil.o $(LIBS) -o $@
diff --git a/progs/glsl/convolutions.c b/progs/glsl/convolutions.c
index c5caa8ffedf..ac71c68235e 100644
--- a/progs/glsl/convolutions.c
+++ b/progs/glsl/convolutions.c
@@ -61,15 +61,15 @@ static void loadAndCompileShader(GLuint shader, const char *text)
{
GLint stat;
- glShaderSourceARB(shader, 1, (const GLchar **) &text, NULL);
+ glShaderSource(shader, 1, (const GLchar **) &text, NULL);
- glCompileShaderARB(shader);
+ glCompileShader(shader);
- glGetObjectParameterivARB(shader, GL_COMPILE_STATUS, &stat);
+ glGetShaderiv(shader, GL_COMPILE_STATUS, &stat);
if (!stat) {
GLchar log[1000];
GLsizei len;
- glGetInfoLogARB(shader, 1000, &len, log);
+ glGetShaderInfoLog(shader, 1000, &len, log);
fprintf(stderr, "Problem compiling shader: %s\n", log);
exit(1);
}
@@ -105,11 +105,11 @@ static void
checkLink(GLuint prog)
{
GLint stat;
- glGetObjectParameterivARB(prog, GL_LINK_STATUS, &stat);
+ glGetProgramiv(prog, GL_LINK_STATUS, &stat);
if (!stat) {
GLchar log[1000];
GLsizei len;
- glGetInfoLogARB(prog, 1000, &len, log);
+ glGetProgramInfoLog(prog, 1000, &len, log);
fprintf(stderr, "Linker error:\n%s\n", log);
}
else {
@@ -200,12 +200,12 @@ static void setupConvolution()
}
loc = glGetUniformLocationARB(program, "KernelValue");
- glUniform4fvARB(loc, 9, vecKer);
+ glUniform4fv(loc, 9, vecKer);
loc = glGetUniformLocationARB(program, "ScaleFactor");
- glUniform4fARB(loc, scale, scale, scale, scale);
+ glUniform4f(loc, scale, scale, scale, scale);
loc = glGetUniformLocationARB(program, "BaseColor");
- glUniform4fARB(loc, baseColor[0], baseColor[1],
- baseColor[2], baseColor[3]);
+ glUniform4f(loc, baseColor[0], baseColor[1],
+ baseColor[2], baseColor[3]);
free(vecKer);
free(kernel);
@@ -229,10 +229,10 @@ static void createProgram(const char *vertProgFile,
glAttachShader(program, fragShader);
}
- glLinkProgramARB(program);
+ glLinkProgram(program);
checkLink(program);
- glUseProgramObjectARB(program);
+ glUseProgram(program);
/*
assert(glIsProgram(program));
@@ -256,7 +256,7 @@ static void createProgram(const char *vertProgFile,
0.0 , -1.0 / texture.height,
-1.0 / texture.width, -1.0 / texture.height };
GLuint offsetLoc = glGetUniformLocationARB(program, "Offset");
- glUniform2fvARB(offsetLoc, 9, offsets);
+ glUniform2fv(offsetLoc, 9, offsets);
}
setupConvolution();
@@ -331,6 +331,7 @@ static void init()
fprintf(stderr, "Sorry, this program requires GL_ARB_shader_objects, GL_ARB_vertex_shader, and GL_ARB_fragment_shader\n");
exit(1);
}
+
fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
diff --git a/progs/glsl/identity.c b/progs/glsl/identity.c
new file mode 100644
index 00000000000..37579eb3469
--- /dev/null
+++ b/progs/glsl/identity.c
@@ -0,0 +1,208 @@
+/**
+ * Test very basic glsl functionality (identity vertex and fragment shaders).
+ * Brian Paul & Stephane Marchesin
+ */
+
+
+#include <assert.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <GL/gl.h>
+#include <GL/glut.h>
+#include <GL/glext.h>
+#include "extfuncs.h"
+#include "shaderutil.h"
+
+
+static char *FragProgFile = NULL;
+static char *VertProgFile = NULL;
+static GLuint fragShader;
+static GLuint vertShader;
+static GLuint program;
+static GLint win = 0;
+static GLboolean anim = GL_FALSE;
+static GLfloat xRot = 0.0f, yRot = 0.0f;
+static int w,h;
+
+
+static void
+Redisplay(void)
+{
+ glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+
+ glBegin(GL_TRIANGLES);
+ glColor3f(.8,0,0);
+ glVertex3f(-0.9, -0.9, 0.0);
+ glColor3f(0,.9,0);
+ glVertex3f( 0.9, -0.9, 0.0);
+ glColor3f(0,0,.7);
+ glVertex3f( 0.0, 0.9, 0.0);
+ glEnd();
+
+ glutSwapBuffers();
+}
+
+
+static void
+Idle(void)
+{
+ yRot = glutGet(GLUT_ELAPSED_TIME) * 0.1;
+ glutPostRedisplay();
+}
+
+
+static void
+Reshape(int width, int height)
+{
+ glViewport(0, 0, width, height);
+ glMatrixMode(GL_PROJECTION);
+ glLoadIdentity();
+ glMatrixMode(GL_MODELVIEW);
+ glLoadIdentity();
+ w = width;
+ h = height;
+}
+
+
+static void
+CleanUp(void)
+{
+ glDeleteShader_func(fragShader);
+ glDeleteShader_func(vertShader);
+ glDeleteProgram_func(program);
+ glutDestroyWindow(win);
+}
+
+
+static void
+Key(unsigned char key, int x, int y)
+{
+ (void) x;
+ (void) y;
+
+ switch(key) {
+ case ' ':
+ case 'a':
+ anim = !anim;
+ if (anim)
+ glutIdleFunc(Idle);
+ else
+ glutIdleFunc(NULL);
+ break;
+ case 27:
+ CleanUp();
+ exit(0);
+ break;
+ }
+ glutPostRedisplay();
+}
+
+
+static void
+SpecialKey(int key, int x, int y)
+{
+ const GLfloat step = 3.0f;
+
+ (void) x;
+ (void) y;
+
+ switch(key) {
+ case GLUT_KEY_UP:
+ xRot -= step;
+ break;
+ case GLUT_KEY_DOWN:
+ xRot += step;
+ break;
+ case GLUT_KEY_LEFT:
+ yRot -= step;
+ break;
+ case GLUT_KEY_RIGHT:
+ yRot += step;
+ break;
+ }
+ glutPostRedisplay();
+}
+
+
+static void
+Init(void)
+{
+ static const char *fragShaderText =
+ "void main() {\n"
+ " gl_FragColor = vec4(1.0,0.0,0.0,1.0);\n"
+ "}\n";
+ static const char *vertShaderText =
+ "void main() {\n"
+ " gl_Position = gl_Vertex;\n"
+ "}\n";
+
+ if (!ShadersSupported())
+ exit(1);
+
+ GetExtensionFuncs();
+
+ if (FragProgFile)
+ fragShader = CompileShaderFile(GL_FRAGMENT_SHADER, FragProgFile);
+ else
+ fragShader = CompileShaderText(GL_FRAGMENT_SHADER, fragShaderText);
+
+ if (VertProgFile)
+ vertShader = CompileShaderFile(GL_VERTEX_SHADER, VertProgFile);
+ else
+ vertShader = CompileShaderText(GL_VERTEX_SHADER, vertShaderText);
+
+ program = LinkShaders(vertShader, fragShader);
+
+ glUseProgram_func(program);
+
+ /*assert(glGetError() == 0);*/
+
+ glClearColor(0.3f, 0.3f, 0.3f, 0.0f);
+ glEnable(GL_DEPTH_TEST);
+
+ printf("GL_RENDERER = %s\n",(const char *) glGetString(GL_RENDERER));
+
+ assert(glIsProgram_func(program));
+ assert(glIsShader_func(fragShader));
+ assert(glIsShader_func(vertShader));
+
+ glColor3f(1, 0, 0);
+}
+
+
+static void
+ParseOptions(int argc, char *argv[])
+{
+ int i;
+ for (i = 1; i < argc; i++) {
+ if (strcmp(argv[i], "-fs") == 0) {
+ FragProgFile = argv[i+1];
+ }
+ else if (strcmp(argv[i], "-vs") == 0) {
+ VertProgFile = argv[i+1];
+ }
+ }
+}
+
+
+int
+main(int argc, char *argv[])
+{
+ glutInit(&argc, argv);
+ glutInitWindowPosition( 0, 0);
+ glutInitWindowSize(200, 200);
+ glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
+ win = glutCreateWindow(argv[0]);
+ glutReshapeFunc(Reshape);
+ glutKeyboardFunc(Key);
+ glutSpecialFunc(SpecialKey);
+ glutDisplayFunc(Redisplay);
+ if (anim)
+ glutIdleFunc(Idle);
+ ParseOptions(argc, argv);
+ Init();
+ glutMainLoop();
+ return 0;
+}
diff --git a/progs/glsl/samplers.c b/progs/glsl/samplers.c
index d2140097297..3fb8577d5e3 100644
--- a/progs/glsl/samplers.c
+++ b/progs/glsl/samplers.c
@@ -245,14 +245,22 @@ GenFragmentShader(GLint numSamplers)
int s;
p += sprintf(p, "// Generated fragment shader:\n");
+#ifndef SAMPLERS_ARRAY
for (s = 0; s < numSamplers; s++) {
p += sprintf(p, "uniform sampler2D tex%d;\n", s);
}
+#else
+ p += sprintf(p, "uniform sampler2D tex[%d];\n", numSamplers);
+#endif
p += sprintf(p, "void main()\n");
p += sprintf(p, "{\n");
p += sprintf(p, " vec4 color = vec4(0.0);\n");
for (s = 0; s < numSamplers; s++) {
+#ifndef SAMPLERS_ARRAY
p += sprintf(p, " color += texture2D(tex%d, gl_TexCoord[0].xy);\n", s);
+#else
+ p += sprintf(p, " color += texture2D(tex[%d], gl_TexCoord[0].xy);\n", s);
+#endif
}
p += sprintf(p, " gl_FragColor = color;\n");
p += sprintf(p, "}\n");
@@ -302,7 +310,11 @@ InitProgram(void)
char uname[10];
GLint loc;
+#ifndef SAMPLERS_ARRAY
sprintf(uname, "tex%d", s);
+#else
+ sprintf(uname, "tex[%d]", s);
+#endif
loc = glGetUniformLocation_func(Program, uname);
assert(loc >= 0);
diff --git a/progs/glsl/texdemo1.c b/progs/glsl/texdemo1.c
index 41010746eea..96ddca1f32d 100644
--- a/progs/glsl/texdemo1.c
+++ b/progs/glsl/texdemo1.c
@@ -49,6 +49,7 @@ static GLfloat TexXrot = 0, TexYrot = 0;
static GLfloat Xrot = 20.0, Yrot = 20.0, Zrot = 0.0;
static GLfloat EyeDist = 10;
static GLboolean Anim = GL_TRUE;
+static int win = 0;
static struct uniform_info ReflectUniforms[] = {
@@ -159,6 +160,7 @@ key(unsigned char k, int x, int y)
EyeDist = 90;
break;
case 27:
+ glutDestroyWindow(win);
exit(0);
}
glutPostRedisplay();
@@ -423,7 +425,7 @@ main(int argc, char *argv[])
glutInit(&argc, argv);
glutInitWindowSize(500, 400);
glutInitDisplayMode(GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE);
- glutCreateWindow(Demo);
+ win = glutCreateWindow(Demo);
glutReshapeFunc(Reshape);
glutKeyboardFunc(key);
glutSpecialFunc(specialkey);
diff --git a/progs/miniglx/Makefile b/progs/miniglx/Makefile
index d5258b0a966..e6f5fa558e9 100644
--- a/progs/miniglx/Makefile
+++ b/progs/miniglx/Makefile
@@ -48,6 +48,7 @@ clean:
depend: $(SOURCES)
+ rm -f depend
touch depend
$(MKDEP) $(MKDEP_OPTIONS) $(INCLUDES) $(SOURCES) > /dev/null
diff --git a/progs/redbook/Makefile b/progs/redbook/Makefile
index 7ba676c265b..0ba5fbbb986 100644
--- a/progs/redbook/Makefile
+++ b/progs/redbook/Makefile
@@ -26,7 +26,7 @@ PROGS = aaindex aapoly aargb accanti accpersp alpha alpha3D anti \
.SUFFIXES: .c
.c: $(LIB_DEP)
- $(CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) $< $(LIBS) -o $@
+ $(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) $< $(LIBS) -o $@
diff --git a/progs/redbook/Windows/redbook.dsw b/progs/redbook/Windows/redbook.dsw
index 71ba7e89e3e..a739af4a4e6 100644
--- a/progs/redbook/Windows/redbook.dsw
+++ b/progs/redbook/Windows/redbook.dsw
@@ -1,29 +1,29 @@
-Microsoft Developer Studio Workspace File, Format Version 6.00
-# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
-
-###############################################################################
-
-Project: "teapots"=".\teapots.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-}}}
-
-###############################################################################
-
-Global:
-
-Package=<5>
-{{{
-}}}
-
-Package=<3>
-{{{
-}}}
-
-###############################################################################
-
+Microsoft Developer Studio Workspace File, Format Version 6.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "teapots"=".\teapots.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
diff --git a/progs/redbook/Windows/teapots.dsp b/progs/redbook/Windows/teapots.dsp
index 4d39865810c..b74ed089254 100644
--- a/progs/redbook/Windows/teapots.dsp
+++ b/progs/redbook/Windows/teapots.dsp
@@ -1,112 +1,112 @@
-# Microsoft Developer Studio Project File - Name="teapots" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=teapots - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "teapots.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "teapots.mak" CFG="teapots - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "teapots - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "teapots - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "teapots - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /W3 /GX /O2 /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../teapots.exe"
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ELSEIF "$(CFG)" == "teapots - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../teapots.exe" /pdbtype:sept
-# Begin Special Build Tool
-SOURCE="$(InputPath)"
-PostBuild_Desc=Copy DLLs
-PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
-# End Special Build Tool
-
-!ENDIF
-
-# Begin Target
-
-# Name "teapots - Win32 Release"
-# Name "teapots - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=..\teapots.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
+# Microsoft Developer Studio Project File - Name="teapots" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=teapots - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "teapots.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "teapots.mak" CFG="teapots - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "teapots - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "teapots - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "teapots - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /W3 /GX /O2 /I "../../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /machine:I386 /out:"../teapots.exe"
+# Begin Special Build Tool
+SOURCE="$(InputPath)"
+PostBuild_Desc=Copy DLLs
+PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
+# End Special Build Tool
+
+!ELSEIF "$(CFG)" == "teapots - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../../include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ../../../lib/GLUT32.LIB ../../../lib/GLU32.LIB ../../../lib/OPENGL32.LIB /nologo /subsystem:console /debug /machine:I386 /out:"../teapots.exe" /pdbtype:sept
+# Begin Special Build Tool
+SOURCE="$(InputPath)"
+PostBuild_Desc=Copy DLLs
+PostBuild_Cmds=copy ..\..\..\lib\*.dll ..
+# End Special Build Tool
+
+!ENDIF
+
+# Begin Target
+
+# Name "teapots - Win32 Release"
+# Name "teapots - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=..\teapots.c
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# End Group
+# End Target
+# End Project
diff --git a/progs/samples/Makefile b/progs/samples/Makefile
index 6509a559a50..63dca07d2e8 100644
--- a/progs/samples/Makefile
+++ b/progs/samples/Makefile
@@ -20,7 +20,7 @@ PROGS = accum bitmap1 bitmap2 blendeq blendxor copy cursor depth eval fog \
.SUFFIXES: .c
.c: $(LIB_DEP)
- $(CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) $< $(LIBS) -o $@
+ $(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) $< $(LIBS) -o $@
##### TARGETS #####
@@ -29,10 +29,10 @@ default: $(PROGS)
sphere: sphere.o readtex.o
- $(CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) sphere.o readtex.o $(LIBS) -o $@
+ $(APP_CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) sphere.o readtex.o $(LIBS) -o $@
sphere.o: sphere.c readtex.h
- $(CC) -c -I$(INCDIR) $(CFLAGS) sphere.c
+ $(APP_CC) -c -I$(INCDIR) $(CFLAGS) sphere.c
readtex.c: $(TOP)/progs/util/readtex.c
cp $< .
@@ -41,7 +41,7 @@ readtex.h: $(TOP)/progs/util/readtex.h
cp $< .
readtex.o: readtex.c readtex.h
- $(CC) -c -I$(INCDIR) $(CFLAGS) $< -o $@
+ $(APP_CC) -c -I$(INCDIR) $(CFLAGS) $< -o $@
clean:
diff --git a/progs/samples/Makefile.DJ b/progs/samples/Makefile.DJ
deleted file mode 100644
index cda4e059418..00000000000
--- a/progs/samples/Makefile.DJ
+++ /dev/null
@@ -1,85 +0,0 @@
-# Mesa 3-D graphics library
-# Version: 4.0
-#
-# Copyright (C) 1999 Brian Paul All Rights Reserved.
-#
-# Permission is hereby granted, free of charge, to any person obtaining a
-# copy of this software and associated documentation files (the "Software"),
-# to deal in the Software without restriction, including without limitation
-# the rights to use, copy, modify, merge, publish, distribute, sublicense,
-# and/or sell copies of the Software, and to permit persons to whom the
-# Software is furnished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice shall be included
-# in all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-# BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-# DOS/DJGPP samples makefile v1.6 for Mesa
-#
-# Copyright (C) 2002 - Daniel Borca
-# Email : dborca@users.sourceforge.net
-# Web : http://www.geocities.com/dborca
-
-
-#
-# Available options:
-#
-# Environment variables:
-# GLIDE path to Glide3 SDK; used with FX.
-# default = $(TOP)/glide3
-# FX=1 build for 3dfx Glide3. Note that this disables
-# compilation of most DMesa code and requires fxMesa.
-# As a consequence, you'll need the DJGPP Glide3
-# library to build any application.
-# default = no
-# DXE=1 use DXE modules (see README.DJ for details).
-# default = no
-#
-# Targets:
-# <file.exe> build a specific file
-#
-
-
-
-.PHONY: all
-.SUFFIXES: .c .o .exe
-.SECONDARY: ../util/readtex.o ../util/showbuffer.o
-
-TOP = ../..
-GLIDE ?= $(TOP)/glide3
-
-CC = gcc
-CFLAGS = -Wall -W -pedantic
-CFLAGS += -O2 -ffast-math
-CFLAGS += -I$(TOP)/include -I../util
-CFLAGS += -DGLUT_IMPORT_LIB
-ifeq ($(FX),1)
-CFLAGS += -DFX
-endif
-
-LD = gxx
-LDFLAGS = -s -L$(TOP)/lib
-
-ifeq ($(DXE),1)
-LDLIBS += -liglut -liglu -ligl
-else
-LDLIBS = -lglut -lglu -lgl
-ifeq ($(FX),1)
-LDFLAGS += -L$(GLIDE)/lib
-LDLIBS += -lgld3x
-endif
-endif
-
-.c.o:
- $(CC) -o $@ $(CFLAGS) -c $<
-%.exe: ../util/readtex.o ../util/showbuffer.o %.o
- $(LD) -o $@ $(LDFLAGS) $^ $(LDLIBS)
-
-all:
- $(error Must specify <filename.exe> to build)
diff --git a/progs/samples/prim.c b/progs/samples/prim.c
index 388e0153b4f..f47c60faefd 100644
--- a/progs/samples/prim.c
+++ b/progs/samples/prim.c
@@ -466,7 +466,7 @@ static void Draw(void)
} else {
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
}
-
+#if 01
Viewport(0, 0); Point();
Viewport(0, 1); Lines();
Viewport(0, 2); LineStrip();
@@ -479,10 +479,12 @@ static void Draw(void)
Viewport(1, 3); TriangleStrip();
Viewport(2, 0); Rect();
+#endif
Viewport(2, 1); PolygonFunc();
+#if 01
Viewport(2, 2); Quads();
Viewport(2, 3); QuadStrip();
-
+#endif
glFlush();
if (doubleBuffer) {
diff --git a/progs/slang/windows/vc60/cltest.dsp b/progs/slang/windows/vc60/cltest.dsp
index 4c0c2e26b46..b4203973177 100644
--- a/progs/slang/windows/vc60/cltest.dsp
+++ b/progs/slang/windows/vc60/cltest.dsp
@@ -1,94 +1,94 @@
-# Microsoft Developer Studio Project File - Name="cltest" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=cltest - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "cltest.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "cltest.mak" CFG="cltest - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "cltest - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "cltest - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "cltest - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "cltest_release"
-# PROP Intermediate_Dir "cltest_release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD BASE RSC /l 0x415 /d "NDEBUG"
-# ADD RSC /l 0x415 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-
-!ELSEIF "$(CFG)" == "cltest - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "cltest_debug"
-# PROP Intermediate_Dir "cltest_debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD BASE RSC /l 0x415 /d "_DEBUG"
-# ADD RSC /l 0x415 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-
-!ENDIF
-
-# Begin Target
-
-# Name "cltest - Win32 Release"
-# Name "cltest - Win32 Debug"
-# Begin Source File
-
-SOURCE=..\..\cltest.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\cltest.txt
-# End Source File
-# End Target
-# End Project
+# Microsoft Developer Studio Project File - Name="cltest" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=cltest - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "cltest.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "cltest.mak" CFG="cltest - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "cltest - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "cltest - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "cltest - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "cltest_release"
+# PROP Intermediate_Dir "cltest_release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x415 /d "NDEBUG"
+# ADD RSC /l 0x415 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+
+!ELSEIF "$(CFG)" == "cltest - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "cltest_debug"
+# PROP Intermediate_Dir "cltest_debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD BASE RSC /l 0x415 /d "_DEBUG"
+# ADD RSC /l 0x415 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+
+!ENDIF
+
+# Begin Target
+
+# Name "cltest - Win32 Release"
+# Name "cltest - Win32 Debug"
+# Begin Source File
+
+SOURCE=..\..\cltest.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\cltest.txt
+# End Source File
+# End Target
+# End Project
diff --git a/progs/slang/windows/vc60/framework.dsp b/progs/slang/windows/vc60/framework.dsp
index 76ed7d388c1..f8ca5d169d6 100644
--- a/progs/slang/windows/vc60/framework.dsp
+++ b/progs/slang/windows/vc60/framework.dsp
@@ -1,92 +1,92 @@
-# Microsoft Developer Studio Project File - Name="framework" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Static Library" 0x0104
-
-CFG=framework - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "framework.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "framework.mak" CFG="framework - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "framework - Win32 Release" (based on "Win32 (x86) Static Library")
-!MESSAGE "framework - Win32 Debug" (based on "Win32 (x86) Static Library")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "framework - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "framework_release"
-# PROP Intermediate_Dir "framework_release"
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
-# ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
-# ADD BASE RSC /l 0x415 /d "NDEBUG"
-# ADD RSC /l 0x415 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LIB32=link.exe -lib
-# ADD BASE LIB32 /nologo
-# ADD LIB32 /nologo
-
-!ELSEIF "$(CFG)" == "framework - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "framework_debug"
-# PROP Intermediate_Dir "framework_debug"
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
-# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
-# ADD BASE RSC /l 0x415 /d "_DEBUG"
-# ADD RSC /l 0x415 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LIB32=link.exe -lib
-# ADD BASE LIB32 /nologo
-# ADD LIB32 /nologo
-
-!ENDIF
-
-# Begin Target
-
-# Name "framework - Win32 Release"
-# Name "framework - Win32 Debug"
-# Begin Source File
-
-SOURCE=..\..\framework.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\framework.h
-# End Source File
-# End Target
-# End Project
+# Microsoft Developer Studio Project File - Name="framework" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Static Library" 0x0104
+
+CFG=framework - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "framework.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "framework.mak" CFG="framework - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "framework - Win32 Release" (based on "Win32 (x86) Static Library")
+!MESSAGE "framework - Win32 Debug" (based on "Win32 (x86) Static Library")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "framework - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "framework_release"
+# PROP Intermediate_Dir "framework_release"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
+# ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
+# ADD BASE RSC /l 0x415 /d "NDEBUG"
+# ADD RSC /l 0x415 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LIB32=link.exe -lib
+# ADD BASE LIB32 /nologo
+# ADD LIB32 /nologo
+
+!ELSEIF "$(CFG)" == "framework - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "framework_debug"
+# PROP Intermediate_Dir "framework_debug"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
+# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
+# ADD BASE RSC /l 0x415 /d "_DEBUG"
+# ADD RSC /l 0x415 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LIB32=link.exe -lib
+# ADD BASE LIB32 /nologo
+# ADD LIB32 /nologo
+
+!ENDIF
+
+# Begin Target
+
+# Name "framework - Win32 Release"
+# Name "framework - Win32 Debug"
+# Begin Source File
+
+SOURCE=..\..\framework.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\framework.h
+# End Source File
+# End Target
+# End Project
diff --git a/progs/slang/windows/vc60/slang.dsw b/progs/slang/windows/vc60/slang.dsw
index 60536c1b0d9..ec38d1d9d50 100644
--- a/progs/slang/windows/vc60/slang.dsw
+++ b/progs/slang/windows/vc60/slang.dsw
@@ -1,74 +1,74 @@
-Microsoft Developer Studio Workspace File, Format Version 6.00
-# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
-
-###############################################################################
-
-Project: "cltest"=".\cltest.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name framework
- End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "framework"=".\framework.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-}}}
-
-###############################################################################
-
-Project: "sotest"=".\sotest.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name framework
- End Project Dependency
-}}}
-
-###############################################################################
-
-Project: "vstest"=".\vstest.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
- Begin Project Dependency
- Project_Dep_Name framework
- End Project Dependency
-}}}
-
-###############################################################################
-
-Global:
-
-Package=<5>
-{{{
-}}}
-
-Package=<3>
-{{{
-}}}
-
-###############################################################################
-
+Microsoft Developer Studio Workspace File, Format Version 6.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "cltest"=".\cltest.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name framework
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "framework"=".\framework.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Project: "sotest"=".\sotest.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name framework
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "vstest"=".\vstest.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name framework
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
diff --git a/progs/slang/windows/vc60/sotest.dsp b/progs/slang/windows/vc60/sotest.dsp
index 105924943b7..3a08ec93aad 100644
--- a/progs/slang/windows/vc60/sotest.dsp
+++ b/progs/slang/windows/vc60/sotest.dsp
@@ -1,90 +1,90 @@
-# Microsoft Developer Studio Project File - Name="sotest" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=sotest - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "sotest.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "sotest.mak" CFG="sotest - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "sotest - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "sotest - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "sotest - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "sotest_release"
-# PROP Intermediate_Dir "sotest_release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD BASE RSC /l 0x415 /d "NDEBUG"
-# ADD RSC /l 0x415 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-
-!ELSEIF "$(CFG)" == "sotest - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "sotest_debug"
-# PROP Intermediate_Dir "sotest_debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD BASE RSC /l 0x415 /d "_DEBUG"
-# ADD RSC /l 0x415 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-
-!ENDIF
-
-# Begin Target
-
-# Name "sotest - Win32 Release"
-# Name "sotest - Win32 Debug"
-# Begin Source File
-
-SOURCE=..\..\sotest.c
-# End Source File
-# End Target
-# End Project
+# Microsoft Developer Studio Project File - Name="sotest" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=sotest - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "sotest.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "sotest.mak" CFG="sotest - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "sotest - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "sotest - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "sotest - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "sotest_release"
+# PROP Intermediate_Dir "sotest_release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x415 /d "NDEBUG"
+# ADD RSC /l 0x415 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+
+!ELSEIF "$(CFG)" == "sotest - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "sotest_debug"
+# PROP Intermediate_Dir "sotest_debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD BASE RSC /l 0x415 /d "_DEBUG"
+# ADD RSC /l 0x415 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+
+!ENDIF
+
+# Begin Target
+
+# Name "sotest - Win32 Release"
+# Name "sotest - Win32 Debug"
+# Begin Source File
+
+SOURCE=..\..\sotest.c
+# End Source File
+# End Target
+# End Project
diff --git a/progs/slang/windows/vc60/vstest.dsp b/progs/slang/windows/vc60/vstest.dsp
index a3a2c707f0c..deb9e3d359b 100644
--- a/progs/slang/windows/vc60/vstest.dsp
+++ b/progs/slang/windows/vc60/vstest.dsp
@@ -1,93 +1,93 @@
-# Microsoft Developer Studio Project File - Name="vstest" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=vstest - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "vstest.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "vstest.mak" CFG="vstest - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "vstest - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE "vstest - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "vstest - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "vstest_release"
-# PROP Intermediate_Dir "vstest_release"
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD BASE RSC /l 0x415 /d "NDEBUG"
-# ADD RSC /l 0x415 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-
-!ELSEIF "$(CFG)" == "vstest - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "vstest_debug"
-# PROP Intermediate_Dir "vstest_debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD BASE RSC /l 0x415 /d "_DEBUG"
-# ADD RSC /l 0x415 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-
-!ENDIF
-
-# Begin Target
-
-# Name "vstest - Win32 Release"
-# Name "vstest - Win32 Debug"
-# Begin Source File
-
-SOURCE=..\..\vstest.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\vstest.txt
-# End Source File
-# End Target
-# End Project
+# Microsoft Developer Studio Project File - Name="vstest" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=vstest - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "vstest.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "vstest.mak" CFG="vstest - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "vstest - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "vstest - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "vstest - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "vstest_release"
+# PROP Intermediate_Dir "vstest_release"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x415 /d "NDEBUG"
+# ADD RSC /l 0x415 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+
+!ELSEIF "$(CFG)" == "vstest - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "vstest_debug"
+# PROP Intermediate_Dir "vstest_debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD BASE RSC /l 0x415 /d "_DEBUG"
+# ADD RSC /l 0x415 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+
+!ENDIF
+
+# Begin Target
+
+# Name "vstest - Win32 Release"
+# Name "vstest - Win32 Debug"
+# Begin Source File
+
+SOURCE=..\..\vstest.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\vstest.txt
+# End Source File
+# End Target
+# End Project
diff --git a/progs/tests/.gitignore b/progs/tests/.gitignore
index 6505c315a67..c5b9e28dab1 100644
--- a/progs/tests/.gitignore
+++ b/progs/tests/.gitignore
@@ -18,6 +18,8 @@ bufferobj
bug_3050
bug_3101
bug_3195
+bug_texstore_i8
+calibrate_rast
copypixrate
crossbar
cva
@@ -28,6 +30,7 @@ exactrast
fbotest1
fbotest2
fbotexture
+fillrate
floattex
fog
fogcoord
@@ -40,7 +43,9 @@ invert
jkrahntest
lineclip
manytex
+minmag
mipmap_limits
+mipmap_view
multipal
no_s3tc
packedpixels
@@ -57,6 +62,8 @@ shader_api
stencil_twoside
stencil_wrap
stencilwrap
+stencil_wrap
+subtex
subtexrate
tex1d
texcmp
@@ -78,4 +85,6 @@ vptorus
vpwarpmesh
yuvrect
yuvsquare
+zcomp
+zdrawpix
zreaddraw
diff --git a/progs/tests/Makefile b/progs/tests/Makefile
index 5f17f88d36c..34c9ab1dcef 100644
--- a/progs/tests/Makefile
+++ b/progs/tests/Makefile
@@ -31,6 +31,8 @@ SOURCES = \
bug_3050.c \
bug_3101.c \
bug_3195.c \
+ bug_texstore_i8.c \
+ calibrate_rast.c \
copypixrate.c \
crossbar.c \
cva.c \
@@ -41,6 +43,7 @@ SOURCES = \
fbotest1.c \
fbotest2.c \
fbotexture.c \
+ fillrate.c \
fog.c \
fogcoord.c \
fptest1.c \
@@ -53,12 +56,14 @@ SOURCES = \
manytex.c \
minmag.c \
mipmap_limits.c \
+ mipmap_view.c \
multipal.c \
no_s3tc.c \
packedpixels.c \
pbo.c \
prog_parameter.c \
projtex.c \
+ quads.c \
random.c \
readrate.c \
rubberband.c \
@@ -68,6 +73,7 @@ SOURCES = \
stencil_twoside.c \
stencilwrap.c \
stencil_wrap.c \
+ subtex \
subtexrate.c \
tex1d.c \
texcompress2.c \
@@ -87,6 +93,8 @@ SOURCES = \
vpwarpmesh.c \
yuvrect.c \
yuvsquare.c \
+ zcomp.c \
+ zdrawpix.c \
zreaddraw.c
PROGS = $(SOURCES:%.c=%)
@@ -111,13 +119,13 @@ clean:
.SUFFIXES: .c
.c:
- $(CC) $(INCLUDES) $(CFLAGS) $(LDFLAGS) $< $(LIBS) -o $@
+ $(APP_CC) $(INCLUDES) $(CFLAGS) $(LDFLAGS) $< $(LIBS) -o $@
.c.o:
- $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
+ $(APP_CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
.S.o:
- $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
+ $(APP_CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
# auto code generation
getprocaddress: getprocaddress.c getproclist.h
@@ -126,40 +134,55 @@ getproclist.h: $(TOP)/src/mesa/glapi/gl_API.xml getprocaddress.c getprocaddress.
python getprocaddress.py > getproclist.h
arraytexture: arraytexture.o readtex.o
- $(CC) $(CFLAGS) arraytexture.o readtex.o $(LIBS) -o $@
+ $(APP_CC) $(CFLAGS) arraytexture.o readtex.o $(LIBS) -o $@
arraytexture.o: arraytexture.c readtex.h
- $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) arraytexture.c -o $@
+ $(APP_CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) arraytexture.c -o $@
afsmultiarb: afsmultiarb.o readtex.o
- $(CC) $(CFLAGS) $(LDFLAGS) afsmultiarb.o readtex.o $(LIBS) -o $@
+ $(APP_CC) $(CFLAGS) $(LDFLAGS) afsmultiarb.o readtex.o $(LIBS) -o $@
afsmultiarb.o: afsmultiarb.c readtex.h
- $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) afsmultiarb.c -o $@
+ $(APP_CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) afsmultiarb.c -o $@
drawbuffers: drawbuffers.o
- $(CC) $(CFLAGS) $(LDFLAGS) drawbuffers.o $(LIBS) -o $@
+ $(APP_CC) $(CFLAGS) $(LDFLAGS) drawbuffers.o $(LIBS) -o $@
drawbuffers.o: drawbuffers.c extfuncs.h
- $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) drawbuffers.c -o $@
+ $(APP_CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) drawbuffers.c -o $@
texrect: texrect.o readtex.o
- $(CC) $(CFLAGS) $(LDFLAGS) texrect.o readtex.o $(LIBS) -o $@
+ $(APP_CC) $(CFLAGS) $(LDFLAGS) texrect.o readtex.o $(LIBS) -o $@
texrect.o: texrect.c readtex.h
- $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) texrect.c -o $@
+ $(APP_CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) texrect.c -o $@
bug_3195: bug_3195.o readtex.o
- $(CC) $(CFLAGS) $(LDFLAGS) bug_3195.o readtex.o $(LIBS) -o $@
+ $(APP_CC) $(CFLAGS) $(LDFLAGS) bug_3195.o readtex.o $(LIBS) -o $@
bug_3195.o: bug_3195.c readtex.h
- $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) bug_3195.c -o $@
+ $(APP_CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) bug_3195.c -o $@
invert: invert.o readtex.o
- $(CC) $(CFLAGS) $(LDFLAGS) invert.o readtex.o $(LIBS) -o $@
+ $(APP_CC) $(CFLAGS) $(LDFLAGS) invert.o readtex.o $(LIBS) -o $@
invert.o: invert.c readtex.h
- $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) invert.c -o $@
+ $(APP_CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) invert.c -o $@
+
+mipmap_view: mipmap_view.o readtex.o
+ $(APP_CC) $(CFLAGS) mipmap_view.o readtex.o $(LIBS) -o $@
+
+mipmap_view.o: mipmap_view.c readtex.h
+ $(APP_CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
+
+
+fillrate: fillrate.o readtex.o
+ $(APP_CC) $(CFLAGS) fillrate.o readtex.o $(LIBS) -o $@
+
+fillrate.o: fillrate.c readtex.h
+ $(APP_CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
+
+
floattex: floattex.o readtex.o shaderutil.o
@@ -170,7 +193,7 @@ floattex.o: floattex.c readtex.h shaderutil.h
readtex.o: readtex.c
- $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) readtex.c -o $@
+ $(APP_CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) readtex.c -o $@
readtex.h: $(TOP)/progs/util/readtex.h
ln -s $(TOP)/progs/util/readtex.h .
diff --git a/progs/tests/bug_texstore_i8.c b/progs/tests/bug_texstore_i8.c
new file mode 100644
index 00000000000..f8dac210f7a
--- /dev/null
+++ b/progs/tests/bug_texstore_i8.c
@@ -0,0 +1,194 @@
+/*
+ * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and
+ * its documentation for any purpose is hereby granted without fee, provided
+ * that (i) the above copyright notices and this permission notice appear in
+ * all copies of the software and related documentation, and (ii) the name of
+ * Silicon Graphics may not be used in any advertising or
+ * publicity relating to the software without the specific, prior written
+ * permission of Silicon Graphics.
+ *
+ * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF
+ * ANY KIND,
+ * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
+ * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * IN NO EVENT SHALL SILICON GRAPHICS BE LIABLE FOR
+ * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
+ * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
+ * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+ * OF THIS SOFTWARE.
+ */
+/*
+ * Based on the trivial/quad-tex-2d program.
+ * Modified by Jakob Bornecrantz <jakob@tungstengraphics.com>
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <GL/glut.h>
+
+static GLenum Target = GL_TEXTURE_2D;
+static GLenum Filter = GL_NEAREST;
+GLenum doubleBuffer;
+static float Rot = 0;
+static int win = 0;
+
+static void Init(void)
+{
+ int internalFormat;
+ int sourceFormat;
+
+ fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
+ fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
+ fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
+
+ glClearColor(0.0, 0.0, 1.0, 0.0);
+
+#define SIZE 16
+ {
+ GLubyte tex2d[SIZE][SIZE][4];
+ GLint s, t;
+
+ for (s = 0; s < SIZE; s++) {
+ for (t = 0; t < SIZE; t++) {
+ tex2d[t][s][0] = 0xff;
+ tex2d[t][s][1] = 0xff;
+ tex2d[t][s][2] = 0xff;
+ tex2d[t][s][3] = 0xff;
+ }
+ }
+
+ internalFormat = GL_LUMINANCE8;
+ sourceFormat = GL_RGBA;
+
+ glTexImage2D(Target,
+ 0,
+ internalFormat,
+ SIZE, SIZE,
+ 0,
+ sourceFormat,
+ GL_UNSIGNED_BYTE,
+ //GL_UNSIGNED_INT,
+ tex2d);
+
+ glEnable(Target);
+ glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
+ glTexParameterf(Target, GL_TEXTURE_WRAP_R, GL_REPEAT);
+ glTexParameterf(Target, GL_TEXTURE_MIN_FILTER, Filter);
+ glTexParameterf(Target, GL_TEXTURE_MAG_FILTER, Filter);
+ }
+}
+
+static void Reshape(int width, int height)
+{
+ glViewport(0, 0, (GLint)width, (GLint)height);
+ glMatrixMode(GL_PROJECTION);
+ glLoadIdentity();
+#if 0
+ glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
+#else
+ glFrustum(-1, 1, -1, 1, 10, 20);
+#endif
+ glMatrixMode(GL_MODELVIEW);
+ glLoadIdentity();
+ glTranslatef(0, 0, -15);
+}
+
+static void Key(unsigned char key, int x, int y)
+{
+ switch (key) {
+ case 'r':
+ Rot += 10.0;
+ break;
+ case 'R':
+ Rot -= 10.0;
+ break;
+ case 27:
+ glutDestroyWindow(win);
+ exit(0);
+ default:
+ return;
+ }
+ glutPostRedisplay();
+}
+
+static void Draw(void)
+{
+ glClear(GL_COLOR_BUFFER_BIT);
+
+ glPushMatrix();
+ glRotatef(Rot, 0, 1, 0);
+
+ glBegin(GL_QUADS);
+ glTexCoord2f(1,0);
+ glVertex3f( 0.9, -0.9, 0.0);
+ glTexCoord2f(1,1);
+ glVertex3f( 0.9, 0.9, 0.0);
+ glTexCoord2f(0,1);
+ glVertex3f(-0.9, 0.9, 0.0);
+ glTexCoord2f(0,0);
+ glVertex3f(-0.9, -0.9, 0.0);
+ glEnd();
+
+ glPopMatrix();
+
+ glFlush();
+
+ if (doubleBuffer) {
+ glutSwapBuffers();
+ }
+}
+
+static GLenum Args(int argc, char **argv)
+{
+ GLint i;
+
+ doubleBuffer = GL_FALSE;
+
+ for (i = 1; i < argc; i++) {
+ if (strcmp(argv[i], "-sb") == 0) {
+ doubleBuffer = GL_FALSE;
+ } else if (strcmp(argv[i], "-db") == 0) {
+ doubleBuffer = GL_TRUE;
+ } else {
+ fprintf(stderr, "%s (Bad option).\n", argv[i]);
+ return GL_FALSE;
+ }
+ }
+ return GL_TRUE;
+}
+
+int main(int argc, char **argv)
+{
+ GLenum type;
+
+ glutInit(&argc, argv);
+
+ if (Args(argc, argv) == GL_FALSE) {
+ exit(1);
+ }
+
+ glutInitWindowPosition(0, 0);
+ glutInitWindowSize(250, 250);
+
+ type = GLUT_RGB;
+ type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
+ glutInitDisplayMode(type);
+
+ win = glutCreateWindow("Tex test");
+ if (!win) {
+ exit(1);
+ }
+
+ Init();
+
+ glutReshapeFunc(Reshape);
+ glutKeyboardFunc(Key);
+ glutDisplayFunc(Draw);
+ glutMainLoop();
+ return 0;
+}
diff --git a/progs/tests/calibrate_rast.c b/progs/tests/calibrate_rast.c
new file mode 100644
index 00000000000..37d8ac85e54
--- /dev/null
+++ b/progs/tests/calibrate_rast.c
@@ -0,0 +1,395 @@
+/*
+ * Automatic primitive rasterization precision test.
+ *
+ * Draw prims at various sub-pixel offsets and examine where the quad is
+ * actually drawn.
+ * Check if the range of offsets which paint the right pixels falls within
+ * OpenGL's specification.
+ * In case of failures, report the coordinate bias needed to fix the problem.
+ *
+ * Note that even Mesa/swrast fails some line tests. This is because some
+ * window coordinates wind up as 53.9999 instead of 54, for example. Enabling
+ * the small translation factor below fixes that. Revisit someday...
+ *
+ * Brian Paul
+ * 28 Feb 2008
+ */
+
+
+#include <assert.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <GL/glut.h>
+
+
+static int Width = 100, Height = 100;
+static int Win;
+static float Step = 0.125;
+#if 0
+/* This tiny offset fixes errors in Mesa/Xlib */
+static float Xtrans = 0.5 * 0.125;
+static float Ytrans = 0.5 * 0.125;
+#else
+static float Xtrans = 0.0;
+static float Ytrans = 0.0;
+#endif
+
+
+static void
+PointCalibrate(int xpos, int ypos)
+{
+ GLfloat rgba[4];
+ float x, y;
+ float xmin, ymin, xmax, ymax;
+
+ xmin = ymin = 1000.0;
+ xmax = ymax = -1000.0;
+
+ for (y = -1.0; y <= 1.0; y += Step) {
+ for (x = -1.0; x <= 1.0; x += Step) {
+ glClear(GL_COLOR_BUFFER_BIT);
+ glBegin(GL_POINTS);
+ glVertex2f(xpos + x, ypos + y);
+ glEnd();
+ glReadPixels(xpos, ypos, 1, 1, GL_RGBA, GL_FLOAT, rgba);
+ if (rgba[0] == 1.0 && rgba[1] == 1.0 && rgba[2] == 1.0) {
+ /* hit */
+ if (x < xmin)
+ xmin = x;
+ if (y < ymin)
+ ymin = y;
+ if (x > xmax)
+ xmax = x;
+ if (y > ymax)
+ ymax = y;
+ }
+ }
+ }
+
+ printf("Point at (%2d, %2d) drawn for x in [%6.3f, %6.3f] and y in [%6.3f, %6.3f]\n",
+ xpos, ypos,
+ xpos + xmin, xpos + xmax,
+ ypos + ymin, ypos + ymax);
+
+ if (xmax - xmin != 1.0 - Step) {
+ printf(" => Inconsistant X-axis rasterization!\n");
+ }
+ if (ymax - ymin != 1.0 - Step) {
+ printf(" => Inconsistant Y-axis rasterization!\n");
+ }
+ if (xmin < 0.0) {
+ printf(" => Points should be X biased by about %f\n", xmin);
+ }
+ if (ymin < 0.0) {
+ printf(" => Points should be Y biased by about %f\n", ymin);
+ }
+ if (xmax > 1.0) {
+ printf(" => Points should be X biased by about %f\n", 1.0 - xmax);
+ }
+ if (ymax > 1.0) {
+ printf(" => Points should be Y biased by about %f\n", 1.0 - ymax);
+ }
+
+}
+
+
+/**
+ * XXX Implement VLineCalibrate() someday
+ */
+static void
+HLineCalibrate(int xpos, int ypos, int len)
+{
+ GLfloat rgba[2][4];
+ float x, y;
+ float ymin, ymax;
+ float xmin_left, xmax_left, xmin_right, xmax_right;
+
+ xmin_left = xmin_right = 1000.0;
+ xmax_left = xmax_right = -1000.0;
+ ymin = 1000;
+ ymax = -1000.0;
+
+ /*
+ * First, check vertical positioning of the horizontal line
+ */
+ for (y = -1.0; y <= 1.0; y += Step) {
+ glClear(GL_COLOR_BUFFER_BIT);
+ glBegin(GL_LINES);
+ glVertex2f(xpos, ypos + y);
+ glVertex2f(xpos + len, ypos + y);
+ glEnd();
+
+ glReadPixels(xpos + len / 2, ypos, 1, 1, GL_RGBA, GL_FLOAT, rgba);
+ if (rgba[0][0] == 1.0) {
+ /* hit */
+ if (y < ymin)
+ ymin = y;
+ if (y > ymax)
+ ymax = y;
+ }
+ }
+
+ printf("H-line at Y=%2d drawn for y in [%6.3f, %6.3f]\n",
+ ypos,
+ ypos + ymin, ypos + ymax);
+
+ if (ymax - ymin != 1.0 - Step) {
+ printf(" => Inconsistant Y-axis rasterization!\n");
+ }
+
+ if (ymin > 0.5 ) {
+ printf(" => Lines should be Y biased by about %f\n", ymin - 0.5);
+ }
+
+ if (ymax < 0.5 ) {
+ printf(" => Lines should be Y biased by about %f\n", 0.5 - ymax);
+ }
+
+ /*
+ * Second, check endpoints (for Y at 1/2 pixel)
+ */
+ for (x = -1.0; x <= 1.0; x += Step) {
+ glClear(GL_COLOR_BUFFER_BIT);
+ glBegin(GL_LINES);
+ glVertex2f(xpos + x, ypos + 0.5f);
+ glVertex2f(xpos + x + len, ypos + 0.5f);
+ glEnd();
+
+ /* left end */
+ glReadPixels(xpos - 1, ypos, 2, 1, GL_RGBA, GL_FLOAT, rgba);
+ if (rgba[0][0] == 0.0 && rgba[1][0] == 1.0) {
+ /* hit */
+ if (x < xmin_left)
+ xmin_left = x;
+ if (x > xmax_left)
+ xmax_left = x;
+ }
+
+ /* right end */
+ glReadPixels(xpos + len - 1, ypos, 2, 1, GL_RGBA, GL_FLOAT, rgba);
+ if (rgba[0][0] == 1.0 && rgba[1][0] == 0.0) {
+ /* hit */
+ if (x < xmin_right)
+ xmin_right = x;
+ if (x > xmax_right)
+ xmax_right = x;
+ }
+ }
+
+ printf("H-line [%d..%d) hit left end for x in [%6.3f, %6.3f] "
+ "hit right end for x in [%6.3f, %6.3f]\n",
+ xpos, xpos + len,
+ xpos + xmin_left, xpos + xmax_left,
+ xpos + len + xmin_right, xpos + len + xmax_right);
+
+ if (xmax_left - xmin_left > 1.0 - Step) {
+ printf(" => Inconsistant left-end rasterization!\n");
+ }
+ if (xmax_right - xmin_right > 1.0 - Step) {
+ printf(" => Inconsistant right-end rasterization!\n");
+ }
+
+ if (xmin_left != xmin_right ||
+ xmax_left != xmax_right) {
+ printf(" => Inconsistant length!\n");
+ }
+
+ if (xmin_left < 0.0) {
+ printf(" => Coords should be X biased by about %f\n", xmin_left );
+ }
+ if (xmin_right < 0.0) {
+ printf(" => Coords should be X biased by about %f\n", xmin_right );
+ }
+ if (xmax_left >= 1.0) {
+ printf(" => Coords should be X biased by about %f\n", -xmax_right + 1.0);
+ }
+ if (xmax_right >= 1.0) {
+ printf(" => Coords should be X biased by about %f\n", -xmax_right + 1.0);
+ }
+
+}
+
+
+static void
+QuadCalibrate(int xpos, int ypos, int width, int height)
+{
+ GLfloat rgba1[2][4];
+ GLfloat rgba2[2][4];
+ float x, y;
+ float xmin, ymin, xmax, ymax;
+
+ xmin = ymin = 1000.0;
+ xmax = ymax = -1000.0;
+
+ for (y = -1.0; y <= 1.0; y += Step) {
+ for (x = -1.0; x <= 1.0; x += Step) {
+ glClear(GL_COLOR_BUFFER_BIT);
+ glBegin(GL_QUADS);
+ glVertex2f(xpos + x, ypos + y);
+ glVertex2f(xpos + x + width, ypos + y);
+ glVertex2f(xpos + x + width, ypos + y + height);
+ glVertex2f(xpos + x, ypos + y + height);
+ glEnd();
+
+ /* horizontal measurement */
+ glReadPixels(xpos - 1, ypos + 2, 2, 1, GL_RGBA, GL_FLOAT, rgba1);
+ glReadPixels(xpos + width - 1, ypos + 2, 2, 1, GL_RGBA, GL_FLOAT, rgba2);
+ if (rgba1[0][0] == 0.0 && rgba1[1][0] == 1.0 &&
+ rgba2[0][0] == 1.0 && rgba2[1][0] == 0.0) {
+ if (x < xmin)
+ xmin = x;
+ if (x > xmax)
+ xmax = x;
+ }
+
+ /* vertical measurement */
+ glReadPixels(xpos + 2, ypos - 1, 1, 2, GL_RGBA, GL_FLOAT, rgba1);
+ glReadPixels(xpos + 2, ypos + height - 1, 1, 2, GL_RGBA, GL_FLOAT, rgba2);
+ if (rgba1[0][0] == 0.0 && rgba1[1][0] == 1.0 &&
+ rgba2[0][0] == 1.0 && rgba2[1][0] == 0.0) {
+ if (y < ymin)
+ ymin = y;
+ if (y > ymax)
+ ymax = y;
+ }
+ }
+ }
+
+ printf("Quad at (%2d, %2d)..(%2d, %2d) drawn"
+ " for x in [%6.3f, %6.3f] and y in [%6.3f, %6.3f]\n",
+ xpos, ypos,
+ xpos + width, ypos + height,
+ xpos + xmin, xpos + xmax,
+ ypos + ymin, ypos + ymax);
+
+ if (xmax - xmin != 1.0 - Step) {
+ printf(" => Inconsistant X-axis rasterization/size!\n");
+ }
+ if (ymax - ymin != 1.0 - Step) {
+ printf(" => Inconsistant Y-axis rasterization/size!\n");
+ }
+
+ if (xmin < -0.5) {
+ printf(" => Coords should be X biased by about %f\n", 0.5 + xmin );
+ }
+ if (ymin < -0.5) {
+ printf(" => Coords should be Y biased by about %f\n", 0.5 + ymin);
+ }
+ if (xmax > 0.5) {
+ printf(" => Coords should be X biased by about %f\n", -xmax + 0.5);
+ }
+ if (ymax > 0.5) {
+ printf(" => Coords should be Y biased by about %f\n", -ymax + 0.5);
+ }
+}
+
+
+/**
+ * Misc/disabled code for debugging.
+ */
+static void
+DebugTest(void)
+{
+ glClear(GL_COLOR_BUFFER_BIT);
+ glEnable(GL_BLEND);
+ glBlendFunc(GL_ONE, GL_ONE);
+
+ glColor3f(.5, .5, .5);
+
+ glBegin(GL_LINES);
+ glVertex2f(30, 35.5);
+ glVertex2f(54, 35.5);
+ glVertex2f(54, 35.5);
+ glVertex2f(66, 35.5);
+ glEnd();
+
+ glDisable(GL_BLEND);
+ glColor3f(1,1,1);
+}
+
+
+static void
+Draw(void)
+{
+ glClear(GL_COLOR_BUFFER_BIT);
+
+ glPushMatrix();
+ glTranslatef(Xtrans, Ytrans, 0);
+
+ PointCalibrate(1, 1);
+ PointCalibrate(50, 50);
+ PointCalibrate(28, 17);
+ PointCalibrate(17, 18);
+ printf("\n");
+
+ HLineCalibrate(5, 10, 10);
+ HLineCalibrate(25, 22, 12);
+ HLineCalibrate(54, 33, 12);
+ HLineCalibrate(54+12, 33, 12);
+ printf("\n");
+
+ QuadCalibrate(2, 2, 10, 10);
+ QuadCalibrate(50, 50, 10, 10);
+ QuadCalibrate(28, 17, 12, 12);
+ QuadCalibrate(17, 28, 12, 12);
+
+ (void) DebugTest;
+
+ glPopMatrix();
+
+ glutSwapBuffers();
+}
+
+
+static void
+Reshape(int width, int height)
+{
+ Width = width;
+ Height = height;
+ glViewport(0, 0, width, height);
+ glMatrixMode(GL_PROJECTION);
+ glLoadIdentity();
+ glOrtho(0, width, 0, height, -1, 1);
+ glMatrixMode(GL_MODELVIEW);
+ glLoadIdentity();
+}
+
+
+static void
+Key(unsigned char key, int x, int y)
+{
+ (void) x;
+ (void) y;
+ switch (key) {
+ case 27:
+ glutDestroyWindow(Win);
+ exit(0);
+ break;
+ }
+ glutPostRedisplay();
+}
+
+
+static void
+Init(void)
+{
+ printf("Measurement/callibration for basic prim rasterization...\n");
+ printf("GL_RENDERER: %s\n", (char*) glGetString(GL_RENDERER));
+}
+
+
+int
+main(int argc, char *argv[])
+{
+ glutInit(&argc, argv);
+ glutInitWindowPosition(0, 0);
+ glutInitWindowSize(Width, Height);
+ glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE);
+ Win = glutCreateWindow(argv[0]);
+ glutReshapeFunc(Reshape);
+ glutKeyboardFunc(Key);
+ glutDisplayFunc(Draw);
+ Init();
+ glutMainLoop();
+ return 0;
+}
diff --git a/progs/tests/copypixrate.c b/progs/tests/copypixrate.c
index e9a42a1c8c9..142315364c6 100644
--- a/progs/tests/copypixrate.c
+++ b/progs/tests/copypixrate.c
@@ -73,6 +73,32 @@ Rand(int max)
}
+static void
+BlitOne(void)
+{
+ int x, y;
+
+ do {
+ x = Rand(WinWidth);
+ y = Rand(WinHeight);
+ } while (x <= ImgWidth && y <= ImgHeight);
+
+#ifdef GL_EXT_framebuffer_blit
+ if (UseBlit)
+ {
+ glBlitFramebufferEXT_func(0, 0, ImgWidth, ImgHeight,
+ x, y, x + ImgWidth, y + ImgHeight,
+ GL_COLOR_BUFFER_BIT, GL_LINEAR);
+ }
+ else
+#endif
+ {
+ glWindowPos2iARB(x, y);
+ glCopyPixels(0, 0, ImgWidth, ImgHeight, GL_COLOR);
+ }
+}
+
+
/**
* Measure glCopyPixels rate
*/
@@ -96,30 +122,14 @@ RunTest(void)
bpp = (r + g + b + a) / 8;
do {
- int x, y;
- x = Rand(WinWidth);
- y = Rand(WinHeight);
+ BlitOne();
- if (x > ImgWidth || y > ImgHeight) {
-#ifdef GL_EXT_framebuffer_blit
- if (UseBlit)
- {
- glBlitFramebufferEXT_func(0, 0, ImgWidth, ImgHeight,
- x, y, x + ImgWidth, y + ImgHeight,
- GL_COLOR_BUFFER_BIT, GL_LINEAR);
- }
- else
-#endif
- {
- glWindowPos2iARB(x, y);
- glCopyPixels(0, 0, ImgWidth, ImgHeight, GL_COLOR);
- }
- glFinish(); /* XXX OK? */
+ if (Buffer == GL_FRONT)
+ glFinish(); /* XXX to view progress */
- iters++;
+ iters++;
- t1 = glutGet(GLUT_ELAPSED_TIME) / 1000.0;
- }
+ t1 = glutGet(GLUT_ELAPSED_TIME) / 1000.0;
} while (t1 - t0 < 5.0);
glDisable(GL_ALPHA_TEST);
@@ -151,8 +161,10 @@ Draw(void)
else
glutSwapBuffers();
+#if 1
printf("exiting\n");
exit(0);
+#endif
}
@@ -175,9 +187,12 @@ Key(unsigned char key, int x, int y)
(void) x;
(void) y;
switch (key) {
- case 27:
- exit(0);
- break;
+ case 'b':
+ BlitOne();
+ break;
+ case 27:
+ exit(0);
+ break;
}
glutPostRedisplay();
}
diff --git a/progs/tests/descrip.mms b/progs/tests/descrip.mms
deleted file mode 100644
index b6ba3e1aebb..00000000000
--- a/progs/tests/descrip.mms
+++ /dev/null
@@ -1,84 +0,0 @@
-# Makefile for GLUT-based demo programs for VMS
-# contributed by Jouk Jansen joukj@hrem.stm.tudelft.nl
-
-
-.first
- define gl [--.include.gl]
-
-.include [--]mms-config.
-
-##### MACROS #####
-
-INCDIR = ([--.include],[-.util])
-CFLAGS = /include=$(INCDIR)/prefix=all/name=(as_is,short)/float=ieee/ieee=denorm
-
-.ifdef SHARE
-GL_LIBS = $(XLIBS)
-.else
-GL_LIBS = [--.lib]libGLUT/l,libMesaGLU/l,libMesaGL/l,$(XLIBS)
-.endif
-
-LIB_DEP = [--.lib]$(GL_LIB) [--.lib]$(GLU_LIB) [--.lib]$(GLUT_LIB)
-
-PROGS = cva.exe,\
- dinoshade.exe,\
- fogcoord.exe,\
- manytex.exe,\
- multipal.exe,\
- projtex.exe,\
- seccolor.exe,\
- sharedtex.exe,\
- texline.exe,\
- texwrap.exe,\
- vptest1.exe,\
- vptest2.exe,\
- vptest3.exe,\
- vptorus.exe,\
- vpwarpmesh.exe
-
-##### RULES #####
-.obj.exe :
- cxxlink $(MMS$TARGET_NAME),$(GL_LIBS)
-
-##### TARGETS #####
-default :
- $(MMS)$(MMSQUALIFIERS) $(PROGS)
-
-clean :
- delete *.obj;*
-
-realclean :
- delete $(PROGS)
- delete *.obj;*
-
-cva.exe : cva.obj $(LIB_DEP)
-dinoshade.exe : dinoshade.obj $(LIB_DEP)
-fogcoord.exe : fogcoord.obj $(LIB_DEP)
-manytex.exe : manytex.obj $(LIB_DEP)
-multipal.exe : multipal.obj $(LIB_DEP)
-projtex.exe : projtex.obj $(LIB_DEP)
-seccolor.exe : seccolor.obj $(LIB_DEP)
-sharedtex.exe : sharedtex.obj $(LIB_DEP)
-texline.exe : texline.obj $(LIB_DEP)
-texwrap.exe : texwrap.obj $(LIB_DEP)
-vptest1.exe : vptest1.obj $(LIB_DEP)
-vptest2.exe : vptest2.obj $(LIB_DEP)
-vptest3.exe : vptest3.obj $(LIB_DEP)
-vptorus.exe : vptorus.obj $(LIB_DEP)
-vpwarpmesh.exe : vpwarpmesh.obj $(LIB_DEP)
-
-cva.obj : cva.c
-dinoshade.obj : dinoshade.c
-fogcoord.obj : fogcoord.c
-manytex.obj : manytex.c
-multipal.obj : multipal.c
-projtex.obj : projtex.c
-seccolor.obj : seccolor.c
-sharedtex.obj : sharedtex.c
-texline.obj : texline.c
-texwrap.obj : texwrap.c
-vptest1.obj : vptest1.c
-vptest2.obj : vptest2.c
-vptest3.obj : vptest3.c
-vptorus.obj : vptorus.c
-vpwarpmesh.obj : vpwarpmesh.c
diff --git a/progs/tests/fillrate.c b/progs/tests/fillrate.c
new file mode 100644
index 00000000000..8fe636c364b
--- /dev/null
+++ b/progs/tests/fillrate.c
@@ -0,0 +1,203 @@
+/**
+ * Measure fill rates for basic shading/texturing modes.
+ *
+ * Brian Paul
+ * 1 April 2008
+ */
+
+
+#define GL_GLEXT_PROTOTYPES
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <GL/glut.h>
+#include "readtex.h"
+
+#define TEXTURE_1_FILE "../images/tile.rgb"
+#define TEXTURE_2_FILE "../images/reflect.rgb"
+
+static int Win;
+static int Width = 1010, Height = 1010;
+static GLuint Textures[2];
+
+
+/**
+ * Draw quad 10 pixels shorter, narrower than window size.
+ */
+static void
+DrawQuad(void)
+{
+ glBegin(GL_POLYGON);
+
+ glColor3f(1.0, 0.5, 0.5);
+ glMultiTexCoord2f(GL_TEXTURE0, 0, 0);
+ glMultiTexCoord2f(GL_TEXTURE1, 0, 0);
+ glVertex2f(5, 5);
+
+ glColor3f(0.5, 1.0, 0.5);
+ glMultiTexCoord2f(GL_TEXTURE0, 1, 0);
+ glMultiTexCoord2f(GL_TEXTURE1, 1, 0);
+ glVertex2f(Width - 5, 5);
+
+ glColor3f(0.5, 0.5, 1.0);
+ glMultiTexCoord2f(GL_TEXTURE0, 1, 1);
+ glMultiTexCoord2f(GL_TEXTURE1, 1, 1);
+ glVertex2f(Width - 5, Height - 5);
+
+ glColor3f(1.0, 0.5, 1.0);
+ glMultiTexCoord2f(GL_TEXTURE0, 0, 1);
+ glMultiTexCoord2f(GL_TEXTURE1, 0, 1);
+ glVertex2f(5, Height - 5);
+
+ glEnd();
+}
+
+
+/**
+ * Compute rate for drawing large quad with given shading/texture state.
+ */
+static void
+RunTest(GLenum shading, GLuint numTextures, GLenum texFilter)
+{
+ const GLdouble minPeriod = 2.0;
+ GLdouble t0, t1;
+ GLdouble pixels, rate;
+ GLint i, iters;
+
+ glActiveTexture(GL_TEXTURE0);
+ if (numTextures > 0) {
+ glBindTexture(GL_TEXTURE_2D, Textures[0]);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, texFilter);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, texFilter);
+ glEnable(GL_TEXTURE_2D);
+ }
+ else {
+ glDisable(GL_TEXTURE_2D);
+ }
+
+ glActiveTexture(GL_TEXTURE1);
+ if (numTextures > 1) {
+ glBindTexture(GL_TEXTURE_2D, Textures[1]);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, texFilter);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, texFilter);
+ glEnable(GL_TEXTURE_2D);
+ }
+ else {
+ glDisable(GL_TEXTURE_2D);
+ }
+
+ glShadeModel(shading);
+
+
+ glFinish();
+
+ iters = 1;
+ do {
+ iters *= 4;
+ t0 = glutGet(GLUT_ELAPSED_TIME) * 0.001;
+ for (i = 0; i < iters; i++) {
+ DrawQuad();
+ }
+ glFinish();
+ t1 = glutGet(GLUT_ELAPSED_TIME) * 0.001;
+ } while (t1 - t0 < minPeriod);
+
+ glutSwapBuffers();
+
+ pixels = (double) iters * (Width - 10) * (Height - 10);
+ rate = pixels / (t1 - t0);
+ rate /= 1000000.0; /* megapixels/second */
+
+ printf("%s ", shading == GL_FLAT ? "GL_FLAT" : "GL_SMOOTH");
+ printf("Textures=%u ", numTextures);
+ printf("Filter=%s: ", texFilter == GL_LINEAR ? "GL_LINEAR" : "GL_NEAREST");
+ printf("%g MPixels/sec\n", rate);
+}
+
+
+static void
+Draw(void)
+{
+ glClear(GL_COLOR_BUFFER_BIT);
+
+ RunTest(GL_FLAT, 0, GL_NEAREST);
+ RunTest(GL_SMOOTH, 0, GL_NEAREST);
+ RunTest(GL_SMOOTH, 1, GL_NEAREST);
+ RunTest(GL_SMOOTH, 1, GL_LINEAR);
+ RunTest(GL_SMOOTH, 2, GL_NEAREST);
+ RunTest(GL_SMOOTH, 2, GL_LINEAR);
+
+ glutSwapBuffers();
+}
+
+
+static void
+Reshape(int width, int height)
+{
+ glViewport(0, 0, width, height);
+ glMatrixMode(GL_PROJECTION);
+ glLoadIdentity();
+ glOrtho(0, width, 0, height, -1, 1);
+ glMatrixMode(GL_MODELVIEW);
+ glLoadIdentity();
+ Width = width;
+ Height = height;
+}
+
+
+static void
+Key(unsigned char key, int x, int y)
+{
+ (void) x;
+ (void) y;
+ switch (key) {
+ case 27:
+ glutDestroyWindow(Win);
+ exit(0);
+ break;
+ }
+ glutPostRedisplay();
+}
+
+
+static void
+Init(void)
+{
+ printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
+
+ glGenTextures(2, Textures);
+
+ glBindTexture(GL_TEXTURE_2D, Textures[0]);
+ glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
+
+ if (!LoadRGBMipmaps(TEXTURE_1_FILE, GL_RGB)) {
+ printf("Error: couldn't load texture image\n");
+ exit(1);
+ }
+
+ glBindTexture(GL_TEXTURE_2D, Textures[1]);
+ glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
+
+ if (!LoadRGBMipmaps(TEXTURE_2_FILE, GL_RGB)) {
+ printf("Error: couldn't load texture image\n");
+ exit(1);
+ }
+
+}
+
+
+int
+main(int argc, char *argv[])
+{
+ glutInit(&argc, argv);
+ glutInitWindowPosition(0, 0);
+ glutInitWindowSize(Width, Height);
+ glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE);
+ Win = glutCreateWindow(argv[0]);
+ glutReshapeFunc(Reshape);
+ glutKeyboardFunc(Key);
+ glutDisplayFunc(Draw);
+ Init();
+ glutMainLoop();
+ return 0;
+}
diff --git a/progs/tests/manytex.c b/progs/tests/manytex.c
index 74b06649f6e..83c86766571 100644
--- a/progs/tests/manytex.c
+++ b/progs/tests/manytex.c
@@ -29,6 +29,7 @@ static GLboolean LinearFilter = GL_FALSE;
static GLboolean RandomSize = GL_FALSE;
static GLint Rows, Columns;
static GLint LowPriorityCount = 0;
+static GLint Win;
static void Idle( void )
@@ -127,6 +128,14 @@ static int RandomInt(int min, int max)
}
+static void DeleteTextures(void)
+{
+ glDeleteTextures(NumTextures, TextureID);
+ free(TextureID);
+ TextureID = NULL;
+}
+
+
static void Init( void )
{
@@ -305,9 +314,12 @@ static void Key( unsigned char key, int x, int y )
Zrot += step;
break;
case ' ':
+ DeleteTextures();
Init();
break;
case 27:
+ DeleteTextures();
+ glutDestroyWindow(Win);
exit(0);
break;
}
@@ -323,7 +335,7 @@ int main( int argc, char *argv[] )
glutInitWindowPosition( 0, 0 );
glutInitWindowSize( WinWidth, WinHeight );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
- glutCreateWindow(argv[0]);
+ Win = glutCreateWindow(argv[0]);
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );
diff --git a/progs/tests/mipmap_view.c b/progs/tests/mipmap_view.c
new file mode 100644
index 00000000000..54607b89398
--- /dev/null
+++ b/progs/tests/mipmap_view.c
@@ -0,0 +1,251 @@
+/*
+ * Test mipmap generation and lod bias.
+ *
+ * Brian Paul
+ * 17 March 2008
+ */
+
+
+#include <assert.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <math.h>
+#include <GL/glut.h>
+#include <GL/glext.h>
+
+#include "readtex.h"
+
+#define TEXTURE_FILE "../images/arch.rgb"
+
+static int TexWidth = 256, TexHeight = 256;
+static int WinWidth = 1044, WinHeight = 900;
+static GLfloat Bias = 0.0;
+static GLboolean ScaleQuads = GL_FALSE;
+static GLint Win = 0;
+
+
+
+static void
+PrintString(const char *s)
+{
+ while (*s) {
+ glutBitmapCharacter(GLUT_BITMAP_8_BY_13, (int) *s);
+ s++;
+ }
+}
+
+
+static void
+Display(void)
+{
+ int x, y, bias;
+ char str[100];
+ int texWidth = TexWidth, texHeight = TexHeight;
+
+ glClear(GL_COLOR_BUFFER_BIT);
+
+ glMatrixMode(GL_PROJECTION);
+ glLoadIdentity();
+ glOrtho(0, WinWidth, 0, WinHeight, -1, 1);
+ glMatrixMode(GL_MODELVIEW);
+ glLoadIdentity();
+
+ glColor3f(1,1,1);
+
+ y = WinHeight - 300;
+ x = 4;
+
+ for (bias = -1; bias < 11; bias++) {
+
+ if (ScaleQuads) {
+ if (bias > 0) {
+ if (texWidth == 1 && texHeight == 1)
+ break;
+ texWidth = TexWidth >> bias;
+ texHeight = TexHeight >> bias;
+ if (texWidth < 1)
+ texWidth = 1;
+ if (texHeight < 1)
+ texHeight = 1;
+ }
+ glTexEnvf(GL_TEXTURE_FILTER_CONTROL_EXT, GL_TEXTURE_LOD_BIAS_EXT, 0.0);
+ }
+ else {
+ glTexEnvf(GL_TEXTURE_FILTER_CONTROL_EXT, GL_TEXTURE_LOD_BIAS_EXT, bias);
+ }
+
+ glRasterPos2f(x, y + TexHeight + 5);
+ if (ScaleQuads)
+ sprintf(str, "Texture Level %d: %d x %d",
+ (bias < 0 ? 0 : bias),
+ texWidth, texHeight);
+ else
+ sprintf(str, "Texture LOD Bias = %d", bias);
+ PrintString(str);
+
+ glPushMatrix();
+ glTranslatef(x, y, 0);
+
+ glEnable(GL_TEXTURE_2D);
+
+ glBegin(GL_POLYGON);
+ glTexCoord2f(0, 0); glVertex2f(0, 0);
+ glTexCoord2f(1, 0); glVertex2f(texWidth, 0);
+ glTexCoord2f(1, 1); glVertex2f(texWidth, texHeight);
+ glTexCoord2f(0, 1); glVertex2f(0, texHeight);
+ glEnd();
+
+ glPopMatrix();
+
+ glDisable(GL_TEXTURE_2D);
+
+ x += TexWidth + 4;
+ if (x >= WinWidth) {
+ x = 4;
+ y -= 300;
+ }
+ }
+
+ glutSwapBuffers();
+}
+
+
+static void
+Reshape(int width, int height)
+{
+ WinWidth = width;
+ WinHeight = height;
+ glViewport(0, 0, width, height);
+}
+
+
+static void
+Key(unsigned char key, int x, int y)
+{
+ (void) x;
+ (void) y;
+ switch (key) {
+ case 'b':
+ Bias -= 10;
+ break;
+ case 'B':
+ Bias += 10;
+ break;
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ Bias = 100.0 * (key - '0');
+ break;
+ case 's':
+ ScaleQuads = !ScaleQuads;
+ break;
+ case 27:
+ glutDestroyWindow(Win);
+ exit(0);
+ break;
+ }
+ glutPostRedisplay();
+}
+
+
+static void
+Init(void)
+{
+ GLfloat maxBias;
+
+ if (!glutExtensionSupported("GL_EXT_texture_lod_bias")) {
+ printf("Sorry, GL_EXT_texture_lod_bias not supported by this renderer.\n");
+ exit(1);
+ }
+
+ if (!glutExtensionSupported("GL_SGIS_generate_mipmap")) {
+ printf("Sorry, GL_SGIS_generate_mipmap not supported by this renderer.\n");
+ exit(1);
+ }
+
+ glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
+
+ if (1) {
+ /* test auto mipmap generation */
+ GLint width, height, i;
+ GLenum format;
+ GLubyte *image = LoadRGBImage(TEXTURE_FILE, &width, &height, &format);
+ if (!image) {
+ printf("Error: could not load texture image %s\n", TEXTURE_FILE);
+ exit(1);
+ }
+ /* resize to TexWidth x TexHeight */
+ if (width != TexWidth || height != TexHeight) {
+ GLubyte *newImage = malloc(TexWidth * TexHeight * 4);
+ gluScaleImage(format, width, height, GL_UNSIGNED_BYTE, image,
+ TexWidth, TexHeight, GL_UNSIGNED_BYTE, newImage);
+ free(image);
+ image = newImage;
+ }
+ printf("Using GL_SGIS_generate_mipmap\n");
+ glTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP_SGIS, GL_TRUE);
+ glTexImage2D(GL_TEXTURE_2D, 0, format, TexWidth, TexHeight, 0,
+ format, GL_UNSIGNED_BYTE, image);
+ free(image);
+
+ /* make sure mipmap was really generated correctly */
+ width = TexWidth;
+ height = TexHeight;
+ for (i = 0; i < 9; i++) {
+ GLint w, h;
+ glGetTexLevelParameteriv(GL_TEXTURE_2D, i, GL_TEXTURE_WIDTH, &w);
+ glGetTexLevelParameteriv(GL_TEXTURE_2D, i, GL_TEXTURE_HEIGHT, &h);
+ printf("Level %d size: %d x %d\n", i, w, h);
+ assert(w == width);
+ assert(h == height);
+ width /= 2;
+ height /= 2;
+ }
+ }
+ else {
+ if (LoadRGBMipmaps(TEXTURE_FILE, GL_RGB)) {
+ printf("Using gluBuildMipmaps()\n");
+ }
+ else {
+ printf("Error: could not load texture image %s\n", TEXTURE_FILE);
+ exit(1);
+ }
+ }
+
+
+ /* mipmapping required for this extension */
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
+ glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
+
+ glGetFloatv(GL_MAX_TEXTURE_LOD_BIAS_EXT, &maxBias);
+
+ printf("GL_RENDERER: %s\n", (char*) glGetString(GL_RENDERER));
+ printf("LOD bias range: [%g, %g]\n", -maxBias, maxBias);
+
+ printf("Press 's' to toggle quad scaling\n");
+}
+
+
+int
+main(int argc, char *argv[])
+{
+ glutInit(&argc, argv);
+ glutInitWindowPosition(0, 0);
+ glutInitWindowSize(WinWidth, WinHeight);
+ glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE);
+ Win = glutCreateWindow(argv[0]);
+ glutReshapeFunc(Reshape);
+ glutKeyboardFunc(Key);
+ glutDisplayFunc(Display);
+ Init();
+ glutMainLoop();
+ return 0;
+}
diff --git a/progs/tests/quads.c b/progs/tests/quads.c
new file mode 100644
index 00000000000..1bf57e6337d
--- /dev/null
+++ b/progs/tests/quads.c
@@ -0,0 +1,258 @@
+/**
+ * Draw colored quads.
+ */
+
+
+#define GL_GLEXT_PROTOTYPES
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <GL/glut.h>
+
+#define NUM_QUADS 20
+
+
+static int Win;
+static GLfloat Xrot = 40, Yrot = 0, Zrot = 0;
+static GLboolean Anim = GL_TRUE;
+static GLuint Vbuffer = 0;
+
+static GLfloat buf[NUM_QUADS * 6 * 4];
+
+static GLboolean SwapBuffers = GL_TRUE;
+
+static GLint Frames = 0, T0 = 0;
+
+
+static void
+Idle(void)
+{
+ Xrot += 3.0;
+ Yrot += 4.0;
+ Zrot += 2.0;
+ glutPostRedisplay();
+}
+
+
+static void
+Draw(void)
+{
+ glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+
+ glPushMatrix();
+ glRotatef(Xrot, 1, 0, 0);
+ glRotatef(Yrot, 0, 1, 0);
+ glRotatef(Zrot, 0, 0, 1);
+
+ glDrawArrays(GL_QUADS, 0, NUM_QUADS*4);
+
+ glPopMatrix();
+
+ if (SwapBuffers)
+ glutSwapBuffers();
+ /*
+ else
+ glFinish();
+ */
+
+ {
+ GLint t = glutGet(GLUT_ELAPSED_TIME);
+ Frames++;
+ if (t - T0 >= 5000) {
+ GLfloat seconds = (t - T0) / 1000.0;
+ GLfloat fps = Frames / seconds;
+ printf("%d frames in %6.3f seconds = %6.3f FPS\n",
+ Frames, seconds, fps);
+ T0 = t;
+ Frames = 0;
+ }
+ }
+}
+
+
+static void
+Reshape(int width, int height)
+{
+ glViewport(0, 0, width, height);
+ glMatrixMode(GL_PROJECTION);
+ glLoadIdentity();
+ glFrustum(-1.0, 1.0, -1.0, 1.0, 5.0, 25.0);
+ glMatrixMode(GL_MODELVIEW);
+ glLoadIdentity();
+ glTranslatef(0.0, 0.0, -8.0);
+}
+
+
+static void
+Key(unsigned char key, int x, int y)
+{
+ const GLfloat step = 3.0;
+ (void) x;
+ (void) y;
+ switch (key) {
+ case 's':
+ SwapBuffers = !SwapBuffers;
+ break;
+ case 'a':
+ Anim = !Anim;
+ if (Anim)
+ glutIdleFunc(Idle);
+ else
+ glutIdleFunc(NULL);
+ break;
+ case 'z':
+ Zrot -= step;
+ break;
+ case 'Z':
+ Zrot += step;
+ break;
+ case 27:
+ glutDestroyWindow(Win);
+ exit(0);
+ break;
+ }
+ glutPostRedisplay();
+}
+
+
+static void
+SpecialKey(int key, int x, int y)
+{
+ const GLfloat step = 3.0;
+ (void) x;
+ (void) y;
+ switch (key) {
+ case GLUT_KEY_UP:
+ Xrot -= step;
+ break;
+ case GLUT_KEY_DOWN:
+ Xrot += step;
+ break;
+ case GLUT_KEY_LEFT:
+ Yrot -= step;
+ break;
+ case GLUT_KEY_RIGHT:
+ Yrot += step;
+ break;
+ }
+ glutPostRedisplay();
+}
+
+
+static void
+quad(float x, float y, float z, float *v)
+{
+ int k = 0;
+
+ /* color */
+ v[k++] = x * 0.5 + 0.5;
+ v[k++] = y * 0.5 + 0.5;
+ v[k++] = z * 0.5 + 0.5;
+ /* vert */
+ v[k++] = x;
+ v[k++] = y;
+ v[k++] = z;
+
+ /* color */
+ v[k++] = -x * 0.5 + 0.5;
+ v[k++] = -y * 0.5 + 0.5;
+ v[k++] = z * 0.5 + 0.5;
+ /* vert */
+ v[k++] = -x;
+ v[k++] = -y;
+ v[k++] = z;
+
+ /* color */
+ v[k++] = -x * 0.5 + 0.5;
+ v[k++] = -y * 0.5 + 0.5;
+ v[k++] = -z * 0.5 + 0.5;
+ /* vert */
+ v[k++] = -x;
+ v[k++] = -y;
+ v[k++] = -z;
+
+ /* color */
+ v[k++] = x * 0.5 + 0.5;
+ v[k++] = y * 0.5 + 0.5;
+ v[k++] = -z * 0.5 + 0.5;
+ /* vert */
+ v[k++] = x;
+ v[k++] = y;
+ v[k++] = -z;
+}
+
+static void
+gen_quads(GLfloat *buf)
+{
+ float *v = buf;
+ float r = 1.0;
+ int i;
+
+ for (i = 0; i < NUM_QUADS; i++) {
+ float angle = i / (float) NUM_QUADS * M_PI;
+ float x = r * cos(angle);
+ float y = r * sin(angle);
+ float z = 1.10;
+ quad(x, y, z, v);
+ v += 24;
+ }
+
+ if (0) {
+ float *p = buf;
+ for (i = 0; i < NUM_QUADS * 4 * 2; i++) {
+ printf("%d: %f %f %f\n", i, p[0], p[1], p[2]);
+ p += 3;
+ }
+ }
+}
+
+
+static void
+Init(void)
+{
+ int bytes = NUM_QUADS * 4 * 2 * 3 * sizeof(float);
+ GLfloat *f;
+
+#if 1
+ glGenBuffers(1, &Vbuffer);
+ glBindBuffer(GL_ARRAY_BUFFER, Vbuffer);
+ glBufferData(GL_ARRAY_BUFFER_ARB, bytes, NULL, GL_STATIC_DRAW_ARB);
+ f = (float *) glMapBuffer(GL_ARRAY_BUFFER_ARB, GL_WRITE_ONLY_ARB);
+ gen_quads(f);
+ glUnmapBuffer(GL_ARRAY_BUFFER_ARB);
+ glColorPointer(3, GL_FLOAT, 6*sizeof(float), (void *) 0);
+ glVertexPointer(3, GL_FLOAT, 6*sizeof(float), (void *) 12);
+#else
+ f = buf;
+ gen_quads(f);
+ glColorPointer(3, GL_FLOAT, 6*sizeof(float), buf);
+ glVertexPointer(3, GL_FLOAT, 6*sizeof(float), buf + 3);
+#endif
+
+ glEnableClientState(GL_COLOR_ARRAY);
+ glEnableClientState(GL_VERTEX_ARRAY);
+
+ glEnable(GL_DEPTH_TEST);
+
+ glClearColor(0.5, 0.5, 0.5, 0.0);
+}
+
+
+int
+main(int argc, char *argv[])
+{
+ glutInit(&argc, argv);
+ glutInitWindowPosition(0, 0);
+ glutInitWindowSize(600, 600);
+ glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
+ Win = glutCreateWindow(argv[0]);
+ glutReshapeFunc(Reshape);
+ glutKeyboardFunc(Key);
+ glutSpecialFunc(SpecialKey);
+ glutDisplayFunc(Draw);
+ if (Anim)
+ glutIdleFunc(Idle);
+ Init();
+ glutMainLoop();
+ return 0;
+}
diff --git a/progs/tests/stencil_twoside.c b/progs/tests/stencil_twoside.c
index be9d9a776ad..8826c46fc26 100644
--- a/progs/tests/stencil_twoside.c
+++ b/progs/tests/stencil_twoside.c
@@ -115,7 +115,6 @@ static void Display( void )
glVertex2f(-1, 1);
glEnd();
-
if (use20syntax) {
stencil_func_separate(GL_FRONT, GL_ALWAYS, 0, ~0);
stencil_func_separate(GL_BACK, GL_ALWAYS, 0, ~0);
@@ -279,7 +278,6 @@ static void Init( void )
stencil_op_separate = glutGetProcAddress( "glStencilOpSeparate" );
printf("\nAll 5 squares should be the same color.\n");
- glEnable( GL_BLEND );
}
diff --git a/progs/tests/subtex.c b/progs/tests/subtex.c
new file mode 100644
index 00000000000..81ceb085aaf
--- /dev/null
+++ b/progs/tests/subtex.c
@@ -0,0 +1,223 @@
+/*
+ * Test glTexSubImage mid-way through a frame.
+ *
+ * The same texture is used for both quads but it gets redefined
+ * with glTexSubImage (or glTexImage) after the first quad.
+ */
+
+
+#include <assert.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include "GL/glut.h"
+
+static GLuint Window = 0;
+static GLboolean Anim = GL_FALSE;
+static GLfloat Angle = 0.0f;
+
+
+
+static void
+first_texture(void)
+{
+ static int width=8, height=8;
+ static GLubyte tex1[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 1, 0, 0, 0,
+ 0, 0, 0, 1, 1, 0, 0, 0,
+ 0, 0, 0, 0, 1, 0, 0, 0,
+ 0, 0, 0, 0, 1, 0, 0, 0,
+ 0, 0, 0, 0, 1, 0, 0, 0,
+ 0, 0, 0, 1, 1, 1, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0 };
+
+ GLubyte tex[64][3];
+ GLint i, j;
+
+ /* red on white */
+ for (i=0;i<height;i++) {
+ for (j=0;j<width;j++) {
+ int p = i*width+j;
+ if (tex1[(height-i-1)*width+j]) {
+ tex[p][0] = 255; tex[p][1] = 0; tex[p][2] = 0;
+ }
+ else {
+ tex[p][0] = 255; tex[p][1] = 255; tex[p][2] = 255;
+ }
+ }
+ }
+
+ glTexImage2D( GL_TEXTURE_2D, 0, 3, width, height, 0,
+ GL_RGB, GL_UNSIGNED_BYTE, tex );
+}
+
+
+static void
+second_texture(void)
+{
+ static int width=8, height=8;
+
+ static GLubyte tex2[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 2, 2, 0, 0, 0,
+ 0, 0, 2, 0, 0, 2, 0, 0,
+ 0, 0, 0, 0, 0, 2, 0, 0,
+ 0, 0, 0, 0, 2, 0, 0, 0,
+ 0, 0, 0, 2, 0, 0, 0, 0,
+ 0, 0, 2, 2, 2, 2, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0 };
+
+ GLubyte tex[64][3];
+ GLint i, j;
+
+ /* green on blue */
+ for (i=0;i<height;i++) {
+ for (j=0;j<width;j++) {
+ int p = i*width+j;
+ if (tex2[(height-i-1)*width+j]) {
+ tex[p][0] = 0; tex[p][1] = 255; tex[p][2] = 0;
+ }
+ else {
+ tex[p][0] = 0; tex[p][1] = 0; tex[p][2] = 255;
+ }
+ }
+ }
+#if 0
+ glTexImage2D( GL_TEXTURE_2D, 0, 3, width, height, 0,
+ GL_RGB, GL_UNSIGNED_BYTE, tex );
+#else
+ glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, width, height,
+ GL_RGB, GL_UNSIGNED_BYTE, tex );
+#endif
+}
+
+
+
+static void draw( void )
+{
+ glClear( GL_COLOR_BUFFER_BIT );
+
+ glColor3f( 1.0, 1.0, 1.0 );
+
+ /* draw first polygon */
+ glPushMatrix();
+ glTranslatef( -1.0, 0.0, 0.0 );
+ glRotatef( Angle, 0.0, 0.0, 1.0 );
+
+ first_texture();
+
+ glBegin( GL_POLYGON );
+ glTexCoord2f( 0.0, 0.0 ); glVertex2f( -1.0, -1.0 );
+ glTexCoord2f( 1.0, 0.0 ); glVertex2f( 1.0, -1.0 );
+ glTexCoord2f( 1.0, 1.0 ); glVertex2f( 1.0, 1.0 );
+ glTexCoord2f( 0.0, 1.0 ); glVertex2f( -1.0, 1.0 );
+ glEnd();
+ glPopMatrix();
+
+ /* draw second polygon */
+ glPushMatrix();
+ glTranslatef( 1.0, 0.0, 0.0 );
+ glRotatef( Angle-90.0, 0.0, 1.0, 0.0 );
+
+ second_texture();
+
+ glBegin( GL_POLYGON );
+ glTexCoord2f( 0.0, 0.0 ); glVertex2f( -1.0, -1.0 );
+ glTexCoord2f( 1.0, 0.0 ); glVertex2f( 1.0, -1.0 );
+ glTexCoord2f( 1.0, 1.0 ); glVertex2f( 1.0, 1.0 );
+ glTexCoord2f( 0.0, 1.0 ); glVertex2f( -1.0, 1.0 );
+ glEnd();
+ glPopMatrix();
+
+ glutSwapBuffers();
+}
+
+
+
+static void idle( void )
+{
+ static double t0 = -1.;
+ double dt, t = glutGet(GLUT_ELAPSED_TIME) / 1000.0;
+ if (t0 < 0.0)
+ t0 = t;
+ dt = t - t0;
+ t0 = t;
+ Angle += 120.0*dt;
+ glutPostRedisplay();
+}
+
+
+
+/* change view Angle, exit upon ESC */
+static void key(unsigned char k, int x, int y)
+{
+ (void) x;
+ (void) y;
+ switch (k) {
+ case 'a':
+ Anim = !Anim;
+ if (Anim)
+ glutIdleFunc( idle );
+ else
+ glutIdleFunc( NULL );
+ break;
+ case 27:
+ glutDestroyWindow(Window);
+ exit(0);
+ }
+}
+
+
+
+/* new window size or exposure */
+static void reshape( int width, int height )
+{
+ glViewport(0, 0, (GLint)width, (GLint)height);
+ glMatrixMode(GL_PROJECTION);
+ glLoadIdentity();
+ /* glOrtho( -3.0, 3.0, -3.0, 3.0, -10.0, 10.0 );*/
+ glFrustum( -2.0, 2.0, -2.0, 2.0, 6.0, 20.0 );
+ glMatrixMode(GL_MODELVIEW);
+ glLoadIdentity();
+ glTranslatef( 0.0, 0.0, -8.0 );
+}
+
+
+static void init( void )
+{
+ /* Setup texturing */
+ glEnable( GL_TEXTURE_2D );
+ glTexEnvi( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_DECAL );
+
+
+ glBindTexture( GL_TEXTURE_2D, 0 );
+ glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST );
+ glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST );
+ glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT );
+ glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT );
+}
+
+
+
+int main( int argc, char *argv[] )
+{
+ glutInit(&argc, argv);
+ glutInitWindowPosition(0, 0);
+ glutInitWindowSize(300, 300);
+ glutInitDisplayMode( GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE );
+
+ Window = glutCreateWindow("Texture Objects");
+ if (!Window) {
+ exit(1);
+ }
+
+ init();
+
+ glutReshapeFunc( reshape );
+ glutKeyboardFunc( key );
+ if (Anim)
+ glutIdleFunc( idle );
+ glutDisplayFunc( draw );
+ glutMainLoop();
+ return 0;
+}
diff --git a/progs/tests/zcomp.c b/progs/tests/zcomp.c
new file mode 100644
index 00000000000..b53079d07fc
--- /dev/null
+++ b/progs/tests/zcomp.c
@@ -0,0 +1,223 @@
+/**
+ * Test Z compositing with glDrawPixels(GL_DEPTH_COMPONENT) and stencil test.
+ */
+
+#define GL_GLEXT_PROTOTYPES
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <GL/glut.h>
+#include "../util/showbuffer.c"
+
+
+static int Win;
+static GLfloat Xrot = 0, Yrot = 0, Zpos = 6;
+static GLboolean Anim = GL_FALSE;
+
+static int Width = 400, Height = 200;
+static GLfloat *Zimg;
+static GLubyte *Cimg;
+static GLboolean showZ = 0;
+
+
+static void
+Idle(void)
+{
+ Xrot += 3.0;
+ Yrot += 4.0;
+ glutPostRedisplay();
+}
+
+
+/**
+ * Draw first object, save color+Z images
+ */
+static void
+DrawFirst(void)
+{
+ static const GLfloat red[4] = { 1.0, 0.0, 0.0, 0.0 };
+
+ glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE, red);
+
+ glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+
+ glPushMatrix();
+ glTranslatef(-1, 0, 0);
+ glRotatef(45 + Xrot, 1, 0, 0);
+
+ glutSolidTorus(0.75, 2.0, 10, 20);
+
+ glPopMatrix();
+
+ glReadPixels(0, 0, Width, Height, GL_DEPTH_COMPONENT, GL_FLOAT, Zimg);
+ glReadPixels(0, 0, Width, Height, GL_RGBA, GL_UNSIGNED_BYTE, Cimg);
+}
+
+
+/**
+ * Draw second object.
+ */
+static void
+DrawSecond(void)
+{
+ static const GLfloat blue[4] = { 0.0, 0.0, 1.0, 0.0 };
+
+ glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE, blue);
+
+ glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
+
+ glPushMatrix();
+ glTranslatef(+1, 0, 0);
+ glRotatef(-45 + Xrot, 1, 0, 0);
+
+ glutSolidTorus(0.75, 2.0, 10, 20);
+
+ glPopMatrix();
+}
+
+
+/**
+ * Composite first/saved image over second rendering.
+ */
+static void
+Composite(void)
+{
+ glWindowPos2i(0, 0);
+
+ /* Draw Z values, set stencil where Z test passes */
+ glEnable(GL_STENCIL_TEST);
+ glStencilFunc(GL_ALWAYS, 1, ~0);
+ glStencilOp(GL_KEEP, GL_KEEP, GL_REPLACE);
+ glColorMask(0,0,0,0);
+ glDrawPixels(Width, Height, GL_DEPTH_COMPONENT, GL_FLOAT, Zimg);
+ glColorMask(1,1,1,1);
+
+ /* Draw color where stencil==1 */
+ glStencilFunc(GL_EQUAL, 1, ~0);
+ glStencilOp(GL_KEEP, GL_KEEP, GL_KEEP);
+ glDisable(GL_DEPTH_TEST);
+ glDrawPixels(Width, Height, GL_RGBA, GL_UNSIGNED_BYTE, Cimg);
+ glEnable(GL_DEPTH_TEST);
+
+ glDisable(GL_STENCIL_TEST);
+}
+
+
+static void
+Draw(void)
+{
+ DrawFirst();
+ DrawSecond();
+ Composite();
+ glutSwapBuffers();
+}
+
+
+static void
+Reshape(int width, int height)
+{
+ GLfloat ar = (float) width / height;
+ glViewport(0, 0, width, height);
+ glMatrixMode(GL_PROJECTION);
+ glLoadIdentity();
+ glFrustum(-ar, ar, -1.0, 1.0, 5.0, 30.0);
+ glMatrixMode(GL_MODELVIEW);
+ glLoadIdentity();
+ glTranslatef(0.0, 0.0, -15.0);
+
+ Width = width;
+ Height = height;
+
+ if (Zimg)
+ free(Zimg);
+ if (Cimg)
+ free(Cimg);
+ Zimg = (float *) malloc(width * height * 4);
+ Cimg = (GLubyte *) malloc(width * height * 4);
+}
+
+
+static void
+Key(unsigned char key, int x, int y)
+{
+ const GLfloat step = 1.0;
+ (void) x;
+ (void) y;
+ switch (key) {
+ case 'a':
+ Anim = !Anim;
+ if (Anim)
+ glutIdleFunc(Idle);
+ else
+ glutIdleFunc(NULL);
+ break;
+ case 'd':
+ showZ = !showZ;
+ break;
+ case 'z':
+ Zpos -= step;
+ break;
+ case 'Z':
+ Zpos += step;
+ break;
+ case 27:
+ glutDestroyWindow(Win);
+ exit(0);
+ break;
+ }
+ glutPostRedisplay();
+}
+
+
+static void
+SpecialKey(int key, int x, int y)
+{
+ const GLfloat step = 3.0;
+ (void) x;
+ (void) y;
+ switch (key) {
+ case GLUT_KEY_UP:
+ Xrot -= step;
+ break;
+ case GLUT_KEY_DOWN:
+ Xrot += step;
+ break;
+ case GLUT_KEY_LEFT:
+ Yrot -= step;
+ break;
+ case GLUT_KEY_RIGHT:
+ Yrot += step;
+ break;
+ }
+ glutPostRedisplay();
+}
+
+
+static void
+Init(void)
+{
+ /* setup lighting, etc */
+ glEnable(GL_DEPTH_TEST);
+ glEnable(GL_LIGHTING);
+ glEnable(GL_LIGHT0);
+}
+
+
+int
+main(int argc, char *argv[])
+{
+ glutInit(&argc, argv);
+ glutInitWindowPosition(0, 0);
+ glutInitWindowSize(Width, Height);
+ glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH | GLUT_STENCIL);
+ Win = glutCreateWindow(argv[0]);
+ glutReshapeFunc(Reshape);
+ glutKeyboardFunc(Key);
+ glutSpecialFunc(SpecialKey);
+ glutDisplayFunc(Draw);
+ if (Anim)
+ glutIdleFunc(Idle);
+ Init();
+ glutMainLoop();
+ return 0;
+}
diff --git a/progs/tests/zdrawpix.c b/progs/tests/zdrawpix.c
new file mode 100644
index 00000000000..dd222e7dd0b
--- /dev/null
+++ b/progs/tests/zdrawpix.c
@@ -0,0 +1,192 @@
+/**
+ * Test glDrawPixels(GL_DEPTH_COMPONENT)
+ *
+ * We load a window-sized buffer of Z values so that Z=1 at the top and
+ * Z=0 at the bottom (and interpolate between).
+ * We draw that image into the Z buffer, then draw an ordinary cube.
+ * The bottom part of the cube should be "clipped" where the cube fails
+ * the Z test.
+ *
+ * Press 'd' to view the Z buffer as a grayscale image.
+ */
+
+#define GL_GLEXT_PROTOTYPES
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <GL/glut.h>
+#include "../util/showbuffer.c"
+
+
+static int Win;
+static GLfloat Xrot = 50, Yrot = 40, Zpos = 6;
+static GLboolean Anim = GL_FALSE;
+
+static int Width = 200, Height = 200;
+static GLfloat *z;
+static GLboolean showZ = 0;
+
+
+static void
+Idle(void)
+{
+ Xrot += 3.0;
+ Yrot += 4.0;
+ glutPostRedisplay();
+}
+
+
+static void
+Draw(void)
+{
+ glClearColor(0, 0, 0.5, 0);
+ glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+
+#if 1
+ glColor3f(1, 0, 0);
+ glWindowPos2i(0,0);
+ glColorMask(0,0,0,0);
+ glDrawPixels(Width, Height, GL_DEPTH_COMPONENT, GL_FLOAT, z);
+#elif 0
+ glPushMatrix();
+ glTranslatef(-0.75, 0, Zpos);
+ glutSolidSphere(1.0, 20, 10);
+ glPopMatrix();
+#endif
+ glColorMask(1,1,1,1);
+
+ /* draw cube */
+ glPushMatrix();
+ glTranslatef(0, 0, Zpos);
+ glRotatef(Xrot, 1, 0, 0);
+ glRotatef(Yrot, 0, 1, 0);
+ glutSolidCube(2.0);
+ glPopMatrix();
+
+#if 0
+ /* drawpixels after cube */
+ glColor3f(1, 0, 0);
+ glWindowPos2i(0,0);
+ //glColorMask(0,0,0,0);
+ glDrawPixels(Width, Height, GL_DEPTH_COMPONENT, GL_FLOAT, z);
+#endif
+
+ if (showZ) {
+ ShowDepthBuffer(Width, Height, 0.0, 1.0);
+ }
+
+ glutSwapBuffers();
+}
+
+
+static void
+Reshape(int width, int height)
+{
+ glViewport(0, 0, width, height);
+ glMatrixMode(GL_PROJECTION);
+ glLoadIdentity();
+ glFrustum(-1.0, 1.0, -1.0, 1.0, 5.0, 30.0);
+ glMatrixMode(GL_MODELVIEW);
+ glLoadIdentity();
+ glTranslatef(0.0, 0.0, -15.0);
+
+ Width = width;
+ Height = height;
+
+ z = (float *) malloc(width * height * 4);
+ {
+ int i, j, k = 0;
+ for (i = 0; i < height; i++) {
+ float zval = (float) i / (height - 1);
+ for (j = 0; j < width; j++) {
+ z[k++] = zval;
+ }
+ }
+ }
+}
+
+
+static void
+Key(unsigned char key, int x, int y)
+{
+ const GLfloat step = 1.0;
+ (void) x;
+ (void) y;
+ switch (key) {
+ case 'a':
+ Anim = !Anim;
+ if (Anim)
+ glutIdleFunc(Idle);
+ else
+ glutIdleFunc(NULL);
+ break;
+ case 'd':
+ showZ = !showZ;
+ break;
+ case 'z':
+ Zpos -= step;
+ break;
+ case 'Z':
+ Zpos += step;
+ break;
+ case 27:
+ glutDestroyWindow(Win);
+ exit(0);
+ break;
+ }
+ glutPostRedisplay();
+}
+
+
+static void
+SpecialKey(int key, int x, int y)
+{
+ const GLfloat step = 3.0;
+ (void) x;
+ (void) y;
+ switch (key) {
+ case GLUT_KEY_UP:
+ Xrot -= step;
+ break;
+ case GLUT_KEY_DOWN:
+ Xrot += step;
+ break;
+ case GLUT_KEY_LEFT:
+ Yrot -= step;
+ break;
+ case GLUT_KEY_RIGHT:
+ Yrot += step;
+ break;
+ }
+ glutPostRedisplay();
+}
+
+
+static void
+Init(void)
+{
+ /* setup lighting, etc */
+ glEnable(GL_DEPTH_TEST);
+ glEnable(GL_LIGHTING);
+ glEnable(GL_LIGHT0);
+}
+
+
+int
+main(int argc, char *argv[])
+{
+ glutInit(&argc, argv);
+ glutInitWindowPosition(0, 0);
+ glutInitWindowSize(400, 400);
+ glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
+ Win = glutCreateWindow(argv[0]);
+ glutReshapeFunc(Reshape);
+ glutKeyboardFunc(Key);
+ glutSpecialFunc(SpecialKey);
+ glutDisplayFunc(Draw);
+ if (Anim)
+ glutIdleFunc(Idle);
+ Init();
+ glutMainLoop();
+ return 0;
+}
diff --git a/progs/trivial/.gitignore b/progs/trivial/.gitignore
index 1c49fdd55fe..d77f120b96b 100644
--- a/progs/trivial/.gitignore
+++ b/progs/trivial/.gitignore
@@ -1,25 +1,49 @@
clear
+clear-fbo
+clear-fbo-tex
+clear-random
+clear-repeat
+clear-scissor
+clear-undefined
dlist-dangling
+dlist-degenerate
dlist-edgeflag
dlist-edgeflag-dangling
drawarrays
drawelements
drawrange
+extfuncs.h
+flat-clip
+fs-tri
line
line-clip
line-cull
+line-smooth
+line-stipple-wide
line-userclip
line-userclip-clip
line-userclip-nop
line-userclip-nop-clip
+line-wide
lineloop
lineloop-clip
+lineloop-elts
+linestrip
+linestrip-flat-stipple
+linestrip-stipple
+linestrip-stipple-wide
+long-fixed-func
+pgon-mode
point
point-clip
point-param
+point-sprite
point-wide
+point-wide-smooth
poly
poly-flat
+poly-flat-clip
+poly-flat-unfilled-clip
poly-unfilled
quad
quad-clip
@@ -32,34 +56,80 @@ quad-offset-unfilled
quad-offset-units
quad-tex-2d
quad-tex-3d
+quad-tex-alpha
quad-tex-pbo
quad-unfilled
+quad-unfilled-clip
+quad-unfilled-stipple
quads
quadstrip
+quadstrip-cont
quadstrip-flat
readtex.c
readtex.h
tri
+tri-alpha
+tri-array-interleaved
tri-blend
+tri-blend-color
+tri-blend-max
+tri-blend-min
+tri-blend-revsub
+tri-blend-sub
tri-clip
tri-cull
+tri-cull-both
tri-dlist
tri-edgeflag
+tri-fbo
+tri-fbo-tex
tri-flat
tri-flat-clip
+tri-fog
+tri-fp
+tri-fp-const-imm
+tri-lit
+tri-mask-tri
+tri-orig
+tri-query
+tri-repeat
+tri-scissor-tri
+tri-stencil
+tri-stipple
+tri-tex
tri-tex-3d
+tri-tri
tri-unfilled
tri-unfilled-clip
+tri-unfilled-edgeflag
tri-unfilled-smooth
+tri-unfilled-tri
+tri-unfilled-tri-lit
tri-unfilled-userclip
+tri-unfilled-userclip-stip
tri-userclip
+tri-z
+tri-z-eq
+trifan
+trifan-flat
+trifan-flat-clip
+trifan-flat-unfilled-clip
+trifan-unfilled
tristrip
tristrip-clip
+tristrip-flat
vbo-drawarrays
vbo-drawelements
vbo-drawrange
vp-array
+vp-array-int
vp-clip
vp-line-clip
vp-tri
+vp-tri-cb
+vp-tri-cb-pos
+vp-tri-cb-tex
+vp-tri-imm
+vp-tri-swap
+vp-tri-tex
vp-unfilled
diff --git a/progs/trivial/Makefile b/progs/trivial/Makefile
index 36a55484886..dce96f6bc8c 100644
--- a/progs/trivial/Makefile
+++ b/progs/trivial/Makefile
@@ -8,73 +8,141 @@ TOP = ../..
include $(TOP)/configs/current
-LIBS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) $(APP_LIB_DEPS)
+LIBS = -L$(TOP)/$(LIB_DIR) -l $(GLEW_LIB) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) $(APP_LIB_DEPS)
SOURCES = \
+ clear-fbo-tex.c \
+ clear-fbo.c \
+ clear-scissor.c \
+ clear-undefined.c \
+ clear-repeat.c \
+ clear-random.c \
clear.c \
+ dlist-dangling.c \
+ dlist-edgeflag-dangling.c \
+ dlist-edgeflag.c \
+ dlist-degenerate.c \
+ drawarrays.c \
+ drawelements.c \
+ drawrange.c \
+ flat-clip.c \
+ fs-tri.c \
line-clip.c \
line-cull.c \
+ line-smooth.c \
+ line-stipple-wide.c \
line-userclip-clip.c \
line-userclip-nop-clip.c \
line-userclip-nop.c \
line-userclip.c \
+ line-wide.c \
line.c \
lineloop-clip.c \
+ lineloop-elts.c \
lineloop.c \
- point.c \
+ linestrip-flat-stipple.c \
+ linestrip-stipple-wide.c \
+ linestrip-stipple.c \
+ linestrip.c \
+ long-fixed-func.c \
+ pgon-mode.c \
point-clip.c \
point-param.c \
+ point-sprite.c \
point-wide.c \
+ point-wide-smooth.c \
+ point.c \
poly-flat.c \
+ poly-flat-clip.c \
+ poly-flat-unfilled-clip.c \
poly-unfilled.c \
poly.c \
- quad-clip.c \
quad-clip-all-vertices.c \
quad-clip-nearplane.c \
+ quad-clip.c \
quad-degenerate.c \
quad-flat.c \
quad-offset-factor.c \
- quad-offset-units.c \
quad-offset-unfilled.c \
- quad-unfilled.c \
+ quad-offset-units.c \
quad-tex-2d.c \
- quad-tex-pbo.c \
quad-tex-3d.c \
+ quad-tex-alpha.c \
+ quad-tex-pbo.c \
+ quad-unfilled-clip.c \
+ quad-unfilled-stipple.c \
+ quad-unfilled.c \
quad.c \
quads.c \
- quadstrip.c \
+ quadstrip-cont.c \
quadstrip-flat.c \
- dlist-edgeflag.c \
- dlist-dangling.c \
- dlist-edgeflag-dangling.c \
- dlist-degenerate.c \
- drawrange.c \
- drawelements.c \
- drawarrays.c \
+ quadstrip.c \
+ tri-alpha.c \
+ tri-array-interleaved.c \
+ tri-blend-color.c \
+ tri-blend-max.c \
+ tri-blend-min.c \
+ tri-blend-revsub.c \
+ tri-blend-sub.c \
tri-blend.c \
- tri-tex-3d.c \
tri-clip.c \
+ tri-cull-both.c \
tri-cull.c \
+ tri-dlist.c \
tri-edgeflag.c \
+ tri-fbo-tex.c \
+ tri-fbo.c \
tri-flat-clip.c \
tri-flat.c \
+ tri-fog.c \
+ tri-fp.c \
+ tri-fp-const-imm.c \
+ tri-lit.c \
+ tri-mask-tri.c \
+ tri-orig.c \
+ tri-query.c \
+ tri-repeat.c \
+ tri-scissor-tri.c \
+ tri-stencil.c \
+ tri-stipple.c \
+ tri-tex.c \
+ tri-tex-3d.c \
+ tri-tri.c \
+ tri-unfilled-edgeflag.c \
tri-unfilled-clip.c \
tri-unfilled-smooth.c \
+ tri-unfilled-tri.c \
+ tri-unfilled-tri-lit.c \
+ tri-unfilled-userclip-stip.c \
tri-unfilled-userclip.c \
tri-unfilled.c \
tri-userclip.c \
- tri-dlist.c \
+ tri-z-eq.c \
+ tri-z.c \
tri.c \
+ trifan-flat.c \
+ trifan-flat-clip.c \
+ trifan-flat-unfilled-clip.c \
+ trifan-unfilled.c \
+ trifan.c \
tristrip-clip.c \
+ tristrip-flat.c \
tristrip.c \
- vbo-drawrange.c \
- vbo-drawelements.c \
vbo-drawarrays.c \
+ vbo-drawelements.c \
+ vbo-drawrange.c \
+ vp-array.c \
+ vp-array-int.c \
vp-clip.c \
- vp-tri.c \
vp-line-clip.c \
- vp-unfilled.c \
- vp-array.c
+ vp-tri.c \
+ vp-tri-swap.c \
+ vp-tri-tex.c \
+ vp-tri-imm.c \
+ vp-tri-cb.c \
+ vp-tri-cb-pos.c \
+ vp-tri-cb-tex.c \
+ vp-unfilled.c
PROGS = $(SOURCES:%.c=%)
@@ -89,13 +157,13 @@ UTIL_FILES = readtex.h readtex.c
.SUFFIXES: .c
.c:
- $(CC) $(INCLUDES) $(CFLAGS) $(LDFLAGS) $< $(LIBS) -o $@
+ $(APP_CC) $(INCLUDES) $(CFLAGS) $(LDFLAGS) $< $(LIBS) -o $@
.c.o:
- $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
+ $(APP_CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
.S.o:
- $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
+ $(APP_CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
##### TARGETS #####
@@ -116,19 +184,19 @@ getproclist.h: $(TOP)/src/mesa/glapi/gl_API.xml getprocaddress.c getprocaddress.
texrect: texrect.o readtex.o
- $(CC) $(CFLAGS) $(LDFLAGS) texrect.o readtex.o $(LIBS) -o $@
+ $(APP_CC) $(CFLAGS) $(LDFLAGS) texrect.o readtex.o $(LIBS) -o $@
texrect.o: texrect.c readtex.h
- $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
+ $(APP_CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
invert: invert.o readtex.o
- $(CC) $(CFLAGS) $(LDFLAGS) invert.o readtex.o $(LIBS) -o $@
+ $(APP_CC) $(CFLAGS) $(LDFLAGS) invert.o readtex.o $(LIBS) -o $@
invert.o: invert.c readtex.h
- $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
+ $(APP_CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
readtex.o: readtex.c
- $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
+ $(APP_CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
readtex.h: $(TOP)/progs/util/readtex.h
@@ -138,6 +206,11 @@ readtex.c: $(TOP)/progs/util/readtex.c
ln -s $(TOP)/progs/util/readtex.c .
+fs-tri: fs-tri.c extfuncs.h
+
+
+extfuncs.h: $(TOP)/progs/util/extfuncs.h
+ cp $< .
# Emacs tags
diff --git a/progs/trivial/SConscript b/progs/trivial/SConscript
new file mode 100644
index 00000000000..76826d9be08
--- /dev/null
+++ b/progs/trivial/SConscript
@@ -0,0 +1,164 @@
+Import('env')
+
+if not env['GLUT']:
+ Return()
+
+env = env.Clone()
+
+env.Prepend(LIBS = ['$GLUT_LIB'])
+
+progs = [
+ 'clear-fbo-tex',
+ 'clear-fbo',
+ 'clear-scissor',
+ 'clear-undefined',
+ 'clear-repeat',
+ 'clear',
+ 'dlist-dangling',
+ 'dlist-edgeflag-dangling',
+ 'dlist-edgeflag',
+ 'dlist-degenerate',
+ 'drawarrays',
+ 'drawelements',
+ 'drawrange',
+ 'flat-clip',
+ 'fs-tri',
+ 'line-clip',
+ 'line-cull',
+ 'line-smooth',
+ 'line-stipple-wide',
+ 'line-userclip-clip',
+ 'line-userclip-nop-clip',
+ 'line-userclip-nop',
+ 'line-userclip',
+ 'line-wide',
+ 'line',
+ 'lineloop-clip',
+ 'lineloop-elts',
+ 'lineloop',
+ 'linestrip-flat-stipple',
+ 'linestrip-stipple-wide',
+ 'linestrip-stipple',
+ 'linestrip',
+ 'long-fixed-func',
+ 'pgon-mode',
+ 'point-clip',
+ 'point-param',
+ 'point-sprite',
+ 'point-wide',
+ 'point-wide-smooth',
+ 'point',
+ 'poly-flat',
+ 'poly-flat-clip',
+ 'poly-flat-unfilled-clip',
+ 'poly-unfilled',
+ 'poly',
+ 'quad-clip-all-vertices',
+ 'quad-clip-nearplane',
+ 'quad-clip',
+ 'quad-degenerate',
+ 'quad-flat',
+ 'quad-offset-factor',
+ 'quad-offset-unfilled',
+ 'quad-offset-units',
+ 'quad-tex-2d',
+ 'quad-tex-3d',
+ 'quad-tex-alpha',
+ 'quad-tex-pbo',
+ 'quad-unfilled-clip',
+ 'quad-unfilled-stipple',
+ 'quad-unfilled',
+ 'quad',
+ 'quads',
+ 'quadstrip-cont',
+ 'quadstrip-flat',
+ 'quadstrip',
+ 'tri-alpha',
+ 'tri-blend-color',
+ 'tri-blend-max',
+ 'tri-blend-min',
+ 'tri-blend-revsub',
+ 'tri-blend-sub',
+ 'tri-blend',
+ 'tri-clip',
+ 'tri-clear',
+ 'tri-cull-both',
+ 'tri-cull',
+ 'tri-dlist',
+ 'tri-edgeflag',
+ 'tri-fbo-tex',
+ 'tri-fbo',
+ 'tri-flat-clip',
+ 'tri-flat',
+ 'tri-fog',
+ 'tri-fp',
+ 'tri-fp-const-imm',
+ 'tri-lit',
+ 'tri-mask-tri',
+ 'tri-orig',
+ 'tri-query',
+ 'tri-repeat',
+ 'tri-scissor-tri',
+ 'tri-stencil',
+ 'tri-tex',
+ 'tri-tex-3d',
+ 'tri-tri',
+ 'tri-unfilled-edgeflag',
+ 'tri-unfilled-clip',
+ 'tri-unfilled-smooth',
+ 'tri-unfilled-tri',
+ 'tri-unfilled-tri-lit',
+ 'tri-unfilled-userclip-stip',
+ 'tri-unfilled-userclip',
+ 'tri-unfilled',
+ 'tri-userclip',
+ 'tri-z-eq',
+ 'tri-z',
+ 'tri',
+ 'trifan-flat',
+ 'trifan-flat-clip',
+ 'trifan-flat-unfilled-clip',
+ 'trifan-unfilled',
+ 'trifan',
+ 'tristrip-clip',
+ 'tristrip-flat',
+ 'tristrip',
+ 'vbo-drawarrays',
+ 'vbo-drawelements',
+ 'vbo-drawrange',
+ 'vp-array',
+ 'vp-array-int',
+ 'vp-clip',
+ 'vp-line-clip',
+ 'vp-tri',
+ 'vp-tri-swap',
+ 'vp-tri-tex',
+ 'vp-tri-imm',
+ 'vp-tri-cb',
+ 'vp-tri-cb-pos',
+ 'vp-tri-cb-tex',
+ 'vp-unfilled',
+]
+
+for prog in progs:
+ prog = env.Program(
+ target = prog,
+ source = prog + '.c',
+ )
+
+# auto code generation
+#getprocaddress: getprocaddress.c getproclist.h
+
+#getproclist.h: $(TOP)/src/mesa/glapi/gl_API.xml getprocaddress.c getprocaddress.py
+# python getprocaddress.py > getproclist.h
+
+
+#readtex.h: $(TOP)/progs/util/readtex.h
+# ln -s $(TOP)/progs/util/readtex.h .
+
+#readtex.c: $(TOP)/progs/util/readtex.c
+# ln -s $(TOP)/progs/util/readtex.c .
+
+
+#extfuncs.h: $(TOP)/progs/util/extfuncs.h
+# cp $< .
diff --git a/progs/trivial/clear-fbo-tex.c b/progs/trivial/clear-fbo-tex.c
new file mode 100644
index 00000000000..eccfde5ae63
--- /dev/null
+++ b/progs/trivial/clear-fbo-tex.c
@@ -0,0 +1,222 @@
+
+#include <assert.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <string.h>
+
+#include <GL/glew.h>
+#include <GL/glut.h>
+
+
+
+static GLenum TexTarget = GL_TEXTURE_2D;
+static int TexWidth = 512, TexHeight = 512;
+static GLenum TexIntFormat = GL_RGBA; /* either GL_RGB or GL_RGBA */
+
+static int Width = 512, Height = 512;
+static GLuint MyFB, TexObj;
+
+
+#define CheckError() assert(glGetError() == 0)
+
+GLenum doubleBuffer;
+
+static void Init(void)
+{
+ fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
+ fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
+ fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
+
+
+ if (!glutExtensionSupported("GL_EXT_framebuffer_object")) {
+ printf("GL_EXT_framebuffer_object not found!\n");
+ exit(0);
+ }
+
+
+ glGenFramebuffersEXT(1, &MyFB);
+ glGenTextures(1, &TexObj);
+
+ /* Make texture object/image */
+ glBindTexture(TexTarget, TexObj);
+ glTexParameteri(TexTarget, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
+ glTexParameteri(TexTarget, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
+ glTexParameteri(TexTarget, GL_TEXTURE_BASE_LEVEL, 0);
+ glTexParameteri(TexTarget, GL_TEXTURE_MAX_LEVEL, 0);
+
+ glTexImage2D(TexTarget, 0, TexIntFormat, TexWidth, TexHeight, 0,
+ GL_RGBA, GL_UNSIGNED_BYTE, NULL);
+
+
+ glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
+
+
+
+ {
+ glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, MyFB);
+
+ glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT,
+ TexTarget, TexObj, 0);
+
+
+ glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
+ }
+
+}
+
+
+
+static void
+Reshape( int width, int height )
+{
+ glViewport( 0, 0, width, height );
+ glMatrixMode( GL_PROJECTION );
+ glLoadIdentity();
+ glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
+ glMatrixMode( GL_MODELVIEW );
+
+ Width = width;
+ Height = height;
+}
+
+static void Key(unsigned char key, int x, int y)
+{
+
+ switch (key) {
+ case 27:
+ exit(1);
+ default:
+ return;
+ }
+
+ glutPostRedisplay();
+}
+
+
+
+static void Draw( void )
+{
+
+
+ /* draw to texture image */
+ glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, MyFB);
+// glDrawBuffer(GL_COLOR_ATTACHMENT1_EXT);
+// glReadBuffer(GL_COLOR_ATTACHMENT1_EXT);
+
+
+ glViewport(0, 0, TexWidth, TexHeight);
+ CheckError();
+
+ glClearColor(0.5, 0.5, 1.0, 0.0);
+ glClear(GL_COLOR_BUFFER_BIT);
+ CheckError();
+
+ if (0) {
+ glBegin(GL_TRIANGLES);
+ glColor3f(0,0,.7);
+ glVertex3f( 0.9, -0.9, -30.0);
+ glColor3f(.8,0,0);
+ glVertex3f( 0.9, 0.9, -30.0);
+ glColor3f(0,.9,0);
+ glVertex3f(-0.9, 0.0, -30.0);
+ glEnd();
+ }
+
+ {
+ GLubyte *buffer = malloc(Width * Height * 4);
+
+ /* read from user framebuffer */
+ glReadPixels(0, 0, Width-60, Height-60, GL_RGBA, GL_UNSIGNED_BYTE, buffer);
+ CheckError();
+
+ /* draw to window */
+ glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
+ glViewport(0, 0, Width, Height);
+
+ /* Try to clear the window, but will overwrite:
+ */
+ glClearColor(0.8, 0.8, 0, 0.0);
+ glClear(GL_COLOR_BUFFER_BIT);
+
+ glWindowPos2iARB(30, 30);
+ glDrawPixels(Width-60, Height-60, GL_RGBA, GL_UNSIGNED_BYTE, buffer);
+
+ free(buffer);
+ }
+
+ /* Bind normal framebuffer */
+ glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
+ glViewport(0, 0, Width, Height);
+
+ if (0) {
+ glBegin(GL_TRIANGLES);
+ glColor3f(0,.7,0);
+ glVertex3f( 0.5, -0.5, -30.0);
+ glColor3f(0,0,.8);
+ glVertex3f( 0.5, 0.5, -30.0);
+ glColor3f(.9,0,0);
+ glVertex3f(-0.5, 0.0, -30.0);
+ glEnd();
+ }
+
+ if (doubleBuffer) {
+ glutSwapBuffers();
+ }
+
+ CheckError();
+}
+
+
+static GLenum Args(int argc, char **argv)
+{
+ GLint i;
+
+ doubleBuffer = GL_FALSE;
+
+ for (i = 1; i < argc; i++) {
+ if (strcmp(argv[i], "-sb") == 0) {
+ doubleBuffer = GL_FALSE;
+ } else if (strcmp(argv[i], "-db") == 0) {
+ doubleBuffer = GL_TRUE;
+ } else {
+ fprintf(stderr, "%s (Bad option).\n", argv[i]);
+ return GL_FALSE;
+ }
+ }
+ return GL_TRUE;
+}
+
+
+
+int
+main( int argc, char *argv[] )
+{
+ GLenum type;
+
+ glutInit(&argc, argv);
+
+ if (Args(argc, argv) == GL_FALSE) {
+ exit(1);
+ }
+
+ glutInitWindowPosition(100, 0); glutInitWindowSize( Width, Height );
+
+ type = GLUT_RGB;
+ type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
+ glutInitDisplayMode(type);
+
+ if (glutCreateWindow(argv[0]) == GL_FALSE) {
+ exit(1);
+ }
+
+ glewInit();
+
+ Init();
+
+ glutReshapeFunc(Reshape);
+ glutKeyboardFunc(Key);
+ glutDisplayFunc(Draw);
+ glutMainLoop();
+ return 0;
+}
diff --git a/progs/trivial/clear-fbo.c b/progs/trivial/clear-fbo.c
new file mode 100644
index 00000000000..64b25430c66
--- /dev/null
+++ b/progs/trivial/clear-fbo.c
@@ -0,0 +1,207 @@
+
+#include <assert.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <string.h>
+
+#include <GL/glew.h>
+#include <GL/glut.h>
+
+
+
+static int Width = 512, Height = 512;
+static GLuint MyFB, MyRB;
+
+
+#define CheckError() assert(glGetError() == 0)
+
+GLenum doubleBuffer;
+
+static void Init(void)
+{
+ fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
+ fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
+ fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
+
+
+ if (!glutExtensionSupported("GL_EXT_framebuffer_object")) {
+ printf("GL_EXT_framebuffer_object not found!\n");
+ exit(0);
+ }
+
+
+ glGenFramebuffersEXT(1, &MyFB);
+ glGenRenderbuffersEXT(1, &MyRB);
+
+ {
+ glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, MyFB);
+
+ glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, MyRB);
+
+ glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT1_EXT,
+ GL_RENDERBUFFER_EXT, MyRB);
+
+ glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_RGB, Width, Height);
+
+ glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
+ }
+
+}
+
+
+
+static void
+Reshape( int width, int height )
+{
+ glViewport( 0, 0, width, height );
+ glMatrixMode( GL_PROJECTION );
+ glLoadIdentity();
+ glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
+ glMatrixMode( GL_MODELVIEW );
+
+ Width = width;
+ Height = height;
+ glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_RGB, Width, Height);
+}
+
+static void Key(unsigned char key, int x, int y)
+{
+
+ switch (key) {
+ case 27:
+ exit(1);
+ default:
+ return;
+ }
+
+ glutPostRedisplay();
+}
+
+
+
+static void Draw( void )
+{
+
+ /* draw to user framebuffer */
+ glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, MyFB);
+ glDrawBuffer(GL_COLOR_ATTACHMENT1_EXT);
+ glReadBuffer(GL_COLOR_ATTACHMENT1_EXT);
+
+
+ glViewport(0, 0, Width, Height);
+ CheckError();
+
+ glClearColor(0.5, 0.5, 1.0, 0.0);
+ glClear(GL_COLOR_BUFFER_BIT);
+ CheckError();
+
+ if (0) {
+ glBegin(GL_TRIANGLES);
+ glColor3f(0,0,.7);
+ glVertex3f( 0.9, -0.9, -30.0);
+ glColor3f(.8,0,0);
+ glVertex3f( 0.9, 0.9, -30.0);
+ glColor3f(0,.9,0);
+ glVertex3f(-0.9, 0.0, -30.0);
+ glEnd();
+ }
+
+ {
+ GLubyte *buffer = malloc(Width * Height * 4);
+
+ /* read from user framebuffer */
+ glReadPixels(0, 0, Width-60, Height-60, GL_RGBA, GL_UNSIGNED_BYTE, buffer);
+ CheckError();
+
+ /* draw to window */
+ glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
+ glViewport(0, 0, Width, Height);
+
+ /* Try to clear the window, but will overwrite:
+ */
+ glClearColor(0.8, 0.8, 0, 0.0);
+ glClear(GL_COLOR_BUFFER_BIT);
+
+ glWindowPos2iARB(30, 30);
+ glDrawPixels(Width-60, Height-60, GL_RGBA, GL_UNSIGNED_BYTE, buffer);
+
+ free(buffer);
+ }
+
+ /* Bind normal framebuffer */
+ glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
+ glViewport(0, 0, Width, Height);
+
+ if (0) {
+ glBegin(GL_TRIANGLES);
+ glColor3f(0,.7,0);
+ glVertex3f( 0.5, -0.5, -30.0);
+ glColor3f(0,0,.8);
+ glVertex3f( 0.5, 0.5, -30.0);
+ glColor3f(.9,0,0);
+ glVertex3f(-0.5, 0.0, -30.0);
+ glEnd();
+ }
+
+ if (doubleBuffer)
+ glutSwapBuffers();
+ else
+ glFinish();
+
+ CheckError();
+}
+
+
+static GLenum Args(int argc, char **argv)
+{
+ GLint i;
+
+ doubleBuffer = GL_FALSE;
+
+ for (i = 1; i < argc; i++) {
+ if (strcmp(argv[i], "-sb") == 0) {
+ doubleBuffer = GL_FALSE;
+ } else if (strcmp(argv[i], "-db") == 0) {
+ doubleBuffer = GL_TRUE;
+ } else {
+ fprintf(stderr, "%s (Bad option).\n", argv[i]);
+ return GL_FALSE;
+ }
+ }
+ return GL_TRUE;
+}
+
+
+
+int
+main( int argc, char *argv[] )
+{
+ GLenum type;
+
+ glutInit(&argc, argv);
+
+ if (Args(argc, argv) == GL_FALSE) {
+ exit(1);
+ }
+
+ glutInitWindowPosition(100, 0); glutInitWindowSize( Width, Height );
+
+ type = GLUT_RGB;
+ type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
+ glutInitDisplayMode(type);
+
+ if (glutCreateWindow(argv[0]) == GL_FALSE) {
+ exit(1);
+ }
+
+ glewInit();
+
+ Init();
+
+ glutReshapeFunc(Reshape);
+ glutKeyboardFunc(Key);
+ glutDisplayFunc(Draw);
+ glutMainLoop();
+ return 0;
+}
diff --git a/progs/trivial/clear-random.c b/progs/trivial/clear-random.c
new file mode 100644
index 00000000000..16bd83339b8
--- /dev/null
+++ b/progs/trivial/clear-random.c
@@ -0,0 +1,132 @@
+/*
+ * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and
+ * its documentation for any purpose is hereby granted without fee, provided
+ * that (i) the above copyright notices and this permission notice appear in
+ * all copies of the software and related documentation, and (ii) the name of
+ * Silicon Graphics may not be used in any advertising or
+ * publicity relating to the software without the specific, prior written
+ * permission of Silicon Graphics.
+ *
+ * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF
+ * ANY KIND,
+ * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
+ * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * IN NO EVENT SHALL SILICON GRAPHICS BE LIABLE FOR
+ * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
+ * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
+ * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+ * OF THIS SOFTWARE.
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <GL/glut.h>
+
+
+#define CI_OFFSET_1 16
+#define CI_OFFSET_2 32
+
+
+GLenum doubleBuffer;
+
+static void Init(void)
+{
+ fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
+ fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
+ fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
+
+}
+
+static void Reshape(int width, int height)
+{
+
+ glViewport(0, 0, (GLint)width, (GLint)height);
+
+ glMatrixMode(GL_PROJECTION);
+ glLoadIdentity();
+ glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
+ glMatrixMode(GL_MODELVIEW);
+}
+
+static void Key(unsigned char key, int x, int y)
+{
+
+ switch (key) {
+ case 27:
+ exit(0);
+ default:
+ return;
+ }
+
+ glutPostRedisplay();
+}
+
+static void Draw(void)
+{
+ glClearColor(
+ rand() / (float)RAND_MAX,
+ rand() / (float)RAND_MAX,
+ rand() / (float)RAND_MAX,
+ 0.0);
+
+ glClear(GL_COLOR_BUFFER_BIT);
+ glFlush();
+
+ if (doubleBuffer) {
+ glutSwapBuffers();
+ }
+}
+
+static GLenum Args(int argc, char **argv)
+{
+ GLint i;
+
+ doubleBuffer = GL_FALSE;
+
+ for (i = 1; i < argc; i++) {
+ if (strcmp(argv[i], "-sb") == 0) {
+ doubleBuffer = GL_FALSE;
+ } else if (strcmp(argv[i], "-db") == 0) {
+ doubleBuffer = GL_TRUE;
+ } else {
+ fprintf(stderr, "%s (Bad option).\n", argv[i]);
+ return GL_FALSE;
+ }
+ }
+ return GL_TRUE;
+}
+
+int main(int argc, char **argv)
+{
+ GLenum type;
+
+ glutInit(&argc, argv);
+
+ if (Args(argc, argv) == GL_FALSE) {
+ exit(1);
+ }
+
+ glutInitWindowPosition(0, 0);
+ glutInitWindowSize( 256, 256);
+
+ type = GLUT_RGB | GLUT_ALPHA;
+ type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
+ glutInitDisplayMode(type);
+
+ if (glutCreateWindow("First Tri") == GL_FALSE) {
+ exit(1);
+ }
+
+ Init();
+
+ glutReshapeFunc(Reshape);
+ glutKeyboardFunc(Key);
+ glutDisplayFunc(Draw);
+ glutMainLoop();
+ return 0;
+}
diff --git a/progs/trivial/clear-repeat.c b/progs/trivial/clear-repeat.c
new file mode 100644
index 00000000000..9f9490c6c87
--- /dev/null
+++ b/progs/trivial/clear-repeat.c
@@ -0,0 +1,111 @@
+/*
+ * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and
+ * its documentation for any purpose is hereby granted without fee, provided
+ * that (i) the above copyright notices and this permission notice appear in
+ * all copies of the software and related documentation, and (ii) the name of
+ * Silicon Graphics may not be used in any advertising or
+ * publicity relating to the software without the specific, prior written
+ * permission of Silicon Graphics.
+ *
+ * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF
+ * ANY KIND,
+ * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
+ * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * IN NO EVENT SHALL SILICON GRAPHICS BE LIABLE FOR
+ * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
+ * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
+ * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+ * OF THIS SOFTWARE.
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <math.h>
+#include <GL/glut.h>
+
+
+#define CI_OFFSET_1 16
+#define CI_OFFSET_2 32
+
+
+static void Init(void)
+{
+ fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
+ fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
+ fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
+
+ glClearColor(0.3, 0.1, 0.3, 0.0);
+}
+
+static void Reshape(int width, int height)
+{
+
+ glViewport(0, 0, (GLint)width, (GLint)height);
+
+ glMatrixMode(GL_PROJECTION);
+ glLoadIdentity();
+ glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
+ glMatrixMode(GL_MODELVIEW);
+}
+
+static void Key(unsigned char key, int x, int y)
+{
+ switch (key) {
+ case 27:
+ exit(0);
+ default:
+ glutPostRedisplay();
+ return;
+ }
+}
+
+static void Draw(void)
+{
+ static float f = 0;
+ while (1) {
+ f += .1;
+ glClearColor((sin(f)+1)/2.0,(cos(f)+1)/2.0,0.5,1);
+ glClear(GL_COLOR_BUFFER_BIT);
+ glutSwapBuffers();
+ }
+ glutPostRedisplay();
+}
+
+static GLenum Args(int argc, char **argv)
+{
+ return GL_TRUE;
+}
+
+int main(int argc, char **argv)
+{
+ GLenum type;
+
+ glutInit(&argc, argv);
+
+ if (Args(argc, argv) == GL_FALSE) {
+ exit(1);
+ }
+
+ glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
+
+ type = GLUT_RGB | GLUT_ALPHA;
+ type |= GLUT_DOUBLE;
+ glutInitDisplayMode(type);
+
+ if (glutCreateWindow("First Tri") == GL_FALSE) {
+ exit(1);
+ }
+
+ Init();
+
+ glutReshapeFunc(Reshape);
+ glutKeyboardFunc(Key);
+ glutDisplayFunc(Draw);
+ glutMainLoop();
+ return 0;
+}
diff --git a/progs/trivial/clear-scissor.c b/progs/trivial/clear-scissor.c
new file mode 100644
index 00000000000..5e2025bed74
--- /dev/null
+++ b/progs/trivial/clear-scissor.c
@@ -0,0 +1,118 @@
+/*
+ * glClear + glScissor
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <GL/glut.h>
+
+
+GLenum doubleBuffer;
+GLint Width = 200, Height = 150;
+
+static void Init(void)
+{
+ fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
+ fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
+ fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
+}
+
+static void Reshape(int width, int height)
+{
+ Width = width;
+ Height = height;
+
+ glViewport(0, 0, (GLint)width, (GLint)height);
+
+ glMatrixMode(GL_PROJECTION);
+ glLoadIdentity();
+ glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
+ glMatrixMode(GL_MODELVIEW);
+}
+
+static void Key(unsigned char key, int x, int y)
+{
+ switch (key) {
+ case 27:
+ exit(1);
+ default:
+ return;
+ }
+ glutPostRedisplay();
+}
+
+static void Draw(void)
+{
+ glEnable(GL_SCISSOR_TEST);
+
+ glClearColor(1, 0, 0, 0);
+ glScissor(0, 0, Width / 2, Height / 2);
+ glClear(GL_COLOR_BUFFER_BIT);
+
+ glClearColor(0, 1, 0, 0);
+ glScissor(Width / 2, 0, Width - Width / 2, Height / 2);
+ glClear(GL_COLOR_BUFFER_BIT);
+
+ glClearColor(0, 0, 1, 0);
+ glScissor(0, Height / 2, Width / 2, Height - Height / 2);
+ glClear(GL_COLOR_BUFFER_BIT);
+
+ glClearColor(1, 1, 1, 0);
+ glScissor(Width / 2, Height / 2, Width - Width / 2, Height - Height / 2);
+ glClear(GL_COLOR_BUFFER_BIT);
+
+ glFlush();
+
+ if (doubleBuffer) {
+ glutSwapBuffers();
+ }
+}
+
+static GLenum Args(int argc, char **argv)
+{
+ GLint i;
+
+ doubleBuffer = GL_FALSE;
+
+ for (i = 1; i < argc; i++) {
+ if (strcmp(argv[i], "-sb") == 0) {
+ doubleBuffer = GL_FALSE;
+ } else if (strcmp(argv[i], "-db") == 0) {
+ doubleBuffer = GL_TRUE;
+ } else {
+ fprintf(stderr, "%s (Bad option).\n", argv[i]);
+ return GL_FALSE;
+ }
+ }
+ return GL_TRUE;
+}
+
+int main(int argc, char **argv)
+{
+ GLenum type;
+
+ glutInit(&argc, argv);
+
+ if (Args(argc, argv) == GL_FALSE) {
+ exit(1);
+ }
+
+ glutInitWindowPosition(0, 0); glutInitWindowSize( Width, Height );
+
+ type = GLUT_RGB | GLUT_ALPHA;
+ type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
+ glutInitDisplayMode(type);
+
+ if (glutCreateWindow(argv[0]) == GL_FALSE) {
+ exit(1);
+ }
+
+ Init();
+
+ glutReshapeFunc(Reshape);
+ glutKeyboardFunc(Key);
+ glutDisplayFunc(Draw);
+ glutMainLoop();
+ return 0;
+}
diff --git a/progs/trivial/clear-undefined.c b/progs/trivial/clear-undefined.c
new file mode 100644
index 00000000000..ce066bf8e6f
--- /dev/null
+++ b/progs/trivial/clear-undefined.c
@@ -0,0 +1,137 @@
+/*
+ * glClear + glScissor + Undefined content of framebuffer
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <GL/glut.h>
+
+
+GLenum doubleBuffer;
+GLint Width = 200, Height = 150;
+
+static void Init(void)
+{
+ fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
+ fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
+ fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
+ fprintf(stderr, "Top right corner should be red\n");
+}
+
+static void Reshape(int width, int height)
+{
+ Width = width;
+ Height = height;
+
+ glViewport(0, 0, (GLint)width, (GLint)height);
+
+ glMatrixMode(GL_PROJECTION);
+ glLoadIdentity();
+ glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
+ glMatrixMode(GL_MODELVIEW);
+}
+
+static void Key(unsigned char key, int x, int y)
+{
+ switch (key) {
+ case 27:
+ exit(1);
+ default:
+ glutPostRedisplay();
+ return;
+ }
+
+}
+
+static void Draw(void)
+{
+ glColor4f(1.0, 0.0, 0.0, 1.0);
+ glBegin(GL_QUADS);
+ glVertex2d(0.0, 0.0);
+ glVertex2d(0.0, 1.0);
+ glVertex2d(1.0, 1.0);
+ glVertex2d(1.0, 0.0);
+ glEnd();
+
+ glBegin(GL_QUADS);
+ glVertex2d(0.0, 0.0);
+ glVertex2d(0.0, -1.0);
+ glVertex2d(1.0, -1.0);
+ glVertex2d(1.0, 0.0);
+ glEnd();
+
+ glEnable(GL_SCISSOR_TEST);
+ glClearColor(1, 1, 0, 0);
+ glScissor(Width / 2, 0, Width - Width / 2, Height / 2);
+ glClear(GL_COLOR_BUFFER_BIT);
+
+ glClearColor(0, 0, 1, 0);
+ glScissor(0, Height / 2, Width / 2, Height - Height / 2);
+ glClear(GL_COLOR_BUFFER_BIT);
+ glDisable(GL_SCISSOR_TEST);
+
+ glColor4f(0.0, 1.0, 0.0, 1.0);
+ glBegin(GL_QUADS);
+ glVertex2d( 0.0, 0.0);
+ glVertex2d( 0.0, -1.0);
+ glVertex2d(-1.0, -1.0);
+ glVertex2d(-1.0, 0.0);
+ glEnd();
+
+ glFlush();
+
+ if (doubleBuffer) {
+ glutSwapBuffers();
+ }
+}
+
+static GLenum Args(int argc, char **argv)
+{
+ GLint i;
+
+ doubleBuffer = GL_TRUE;
+
+ for (i = 1; i < argc; i++) {
+ if (strcmp(argv[i], "-sb") == 0) {
+ doubleBuffer = GL_FALSE;
+ } else if (strcmp(argv[i], "-db") == 0) {
+ doubleBuffer = GL_TRUE;
+ } else {
+ fprintf(stderr, "%s (Bad option).\n", argv[i]);
+ return GL_FALSE;
+ }
+ }
+ return GL_TRUE;
+}
+
+int main(int argc, char **argv)
+{
+ GLenum type;
+
+ glutInit(&argc, argv);
+
+ if (Args(argc, argv) == GL_FALSE) {
+ exit(1);
+ }
+
+ glutInitWindowPosition(0, 0); glutInitWindowSize( Width, Height );
+
+
+ type = GLUT_RGB | GLUT_ALPHA;
+ type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
+ glutInitDisplayMode(type);
+
+ if (glutCreateWindow(argv[0]) == GL_FALSE) {
+ exit(1);
+ }
+
+ Init();
+ Reshape(Width, Height);
+
+ glutReshapeFunc(Reshape);
+ glutKeyboardFunc(Key);
+ glutDisplayFunc(Draw);
+ glutMainLoop();
+ return 0;
+}
diff --git a/progs/trivial/clear.c b/progs/trivial/clear.c
index 7e7ca588c31..da4fff04590 100644
--- a/progs/trivial/clear.c
+++ b/progs/trivial/clear.c
@@ -59,7 +59,7 @@ static void Key(unsigned char key, int x, int y)
switch (key) {
case 27:
- exit(1);
+ exit(0);
default:
return;
}
@@ -106,9 +106,10 @@ int main(int argc, char **argv)
exit(1);
}
- glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
+ glutInitWindowPosition(0, 0);
+ glutInitWindowSize( 256, 256);
- type = GLUT_RGB;
+ type = GLUT_RGB | GLUT_ALPHA;
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
@@ -122,5 +123,5 @@ int main(int argc, char **argv)
glutKeyboardFunc(Key);
glutDisplayFunc(Draw);
glutMainLoop();
- return 0;
+ return 0;
}
diff --git a/progs/trivial/createwin.c b/progs/trivial/createwin.c
new file mode 100644
index 00000000000..901048555a9
--- /dev/null
+++ b/progs/trivial/createwin.c
@@ -0,0 +1,120 @@
+/*
+ * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and
+ * its documentation for any purpose is hereby granted without fee, provided
+ * that (i) the above copyright notices and this permission notice appear in
+ * all copies of the software and related documentation, and (ii) the name of
+ * Silicon Graphics may not be used in any advertising or
+ * publicity relating to the software without the specific, prior written
+ * permission of Silicon Graphics.
+ *
+ * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF
+ * ANY KIND,
+ * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
+ * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * IN NO EVENT SHALL SILICON GRAPHICS BE LIABLE FOR
+ * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
+ * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
+ * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+ * OF THIS SOFTWARE.
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <GL/glut.h>
+
+
+#define CI_OFFSET_1 16
+#define CI_OFFSET_2 32
+
+
+GLenum doubleBuffer;
+
+static void Init(void)
+{
+ fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
+ fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
+ fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
+
+ glClearColor(0.0, 0.0, 1.0, 0.0);
+}
+
+static void Reshape(int width, int height)
+{
+
+ glViewport(0, 0, (GLint)width, (GLint)height);
+
+ glMatrixMode(GL_PROJECTION);
+ glLoadIdentity();
+ glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
+ glMatrixMode(GL_MODELVIEW);
+}
+
+static void Key(unsigned char key, int x, int y)
+{
+
+ switch (key) {
+ case 27:
+ exit(1);
+ default:
+ return;
+ }
+
+ glutPostRedisplay();
+}
+
+static void Draw(void)
+{
+}
+
+static GLenum Args(int argc, char **argv)
+{
+ GLint i;
+
+ doubleBuffer = GL_FALSE;
+
+ for (i = 1; i < argc; i++) {
+ if (strcmp(argv[i], "-sb") == 0) {
+ doubleBuffer = GL_FALSE;
+ } else if (strcmp(argv[i], "-db") == 0) {
+ doubleBuffer = GL_TRUE;
+ } else {
+ fprintf(stderr, "%s (Bad option).\n", argv[i]);
+ return GL_FALSE;
+ }
+ }
+ return GL_TRUE;
+}
+
+int main(int argc, char **argv)
+{
+ GLenum type;
+
+ glutInit(&argc, argv);
+
+ if (Args(argc, argv) == GL_FALSE) {
+ exit(1);
+ }
+
+ glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
+
+ type = GLUT_RGB;
+ type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
+ glutInitDisplayMode(type);
+
+ if (glutCreateWindow("First Tri") == GL_FALSE) {
+ exit(1);
+ }
+
+ Init();
+
+ glutReshapeFunc(Reshape);
+ glutKeyboardFunc(Key);
+ glutDisplayFunc(Draw);
+// glutMainLoop();
+ return 0;
+}
diff --git a/progs/trivial/dlist-dangling.c b/progs/trivial/dlist-dangling.c
index 97f878e96b9..00a75078444 100644
--- a/progs/trivial/dlist-dangling.c
+++ b/progs/trivial/dlist-dangling.c
@@ -131,7 +131,7 @@ int main(int argc, char **argv)
glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
- type = GLUT_RGB;
+ type = GLUT_RGB | GLUT_ALPHA;
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
diff --git a/progs/trivial/dlist-edgeflag-dangling.c b/progs/trivial/dlist-edgeflag-dangling.c
index 47d29bdade1..08fae549c31 100644
--- a/progs/trivial/dlist-edgeflag-dangling.c
+++ b/progs/trivial/dlist-edgeflag-dangling.c
@@ -136,7 +136,7 @@ int main(int argc, char **argv)
glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
- type = GLUT_RGB;
+ type = GLUT_RGB | GLUT_ALPHA;
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
diff --git a/progs/trivial/dlist-edgeflag.c b/progs/trivial/dlist-edgeflag.c
index b58e7eb4355..ae799dc3557 100644
--- a/progs/trivial/dlist-edgeflag.c
+++ b/progs/trivial/dlist-edgeflag.c
@@ -140,7 +140,7 @@ int main(int argc, char **argv)
glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
- type = GLUT_RGB;
+ type = GLUT_RGB | GLUT_ALPHA;
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
diff --git a/progs/trivial/drawarrays.c b/progs/trivial/drawarrays.c
index 596eee9eef1..27d86682f75 100644
--- a/progs/trivial/drawarrays.c
+++ b/progs/trivial/drawarrays.c
@@ -5,7 +5,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#define GL_GLEXT_PROTOTYPES
+#include <GL/glew.h>
#include <GL/glut.h>
@@ -118,6 +118,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( 250, 250 );
glutInitDisplayMode( GLUT_RGB | GLUT_SINGLE | GLUT_DEPTH );
glutCreateWindow(argv[0]);
+ glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );
diff --git a/progs/trivial/drawelements.c b/progs/trivial/drawelements.c
index e0c8e80b68c..4c115030afc 100644
--- a/progs/trivial/drawelements.c
+++ b/progs/trivial/drawelements.c
@@ -5,7 +5,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#define GL_GLEXT_PROTOTYPES
+#include <GL/glew.h>
#include <GL/glut.h>
GLfloat verts[][4] = {
@@ -111,6 +111,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( 250, 250 );
glutInitDisplayMode( GLUT_RGB | GLUT_SINGLE | GLUT_DEPTH );
glutCreateWindow(argv[0]);
+ glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );
diff --git a/progs/trivial/drawrange.c b/progs/trivial/drawrange.c
index 9c787cbfcde..e9ea99b5376 100644
--- a/progs/trivial/drawrange.c
+++ b/progs/trivial/drawrange.c
@@ -5,7 +5,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#define GL_GLEXT_PROTOTYPES
+#include <GL/glew.h>
#include <GL/glut.h>
GLfloat verts[][4] = {
@@ -109,6 +109,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( 250, 250 );
glutInitDisplayMode( GLUT_RGB | GLUT_SINGLE | GLUT_DEPTH );
glutCreateWindow(argv[0]);
+ glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );
diff --git a/progs/trivial/flat-clip.c b/progs/trivial/flat-clip.c
new file mode 100644
index 00000000000..dbe17a342eb
--- /dev/null
+++ b/progs/trivial/flat-clip.c
@@ -0,0 +1,151 @@
+/**
+ * Test flat shading and clipping.
+ *
+ * Brian Paul
+ * 30 August 2007
+ */
+
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <GL/glut.h>
+
+static int Win;
+static GLfloat Scale = 2.0, Zrot = 50;
+static GLenum Mode = GL_LINE_LOOP;
+static GLboolean Smooth = 0;
+static GLenum PolygonMode = GL_FILL;
+
+
+static void
+Draw(void)
+{
+ glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+
+ if (Smooth)
+ glShadeModel(GL_SMOOTH);
+ else
+ glShadeModel(GL_FLAT);
+
+ glPushMatrix();
+ glScalef(Scale, Scale, 1);
+ glRotatef(Zrot, 0, 0, 1);
+
+ glPolygonMode(GL_FRONT_AND_BACK, PolygonMode);
+
+ glBegin(Mode);
+ glColor3f(1, 0, 0);
+ glVertex2f(-1, -1);
+ glColor3f(0, 1, 0);
+ glVertex2f( 2, -1);
+ glColor3f(0, 0, 1);
+ glVertex2f( 0, 1);
+ glEnd();
+
+ glPushMatrix();
+ glScalef(0.9, 0.9, 1);
+ glBegin(Mode);
+ glColor3f(1, 0, 0);
+ glVertex2f( 0, 1);
+
+ glColor3f(0, 0, 1);
+ glVertex2f( 2, -1);
+
+ glColor3f(0, 1, 0);
+ glVertex2f(-1, -1);
+
+ glEnd();
+ glPopMatrix();
+
+ glPopMatrix();
+
+ glutSwapBuffers();
+}
+
+
+static void
+Reshape(int width, int height)
+{
+ glViewport(0, 0, width, height);
+ glMatrixMode(GL_PROJECTION);
+ glLoadIdentity();
+ glFrustum(-1.0, 1.0, -1.0, 1.0, 5.0, 25.0);
+ glMatrixMode(GL_MODELVIEW);
+ glLoadIdentity();
+ glTranslatef(0.0, 0.0, -15.0);
+}
+
+
+static void
+Key(unsigned char key, int x, int y)
+{
+ (void) x;
+ (void) y;
+ switch (key) {
+ case 'p':
+ if (Mode == GL_TRIANGLES)
+ Mode = GL_LINE_LOOP;
+ else
+ Mode = GL_TRIANGLES;
+ break;
+ case 'f':
+ if (PolygonMode == GL_POINT)
+ PolygonMode = GL_LINE;
+ else if (PolygonMode == GL_LINE)
+ PolygonMode = GL_FILL;
+ else
+ PolygonMode = GL_POINT;
+ printf("PolygonMode = 0x%x\n", PolygonMode);
+ break;
+ case 'r':
+ Zrot -= 5.0;
+ break;
+ case 'R':
+ Zrot += 5.0;
+ break;
+ case 'z':
+ Scale *= 1.1;
+ break;
+ case 'Z':
+ Scale /= 1.1;
+ break;
+ case 's':
+ Smooth = !Smooth;
+ break;
+ case 27:
+ glutDestroyWindow(Win);
+ exit(0);
+ break;
+ }
+ glutPostRedisplay();
+}
+
+
+static void
+Init(void)
+{
+ printf("Usage:\n");
+ printf(" z/Z: change triangle size\n");
+ printf(" r/R: rotate\n");
+ printf(" p: toggle line/fill mode\n");
+ printf(" s: toggle smooth/flat shading\n");
+ printf(" f: switch polygon fill mode\n");
+}
+
+
+int
+main(int argc, char *argv[])
+{
+ glutInit(&argc, argv);
+ glutInitWindowPosition(0, 0);
+ glutInitWindowSize(400, 400);
+ glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
+ Win = glutCreateWindow(argv[0]);
+ glutReshapeFunc(Reshape);
+ glutKeyboardFunc(Key);
+ glutDisplayFunc(Draw);
+ Init();
+ glutMainLoop();
+ return 0;
+}
diff --git a/progs/trivial/fs-tri.c b/progs/trivial/fs-tri.c
new file mode 100644
index 00000000000..6e86df1dcfa
--- /dev/null
+++ b/progs/trivial/fs-tri.c
@@ -0,0 +1,209 @@
+/* Test fragment shader */
+
+#include <assert.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <GL/glew.h>
+#include <GL/glut.h>
+
+
+static GLuint fragShader;
+static GLuint vertShader;
+static GLuint program;
+static GLint win = 0;
+static GLfloat xpos = 0, ypos = 0;
+
+
+static void
+Redisplay(void)
+{
+ glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+
+ glPushMatrix();
+ glTranslatef(xpos, ypos, 0);
+
+ glBegin(GL_TRIANGLES);
+ glColor3f(1, 0, 0);
+ glVertex2f(-0.9, -0.9);
+ glColor3f(0, 1, 0);
+ glVertex2f( 0.9, -0.9);
+ glColor3f(0, 0, 1);
+ glVertex2f( 0, 0.9);
+ glEnd();
+
+ glPopMatrix();
+
+ glutSwapBuffers();
+}
+
+
+static void
+Reshape(int width, int height)
+{
+ glViewport(0, 0, width, height);
+ glMatrixMode(GL_PROJECTION);
+ glLoadIdentity();
+ glOrtho(-1, 1, -1, 1, -1, 1);
+ glMatrixMode(GL_MODELVIEW);
+ glLoadIdentity();
+}
+
+
+static void
+CleanUp(void)
+{
+ glDeleteShader(fragShader);
+ glDeleteShader(vertShader);
+ glDeleteProgram(program);
+ glutDestroyWindow(win);
+}
+
+
+static void
+Key(unsigned char key, int x, int y)
+{
+ (void) x;
+ (void) y;
+
+ switch(key) {
+ case 27:
+ CleanUp();
+ exit(0);
+ break;
+ }
+ glutPostRedisplay();
+}
+
+
+static void
+SpecialKey(int key, int x, int y)
+{
+ const GLfloat step = 0.1;
+
+ (void) x;
+ (void) y;
+
+ switch(key) {
+ case GLUT_KEY_UP:
+ ypos += step;
+ break;
+ case GLUT_KEY_DOWN:
+ ypos -= step;
+ break;
+ case GLUT_KEY_LEFT:
+ xpos -= step;
+ break;
+ case GLUT_KEY_RIGHT:
+ xpos += step;
+ break;
+ }
+ glutPostRedisplay();
+}
+
+
+static void
+LoadAndCompileShader(GLuint shader, const char *text)
+{
+ GLint stat;
+
+ glShaderSource(shader, 1, (const GLchar **) &text, NULL);
+
+ glCompileShader(shader);
+
+ glGetShaderiv(shader, GL_COMPILE_STATUS, &stat);
+ if (!stat) {
+ GLchar log[1000];
+ GLsizei len;
+ glGetShaderInfoLog(shader, 1000, &len, log);
+ fprintf(stderr, "fslight: problem compiling shader:\n%s\n", log);
+ exit(1);
+ }
+}
+
+
+static void
+CheckLink(GLuint prog)
+{
+ GLint stat;
+ glGetProgramiv(prog, GL_LINK_STATUS, &stat);
+ if (!stat) {
+ GLchar log[1000];
+ GLsizei len;
+ glGetProgramInfoLog(prog, 1000, &len, log);
+ fprintf(stderr, "Linker error:\n%s\n", log);
+ }
+}
+
+
+static void
+Init(void)
+{
+ /* fragment color is a function of fragment position: */
+ static const char *fragShaderText =
+ "void main() {\n"
+ " gl_FragColor = gl_FragCoord * vec4(0.005); \n"
+ " //gl_FragColor = gl_Color; \n"
+ " //gl_FragColor = vec4(1, 0, 0.5, 0); \n"
+ "}\n";
+#if 0
+ static const char *vertShaderText =
+ "varying vec3 normal;\n"
+ "void main() {\n"
+ " gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;\n"
+ " normal = gl_NormalMatrix * gl_Normal;\n"
+ "}\n";
+#endif
+ const char *version;
+
+ version = (const char *) glGetString(GL_VERSION);
+ if (version[0] != '2' || version[1] != '.') {
+ printf("This program requires OpenGL 2.x, found %s\n", version);
+ exit(1);
+ }
+
+ fragShader = glCreateShader(GL_FRAGMENT_SHADER);
+ LoadAndCompileShader(fragShader, fragShaderText);
+
+#if 0
+ vertShader = glCreateShader(GL_VERTEX_SHADER);
+ LoadAndCompileShader(vertShader, vertShaderText);
+#endif
+
+ program = glCreateProgram();
+ glAttachShader(program, fragShader);
+#if 0
+ glAttachShader(program, vertShader);
+#endif
+ glLinkProgram(program);
+ CheckLink(program);
+ glUseProgram(program);
+
+ assert(glGetError() == 0);
+
+ glClearColor(0.3f, 0.3f, 0.3f, 0.0f);
+
+ printf("GL_RENDERER = %s\n",(const char *) glGetString(GL_RENDERER));
+}
+
+
+int
+main(int argc, char *argv[])
+{
+ glutInit(&argc, argv);
+ glutInitWindowPosition( 0, 0);
+ glutInitWindowSize(200, 200);
+ glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
+ win = glutCreateWindow(argv[0]);
+ glewInit();
+ glutReshapeFunc(Reshape);
+ glutKeyboardFunc(Key);
+ glutSpecialFunc(SpecialKey);
+ glutDisplayFunc(Redisplay);
+ Init();
+ glutMainLoop();
+ return 0;
+}
+
+
diff --git a/progs/trivial/line-clip.c b/progs/trivial/line-clip.c
index 9acd12acc7b..fd79d049c4f 100644
--- a/progs/trivial/line-clip.c
+++ b/progs/trivial/line-clip.c
@@ -122,7 +122,7 @@ int main(int argc, char **argv)
glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
- type = GLUT_RGB;
+ type = GLUT_RGB | GLUT_ALPHA;
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
diff --git a/progs/trivial/line-cull.c b/progs/trivial/line-cull.c
index 8999a8f0b1c..038004b4c4a 100644
--- a/progs/trivial/line-cull.c
+++ b/progs/trivial/line-cull.c
@@ -118,7 +118,7 @@ int main(int argc, char **argv)
glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
- type = GLUT_RGB;
+ type = GLUT_RGB | GLUT_ALPHA;
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
diff --git a/progs/trivial/line-smooth.c b/progs/trivial/line-smooth.c
new file mode 100644
index 00000000000..f030de9b9fe
--- /dev/null
+++ b/progs/trivial/line-smooth.c
@@ -0,0 +1,172 @@
+/*
+ * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and
+ * its documentation for any purpose is hereby granted without fee, provided
+ * that (i) the above copyright notices and this permission notice appear in
+ * all copies of the software and related documentation, and (ii) the name of
+ * Silicon Graphics may not be used in any advertising or
+ * publicity relating to the software without the specific, prior written
+ * permission of Silicon Graphics.
+ *
+ * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF
+ * ANY KIND,
+ * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
+ * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * IN NO EVENT SHALL SILICON GRAPHICS BE LIABLE FOR
+ * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
+ * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
+ * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+ * OF THIS SOFTWARE.
+ */
+
+#include <math.h>
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <GL/glut.h>
+
+
+#define CI_OFFSET_1 16
+#define CI_OFFSET_2 32
+
+
+GLenum doubleBuffer;
+GLboolean smooth = GL_TRUE;
+GLfloat width = 1.0;
+
+
+static void Init(void)
+{
+ float range[2], aarange[2];
+ fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
+ fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
+ fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
+ glGetFloatv(GL_LINE_WIDTH_RANGE, aarange);
+ glGetFloatv(GL_ALIASED_LINE_WIDTH_RANGE, range);
+ printf("Non-AA line width range: %f .. %f\n", range[0], range[1]);
+ printf("AA line width range: %f .. %f\n", aarange[0], aarange[1]);
+}
+
+
+static void Reshape(int width, int height)
+{
+ glViewport(0, 0, (GLint)width, (GLint)height);
+ glMatrixMode(GL_PROJECTION);
+ glLoadIdentity();
+ glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
+ glMatrixMode(GL_MODELVIEW);
+ glLoadIdentity();
+ glTranslatef(0, 0, -30);
+}
+
+static void Key(unsigned char key, int x, int y)
+{
+ switch (key) {
+ case 'w':
+ width -= 0.5;
+ if (width < 0.5)
+ width = 0.5;
+ break;
+ case 'W':
+ width += 0.5;
+ break;
+ case 's':
+ smooth = !smooth;
+ break;
+ case 27:
+ exit(1);
+ default:
+ return;
+ }
+ printf("LineWidth: %g\n", width);
+ glutPostRedisplay();
+}
+
+
+static void Draw(void)
+{
+ float a;
+
+ glClear(GL_COLOR_BUFFER_BIT);
+
+ glLineWidth(width);
+
+ if (smooth) {
+ glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+ glEnable(GL_BLEND);
+ glEnable(GL_LINE_SMOOTH);
+ }
+
+ glColor3f(1, 1, 1);
+
+ glBegin(GL_LINES);
+ for (a = 0; a < 3.14159; a += 0.2) {
+ float x = .9 * cos(a);
+ float y = .9 * sin(a);
+
+ glVertex2f(-x, -y);
+ glVertex2f( x, y);
+ }
+ glEnd();
+
+ glDisable(GL_LINE_SMOOTH);
+ glDisable(GL_BLEND);
+
+ glFlush();
+
+ if (doubleBuffer) {
+ glutSwapBuffers();
+ }
+}
+
+static GLenum Args(int argc, char **argv)
+{
+ GLint i;
+
+ doubleBuffer = GL_FALSE;
+
+ for (i = 1; i < argc; i++) {
+ if (strcmp(argv[i], "-sb") == 0) {
+ doubleBuffer = GL_FALSE;
+ } else if (strcmp(argv[i], "-db") == 0) {
+ doubleBuffer = GL_TRUE;
+ } else {
+ fprintf(stderr, "%s (Bad option).\n", argv[i]);
+ return GL_FALSE;
+ }
+ }
+ return GL_TRUE;
+}
+
+
+int main(int argc, char **argv)
+{
+ GLenum type;
+
+ glutInit(&argc, argv);
+
+ if (Args(argc, argv) == GL_FALSE) {
+ exit(1);
+ }
+
+ glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
+
+ type = GLUT_RGB;
+ type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
+ glutInitDisplayMode(type);
+
+ if (glutCreateWindow(argv[0]) == GL_FALSE) {
+ exit(1);
+ }
+
+ Init();
+
+ glutReshapeFunc(Reshape);
+ glutKeyboardFunc(Key);
+ glutDisplayFunc(Draw);
+ glutMainLoop();
+ return 0;
+}
diff --git a/progs/trivial/line-stipple-wide.c b/progs/trivial/line-stipple-wide.c
new file mode 100644
index 00000000000..09e5e1fe089
--- /dev/null
+++ b/progs/trivial/line-stipple-wide.c
@@ -0,0 +1,148 @@
+/*
+ * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and
+ * its documentation for any purpose is hereby granted without fee, provided
+ * that (i) the above copyright notices and this permission notice appear in
+ * all copies of the software and related documentation, and (ii) the name of
+ * Silicon Graphics may not be used in any advertising or
+ * publicity relating to the software without the specific, prior written
+ * permission of Silicon Graphics.
+ *
+ * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF
+ * ANY KIND,
+ * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
+ * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * IN NO EVENT SHALL SILICON GRAPHICS BE LIABLE FOR
+ * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
+ * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
+ * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+ * OF THIS SOFTWARE.
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <GL/glut.h>
+
+
+#define CI_OFFSET_1 16
+#define CI_OFFSET_2 32
+
+
+GLenum doubleBuffer;
+
+static void Init(void)
+{
+ fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
+ fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
+ fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
+
+ glClearColor(0.0, 0.0, 1.0, 0.0);
+}
+
+static void Reshape(int width, int height)
+{
+
+ glViewport(0, 0, (GLint)width, (GLint)height);
+
+ glMatrixMode(GL_PROJECTION);
+ glLoadIdentity();
+ glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
+ glMatrixMode(GL_MODELVIEW);
+}
+
+static void Key(unsigned char key, int x, int y)
+{
+
+ switch (key) {
+ case 27:
+ exit(1);
+ default:
+ return;
+ }
+
+ glutPostRedisplay();
+}
+
+static void Draw(void)
+{
+ glClear(GL_COLOR_BUFFER_BIT);
+
+ glEnable(GL_LINE_STIPPLE);
+ glLineStipple( 5, 0xfffe );
+ glLineWidth( 4 );
+
+ glBegin(GL_LINES);
+ glColor3f(0,0,.7);
+ glVertex3f( 0.9, -0.9, -30.0);
+ glColor3f(.8,0,0);
+ glVertex3f( 0.9, 0.9, -30.0);
+
+ glColor3f(.8,0,0);
+ glVertex3f( 0.9, 0.9, -30.0);
+ glColor3f(0,.9,0);
+ glVertex3f(-0.9, 0.0, -30.0);
+
+ glColor3f(0,.9,0);
+ glVertex3f(-0.9, 0.0, -30.0);
+ glColor3f(0,0,.7);
+ glVertex3f( 0.9, -0.9, -30.0);
+ glEnd();
+
+ glFlush();
+
+ if (doubleBuffer) {
+ glutSwapBuffers();
+ }
+}
+
+static GLenum Args(int argc, char **argv)
+{
+ GLint i;
+
+ doubleBuffer = GL_FALSE;
+
+ for (i = 1; i < argc; i++) {
+ if (strcmp(argv[i], "-sb") == 0) {
+ doubleBuffer = GL_FALSE;
+ } else if (strcmp(argv[i], "-db") == 0) {
+ doubleBuffer = GL_TRUE;
+ } else {
+ fprintf(stderr, "%s (Bad option).\n", argv[i]);
+ return GL_FALSE;
+ }
+ }
+ return GL_TRUE;
+}
+
+int main(int argc, char **argv)
+{
+ GLenum type;
+
+ glutInit(&argc, argv);
+
+ if (Args(argc, argv) == GL_FALSE) {
+ exit(1);
+ }
+
+ glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
+
+ type = GLUT_RGB;
+ type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
+ glutInitDisplayMode(type);
+
+ if (glutCreateWindow("First Tri") == GL_FALSE) {
+ exit(1);
+ }
+
+ Init();
+
+ glutReshapeFunc(Reshape);
+ glutKeyboardFunc(Key);
+ glutDisplayFunc(Draw);
+ glutMainLoop();
+ return 0;
+}
diff --git a/progs/trivial/line-userclip-clip.c b/progs/trivial/line-userclip-clip.c
index b24d8452bcd..5c9c1b3b291 100644
--- a/progs/trivial/line-userclip-clip.c
+++ b/progs/trivial/line-userclip-clip.c
@@ -124,7 +124,7 @@ int main(int argc, char **argv)
glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
- type = GLUT_RGB;
+ type = GLUT_RGB | GLUT_ALPHA;
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
diff --git a/progs/trivial/line-userclip-nop-clip.c b/progs/trivial/line-userclip-nop-clip.c
index e2e0b85a522..a6ee44fbd0f 100644
--- a/progs/trivial/line-userclip-nop-clip.c
+++ b/progs/trivial/line-userclip-nop-clip.c
@@ -124,7 +124,7 @@ int main(int argc, char **argv)
glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
- type = GLUT_RGB;
+ type = GLUT_RGB | GLUT_ALPHA;
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
diff --git a/progs/trivial/line-userclip-nop.c b/progs/trivial/line-userclip-nop.c
index eacee069789..cebea5f4812 100644
--- a/progs/trivial/line-userclip-nop.c
+++ b/progs/trivial/line-userclip-nop.c
@@ -124,7 +124,7 @@ int main(int argc, char **argv)
glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
- type = GLUT_RGB;
+ type = GLUT_RGB | GLUT_ALPHA;
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
diff --git a/progs/trivial/line-userclip.c b/progs/trivial/line-userclip.c
index 6af91431d08..ecfd28cac71 100644
--- a/progs/trivial/line-userclip.c
+++ b/progs/trivial/line-userclip.c
@@ -124,7 +124,7 @@ int main(int argc, char **argv)
glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
- type = GLUT_RGB;
+ type = GLUT_RGB | GLUT_ALPHA;
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
diff --git a/progs/trivial/line-wide.c b/progs/trivial/line-wide.c
new file mode 100644
index 00000000000..543b1f67f34
--- /dev/null
+++ b/progs/trivial/line-wide.c
@@ -0,0 +1,147 @@
+/*
+ * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and
+ * its documentation for any purpose is hereby granted without fee, provided
+ * that (i) the above copyright notices and this permission notice appear in
+ * all copies of the software and related documentation, and (ii) the name of
+ * Silicon Graphics may not be used in any advertising or
+ * publicity relating to the software without the specific, prior written
+ * permission of Silicon Graphics.
+ *
+ * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF
+ * ANY KIND,
+ * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
+ * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * IN NO EVENT SHALL SILICON GRAPHICS BE LIABLE FOR
+ * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
+ * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
+ * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+ * OF THIS SOFTWARE.
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <GL/glut.h>
+
+
+#define CI_OFFSET_1 16
+#define CI_OFFSET_2 32
+
+
+GLenum doubleBuffer;
+
+static void Init(void)
+{
+ fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
+ fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
+ fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
+
+ glClearColor(0.0, 0.0, 1.0, 0.0);
+}
+
+static void Reshape(int width, int height)
+{
+
+ glViewport(0, 0, (GLint)width, (GLint)height);
+
+ glMatrixMode(GL_PROJECTION);
+ glLoadIdentity();
+ glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
+ glMatrixMode(GL_MODELVIEW);
+}
+
+static void Key(unsigned char key, int x, int y)
+{
+
+ switch (key) {
+ case 27:
+ exit(1);
+ default:
+ return;
+ }
+
+ glutPostRedisplay();
+}
+
+static void Draw(void)
+{
+ glClear(GL_COLOR_BUFFER_BIT);
+
+ glLineWidth(4.0);
+
+ glBegin(GL_LINES);
+ glColor3f(0,0,.7);
+ glVertex3f( 0.9, -0.9, -30.0);
+ glColor3f(.8,0,0);
+ glVertex3f( 0.9, 0.9, -30.0);
+
+ glColor3f(.8,0,0);
+ glVertex3f( 0.9, 0.9, -30.0);
+ glColor3f(0,.9,0);
+ glVertex3f(-0.9, 0.0, -30.0);
+
+
+ glColor3f(0,.9,0);
+ glVertex3f(-0.9, 0.0, -30.0);
+ glColor3f(0,0,.7);
+ glVertex3f( 0.9, -0.9, -30.0);
+ glEnd();
+
+ glFlush();
+
+ if (doubleBuffer) {
+ glutSwapBuffers();
+ }
+}
+
+static GLenum Args(int argc, char **argv)
+{
+ GLint i;
+
+ doubleBuffer = GL_FALSE;
+
+ for (i = 1; i < argc; i++) {
+ if (strcmp(argv[i], "-sb") == 0) {
+ doubleBuffer = GL_FALSE;
+ } else if (strcmp(argv[i], "-db") == 0) {
+ doubleBuffer = GL_TRUE;
+ } else {
+ fprintf(stderr, "%s (Bad option).\n", argv[i]);
+ return GL_FALSE;
+ }
+ }
+ return GL_TRUE;
+}
+
+int main(int argc, char **argv)
+{
+ GLenum type;
+
+ glutInit(&argc, argv);
+
+ if (Args(argc, argv) == GL_FALSE) {
+ exit(1);
+ }
+
+ glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
+
+ type = GLUT_RGB;
+ type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
+ glutInitDisplayMode(type);
+
+ if (glutCreateWindow("First Tri") == GL_FALSE) {
+ exit(1);
+ }
+
+ Init();
+
+ glutReshapeFunc(Reshape);
+ glutKeyboardFunc(Key);
+ glutDisplayFunc(Draw);
+ glutMainLoop();
+ return 0;
+}
diff --git a/progs/trivial/line.c b/progs/trivial/line.c
index 58bad91b05a..de5f9274e41 100644
--- a/progs/trivial/line.c
+++ b/progs/trivial/line.c
@@ -71,15 +71,20 @@ static void Draw(void)
{
glClear(GL_COLOR_BUFFER_BIT);
- glBegin(GL_LINE_STRIP);
+ glBegin(GL_LINES);
glColor3f(0,0,.7);
glVertex3f( 0.9, -0.9, -30.0);
glColor3f(.8,0,0);
glVertex3f( 0.9, 0.9, -30.0);
+
+ glColor3f(.8,0,0);
+ glVertex3f( 0.9, 0.9, -30.0);
+ glColor3f(0,.9,0);
+ glVertex3f(-0.9, 0.0, -30.0);
+
+
glColor3f(0,.9,0);
glVertex3f(-0.9, 0.0, -30.0);
- /* Repeat the first vertex - don't have lineloop support in GS yet
- */
glColor3f(0,0,.7);
glVertex3f( 0.9, -0.9, -30.0);
glEnd();
diff --git a/progs/trivial/lineloop-clip.c b/progs/trivial/lineloop-clip.c
index d8645ee3477..211056720fe 100644
--- a/progs/trivial/lineloop-clip.c
+++ b/progs/trivial/lineloop-clip.c
@@ -118,7 +118,7 @@ int main(int argc, char **argv)
glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
- type = GLUT_RGB;
+ type = GLUT_RGB | GLUT_ALPHA;
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
diff --git a/progs/trivial/lineloop-elts.c b/progs/trivial/lineloop-elts.c
new file mode 100644
index 00000000000..ab944157c01
--- /dev/null
+++ b/progs/trivial/lineloop-elts.c
@@ -0,0 +1,121 @@
+/* Test rebasing */
+
+#include <assert.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <GL/glew.h>
+#include <GL/glut.h>
+
+GLfloat verts[][4] = {
+ { 0.9, -0.9, 0.0, 1.0 },
+ { 0.9, 0.9, 0.0, 1.0 },
+ { -0.9, 0.9, 0.0, 1.0 },
+ { -0.9, -0.9, 0.0, 1.0 },
+};
+
+GLubyte color[][4] = {
+ { 0x00, 0x00, 0xff, 0x00 },
+ { 0x00, 0xff, 0x00, 0x00 },
+ { 0xff, 0x00, 0x00, 0x00 },
+ { 0xff, 0xff, 0xff, 0x00 },
+};
+
+GLuint indices[] = { 1, 2, 3 };
+
+static void Init( void )
+{
+ GLint errno;
+ GLuint prognum;
+
+ static const char *prog1 =
+ "!!ARBvp1.0\n"
+ "MOV result.color, vertex.color;\n"
+ "MOV result.position, vertex.position;\n"
+ "END\n";
+
+ glGenProgramsARB(1, &prognum);
+ glBindProgramARB(GL_VERTEX_PROGRAM_ARB, prognum);
+ glProgramStringARB(GL_VERTEX_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB,
+ strlen(prog1), (const GLubyte *) prog1);
+
+ assert(glIsProgramARB(prognum));
+ errno = glGetError();
+ printf("glGetError = %d\n", errno);
+ if (errno != GL_NO_ERROR)
+ {
+ GLint errorpos;
+
+ glGetIntegerv(GL_PROGRAM_ERROR_POSITION_ARB, &errorpos);
+ printf("errorpos: %d\n", errorpos);
+ printf("%s\n", (char *)glGetString(GL_PROGRAM_ERROR_STRING_ARB));
+ }
+
+
+ glEnableClientState( GL_VERTEX_ARRAY );
+ glEnableClientState( GL_COLOR_ARRAY );
+ glVertexPointer( 3, GL_FLOAT, sizeof(verts[0]), verts );
+ glColorPointer( 4, GL_UNSIGNED_BYTE, 0, color );
+
+}
+
+
+
+static void Display( void )
+{
+ glClearColor(0.3, 0.3, 0.3, 1);
+ glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
+
+ glEnable(GL_VERTEX_PROGRAM_NV);
+
+ /* Should have min_index == 1, maybe force a rebase:
+ */
+ glDrawElements( GL_LINE_LOOP, 3, GL_UNSIGNED_INT, indices );
+
+ glFlush();
+}
+
+
+static void Reshape( int width, int height )
+{
+ glViewport( 0, 0, width, height );
+ glMatrixMode( GL_PROJECTION );
+ glLoadIdentity();
+ glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
+ glMatrixMode( GL_MODELVIEW );
+ glLoadIdentity();
+ /*glTranslatef( 0.0, 0.0, -15.0 );*/
+}
+
+
+static void Key( unsigned char key, int x, int y )
+{
+ (void) x;
+ (void) y;
+ switch (key) {
+ case 27:
+ exit(0);
+ break;
+ }
+ glutPostRedisplay();
+}
+
+
+
+
+int main( int argc, char *argv[] )
+{
+ glutInit( &argc, argv );
+ glutInitWindowPosition( 0, 0 );
+ glutInitWindowSize( 250, 250 );
+ glutInitDisplayMode( GLUT_RGB | GLUT_SINGLE | GLUT_DEPTH );
+ glutCreateWindow(argv[0]);
+ glewInit();
+ glutReshapeFunc( Reshape );
+ glutKeyboardFunc( Key );
+ glutDisplayFunc( Display );
+ Init();
+ glutMainLoop();
+ return 0;
+}
diff --git a/progs/trivial/lineloop.c b/progs/trivial/lineloop.c
index 7500c54fc26..fab7d1ea022 100644
--- a/progs/trivial/lineloop.c
+++ b/progs/trivial/lineloop.c
@@ -118,7 +118,7 @@ int main(int argc, char **argv)
glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
- type = GLUT_RGB;
+ type = GLUT_RGB | GLUT_ALPHA;
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
diff --git a/progs/trivial/linestrip-clip.c b/progs/trivial/linestrip-clip.c
new file mode 100644
index 00000000000..acab0f4e1cf
--- /dev/null
+++ b/progs/trivial/linestrip-clip.c
@@ -0,0 +1,141 @@
+/*
+ * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and
+ * its documentation for any purpose is hereby granted without fee, provided
+ * that (i) the above copyright notices and this permission notice appear in
+ * all copies of the software and related documentation, and (ii) the name of
+ * Silicon Graphics may not be used in any advertising or
+ * publicity relating to the software without the specific, prior written
+ * permission of Silicon Graphics.
+ *
+ * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF
+ * ANY KIND,
+ * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
+ * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * IN NO EVENT SHALL SILICON GRAPHICS BE LIABLE FOR
+ * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
+ * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
+ * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+ * OF THIS SOFTWARE.
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <GL/glut.h>
+
+
+#define CI_OFFSET_1 16
+#define CI_OFFSET_2 32
+
+
+GLenum doubleBuffer;
+
+static void Init(void)
+{
+ fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
+ fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
+ fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
+
+ glClearColor(0.0, 0.0, 1.0, 0.0);
+}
+
+static void Reshape(int width, int height)
+{
+
+ glViewport(0, 0, (GLint)width, (GLint)height);
+
+ glMatrixMode(GL_PROJECTION);
+ glLoadIdentity();
+ glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
+ glMatrixMode(GL_MODELVIEW);
+}
+
+static void Key(unsigned char key, int x, int y)
+{
+
+ switch (key) {
+ case 27:
+ exit(1);
+ default:
+ return;
+ }
+
+ glutPostRedisplay();
+}
+
+static void Draw(void)
+{
+ glClear(GL_COLOR_BUFFER_BIT);
+
+ glBegin(GL_LINE_STRIP);
+ glColor3f(0,0,.7);
+ glVertex3f( 0.9, -0.9, -30.0);
+
+ glColor3f(.8,0,0);
+ glVertex3f( 0.9, 0.9, -30.0);
+
+ glColor3f(0,.9,0);
+ glVertex3f(-1.9, 0.0, -30.0);
+
+ glColor3f(0,0,.7);
+ glVertex3f( 0.8, -0.8, -30.0);
+ glEnd();
+
+ glFlush();
+
+ if (doubleBuffer) {
+ glutSwapBuffers();
+ }
+}
+
+static GLenum Args(int argc, char **argv)
+{
+ GLint i;
+
+ doubleBuffer = GL_FALSE;
+
+ for (i = 1; i < argc; i++) {
+ if (strcmp(argv[i], "-sb") == 0) {
+ doubleBuffer = GL_FALSE;
+ } else if (strcmp(argv[i], "-db") == 0) {
+ doubleBuffer = GL_TRUE;
+ } else {
+ fprintf(stderr, "%s (Bad option).\n", argv[i]);
+ return GL_FALSE;
+ }
+ }
+ return GL_TRUE;
+}
+
+int main(int argc, char **argv)
+{
+ GLenum type;
+
+ glutInit(&argc, argv);
+
+ if (Args(argc, argv) == GL_FALSE) {
+ exit(1);
+ }
+
+ glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
+
+ type = GLUT_RGB;
+ type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
+ glutInitDisplayMode(type);
+
+ if (glutCreateWindow("First Tri") == GL_FALSE) {
+ exit(1);
+ }
+
+ Init();
+
+ glutReshapeFunc(Reshape);
+ glutKeyboardFunc(Key);
+ glutDisplayFunc(Draw);
+ glutMainLoop();
+ return 0;
+}
diff --git a/progs/trivial/linestrip-flat-stipple.c b/progs/trivial/linestrip-flat-stipple.c
new file mode 100644
index 00000000000..b691437346a
--- /dev/null
+++ b/progs/trivial/linestrip-flat-stipple.c
@@ -0,0 +1,142 @@
+/*
+ * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and
+ * its documentation for any purpose is hereby granted without fee, provided
+ * that (i) the above copyright notices and this permission notice appear in
+ * all copies of the software and related documentation, and (ii) the name of
+ * Silicon Graphics may not be used in any advertising or
+ * publicity relating to the software without the specific, prior written
+ * permission of Silicon Graphics.
+ *
+ * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF
+ * ANY KIND,
+ * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
+ * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * IN NO EVENT SHALL SILICON GRAPHICS BE LIABLE FOR
+ * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
+ * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
+ * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+ * OF THIS SOFTWARE.
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <GL/glut.h>
+
+
+#define CI_OFFSET_1 16
+#define CI_OFFSET_2 32
+
+
+GLenum doubleBuffer;
+
+static void Init(void)
+{
+ fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
+ fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
+ fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
+
+ glClearColor(0.0, 0.0, 1.0, 0.0);
+}
+
+static void Reshape(int width, int height)
+{
+
+ glViewport(0, 0, (GLint)width, (GLint)height);
+
+ glMatrixMode(GL_PROJECTION);
+ glLoadIdentity();
+ glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
+ glMatrixMode(GL_MODELVIEW);
+}
+
+static void Key(unsigned char key, int x, int y)
+{
+
+ switch (key) {
+ case 27:
+ exit(1);
+ default:
+ return;
+ }
+
+ glutPostRedisplay();
+}
+
+static void Draw(void)
+{
+ glClear(GL_COLOR_BUFFER_BIT);
+
+ glShadeModel(GL_FLAT);
+ glEnable(GL_LINE_STIPPLE);
+ glLineStipple( 5, 0xfffe );
+
+ glBegin(GL_LINE_STRIP);
+ glColor3f(0,0,.7);
+ glVertex3f( 0.9, -0.9, -30.0);
+ glColor3f(.8,0,0);
+ glVertex3f( 0.9, 0.9, -30.0);
+ glColor3f(0,.9,0);
+ glVertex3f(-0.9, 0.0, -30.0);
+ glColor3f(0,0,.7);
+ glVertex3f( 0.9, -0.9, -30.0);
+ glEnd();
+
+ glFlush();
+
+ if (doubleBuffer) {
+ glutSwapBuffers();
+ }
+}
+
+static GLenum Args(int argc, char **argv)
+{
+ GLint i;
+
+ doubleBuffer = GL_FALSE;
+
+ for (i = 1; i < argc; i++) {
+ if (strcmp(argv[i], "-sb") == 0) {
+ doubleBuffer = GL_FALSE;
+ } else if (strcmp(argv[i], "-db") == 0) {
+ doubleBuffer = GL_TRUE;
+ } else {
+ fprintf(stderr, "%s (Bad option).\n", argv[i]);
+ return GL_FALSE;
+ }
+ }
+ return GL_TRUE;
+}
+
+int main(int argc, char **argv)
+{
+ GLenum type;
+
+ glutInit(&argc, argv);
+
+ if (Args(argc, argv) == GL_FALSE) {
+ exit(1);
+ }
+
+ glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
+
+ type = GLUT_RGB;
+ type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
+ glutInitDisplayMode(type);
+
+ if (glutCreateWindow("First Tri") == GL_FALSE) {
+ exit(1);
+ }
+
+ Init();
+
+ glutReshapeFunc(Reshape);
+ glutKeyboardFunc(Key);
+ glutDisplayFunc(Draw);
+ glutMainLoop();
+ return 0;
+}
diff --git a/progs/trivial/linestrip-stipple-wide.c b/progs/trivial/linestrip-stipple-wide.c
new file mode 100644
index 00000000000..53dfa554e98
--- /dev/null
+++ b/progs/trivial/linestrip-stipple-wide.c
@@ -0,0 +1,142 @@
+/*
+ * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and
+ * its documentation for any purpose is hereby granted without fee, provided
+ * that (i) the above copyright notices and this permission notice appear in
+ * all copies of the software and related documentation, and (ii) the name of
+ * Silicon Graphics may not be used in any advertising or
+ * publicity relating to the software without the specific, prior written
+ * permission of Silicon Graphics.
+ *
+ * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF
+ * ANY KIND,
+ * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
+ * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * IN NO EVENT SHALL SILICON GRAPHICS BE LIABLE FOR
+ * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
+ * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
+ * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+ * OF THIS SOFTWARE.
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <GL/glut.h>
+
+
+#define CI_OFFSET_1 16
+#define CI_OFFSET_2 32
+
+
+GLenum doubleBuffer;
+
+static void Init(void)
+{
+ fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
+ fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
+ fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
+
+ glClearColor(0.0, 0.0, 1.0, 0.0);
+}
+
+static void Reshape(int width, int height)
+{
+
+ glViewport(0, 0, (GLint)width, (GLint)height);
+
+ glMatrixMode(GL_PROJECTION);
+ glLoadIdentity();
+ glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
+ glMatrixMode(GL_MODELVIEW);
+}
+
+static void Key(unsigned char key, int x, int y)
+{
+
+ switch (key) {
+ case 27:
+ exit(1);
+ default:
+ return;
+ }
+
+ glutPostRedisplay();
+}
+
+static void Draw(void)
+{
+ glClear(GL_COLOR_BUFFER_BIT);
+
+ glEnable(GL_LINE_STIPPLE);
+ glLineStipple( 5, 0xfffe );
+ glLineWidth( 4 );
+
+ glBegin(GL_LINE_STRIP);
+ glColor3f(0,0,.7);
+ glVertex3f( 0.9, -0.9, -30.0);
+ glColor3f(.8,0,0);
+ glVertex3f( 0.9, 0.9, -30.0);
+ glColor3f(0,.9,0);
+ glVertex3f(-0.9, 0.0, -30.0);
+ glColor3f(0,0,.7);
+ glVertex3f( 0.9, -0.9, -30.0);
+ glEnd();
+
+ glFlush();
+
+ if (doubleBuffer) {
+ glutSwapBuffers();
+ }
+}
+
+static GLenum Args(int argc, char **argv)
+{
+ GLint i;
+
+ doubleBuffer = GL_FALSE;
+
+ for (i = 1; i < argc; i++) {
+ if (strcmp(argv[i], "-sb") == 0) {
+ doubleBuffer = GL_FALSE;
+ } else if (strcmp(argv[i], "-db") == 0) {
+ doubleBuffer = GL_TRUE;
+ } else {
+ fprintf(stderr, "%s (Bad option).\n", argv[i]);
+ return GL_FALSE;
+ }
+ }
+ return GL_TRUE;
+}
+
+int main(int argc, char **argv)
+{
+ GLenum type;
+
+ glutInit(&argc, argv);
+
+ if (Args(argc, argv) == GL_FALSE) {
+ exit(1);
+ }
+
+ glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
+
+ type = GLUT_RGB;
+ type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
+ glutInitDisplayMode(type);
+
+ if (glutCreateWindow("First Tri") == GL_FALSE) {
+ exit(1);
+ }
+
+ Init();
+
+ glutReshapeFunc(Reshape);
+ glutKeyboardFunc(Key);
+ glutDisplayFunc(Draw);
+ glutMainLoop();
+ return 0;
+}
diff --git a/progs/trivial/linestrip-stipple.c b/progs/trivial/linestrip-stipple.c
new file mode 100644
index 00000000000..5933d1a136f
--- /dev/null
+++ b/progs/trivial/linestrip-stipple.c
@@ -0,0 +1,141 @@
+/*
+ * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and
+ * its documentation for any purpose is hereby granted without fee, provided
+ * that (i) the above copyright notices and this permission notice appear in
+ * all copies of the software and related documentation, and (ii) the name of
+ * Silicon Graphics may not be used in any advertising or
+ * publicity relating to the software without the specific, prior written
+ * permission of Silicon Graphics.
+ *
+ * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF
+ * ANY KIND,
+ * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
+ * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * IN NO EVENT SHALL SILICON GRAPHICS BE LIABLE FOR
+ * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
+ * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
+ * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+ * OF THIS SOFTWARE.
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <GL/glut.h>
+
+
+#define CI_OFFSET_1 16
+#define CI_OFFSET_2 32
+
+
+GLenum doubleBuffer;
+
+static void Init(void)
+{
+ fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
+ fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
+ fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
+
+ glClearColor(0.0, 0.0, 1.0, 0.0);
+}
+
+static void Reshape(int width, int height)
+{
+
+ glViewport(0, 0, (GLint)width, (GLint)height);
+
+ glMatrixMode(GL_PROJECTION);
+ glLoadIdentity();
+ glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
+ glMatrixMode(GL_MODELVIEW);
+}
+
+static void Key(unsigned char key, int x, int y)
+{
+
+ switch (key) {
+ case 27:
+ exit(1);
+ default:
+ return;
+ }
+
+ glutPostRedisplay();
+}
+
+static void Draw(void)
+{
+ glClear(GL_COLOR_BUFFER_BIT);
+
+ glEnable(GL_LINE_STIPPLE);
+ glLineStipple( 5, 0xfffe );
+
+ glBegin(GL_LINE_STRIP);
+ glColor3f(0,0,.7);
+ glVertex3f( 0.9, -0.9, -30.0);
+ glColor3f(.8,0,0);
+ glVertex3f( 0.9, 0.9, -30.0);
+ glColor3f(0,.9,0);
+ glVertex3f(-0.9, 0.0, -30.0);
+ glColor3f(0,0,.7);
+ glVertex3f( 0.9, -0.9, -30.0);
+ glEnd();
+
+ glFlush();
+
+ if (doubleBuffer) {
+ glutSwapBuffers();
+ }
+}
+
+static GLenum Args(int argc, char **argv)
+{
+ GLint i;
+
+ doubleBuffer = GL_FALSE;
+
+ for (i = 1; i < argc; i++) {
+ if (strcmp(argv[i], "-sb") == 0) {
+ doubleBuffer = GL_FALSE;
+ } else if (strcmp(argv[i], "-db") == 0) {
+ doubleBuffer = GL_TRUE;
+ } else {
+ fprintf(stderr, "%s (Bad option).\n", argv[i]);
+ return GL_FALSE;
+ }
+ }
+ return GL_TRUE;
+}
+
+int main(int argc, char **argv)
+{
+ GLenum type;
+
+ glutInit(&argc, argv);
+
+ if (Args(argc, argv) == GL_FALSE) {
+ exit(1);
+ }
+
+ glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
+
+ type = GLUT_RGB;
+ type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
+ glutInitDisplayMode(type);
+
+ if (glutCreateWindow("First Tri") == GL_FALSE) {
+ exit(1);
+ }
+
+ Init();
+
+ glutReshapeFunc(Reshape);
+ glutKeyboardFunc(Key);
+ glutDisplayFunc(Draw);
+ glutMainLoop();
+ return 0;
+}
diff --git a/progs/trivial/linestrip.c b/progs/trivial/linestrip.c
new file mode 100644
index 00000000000..06dd1c10872
--- /dev/null
+++ b/progs/trivial/linestrip.c
@@ -0,0 +1,138 @@
+/*
+ * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and
+ * its documentation for any purpose is hereby granted without fee, provided
+ * that (i) the above copyright notices and this permission notice appear in
+ * all copies of the software and related documentation, and (ii) the name of
+ * Silicon Graphics may not be used in any advertising or
+ * publicity relating to the software without the specific, prior written
+ * permission of Silicon Graphics.
+ *
+ * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF
+ * ANY KIND,
+ * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
+ * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * IN NO EVENT SHALL SILICON GRAPHICS BE LIABLE FOR
+ * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
+ * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
+ * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+ * OF THIS SOFTWARE.
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <GL/glut.h>
+
+
+#define CI_OFFSET_1 16
+#define CI_OFFSET_2 32
+
+
+GLenum doubleBuffer;
+
+static void Init(void)
+{
+ fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
+ fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
+ fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
+
+ glClearColor(0.0, 0.0, 1.0, 0.0);
+}
+
+static void Reshape(int width, int height)
+{
+
+ glViewport(0, 0, (GLint)width, (GLint)height);
+
+ glMatrixMode(GL_PROJECTION);
+ glLoadIdentity();
+ glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
+ glMatrixMode(GL_MODELVIEW);
+}
+
+static void Key(unsigned char key, int x, int y)
+{
+
+ switch (key) {
+ case 27:
+ exit(1);
+ default:
+ return;
+ }
+
+ glutPostRedisplay();
+}
+
+static void Draw(void)
+{
+ glClear(GL_COLOR_BUFFER_BIT);
+
+ glBegin(GL_LINE_STRIP);
+ glColor3f(0,0,.7);
+ glVertex3f( 0.9, -0.9, -30.0);
+ glColor3f(.8,0,0);
+ glVertex3f( 0.9, 0.9, -30.0);
+ glColor3f(0,.9,0);
+ glVertex3f(-0.9, 0.0, -30.0);
+ glColor3f(0,0,.7);
+ glVertex3f( 0.9, -0.9, -30.0);
+ glEnd();
+
+ glFlush();
+
+ if (doubleBuffer) {
+ glutSwapBuffers();
+ }
+}
+
+static GLenum Args(int argc, char **argv)
+{
+ GLint i;
+
+ doubleBuffer = GL_FALSE;
+
+ for (i = 1; i < argc; i++) {
+ if (strcmp(argv[i], "-sb") == 0) {
+ doubleBuffer = GL_FALSE;
+ } else if (strcmp(argv[i], "-db") == 0) {
+ doubleBuffer = GL_TRUE;
+ } else {
+ fprintf(stderr, "%s (Bad option).\n", argv[i]);
+ return GL_FALSE;
+ }
+ }
+ return GL_TRUE;
+}
+
+int main(int argc, char **argv)
+{
+ GLenum type;
+
+ glutInit(&argc, argv);
+
+ if (Args(argc, argv) == GL_FALSE) {
+ exit(1);
+ }
+
+ glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
+
+ type = GLUT_RGB;
+ type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
+ glutInitDisplayMode(type);
+
+ if (glutCreateWindow("First Tri") == GL_FALSE) {
+ exit(1);
+ }
+
+ Init();
+
+ glutReshapeFunc(Reshape);
+ glutKeyboardFunc(Key);
+ glutDisplayFunc(Draw);
+ glutMainLoop();
+ return 0;
+}
diff --git a/progs/trivial/long-fixed-func.c b/progs/trivial/long-fixed-func.c
new file mode 100644
index 00000000000..41ad25c1b3d
--- /dev/null
+++ b/progs/trivial/long-fixed-func.c
@@ -0,0 +1,152 @@
+/**
+ * Enable as much fixed-function vertex processing state as possible
+ * to test fixed-function -> program code generation.
+ */
+
+
+
+#include <GL/glew.h>
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <GL/glut.h>
+
+
+static void
+Reshape(int width, int height)
+{
+ glViewport(0, 0, (GLint)width, (GLint)height);
+ glMatrixMode(GL_PROJECTION);
+ glLoadIdentity();
+ glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
+ glMatrixMode(GL_MODELVIEW);
+}
+
+
+static void
+Draw(void)
+{
+ glClear(GL_COLOR_BUFFER_BIT);
+
+ glBegin(GL_TRIANGLES);
+ glColor3f(.8,0,0);
+ glVertex3f(-0.9, -0.9, -30.0);
+ glColor3f(0,.9,0);
+ glVertex3f( 0.9, -0.9, -30.0);
+ glColor3f(0,0,.7);
+ glVertex3f( 0.0, 0.9, -30.0);
+ glEnd();
+
+ glFlush();
+
+ glutSwapBuffers();
+}
+
+
+static void
+Init(void)
+{
+ GLubyte tex[16][16][4];
+ GLfloat pos[4] = {5, 10, 3, 1.0};
+ int i, j;
+
+ fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
+ fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
+ fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
+
+ glClearColor(0.3, 0.1, 0.3, 0.0);
+
+ for (i = 0; i < 16; i++) {
+ for (j = 0; j < 16; j++) {
+ if ((i+j) & 1) {
+ tex[i][j][0] = 100;
+ tex[i][j][1] = 100;
+ tex[i][j][2] = 100;
+ tex[i][j][3] = 255;
+ }
+ else {
+ tex[i][j][0] = 200;
+ tex[i][j][1] = 200;
+ tex[i][j][2] = 200;
+ tex[i][j][3] = 255;
+ }
+ }
+ }
+
+
+ glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, 1);
+ glFogi(GL_FOG_MODE, GL_LINEAR);
+ glEnable(GL_FOG);
+
+ glPointParameterfv(GL_DISTANCE_ATTENUATION_EXT, pos);
+
+ for (i = 0; i < 8; i++) {
+ GLuint texObj;
+
+ glEnable(GL_LIGHT0 + i);
+ glLightf(GL_LIGHT0 + i, GL_SPOT_EXPONENT, 3.5);
+ glLightf(GL_LIGHT0 + i, GL_SPOT_CUTOFF, 30.);
+ glLightf(GL_LIGHT0 + i, GL_CONSTANT_ATTENUATION, 3.);
+ glLightf(GL_LIGHT0 + i, GL_LINEAR_ATTENUATION, 3.);
+ glLightf(GL_LIGHT0 + i, GL_QUADRATIC_ATTENUATION, 3.);
+ glLightfv(GL_LIGHT0 + i, GL_POSITION, pos);
+
+ glActiveTexture(GL_TEXTURE0 + i);
+ glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_SPHERE_MAP);
+ glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, GL_SPHERE_MAP);
+ glTexGeni(GL_R, GL_TEXTURE_GEN_MODE, GL_EYE_LINEAR);
+ glTexGeni(GL_Q, GL_TEXTURE_GEN_MODE, GL_EYE_LINEAR);
+ glEnable(GL_TEXTURE_GEN_S);
+ glEnable(GL_TEXTURE_GEN_T);
+ glEnable(GL_TEXTURE_GEN_R);
+ glEnable(GL_TEXTURE_GEN_Q);
+ glEnable(GL_TEXTURE_2D);
+
+ glMatrixMode(GL_TEXTURE);
+ glScalef(2.0, 1.0, 3.0);
+
+ glGenTextures(1, &texObj);
+ glBindTexture(GL_TEXTURE_2D, texObj);
+ glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 16, 16, 0,
+ GL_RGBA, GL_UNSIGNED_BYTE, tex);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
+ glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
+ }
+
+ glEnable(GL_LIGHTING);
+ glActiveTexture(GL_TEXTURE0);
+ glMatrixMode(GL_MODELVIEW);
+}
+
+
+static void
+Key(unsigned char key, int x, int y)
+{
+ if (key == 27) {
+ exit(0);
+ }
+ glutPostRedisplay();
+}
+
+
+int
+main(int argc, char **argv)
+{
+ GLenum type = GLUT_RGB | GLUT_DOUBLE;
+
+ glutInit(&argc, argv);
+ glutInitWindowPosition(0, 0);
+ glutInitWindowSize( 250, 250);
+ glutInitDisplayMode(type);
+ if (glutCreateWindow("tri-long-fixedfunc") == GL_FALSE) {
+ exit(1);
+ }
+ glewInit();
+ glutReshapeFunc(Reshape);
+ glutKeyboardFunc(Key);
+ glutDisplayFunc(Draw);
+ Init();
+ glutMainLoop();
+ return 0;
+}
diff --git a/progs/trivial/pgon-mode.c b/progs/trivial/pgon-mode.c
new file mode 100644
index 00000000000..db586386196
--- /dev/null
+++ b/progs/trivial/pgon-mode.c
@@ -0,0 +1,136 @@
+/**
+ * Test glPolygonMode.
+ * A tri-strip w/ two tris is drawn so that the first tri is front-facing
+ * but the second tri is back-facing.
+ * Set glPolygonMode differently for the front/back faces
+ *
+ */
+
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <GL/glut.h>
+
+static int Win;
+static GLfloat Zrot = 0;
+static GLboolean FrontFillBackUnfilled = GL_TRUE;
+static GLboolean Lines = GL_TRUE;
+
+
+static void
+Draw(void)
+{
+ glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+
+ if (FrontFillBackUnfilled) {
+ if (Lines) {
+ printf("FrontMode = FILL, BackMode = LINE\n");
+ glPolygonMode(GL_BACK, GL_LINE);
+ }
+ else {
+ printf("FrontMode = FILL, BackMode = POINT\n");
+ glPolygonMode(GL_BACK, GL_POINT);
+ }
+ glPolygonMode(GL_FRONT, GL_FILL);
+ }
+ else {
+ if (Lines) {
+ printf("FrontMode = LINE, BackMode = FILL\n");
+ glPolygonMode(GL_FRONT, GL_LINE);
+ }
+ else {
+ printf("FrontMode = POINT, BackMode = FILL\n");
+ glPolygonMode(GL_FRONT, GL_POINT);
+ }
+ glPolygonMode(GL_BACK, GL_FILL);
+ }
+
+ glPushMatrix();
+ glRotatef(Zrot, 0, 0, 1);
+
+ glBegin(GL_TRIANGLE_STRIP);
+ glVertex2f(-1, 0);
+ glVertex2f( 1, 0);
+ glVertex2f(0, 1);
+ glVertex2f(0, -1);
+ glEnd();
+
+ glPopMatrix();
+
+ glutSwapBuffers();
+}
+
+
+static void
+Reshape(int width, int height)
+{
+ glViewport(0, 0, width, height);
+ glMatrixMode(GL_PROJECTION);
+ glLoadIdentity();
+ glFrustum(-1.0, 1.0, -1.0, 1.0, 5.0, 25.0);
+ glMatrixMode(GL_MODELVIEW);
+ glLoadIdentity();
+ glTranslatef(0.0, 0.0, -15.0);
+}
+
+
+static void
+Key(unsigned char key, int x, int y)
+{
+ const GLfloat step = 3.0;
+ (void) x;
+ (void) y;
+ switch (key) {
+ case 'p':
+ FrontFillBackUnfilled = !FrontFillBackUnfilled;
+ break;
+ case 'l':
+ Lines = !Lines;
+ break;
+ case 'z':
+ Zrot -= step;
+ break;
+ case 'Z':
+ Zrot += step;
+ break;
+ case 27:
+ glutDestroyWindow(Win);
+ exit(0);
+ break;
+ }
+ glutPostRedisplay();
+}
+
+
+static void
+Init(void)
+{
+ printf("GL_RENDERER = %s\n", (char*) glGetString(GL_RENDERER));
+
+ glLineWidth(3.0);
+ glPointSize(3.0);
+
+ glColor4f(1, 1, 1, 0.8);
+ glEnable(GL_BLEND);
+ glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+
+ printf("Press 'p' to toggle polygon mode\n");
+}
+
+
+int
+main(int argc, char *argv[])
+{
+ glutInit(&argc, argv);
+ glutInitWindowPosition(0, 0);
+ glutInitWindowSize(400, 400);
+ glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
+ Win = glutCreateWindow(argv[0]);
+ glutReshapeFunc(Reshape);
+ glutKeyboardFunc(Key);
+ glutDisplayFunc(Draw);
+ Init();
+ glutMainLoop();
+ return 0;
+}
diff --git a/progs/trivial/point-clip.c b/progs/trivial/point-clip.c
index 32792047c64..7fec54e1db9 100644
--- a/progs/trivial/point-clip.c
+++ b/progs/trivial/point-clip.c
@@ -120,7 +120,7 @@ int main(int argc, char **argv)
glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
- type = GLUT_RGB;
+ type = GLUT_RGB | GLUT_ALPHA;
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
diff --git a/progs/trivial/point-param.c b/progs/trivial/point-param.c
index 02500cd34e8..1edeec3468a 100644
--- a/progs/trivial/point-param.c
+++ b/progs/trivial/point-param.c
@@ -22,7 +22,7 @@
* OF THIS SOFTWARE.
*/
-#define GL_GLEXT_PROTOTYPES
+#include <GL/glew.h>
#include <math.h>
#include <stdio.h>
#include <string.h>
@@ -138,7 +138,7 @@ int main(int argc, char **argv)
glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
- type = GLUT_RGB;
+ type = GLUT_RGB | GLUT_ALPHA;
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
@@ -146,6 +146,8 @@ int main(int argc, char **argv)
exit(1);
}
+ glewInit();
+
Init();
glutReshapeFunc(Reshape);
diff --git a/progs/trivial/point-sprite.c b/progs/trivial/point-sprite.c
new file mode 100644
index 00000000000..583bdca1b71
--- /dev/null
+++ b/progs/trivial/point-sprite.c
@@ -0,0 +1,174 @@
+/*
+ * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and
+ * its documentation for any purpose is hereby granted without fee, provided
+ * that (i) the above copyright notices and this permission notice appear in
+ * all copies of the software and related documentation, and (ii) the name of
+ * Silicon Graphics may not be used in any advertising or
+ * publicity relating to the software without the specific, prior written
+ * permission of Silicon Graphics.
+ *
+ * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF
+ * ANY KIND,
+ * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
+ * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * IN NO EVENT SHALL SILICON GRAPHICS BE LIABLE FOR
+ * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
+ * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
+ * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+ * OF THIS SOFTWARE.
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <GL/glut.h>
+
+
+#define CI_OFFSET_1 16
+#define CI_OFFSET_2 32
+
+
+GLenum doubleBuffer;
+
+static void Init(void)
+{
+ fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
+ fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
+ fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
+
+
+#define SIZE 16
+ {
+ GLubyte tex2d[SIZE][SIZE][3];
+ GLint s, t;
+
+ for (s = 0; s < SIZE; s++) {
+ for (t = 0; t < SIZE; t++) {
+#if 1
+ tex2d[t][s][0] = (s < SIZE/2) ? 0 : 255;
+ tex2d[t][s][1] = (t < SIZE/2) ? 0 : 255;
+ tex2d[t][s][2] = 0;
+#else
+ tex2d[t][s][0] = s*255/(SIZE-1);
+ tex2d[t][s][1] = t*255/(SIZE-1);
+ tex2d[t][s][2] = 0;
+#endif
+ }
+ }
+
+ glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
+ glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_R, GL_REPEAT);
+ glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
+ glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
+
+ glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
+ glTexImage2D(GL_TEXTURE_2D, 0, 3, SIZE, SIZE, 0,
+ GL_RGB, GL_UNSIGNED_BYTE, tex2d);
+ glPixelStorei(GL_UNPACK_ALIGNMENT, 4);
+ glEnable(GL_TEXTURE_2D);
+ }
+
+ glEnable(GL_POINT_SPRITE);
+
+ glClearColor(0.0, 0.0, 1.0, 0.0);
+}
+
+static void Reshape(int width, int height)
+{
+
+ glViewport(0, 0, (GLint)width, (GLint)height);
+
+ glMatrixMode(GL_PROJECTION);
+ glLoadIdentity();
+ glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
+ glMatrixMode(GL_MODELVIEW);
+}
+
+static void Key(unsigned char key, int x, int y)
+{
+
+ switch (key) {
+ case 27:
+ exit(1);
+ default:
+ return;
+ }
+
+ glutPostRedisplay();
+}
+
+static void Draw(void)
+{
+ glClear(GL_COLOR_BUFFER_BIT);
+
+ glPointSize(16.0);
+
+ glBegin(GL_POINTS);
+ glColor3f(1,0,0);
+ glVertex3f( 0.6, -0.6, -30.0);
+ glColor3f(1,1,0);
+ glVertex3f( 0.6, 0.6, -30.0);
+ glColor3f(1,0,1);
+ glVertex3f(-0.6, 0.6, -30.0);
+ glColor3f(0,1,1);
+ glVertex3f(-0.6, -0.6, -30.0);
+ glEnd();
+
+ glFlush();
+
+ if (doubleBuffer) {
+ glutSwapBuffers();
+ }
+}
+
+static GLenum Args(int argc, char **argv)
+{
+ GLint i;
+
+ doubleBuffer = GL_FALSE;
+
+ for (i = 1; i < argc; i++) {
+ if (strcmp(argv[i], "-sb") == 0) {
+ doubleBuffer = GL_FALSE;
+ } else if (strcmp(argv[i], "-db") == 0) {
+ doubleBuffer = GL_TRUE;
+ } else {
+ fprintf(stderr, "%s (Bad option).\n", argv[i]);
+ return GL_FALSE;
+ }
+ }
+ return GL_TRUE;
+}
+
+int main(int argc, char **argv)
+{
+ GLenum type;
+
+ glutInit(&argc, argv);
+
+ if (Args(argc, argv) == GL_FALSE) {
+ exit(1);
+ }
+
+ glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
+
+ type = GLUT_RGB;
+ type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
+ glutInitDisplayMode(type);
+
+ if (glutCreateWindow("First Tri") == GL_FALSE) {
+ exit(1);
+ }
+
+ Init();
+
+ glutReshapeFunc(Reshape);
+ glutKeyboardFunc(Key);
+ glutDisplayFunc(Draw);
+ glutMainLoop();
+ return 0;
+}
diff --git a/progs/trivial/point-wide-smooth.c b/progs/trivial/point-wide-smooth.c
new file mode 100644
index 00000000000..55cbcaec70b
--- /dev/null
+++ b/progs/trivial/point-wide-smooth.c
@@ -0,0 +1,145 @@
+/*
+ * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and
+ * its documentation for any purpose is hereby granted without fee, provided
+ * that (i) the above copyright notices and this permission notice appear in
+ * all copies of the software and related documentation, and (ii) the name of
+ * Silicon Graphics may not be used in any advertising or
+ * publicity relating to the software without the specific, prior written
+ * permission of Silicon Graphics.
+ *
+ * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF
+ * ANY KIND,
+ * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
+ * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * IN NO EVENT SHALL SILICON GRAPHICS BE LIABLE FOR
+ * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
+ * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
+ * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+ * OF THIS SOFTWARE.
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <GL/glut.h>
+
+
+#define CI_OFFSET_1 16
+#define CI_OFFSET_2 32
+
+
+GLenum doubleBuffer;
+
+
+static void Init(void)
+{
+ fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
+ fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
+ fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
+
+ glClearColor(0.0, 0.0, 1.0, 0.0);
+}
+
+static void Reshape(int width, int height)
+{
+
+ glViewport(0, 0, (GLint)width, (GLint)height);
+
+ glMatrixMode(GL_PROJECTION);
+ glLoadIdentity();
+ glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
+ glMatrixMode(GL_MODELVIEW);
+}
+
+static void Key(unsigned char key, int x, int y)
+{
+
+ switch (key) {
+ case 27:
+ exit(1);
+ default:
+ return;
+ }
+
+ glutPostRedisplay();
+}
+
+static void Draw(void)
+{
+ glClear(GL_COLOR_BUFFER_BIT);
+
+ glPointSize(8.0);
+
+ glEnable(GL_POINT_SMOOTH);
+ glEnable(GL_BLEND);
+ glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+
+ glBegin(GL_POINTS);
+ glColor3f(1,0,0);
+ glVertex3f( 0.9, -0.9, -30.0);
+ glColor3f(1,1,0);
+ glVertex3f( 0.9, 0.9, -30.0);
+ glColor3f(1,0,1);
+ glVertex3f(-0.9, 0.9, -30.0);
+ glColor3f(0,1,1);
+ glVertex3f(-0.9, -0.9, -30.0);
+ glEnd();
+
+ glFlush();
+
+ if (doubleBuffer) {
+ glutSwapBuffers();
+ }
+}
+
+static GLenum Args(int argc, char **argv)
+{
+ GLint i;
+
+ doubleBuffer = GL_FALSE;
+
+ for (i = 1; i < argc; i++) {
+ if (strcmp(argv[i], "-sb") == 0) {
+ doubleBuffer = GL_FALSE;
+ } else if (strcmp(argv[i], "-db") == 0) {
+ doubleBuffer = GL_TRUE;
+ } else {
+ fprintf(stderr, "%s (Bad option).\n", argv[i]);
+ return GL_FALSE;
+ }
+ }
+ return GL_TRUE;
+}
+
+int main(int argc, char **argv)
+{
+ GLenum type;
+
+ glutInit(&argc, argv);
+
+ if (Args(argc, argv) == GL_FALSE) {
+ exit(1);
+ }
+
+ glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
+
+ type = GLUT_RGB | GLUT_ALPHA;
+ type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
+ glutInitDisplayMode(type);
+
+ if (glutCreateWindow("First Tri") == GL_FALSE) {
+ exit(1);
+ }
+
+ Init();
+
+ glutReshapeFunc(Reshape);
+ glutKeyboardFunc(Key);
+ glutDisplayFunc(Draw);
+ glutMainLoop();
+ return 0;
+}
diff --git a/progs/trivial/point-wide.c b/progs/trivial/point-wide.c
index 473ca043f1d..265b20097b1 100644
--- a/progs/trivial/point-wide.c
+++ b/progs/trivial/point-wide.c
@@ -34,6 +34,7 @@
GLenum doubleBuffer;
+
static void Init(void)
{
fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
@@ -70,6 +71,7 @@ static void Key(unsigned char key, int x, int y)
static void Draw(void)
{
glClear(GL_COLOR_BUFFER_BIT);
+ glDisable(GL_DEPTH_TEST);
glPointSize(8.0);
@@ -122,7 +124,7 @@ int main(int argc, char **argv)
glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
- type = GLUT_RGB;
+ type = GLUT_RGB | GLUT_ALPHA;
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
diff --git a/progs/trivial/point.c b/progs/trivial/point.c
index 87465bfb2c1..8dabfb6ca64 100644
--- a/progs/trivial/point.c
+++ b/progs/trivial/point.c
@@ -120,7 +120,7 @@ int main(int argc, char **argv)
glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
- type = GLUT_RGB;
+ type = GLUT_RGB | GLUT_ALPHA;
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
diff --git a/progs/trivial/poly-flat-clip.c b/progs/trivial/poly-flat-clip.c
new file mode 100644
index 00000000000..72c2a29a0d2
--- /dev/null
+++ b/progs/trivial/poly-flat-clip.c
@@ -0,0 +1,140 @@
+/*
+ * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and
+ * its documentation for any purpose is hereby granted without fee, provided
+ * that (i) the above copyright notices and this permission notice appear in
+ * all copies of the software and related documentation, and (ii) the name of
+ * Silicon Graphics may not be used in any advertising or
+ * publicity relating to the software without the specific, prior written
+ * permission of Silicon Graphics.
+ *
+ * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF
+ * ANY KIND,
+ * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
+ * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * IN NO EVENT SHALL SILICON GRAPHICS BE LIABLE FOR
+ * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
+ * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
+ * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+ * OF THIS SOFTWARE.
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <GL/glut.h>
+
+
+#define CI_OFFSET_1 16
+#define CI_OFFSET_2 32
+
+
+GLenum doubleBuffer;
+
+static void Init(void)
+{
+ fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
+ fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
+ fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
+
+ glClearColor(0.0, 0.0, 1.0, 0.0);
+}
+
+static void Reshape(int width, int height)
+{
+
+ glViewport(0, 0, (GLint)width, (GLint)height);
+
+ glMatrixMode(GL_PROJECTION);
+ glLoadIdentity();
+ glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
+ glMatrixMode(GL_MODELVIEW);
+}
+
+static void Key(unsigned char key, int x, int y)
+{
+
+ switch (key) {
+ case 27:
+ exit(1);
+ default:
+ return;
+ }
+
+ glutPostRedisplay();
+}
+
+static void Draw(void)
+{
+ glClear(GL_COLOR_BUFFER_BIT);
+ glShadeModel(GL_FLAT);
+
+
+ glBegin(GL_POLYGON);
+ glColor3f(1,0,0);
+ glVertex3f( 0, 0, -30.0);
+ glColor3f(1,1,0);
+ glVertex3f( 1.3, 1.1, -30.0);
+ glColor3f(1,0,1);
+ glVertex3f(-.9, .9, -30.0);
+ glColor3f(0,1,1);
+ glVertex3f(-1.1, -1.3, -30.0);
+ glEnd();
+
+ glFlush();
+
+ if (doubleBuffer) {
+ glutSwapBuffers();
+ }
+}
+
+static GLenum Args(int argc, char **argv)
+{
+ GLint i;
+
+ doubleBuffer = GL_FALSE;
+
+ for (i = 1; i < argc; i++) {
+ if (strcmp(argv[i], "-sb") == 0) {
+ doubleBuffer = GL_FALSE;
+ } else if (strcmp(argv[i], "-db") == 0) {
+ doubleBuffer = GL_TRUE;
+ } else {
+ fprintf(stderr, "%s (Bad option).\n", argv[i]);
+ return GL_FALSE;
+ }
+ }
+ return GL_TRUE;
+}
+
+int main(int argc, char **argv)
+{
+ GLenum type;
+
+ glutInit(&argc, argv);
+
+ if (Args(argc, argv) == GL_FALSE) {
+ exit(1);
+ }
+
+ glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
+
+ type = GLUT_RGB;
+ type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
+ glutInitDisplayMode(type);
+
+ if (glutCreateWindow("First Tri") == GL_FALSE) {
+ exit(1);
+ }
+
+ Init();
+
+ glutReshapeFunc(Reshape);
+ glutKeyboardFunc(Key);
+ glutDisplayFunc(Draw);
+ glutMainLoop();
+ return 0;
+}
diff --git a/progs/trivial/poly-flat-unfilled-clip.c b/progs/trivial/poly-flat-unfilled-clip.c
new file mode 100644
index 00000000000..d3a14a516a4
--- /dev/null
+++ b/progs/trivial/poly-flat-unfilled-clip.c
@@ -0,0 +1,144 @@
+/*
+ * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and
+ * its documentation for any purpose is hereby granted without fee, provided
+ * that (i) the above copyright notices and this permission notice appear in
+ * all copies of the software and related documentation, and (ii) the name of
+ * Silicon Graphics may not be used in any advertising or
+ * publicity relating to the software without the specific, prior written
+ * permission of Silicon Graphics.
+ *
+ * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF
+ * ANY KIND,
+ * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
+ * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * IN NO EVENT SHALL SILICON GRAPHICS BE LIABLE FOR
+ * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
+ * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
+ * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+ * OF THIS SOFTWARE.
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <GL/glut.h>
+
+
+#define CI_OFFSET_1 16
+#define CI_OFFSET_2 32
+
+
+GLenum doubleBuffer;
+
+static void Init(void)
+{
+ fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
+ fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
+ fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
+
+ glClearColor(0.0, 0.0, 1.0, 0.0);
+}
+
+static void Reshape(int width, int height)
+{
+
+ glViewport(0, 0, (GLint)width, (GLint)height);
+
+ glMatrixMode(GL_PROJECTION);
+ glLoadIdentity();
+ glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
+ glMatrixMode(GL_MODELVIEW);
+}
+
+static void Key(unsigned char key, int x, int y)
+{
+
+ switch (key) {
+ case 27:
+ exit(1);
+ default:
+ return;
+ }
+
+ glutPostRedisplay();
+}
+
+static void Draw(void)
+{
+ glClear(GL_COLOR_BUFFER_BIT);
+ glShadeModel(GL_FLAT);
+
+ glPolygonMode(GL_FRONT, GL_LINE);
+ glPolygonMode(GL_BACK, GL_LINE);
+ glLineWidth(4.0);
+
+
+ glBegin(GL_POLYGON);
+ glColor3f(1,0,0);
+ glVertex3f( 0, 0, -30.0);
+ glColor3f(1,1,0);
+ glVertex3f( 1.3, 1.1, -30.0);
+ glColor3f(1,0,1);
+ glVertex3f(-.9, .9, -30.0);
+ glColor3f(0,1,1);
+ glVertex3f(-1.1, -1.3, -30.0);
+ glEnd();
+
+ glFlush();
+
+ if (doubleBuffer) {
+ glutSwapBuffers();
+ }
+}
+
+static GLenum Args(int argc, char **argv)
+{
+ GLint i;
+
+ doubleBuffer = GL_FALSE;
+
+ for (i = 1; i < argc; i++) {
+ if (strcmp(argv[i], "-sb") == 0) {
+ doubleBuffer = GL_FALSE;
+ } else if (strcmp(argv[i], "-db") == 0) {
+ doubleBuffer = GL_TRUE;
+ } else {
+ fprintf(stderr, "%s (Bad option).\n", argv[i]);
+ return GL_FALSE;
+ }
+ }
+ return GL_TRUE;
+}
+
+int main(int argc, char **argv)
+{
+ GLenum type;
+
+ glutInit(&argc, argv);
+
+ if (Args(argc, argv) == GL_FALSE) {
+ exit(1);
+ }
+
+ glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
+
+ type = GLUT_RGB;
+ type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
+ glutInitDisplayMode(type);
+
+ if (glutCreateWindow("First Tri") == GL_FALSE) {
+ exit(1);
+ }
+
+ Init();
+
+ glutReshapeFunc(Reshape);
+ glutKeyboardFunc(Key);
+ glutDisplayFunc(Draw);
+ glutMainLoop();
+ return 0;
+}
diff --git a/progs/trivial/poly-flat.c b/progs/trivial/poly-flat.c
index 747b24dc0ce..a847d6828a7 100644
--- a/progs/trivial/poly-flat.c
+++ b/progs/trivial/poly-flat.c
@@ -122,7 +122,7 @@ int main(int argc, char **argv)
glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
- type = GLUT_RGB;
+ type = GLUT_RGB | GLUT_ALPHA;
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
diff --git a/progs/trivial/poly-unfilled.c b/progs/trivial/poly-unfilled.c
index e0ae463b083..ae092a830ab 100644
--- a/progs/trivial/poly-unfilled.c
+++ b/progs/trivial/poly-unfilled.c
@@ -121,7 +121,7 @@ int main(int argc, char **argv)
glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
- type = GLUT_RGB;
+ type = GLUT_RGB | GLUT_ALPHA;
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
diff --git a/progs/trivial/poly.c b/progs/trivial/poly.c
index bdb9e27aa91..2f254de4815 100644
--- a/progs/trivial/poly.c
+++ b/progs/trivial/poly.c
@@ -120,7 +120,7 @@ int main(int argc, char **argv)
glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
- type = GLUT_RGB;
+ type = GLUT_RGB | GLUT_ALPHA;
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
diff --git a/progs/trivial/psb_context.c b/progs/trivial/psb_context.c
new file mode 100644
index 00000000000..e69de29bb2d
--- /dev/null
+++ b/progs/trivial/psb_context.c
diff --git a/progs/trivial/quad-clip-all-vertices.c b/progs/trivial/quad-clip-all-vertices.c
index 019ef0c479a..3e0f3d94948 100644
--- a/progs/trivial/quad-clip-all-vertices.c
+++ b/progs/trivial/quad-clip-all-vertices.c
@@ -120,7 +120,7 @@ int main(int argc, char **argv)
glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
- type = GLUT_RGB;
+ type = GLUT_RGB | GLUT_ALPHA;
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
diff --git a/progs/trivial/quad-clip-nearplane.c b/progs/trivial/quad-clip-nearplane.c
index be9b9c619ae..1e8056c474b 100644
--- a/progs/trivial/quad-clip-nearplane.c
+++ b/progs/trivial/quad-clip-nearplane.c
@@ -133,7 +133,7 @@ int main(int argc, char **argv)
glutInitWindowPosition(0, 0);
glutInitWindowSize( 250, 250);
- type = GLUT_RGB;
+ type = GLUT_RGB | GLUT_ALPHA;
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
diff --git a/progs/trivial/quad-clip.c b/progs/trivial/quad-clip.c
index 9f3a45caec3..504fef3dc59 100644
--- a/progs/trivial/quad-clip.c
+++ b/progs/trivial/quad-clip.c
@@ -120,7 +120,7 @@ int main(int argc, char **argv)
glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
- type = GLUT_RGB;
+ type = GLUT_RGB | GLUT_ALPHA;
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
diff --git a/progs/trivial/quad-degenerate.c b/progs/trivial/quad-degenerate.c
index b14b0f1d879..83047408573 100644
--- a/progs/trivial/quad-degenerate.c
+++ b/progs/trivial/quad-degenerate.c
@@ -125,7 +125,7 @@ int main(int argc, char **argv)
glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
- type = GLUT_RGB;
+ type = GLUT_RGB | GLUT_ALPHA;
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
diff --git a/progs/trivial/quad-flat.c b/progs/trivial/quad-flat.c
index d6e9f021206..bd8be7c43e3 100644
--- a/progs/trivial/quad-flat.c
+++ b/progs/trivial/quad-flat.c
@@ -130,7 +130,7 @@ int main(int argc, char **argv)
glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
- type = GLUT_RGB;
+ type = GLUT_RGB | GLUT_ALPHA;
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
diff --git a/progs/trivial/quad-offset-factor.c b/progs/trivial/quad-offset-factor.c
index 861d3461c04..90943d908ff 100644
--- a/progs/trivial/quad-offset-factor.c
+++ b/progs/trivial/quad-offset-factor.c
@@ -27,11 +27,6 @@
#include <stdlib.h>
#include <GL/glut.h>
-
-#define CI_OFFSET_1 16
-#define CI_OFFSET_2 32
-
-
GLenum doubleBuffer;
static void Init(void)
@@ -45,7 +40,6 @@ static void Init(void)
static void Reshape(int width, int height)
{
-
glViewport(0, 0, (GLint)width, (GLint)height);
glMatrixMode(GL_PROJECTION);
@@ -56,7 +50,6 @@ static void Reshape(int width, int height)
static void Key(unsigned char key, int x, int y)
{
-
switch (key) {
case 27:
exit(1);
@@ -75,7 +68,6 @@ static void quad( float half )
glVertex3f(-half/9.0, half/9.0, -25.0 - half);
glVertex3f(-half/9.0, -half/9.0, -25.0 - half);
glEnd();
-
}
static void Draw(void)
@@ -83,27 +75,24 @@ static void Draw(void)
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glEnable(GL_DEPTH_TEST);
-
-
+ /* red: offset back */
glEnable(GL_POLYGON_OFFSET_FILL);
glPolygonOffset(1, 0);
-
glColor3f(1,0,0);
quad(9);
+ /* green: no offset */
glDisable(GL_POLYGON_OFFSET_FILL);
glColor3f(0,1,0);
quad(6);
-
+ /* black: offset zero, should not be visible because of z test */
glEnable(GL_POLYGON_OFFSET_FILL);
glPolygonOffset(0, 0);
-
- /* Black - should not be visible
- */
glColor3f(0,0,0);
quad(6);
+ /* blue: offset forward */
glEnable(GL_POLYGON_OFFSET_FILL);
glPolygonOffset(-1, 0);
glColor3f(0,0,1);
@@ -149,7 +138,7 @@ int main(int argc, char **argv)
glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
- type = GLUT_RGB | GLUT_DEPTH;
+ type = GLUT_RGB | GLUT_ALPHA | GLUT_DEPTH;
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
@@ -163,5 +152,5 @@ int main(int argc, char **argv)
glutKeyboardFunc(Key);
glutDisplayFunc(Draw);
glutMainLoop();
- return 0;
+ return 0;
}
diff --git a/progs/trivial/quad-offset-unfilled.c b/progs/trivial/quad-offset-unfilled.c
index 1cecf3c1cef..1ad44cdcaec 100644
--- a/progs/trivial/quad-offset-unfilled.c
+++ b/progs/trivial/quad-offset-unfilled.c
@@ -72,6 +72,8 @@ static void Draw(void)
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glEnable(GL_DEPTH_TEST);
+ glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
+
glEnable(GL_POLYGON_OFFSET_FILL);
@@ -95,7 +97,7 @@ static void Draw(void)
glVertex3f(-0.6, -0.6, -35.0);
glEnd();
- glEnable(GL_POLYGON_OFFSET_FILL);
+ glEnable(GL_POLYGON_OFFSET_LINE);
glPolygonOffset(-1, 0);
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
@@ -149,7 +151,7 @@ int main(int argc, char **argv)
glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
- type = GLUT_RGB | GLUT_DEPTH;
+ type = GLUT_RGB | GLUT_ALPHA | GLUT_DEPTH;
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
diff --git a/progs/trivial/quad-offset-units.c b/progs/trivial/quad-offset-units.c
index 5c41be308ee..d5db21469e6 100644
--- a/progs/trivial/quad-offset-units.c
+++ b/progs/trivial/quad-offset-units.c
@@ -27,11 +27,6 @@
#include <stdlib.h>
#include <GL/glut.h>
-
-#define CI_OFFSET_1 16
-#define CI_OFFSET_2 32
-
-
GLenum doubleBuffer;
static void Init(void)
@@ -45,7 +40,6 @@ static void Init(void)
static void Reshape(int width, int height)
{
-
glViewport(0, 0, (GLint)width, (GLint)height);
glMatrixMode(GL_PROJECTION);
@@ -56,7 +50,6 @@ static void Reshape(int width, int height)
static void Key(unsigned char key, int x, int y)
{
-
switch (key) {
case 27:
exit(1);
@@ -75,7 +68,6 @@ static void quad( float half )
glVertex3f(-half/9.0, half/9.0, -25.0 - half);
glVertex3f(-half/9.0, -half/9.0, -25.0 - half);
glEnd();
-
}
static void Draw(void)
@@ -83,27 +75,26 @@ static void Draw(void)
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glEnable(GL_DEPTH_TEST);
-
-
+ /* red: offset back */
glEnable(GL_POLYGON_OFFSET_FILL);
glPolygonOffset(0, 4);
-
glColor3f(1,0,0);
quad(9);
+ /* black: no offset */
glDisable(GL_POLYGON_OFFSET_FILL);
glColor3f(0,0,0);
quad(6);
+ /* green: offset 0 (this should obscure the black quad) */
glEnable(GL_POLYGON_OFFSET_FILL);
glPolygonOffset(0, 0);
-
glDepthFunc( GL_EQUAL );
glColor3f(0,1,0);
quad(6);
- glDepthFunc( GL_LESS );
-
+ /* blue: offset forward */
+ glDepthFunc( GL_LESS );
glPolygonOffset(0, -4);
glColor3f(0,0,1);
quad(3);
@@ -148,7 +139,7 @@ int main(int argc, char **argv)
glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
- type = GLUT_RGB | GLUT_DEPTH;
+ type = GLUT_RGB | GLUT_ALPHA | GLUT_DEPTH;
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
@@ -162,5 +153,5 @@ int main(int argc, char **argv)
glutKeyboardFunc(Key);
glutDisplayFunc(Draw);
glutMainLoop();
- return 0;
+ return 0;
}
diff --git a/progs/trivial/quad-tex-2d.c b/progs/trivial/quad-tex-2d.c
index 70b9fbf8c61..97c9fc54d86 100644
--- a/progs/trivial/quad-tex-2d.c
+++ b/progs/trivial/quad-tex-2d.c
@@ -27,11 +27,11 @@
#include <stdlib.h>
#include <GL/glut.h>
-
-#define CI_OFFSET_1 16
-#define CI_OFFSET_2 32
-
+static GLenum Target = GL_TEXTURE_2D;
+static GLenum Filter = GL_NEAREST;
GLenum doubleBuffer;
+static float Rot = 0;
+static int win = 0;
static void Init(void)
{
@@ -41,7 +41,7 @@ static void Init(void)
glClearColor(0.0, 0.0, 1.0, 0.0);
-#define SIZE 16
+#define SIZE 32
{
GLubyte tex2d[SIZE][SIZE][3];
GLint s, t;
@@ -60,59 +60,77 @@ static void Init(void)
}
}
+ glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
+
+ if (Target == GL_TEXTURE_1D)
+ glTexImage1D(Target, 0, 3, SIZE, 0, GL_RGB, GL_UNSIGNED_BYTE, tex2d);
+ else
+ glTexImage2D(Target, 0, 3, SIZE, SIZE, 0,
+ GL_RGB, GL_UNSIGNED_BYTE, tex2d);
+
+ glEnable(Target);
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
- glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_R, GL_REPEAT);
- glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
- glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
+ glTexParameterf(Target, GL_TEXTURE_WRAP_R, GL_REPEAT);
+ glTexParameterf(Target, GL_TEXTURE_MIN_FILTER, Filter);
+ glTexParameterf(Target, GL_TEXTURE_MAG_FILTER, Filter);
- glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
- glTexImage2D(GL_TEXTURE_2D, 0, 3, SIZE, SIZE, 0,
- GL_RGB, GL_UNSIGNED_BYTE, tex2d);
glPixelStorei(GL_UNPACK_ALIGNMENT, 4);
- glEnable(GL_TEXTURE_2D);
}
-
}
static void Reshape(int width, int height)
{
-
- glViewport(0, 0, (GLint)width, (GLint)height);
-
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
- glMatrixMode(GL_MODELVIEW);
+ glViewport(0, 0, (GLint)width, (GLint)height);
+ glMatrixMode(GL_PROJECTION);
+ glLoadIdentity();
+#if 0
+ glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
+#else
+ glFrustum(-1, 1, -1, 1, 10, 20);
+#endif
+ glMatrixMode(GL_MODELVIEW);
+ glLoadIdentity();
+ glTranslatef(0, 0, -15);
}
static void Key(unsigned char key, int x, int y)
{
-
- switch (key) {
- case 27:
- exit(1);
- default:
- return;
- }
-
- glutPostRedisplay();
+ switch (key) {
+ case 'r':
+ Rot += 10.0;
+ break;
+ case 'R':
+ Rot -= 10.0;
+ break;
+ case 27:
+ glutDestroyWindow(win);
+ exit(0);
+ default:
+ return;
+ }
+ glutPostRedisplay();
}
static void Draw(void)
{
glClear(GL_COLOR_BUFFER_BIT);
+ glPushMatrix();
+ glRotatef(Rot, 0, 1, 0);
+
glBegin(GL_QUADS);
glTexCoord2f(1,0);
- glVertex3f( 0.9, -0.9, -30.0);
+ glVertex3f( 0.9, -0.9, 0.0);
glTexCoord2f(1,1);
- glVertex3f( 0.9, 0.9, -30.0);
+ glVertex3f( 0.9, 0.9, 0.0);
glTexCoord2f(0,1);
- glVertex3f(-0.9, 0.9, -30.0);
+ glVertex3f(-0.9, 0.9, 0.0);
glTexCoord2f(0,0);
- glVertex3f(-0.9, -0.9, -30.0);
+ glVertex3f(-0.9, -0.9, 0.0);
glEnd();
+ glPopMatrix();
+
glFlush();
if (doubleBuffer) {
@@ -155,7 +173,8 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ win = glutCreateWindow("First Tri");
+ if (!win) {
exit(1);
}
@@ -165,5 +184,5 @@ int main(int argc, char **argv)
glutKeyboardFunc(Key);
glutDisplayFunc(Draw);
glutMainLoop();
- return 0;
+ return 0;
}
diff --git a/progs/trivial/quad-tex-3d.c b/progs/trivial/quad-tex-3d.c
index 0b2dcc08a5f..ca7ea91d2f3 100644
--- a/progs/trivial/quad-tex-3d.c
+++ b/progs/trivial/quad-tex-3d.c
@@ -25,6 +25,7 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
+#include <GL/glew.h>
#include <GL/glut.h>
@@ -159,7 +160,7 @@ int main(int argc, char **argv)
glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
- type = GLUT_RGB;
+ type = GLUT_RGB | GLUT_ALPHA;
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
@@ -167,6 +168,8 @@ int main(int argc, char **argv)
exit(1);
}
+ glewInit();
+
Init();
glutReshapeFunc(Reshape);
diff --git a/progs/trivial/quad-tex-alpha.c b/progs/trivial/quad-tex-alpha.c
new file mode 100644
index 00000000000..cd73f013eb0
--- /dev/null
+++ b/progs/trivial/quad-tex-alpha.c
@@ -0,0 +1,170 @@
+/*
+ * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and
+ * its documentation for any purpose is hereby granted without fee, provided
+ * that (i) the above copyright notices and this permission notice appear in
+ * all copies of the software and related documentation, and (ii) the name of
+ * Silicon Graphics may not be used in any advertising or
+ * publicity relating to the software without the specific, prior written
+ * permission of Silicon Graphics.
+ *
+ * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF
+ * ANY KIND,
+ * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
+ * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * IN NO EVENT SHALL SILICON GRAPHICS BE LIABLE FOR
+ * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
+ * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
+ * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+ * OF THIS SOFTWARE.
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <GL/glut.h>
+
+
+#define CI_OFFSET_1 16
+#define CI_OFFSET_2 32
+
+
+GLenum doubleBuffer;
+
+static void Init(void)
+{
+ fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
+ fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
+ fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
+
+ glClearColor(0.0, 0.0, 1.0, 0.0);
+
+#define SIZE 16
+ {
+ GLubyte tex2d[SIZE][SIZE][4];
+ GLint s, t;
+
+ for (s = 0; s < SIZE; s++) {
+ for (t = 0; t < SIZE; t++) {
+ tex2d[t][s][0] = (s < SIZE/2) ? 0 : 255;
+ tex2d[t][s][1] = (t < SIZE/2) ? 0 : 255;
+ tex2d[t][s][2] = 0;
+ tex2d[t][s][3] = ((t^s) & 3) * 63;
+ }
+ }
+
+ glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
+ glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_R, GL_REPEAT);
+ glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
+ glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
+
+ glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
+ glTexImage2D(GL_TEXTURE_2D, 0, 4, SIZE, SIZE, 0,
+ GL_RGBA, GL_UNSIGNED_BYTE, tex2d);
+ glPixelStorei(GL_UNPACK_ALIGNMENT, 4);
+ glEnable(GL_TEXTURE_2D);
+ }
+}
+
+static void Reshape(int width, int height)
+{
+
+ glViewport(0, 0, (GLint)width, (GLint)height);
+
+ glMatrixMode(GL_PROJECTION);
+ glLoadIdentity();
+ glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
+ glMatrixMode(GL_MODELVIEW);
+}
+
+static void Key(unsigned char key, int x, int y)
+{
+
+ switch (key) {
+ case 27:
+ exit(1);
+ default:
+ return;
+ }
+
+ glutPostRedisplay();
+}
+
+static void Draw(void)
+{
+ glClear(GL_COLOR_BUFFER_BIT);
+
+ glDisable(GL_DEPTH_TEST);
+ glDisable(GL_STENCIL_TEST);
+ glEnable(GL_ALPHA_TEST);
+ glAlphaFunc(GL_GEQUAL, 0.5);
+
+ glBegin(GL_QUADS);
+ glTexCoord2f(1,0);
+ glVertex3f( 0.9, -0.9, -30.0);
+ glTexCoord2f(1,1);
+ glVertex3f( 0.9, 0.9, -30.0);
+ glTexCoord2f(0,1);
+ glVertex3f(-0.9, 0.9, -30.0);
+ glTexCoord2f(0,0);
+ glVertex3f(-0.9, -0.9, -30.0);
+ glEnd();
+
+
+ glFlush();
+
+ if (doubleBuffer) {
+ glutSwapBuffers();
+ }
+}
+
+static GLenum Args(int argc, char **argv)
+{
+ GLint i;
+
+ doubleBuffer = GL_FALSE;
+
+ for (i = 1; i < argc; i++) {
+ if (strcmp(argv[i], "-sb") == 0) {
+ doubleBuffer = GL_FALSE;
+ } else if (strcmp(argv[i], "-db") == 0) {
+ doubleBuffer = GL_TRUE;
+ } else {
+ fprintf(stderr, "%s (Bad option).\n", argv[i]);
+ return GL_FALSE;
+ }
+ }
+ return GL_TRUE;
+}
+
+int main(int argc, char **argv)
+{
+ GLenum type;
+
+ glutInit(&argc, argv);
+
+ if (Args(argc, argv) == GL_FALSE) {
+ exit(1);
+ }
+
+ glutInitWindowPosition(100, 0); glutInitWindowSize( 250, 250);
+
+ type = GLUT_RGB;
+ type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
+ glutInitDisplayMode(type);
+
+ if (glutCreateWindow("First Tri") == GL_FALSE) {
+ exit(1);
+ }
+
+ Init();
+
+ glutReshapeFunc(Reshape);
+ glutKeyboardFunc(Key);
+ glutDisplayFunc(Draw);
+ glutMainLoop();
+ return 0;
+}
diff --git a/progs/trivial/quad-tex-pbo.c b/progs/trivial/quad-tex-pbo.c
index 5b63c698a7e..c6f60f51fa6 100644
--- a/progs/trivial/quad-tex-pbo.c
+++ b/progs/trivial/quad-tex-pbo.c
@@ -22,7 +22,7 @@
* OF THIS SOFTWARE.
*/
-#define GL_GLEXT_PROTOTYPES
+#include <GL/glew.h>
#include <stdio.h>
#include <string.h>
@@ -171,6 +171,8 @@ int main(int argc, char **argv)
exit(1);
}
+ glewInit();
+
Init();
glutReshapeFunc(Reshape);
diff --git a/progs/trivial/quad-unfilled-clip.c b/progs/trivial/quad-unfilled-clip.c
new file mode 100644
index 00000000000..e298bd455bf
--- /dev/null
+++ b/progs/trivial/quad-unfilled-clip.c
@@ -0,0 +1,139 @@
+/*
+ * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and
+ * its documentation for any purpose is hereby granted without fee, provided
+ * that (i) the above copyright notices and this permission notice appear in
+ * all copies of the software and related documentation, and (ii) the name of
+ * Silicon Graphics may not be used in any advertising or
+ * publicity relating to the software without the specific, prior written
+ * permission of Silicon Graphics.
+ *
+ * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF
+ * ANY KIND,
+ * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
+ * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * IN NO EVENT SHALL SILICON GRAPHICS BE LIABLE FOR
+ * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
+ * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
+ * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+ * OF THIS SOFTWARE.
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <GL/glut.h>
+
+
+#define CI_OFFSET_1 16
+#define CI_OFFSET_2 32
+
+
+GLenum doubleBuffer;
+
+static void Init(void)
+{
+ fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
+ fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
+ fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
+
+ glClearColor(0.0, 0.0, 1.0, 0.0);
+}
+
+static void Reshape(int width, int height)
+{
+
+ glViewport(0, 0, (GLint)width, (GLint)height);
+
+ glMatrixMode(GL_PROJECTION);
+ glLoadIdentity();
+ glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
+ glMatrixMode(GL_MODELVIEW);
+}
+
+static void Key(unsigned char key, int x, int y)
+{
+
+ switch (key) {
+ case 27:
+ exit(1);
+ default:
+ return;
+ }
+
+ glutPostRedisplay();
+}
+
+static void Draw(void)
+{
+ glClear(GL_COLOR_BUFFER_BIT);
+ glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
+
+ glBegin(GL_QUADS);
+ glColor3f(1,0,0);
+ glVertex3f( 0.9, -0.9, -30.0);
+ glColor3f(1,1,0);
+ glVertex3f( 0.9, 0.9, -30.0);
+ glColor3f(1,0,1);
+ glVertex3f(-1.9, 0.9, -30.0);
+ glColor3f(0,1,1);
+ glVertex3f(-0.9, -0.9, -30.0);
+ glEnd();
+
+ glFlush();
+
+ if (doubleBuffer) {
+ glutSwapBuffers();
+ }
+}
+
+static GLenum Args(int argc, char **argv)
+{
+ GLint i;
+
+ doubleBuffer = GL_FALSE;
+
+ for (i = 1; i < argc; i++) {
+ if (strcmp(argv[i], "-sb") == 0) {
+ doubleBuffer = GL_FALSE;
+ } else if (strcmp(argv[i], "-db") == 0) {
+ doubleBuffer = GL_TRUE;
+ } else {
+ fprintf(stderr, "%s (Bad option).\n", argv[i]);
+ return GL_FALSE;
+ }
+ }
+ return GL_TRUE;
+}
+
+int main(int argc, char **argv)
+{
+ GLenum type;
+
+ glutInit(&argc, argv);
+
+ if (Args(argc, argv) == GL_FALSE) {
+ exit(1);
+ }
+
+ glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
+
+ type = GLUT_RGB;
+ type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
+ glutInitDisplayMode(type);
+
+ if (glutCreateWindow("First Tri") == GL_FALSE) {
+ exit(1);
+ }
+
+ Init();
+
+ glutReshapeFunc(Reshape);
+ glutKeyboardFunc(Key);
+ glutDisplayFunc(Draw);
+ glutMainLoop();
+ return 0;
+}
diff --git a/progs/trivial/quad-unfilled-stipple.c b/progs/trivial/quad-unfilled-stipple.c
new file mode 100644
index 00000000000..2036aacbaab
--- /dev/null
+++ b/progs/trivial/quad-unfilled-stipple.c
@@ -0,0 +1,142 @@
+/*
+ * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and
+ * its documentation for any purpose is hereby granted without fee, provided
+ * that (i) the above copyright notices and this permission notice appear in
+ * all copies of the software and related documentation, and (ii) the name of
+ * Silicon Graphics may not be used in any advertising or
+ * publicity relating to the software without the specific, prior written
+ * permission of Silicon Graphics.
+ *
+ * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF
+ * ANY KIND,
+ * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
+ * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * IN NO EVENT SHALL SILICON GRAPHICS BE LIABLE FOR
+ * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
+ * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
+ * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+ * OF THIS SOFTWARE.
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <GL/glut.h>
+
+
+#define CI_OFFSET_1 16
+#define CI_OFFSET_2 32
+
+
+GLenum doubleBuffer;
+
+static void Init(void)
+{
+ fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
+ fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
+ fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
+
+ glClearColor(0.0, 0.0, 1.0, 0.0);
+}
+
+static void Reshape(int width, int height)
+{
+
+ glViewport(0, 0, (GLint)width, (GLint)height);
+
+ glMatrixMode(GL_PROJECTION);
+ glLoadIdentity();
+ glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
+ glMatrixMode(GL_MODELVIEW);
+}
+
+static void Key(unsigned char key, int x, int y)
+{
+
+ switch (key) {
+ case 27:
+ exit(1);
+ default:
+ return;
+ }
+
+ glutPostRedisplay();
+}
+
+static void Draw(void)
+{
+ glClear(GL_COLOR_BUFFER_BIT);
+ glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
+
+ glEnable(GL_LINE_STIPPLE);
+ glLineStipple( 5, 0xfffe );
+
+ glBegin(GL_QUADS);
+ glColor3f(1,0,0);
+ glVertex3f( 0.9, -0.9, -30.0);
+ glColor3f(1,1,1);
+ glVertex3f( 0.9, 0.9, -30.0);
+ glColor3f(0,1,0);
+ glVertex3f(-0.9, 0.9, -30.0);
+ glColor3f(0,0,0);
+ glVertex3f(-0.9, -0.9, -30.0);
+ glEnd();
+
+ glFlush();
+
+ if (doubleBuffer) {
+ glutSwapBuffers();
+ }
+}
+
+static GLenum Args(int argc, char **argv)
+{
+ GLint i;
+
+ doubleBuffer = GL_FALSE;
+
+ for (i = 1; i < argc; i++) {
+ if (strcmp(argv[i], "-sb") == 0) {
+ doubleBuffer = GL_FALSE;
+ } else if (strcmp(argv[i], "-db") == 0) {
+ doubleBuffer = GL_TRUE;
+ } else {
+ fprintf(stderr, "%s (Bad option).\n", argv[i]);
+ return GL_FALSE;
+ }
+ }
+ return GL_TRUE;
+}
+
+int main(int argc, char **argv)
+{
+ GLenum type;
+
+ glutInit(&argc, argv);
+
+ if (Args(argc, argv) == GL_FALSE) {
+ exit(1);
+ }
+
+ glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
+
+ type = GLUT_RGB;
+ type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
+ glutInitDisplayMode(type);
+
+ if (glutCreateWindow("First Tri") == GL_FALSE) {
+ exit(1);
+ }
+
+ Init();
+
+ glutReshapeFunc(Reshape);
+ glutKeyboardFunc(Key);
+ glutDisplayFunc(Draw);
+ glutMainLoop();
+ return 0;
+}
diff --git a/progs/trivial/quad-unfilled.c b/progs/trivial/quad-unfilled.c
index 9d63d2dfb95..9d0087ce08d 100644
--- a/progs/trivial/quad-unfilled.c
+++ b/progs/trivial/quad-unfilled.c
@@ -121,7 +121,7 @@ int main(int argc, char **argv)
glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
- type = GLUT_RGB;
+ type = GLUT_RGB | GLUT_ALPHA;
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
diff --git a/progs/trivial/quads.c b/progs/trivial/quads.c
index 1ca82cd9f8b..307a9e07209 100644
--- a/progs/trivial/quads.c
+++ b/progs/trivial/quads.c
@@ -138,7 +138,7 @@ int main(int argc, char **argv)
glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
- type = GLUT_RGB;
+ type = GLUT_RGB | GLUT_ALPHA;
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
diff --git a/progs/trivial/quadstrip-cont.c b/progs/trivial/quadstrip-cont.c
new file mode 100644
index 00000000000..c6c8f69f8ca
--- /dev/null
+++ b/progs/trivial/quadstrip-cont.c
@@ -0,0 +1,162 @@
+/*
+ * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and
+ * its documentation for any purpose is hereby granted without fee, provided
+ * that (i) the above copyright notices and this permission notice appear in
+ * all copies of the software and related documentation, and (ii) the name of
+ * Silicon Graphics may not be used in any advertising or
+ * publicity relating to the software without the specific, prior written
+ * permission of Silicon Graphics.
+ *
+ * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF
+ * ANY KIND,
+ * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
+ * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * IN NO EVENT SHALL SILICON GRAPHICS BE LIABLE FOR
+ * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
+ * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
+ * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+ * OF THIS SOFTWARE.
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <GL/glut.h>
+
+GLenum doubleBuffer;
+
+static void Init(void)
+{
+ fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
+ fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
+ fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
+
+ glClearColor(0.0, 0.0, 1.0, 0.0);
+}
+
+static void Reshape(int width, int height)
+{
+
+ glViewport(0, 0, (GLint)width, (GLint)height);
+
+ glMatrixMode(GL_PROJECTION);
+ glLoadIdentity();
+ glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
+ glMatrixMode(GL_MODELVIEW);
+}
+
+static void Key(unsigned char key, int x, int y)
+{
+
+ switch (key) {
+ case 27:
+ exit(1);
+ default:
+ return;
+ }
+
+ glutPostRedisplay();
+}
+
+static void Draw(void)
+{
+ glClear(GL_COLOR_BUFFER_BIT);
+
+ glBegin(GL_QUAD_STRIP);
+ glColor3f(1,0,0);
+ glVertex3f( 0.9, -0.9, -30.0);
+ glColor3f(1,1,0);
+ glVertex3f( 0.9, 0.9, -30.0);
+
+ glColor3f(1,0,0);
+ glVertex3f( 0.1, -0.8, -30.0);
+ glColor3f(1,1,0);
+ glVertex3f( 0.1, 0.8, -30.0);
+
+ glColor3f(0,1,1);
+ glVertex3f(-0.1, -0.9, -30.0);
+ glColor3f(1,0,1);
+ glVertex3f(-0.1, 0.9, -30.0);
+
+ glColor3f(0,1,1);
+ glVertex3f(-0.9, -0.8, -30.0);
+ glColor3f(1,0,1);
+ glVertex3f(-0.9, 0.8, -30.0);
+ glEnd();
+
+ glFlush();
+
+ if (doubleBuffer) {
+ glutSwapBuffers();
+ }
+}
+
+static void
+idle(void)
+{
+ glutPostRedisplay();
+}
+
+
+static void
+visible(int vis)
+{
+ if (vis == GLUT_VISIBLE)
+ glutIdleFunc(idle);
+ else
+ glutIdleFunc(NULL);
+}
+
+
+static GLenum Args(int argc, char **argv)
+{
+ GLint i;
+
+ doubleBuffer = GL_FALSE;
+
+ for (i = 1; i < argc; i++) {
+ if (strcmp(argv[i], "-sb") == 0) {
+ doubleBuffer = GL_FALSE;
+ } else if (strcmp(argv[i], "-db") == 0) {
+ doubleBuffer = GL_TRUE;
+ } else {
+ fprintf(stderr, "%s (Bad option).\n", argv[i]);
+ return GL_FALSE;
+ }
+ }
+ return GL_TRUE;
+}
+
+int main(int argc, char **argv)
+{
+ GLenum type;
+
+ glutInit(&argc, argv);
+
+ if (Args(argc, argv) == GL_FALSE) {
+ exit(1);
+ }
+
+ glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
+
+ type = GLUT_RGB;
+ type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
+ glutInitDisplayMode(type);
+
+ if (glutCreateWindow("First Tri") == GL_FALSE) {
+ exit(1);
+ }
+
+ Init();
+
+ glutReshapeFunc(Reshape);
+ glutKeyboardFunc(Key);
+ glutDisplayFunc(Draw);
+ glutVisibilityFunc(visible);
+ glutMainLoop();
+ return 0;
+}
diff --git a/progs/trivial/quadstrip-flat.c b/progs/trivial/quadstrip-flat.c
index 061a0e409e4..d02135f702a 100644
--- a/progs/trivial/quadstrip-flat.c
+++ b/progs/trivial/quadstrip-flat.c
@@ -132,7 +132,7 @@ int main(int argc, char **argv)
glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
- type = GLUT_RGB;
+ type = GLUT_RGB | GLUT_ALPHA;
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
diff --git a/progs/trivial/quadstrip.c b/progs/trivial/quadstrip.c
index 342463f1a24..ff8644be09e 100644
--- a/progs/trivial/quadstrip.c
+++ b/progs/trivial/quadstrip.c
@@ -126,7 +126,7 @@ int main(int argc, char **argv)
glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
- type = GLUT_RGB;
+ type = GLUT_RGB | GLUT_ALPHA;
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
diff --git a/progs/trivial/readpixels.c b/progs/trivial/readpixels.c
new file mode 100644
index 00000000000..88aac2684a8
--- /dev/null
+++ b/progs/trivial/readpixels.c
@@ -0,0 +1,103 @@
+/*
+ * glRead/DrawPixels test
+ */
+
+
+#include <GL/glew.h>
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <GL/glut.h>
+
+static int Width = 250, Height = 250;
+static GLfloat Zoom = 1.0;
+
+static void Init(void)
+{
+ fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
+ fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
+ fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
+ glClearColor(0.3, 0.1, 0.3, 0.0);
+}
+
+static void Reshape(int width, int height)
+{
+ Width = width / 2;
+ Height = height;
+ /* draw on left half (we'll read that area) */
+ glViewport(0, 0, Width, height);
+ glMatrixMode(GL_PROJECTION);
+ glLoadIdentity();
+ glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
+ glMatrixMode(GL_MODELVIEW);
+}
+
+static void Key(unsigned char key, int x, int y)
+{
+ switch (key) {
+ case 27:
+ exit(0);
+ default:
+ return;
+ }
+ glutPostRedisplay();
+}
+
+static void Draw(void)
+{
+ GLfloat *image = (GLfloat *) malloc(Width * Height * 4 * sizeof(GLfloat));
+
+ glClear(GL_COLOR_BUFFER_BIT);
+
+ glBegin(GL_TRIANGLES);
+ glColor3f(.8,0,0);
+ glVertex3f(-0.9, -0.9, -30.0);
+ glColor3f(0,.9,0);
+ glVertex3f( 0.9, -0.9, -30.0);
+ glColor3f(0,0,.7);
+ glVertex3f( 0.0, 0.9, -30.0);
+ glEnd();
+
+ glBegin(GL_QUADS);
+ glColor3f(1, 1, 1);
+ glVertex2f(-1.0, -1.0);
+ glVertex2f(-0.9, -1.0);
+ glVertex2f(-0.9, -0.9);
+ glVertex2f(-1.0, -0.9);
+ glEnd();
+
+ glReadPixels(0, 0, Width, Height, GL_RGBA, GL_FLOAT, image);
+ printf("Pixel(0,0) = %f, %f, %f, %f\n",
+ image[0], image[1], image[2], image[3]);
+ /* draw to right half of window */
+ glWindowPos2iARB(Width, 0);
+ glPixelZoom(Zoom, Zoom);
+ glDrawPixels(Width, Height, GL_RGBA, GL_FLOAT, image);
+ free(image);
+
+ glutSwapBuffers();
+}
+
+int main(int argc, char **argv)
+{
+ glutInit(&argc, argv);
+ glutInitWindowPosition(0, 0);
+ glutInitWindowSize(Width*2, Height);
+ glutInitDisplayMode(GLUT_RGB | GLUT_ALPHA | GLUT_DOUBLE);
+ if (glutCreateWindow(argv[0]) == GL_FALSE) {
+ exit(1);
+ }
+
+ if (argc > 1)
+ Zoom = atof(argv[1]);
+
+ glewInit();
+
+ Init();
+
+ glutReshapeFunc(Reshape);
+ glutKeyboardFunc(Key);
+ glutDisplayFunc(Draw);
+ glutMainLoop();
+ return 0;
+}
diff --git a/progs/trivial/tri-alpha-tex.c b/progs/trivial/tri-alpha-tex.c
new file mode 100644
index 00000000000..776f39dcc35
--- /dev/null
+++ b/progs/trivial/tri-alpha-tex.c
@@ -0,0 +1,179 @@
+/*
+ * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and
+ * its documentation for any purpose is hereby granted without fee, provided
+ * that (i) the above copyright notices and this permission notice appear in
+ * all copies of the software and related documentation, and (ii) the name of
+ * Silicon Graphics may not be used in any advertising or
+ * publicity relating to the software without the specific, prior written
+ * permission of Silicon Graphics.
+ *
+ * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF
+ * ANY KIND,
+ * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
+ * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * IN NO EVENT SHALL SILICON GRAPHICS BE LIABLE FOR
+ * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
+ * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
+ * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+ * OF THIS SOFTWARE.
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <GL/glut.h>
+
+
+#define CI_OFFSET_1 16
+#define CI_OFFSET_2 32
+
+
+GLenum doubleBuffer;
+
+static void Init(void)
+{
+ fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
+ fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
+ fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
+
+ glClearColor(0.0, 0.0, 1.0, 0.0);
+
+#define SIZE 16
+ {
+ GLubyte tex2d[SIZE][SIZE][4];
+ GLint s, t;
+
+ for (s = 0; s < SIZE; s++) {
+ for (t = 0; t < SIZE; t++) {
+ tex2d[t][s][0] = (s < SIZE/2) ? 0 : 255;
+ tex2d[t][s][1] = (t < SIZE/2) ? 0 : 255;
+ tex2d[t][s][2] = 0;
+ tex2d[t][s][3] = ((t^s) & 3) * 63;
+ }
+ }
+
+ glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
+ glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_R, GL_REPEAT);
+ glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
+ glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
+
+ glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
+ glTexImage2D(GL_TEXTURE_2D, 0, 4, SIZE, SIZE, 0,
+ GL_RGBA, GL_UNSIGNED_BYTE, tex2d);
+ glPixelStorei(GL_UNPACK_ALIGNMENT, 4);
+ glEnable(GL_TEXTURE_2D);
+ }
+}
+
+static void Reshape(int width, int height)
+{
+
+ glViewport(0, 0, (GLint)width, (GLint)height);
+
+ glMatrixMode(GL_PROJECTION);
+ glLoadIdentity();
+ glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
+ glMatrixMode(GL_MODELVIEW);
+}
+
+static void Key(unsigned char key, int x, int y)
+{
+
+ switch (key) {
+ case 27:
+ exit(1);
+ default:
+ return;
+ }
+
+ glutPostRedisplay();
+}
+
+static void Draw(void)
+{
+ glClear(GL_COLOR_BUFFER_BIT);
+
+ glDisable(GL_DEPTH_TEST);
+ glDisable(GL_STENCIL_TEST);
+ glEnable(GL_ALPHA_TEST);
+ glAlphaFunc(GL_GEQUAL, 0.5);
+
+ glBegin(GL_QUADS);
+ glTexCoord2f(1,0);
+ glVertex3f( 0.9, -0.9, -30.0);
+ glTexCoord2f(1,1);
+ glVertex3f( 0.9, 0.9, -30.0);
+ glTexCoord2f(0,1);
+ glVertex3f(-0.9, 0.9, -30.0);
+ glTexCoord2f(0,0);
+ glVertex3f(-0.9, -0.9, -30.0);
+ glEnd();
+#if 0
+ glBegin(GL_TRIANGLES);
+ glColor4f(0,0,.7,1);
+ glVertex3f( 0.9, -0.9, -30.0);
+ glColor4f(.8,0,0,.5);
+ glVertex3f( 0.9, 0.9, -30.0);
+ glColor4f(0,.9,0,0);
+ glVertex3f(-0.9, 0.0, -30.0);
+ glEnd();
+#endif
+
+ glFlush();
+
+ if (doubleBuffer) {
+ glutSwapBuffers();
+ }
+}
+
+static GLenum Args(int argc, char **argv)
+{
+ GLint i;
+
+ doubleBuffer = GL_FALSE;
+
+ for (i = 1; i < argc; i++) {
+ if (strcmp(argv[i], "-sb") == 0) {
+ doubleBuffer = GL_FALSE;
+ } else if (strcmp(argv[i], "-db") == 0) {
+ doubleBuffer = GL_TRUE;
+ } else {
+ fprintf(stderr, "%s (Bad option).\n", argv[i]);
+ return GL_FALSE;
+ }
+ }
+ return GL_TRUE;
+}
+
+int main(int argc, char **argv)
+{
+ GLenum type;
+
+ glutInit(&argc, argv);
+
+ if (Args(argc, argv) == GL_FALSE) {
+ exit(1);
+ }
+
+ glutInitWindowPosition(100, 0); glutInitWindowSize( 250, 250);
+
+ type = GLUT_RGB;
+ type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
+ glutInitDisplayMode(type);
+
+ if (glutCreateWindow("First Tri") == GL_FALSE) {
+ exit(1);
+ }
+
+ Init();
+
+ glutReshapeFunc(Reshape);
+ glutKeyboardFunc(Key);
+ glutDisplayFunc(Draw);
+ glutMainLoop();
+ return 0;
+}
diff --git a/progs/trivial/tri-alpha.c b/progs/trivial/tri-alpha.c
new file mode 100644
index 00000000000..90cfdbe199d
--- /dev/null
+++ b/progs/trivial/tri-alpha.c
@@ -0,0 +1,141 @@
+/*
+ * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and
+ * its documentation for any purpose is hereby granted without fee, provided
+ * that (i) the above copyright notices and this permission notice appear in
+ * all copies of the software and related documentation, and (ii) the name of
+ * Silicon Graphics may not be used in any advertising or
+ * publicity relating to the software without the specific, prior written
+ * permission of Silicon Graphics.
+ *
+ * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF
+ * ANY KIND,
+ * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
+ * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * IN NO EVENT SHALL SILICON GRAPHICS BE LIABLE FOR
+ * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
+ * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
+ * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+ * OF THIS SOFTWARE.
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <GL/glut.h>
+
+
+#define CI_OFFSET_1 16
+#define CI_OFFSET_2 32
+
+
+GLenum doubleBuffer;
+
+static void Init(void)
+{
+ fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
+ fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
+ fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
+
+ glClearColor(0.0, 0.0, 1.0, 0.0);
+}
+
+static void Reshape(int width, int height)
+{
+
+ glViewport(0, 0, (GLint)width, (GLint)height);
+
+ glMatrixMode(GL_PROJECTION);
+ glLoadIdentity();
+ glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
+ glMatrixMode(GL_MODELVIEW);
+}
+
+static void Key(unsigned char key, int x, int y)
+{
+
+ switch (key) {
+ case 27:
+ exit(1);
+ default:
+ return;
+ }
+
+ glutPostRedisplay();
+}
+
+static void Draw(void)
+{
+ glClear(GL_COLOR_BUFFER_BIT);
+
+ glDisable(GL_DEPTH_TEST);
+ glDisable(GL_STENCIL_TEST);
+ glEnable(GL_ALPHA_TEST);
+ glAlphaFunc(GL_GEQUAL, 0.5);
+
+ glBegin(GL_TRIANGLES);
+ glColor4f(0,0,.7,1);
+ glVertex3f( 0.9, -0.9, -30.0);
+ glColor4f(.8,0,0,.5);
+ glVertex3f( 0.9, 0.9, -30.0);
+ glColor4f(0,.9,0,0);
+ glVertex3f(-0.9, 0.0, -30.0);
+ glEnd();
+
+ glFlush();
+
+ if (doubleBuffer) {
+ glutSwapBuffers();
+ }
+}
+
+static GLenum Args(int argc, char **argv)
+{
+ GLint i;
+
+ doubleBuffer = GL_FALSE;
+
+ for (i = 1; i < argc; i++) {
+ if (strcmp(argv[i], "-sb") == 0) {
+ doubleBuffer = GL_FALSE;
+ } else if (strcmp(argv[i], "-db") == 0) {
+ doubleBuffer = GL_TRUE;
+ } else {
+ fprintf(stderr, "%s (Bad option).\n", argv[i]);
+ return GL_FALSE;
+ }
+ }
+ return GL_TRUE;
+}
+
+int main(int argc, char **argv)
+{
+ GLenum type;
+
+ glutInit(&argc, argv);
+
+ if (Args(argc, argv) == GL_FALSE) {
+ exit(1);
+ }
+
+ glutInitWindowPosition(100, 0); glutInitWindowSize( 250, 250);
+
+ type = GLUT_RGB;
+ type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
+ glutInitDisplayMode(type);
+
+ if (glutCreateWindow("First Tri") == GL_FALSE) {
+ exit(1);
+ }
+
+ Init();
+
+ glutReshapeFunc(Reshape);
+ glutKeyboardFunc(Key);
+ glutDisplayFunc(Draw);
+ glutMainLoop();
+ return 0;
+}
diff --git a/progs/trivial/tri-array-interleaved.c b/progs/trivial/tri-array-interleaved.c
new file mode 100644
index 00000000000..95de2056cf1
--- /dev/null
+++ b/progs/trivial/tri-array-interleaved.c
@@ -0,0 +1,120 @@
+/* Test rebasing */
+
+#include <assert.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <GL/glew.h>
+#include <GL/glut.h>
+
+struct {
+ GLubyte color[4];
+ GLfloat vert[3];
+} verts[] = {
+
+ { { 0x00, 0x00, 0xff, 0x00 },
+ { 0.9, -0.9, 0.0 } },
+
+ { { 0x00, 0xff, 0x00, 0x00 },
+ { 0.9, 0.9, 0.0 } },
+
+ { { 0xff, 0x00, 0x00, 0x00 },
+ { -0.9, 0.9, 0.0 } },
+
+ { { 0xff, 0xff, 0xff, 0x00 },
+ { -0.9, -0.9, 0.0 } },
+};
+
+GLuint indices[] = { 1, 2, 3 };
+
+static void Init( void )
+{
+ GLint errno;
+ GLuint prognum;
+
+ static const char *prog1 =
+ "!!ARBvp1.0\n"
+ "MOV result.color, vertex.color;\n"
+ "MOV result.position, vertex.position;\n"
+ "END\n";
+
+ glGenProgramsARB(1, &prognum);
+ glBindProgramARB(GL_VERTEX_PROGRAM_ARB, prognum);
+ glProgramStringARB(GL_VERTEX_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB,
+ strlen(prog1), (const GLubyte *) prog1);
+
+ assert(glIsProgramARB(prognum));
+ errno = glGetError();
+ printf("glGetError = %d\n", errno);
+ if (errno != GL_NO_ERROR)
+ {
+ GLint errorpos;
+
+ glGetIntegerv(GL_PROGRAM_ERROR_POSITION_ARB, &errorpos);
+ printf("errorpos: %d\n", errorpos);
+ printf("%s\n", (char *)glGetString(GL_PROGRAM_ERROR_STRING_ARB));
+ }
+
+ glInterleavedArrays( GL_C4UB_V3F, sizeof(verts[0]), verts );
+}
+
+
+
+static void Display( void )
+{
+ glClearColor(0.3, 0.3, 0.3, 1);
+ glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
+
+ glEnable(GL_VERTEX_PROGRAM_NV);
+
+ /* Should have min_index == 1, maybe force a rebase:
+ */
+ glDrawElements( GL_TRIANGLES, 3, GL_UNSIGNED_INT, indices );
+
+ glFlush();
+}
+
+
+static void Reshape( int width, int height )
+{
+ glViewport( 0, 0, width, height );
+ glMatrixMode( GL_PROJECTION );
+ glLoadIdentity();
+ glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
+ glMatrixMode( GL_MODELVIEW );
+ glLoadIdentity();
+ /*glTranslatef( 0.0, 0.0, -15.0 );*/
+}
+
+
+static void Key( unsigned char key, int x, int y )
+{
+ (void) x;
+ (void) y;
+ switch (key) {
+ case 27:
+ exit(0);
+ break;
+ }
+ glutPostRedisplay();
+}
+
+
+
+
+int main( int argc, char *argv[] )
+{
+ glutInit( &argc, argv );
+ glutInitWindowPosition( 0, 0 );
+ glutInitWindowSize( 250, 250 );
+ glutInitDisplayMode( GLUT_RGB | GLUT_SINGLE | GLUT_DEPTH );
+ glutCreateWindow(argv[0]);
+ glewInit();
+ glutReshapeFunc( Reshape );
+ glutKeyboardFunc( Key );
+ glutDisplayFunc( Display );
+ Init();
+ glutMainLoop();
+ return 0;
+}
diff --git a/progs/trivial/tri-blend-color.c b/progs/trivial/tri-blend-color.c
new file mode 100644
index 00000000000..d2d72d0b62f
--- /dev/null
+++ b/progs/trivial/tri-blend-color.c
@@ -0,0 +1,144 @@
+/*
+ * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and
+ * its documentation for any purpose is hereby granted without fee, provided
+ * that (i) the above copyright notices and this permission notice appear in
+ * all copies of the software and related documentation, and (ii) the name of
+ * Silicon Graphics may not be used in any advertising or
+ * publicity relating to the software without the specific, prior written
+ * permission of Silicon Graphics.
+ *
+ * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF
+ * ANY KIND,
+ * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
+ * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * IN NO EVENT SHALL SILICON GRAPHICS BE LIABLE FOR
+ * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
+ * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
+ * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+ * OF THIS SOFTWARE.
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <GL/glew.h>
+#include <GL/glut.h>
+
+
+#define CI_OFFSET_1 16
+#define CI_OFFSET_2 32
+
+
+GLenum doubleBuffer;
+
+static void Init(void)
+{
+ fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
+ fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
+ fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
+
+}
+
+static void Reshape(int width, int height)
+{
+
+ glViewport(0, 0, (GLint)width, (GLint)height);
+
+ glMatrixMode(GL_PROJECTION);
+ glLoadIdentity();
+ glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
+ glMatrixMode(GL_MODELVIEW);
+}
+
+static void Key(unsigned char key, int x, int y)
+{
+
+ switch (key) {
+ case 27:
+ exit(1);
+ default:
+ return;
+ }
+
+ glutPostRedisplay();
+}
+
+static void Draw(void)
+{
+ glClearColor(0.0, 0.0, 1.0, 0.0);
+ glClear(GL_COLOR_BUFFER_BIT);
+
+ glEnable(GL_BLEND);
+ glBlendEquation(GL_FUNC_ADD);
+ glBlendColor(1.0, 0, 0, 0);
+ glBlendFunc(GL_CONSTANT_COLOR, GL_SRC_COLOR);
+
+ glBegin(GL_TRIANGLES);
+ glColor3f(0,0,.7);
+ glVertex3f( 0.9, -0.9, -30.0);
+ glColor3f(.8,0,0);
+ glVertex3f( 0.9, 0.9, -30.0);
+ glColor3f(0,.9,0);
+ glVertex3f(-0.9, 0.0, -30.0);
+ glEnd();
+
+ glFlush();
+
+ if (doubleBuffer) {
+ glutSwapBuffers();
+ }
+}
+
+static GLenum Args(int argc, char **argv)
+{
+ GLint i;
+
+ doubleBuffer = GL_FALSE;
+
+ for (i = 1; i < argc; i++) {
+ if (strcmp(argv[i], "-sb") == 0) {
+ doubleBuffer = GL_FALSE;
+ } else if (strcmp(argv[i], "-db") == 0) {
+ doubleBuffer = GL_TRUE;
+ } else {
+ fprintf(stderr, "%s (Bad option).\n", argv[i]);
+ return GL_FALSE;
+ }
+ }
+ return GL_TRUE;
+}
+
+int main(int argc, char **argv)
+{
+ GLenum type;
+
+ glutInit(&argc, argv);
+
+ if (Args(argc, argv) == GL_FALSE) {
+ exit(1);
+ }
+
+ glutInitWindowPosition(100, 0); glutInitWindowSize( 250, 250);
+
+ type = GLUT_RGB;
+ type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
+ glutInitDisplayMode(type);
+
+ if (glutCreateWindow("First Tri") == GL_FALSE) {
+ exit(1);
+ }
+
+ glewInit();
+
+ Init();
+
+ glutReshapeFunc(Reshape);
+ glutKeyboardFunc(Key);
+ glutDisplayFunc(Draw);
+ glutMainLoop();
+ return 0;
+}
diff --git a/progs/trivial/tri-blend-max.c b/progs/trivial/tri-blend-max.c
new file mode 100644
index 00000000000..b39f8f3f12a
--- /dev/null
+++ b/progs/trivial/tri-blend-max.c
@@ -0,0 +1,147 @@
+/*
+ * Copyright (c) 1993-1997, Silicon Graphics, Inc.
+ * ALL RIGHTS RESERVED
+ * Permission to use, copy, modify, and distribute this software for
+ * any purpose and without fee is hereby granted, provided that the above
+ * copyright notice appear in all copies and that both the copyright notice
+ * and this permission notice appear in supporting documentation, and that
+ * the name of Silicon Graphics, Inc. not be used in advertising
+ * or publicity pertaining to distribution of the software without specific,
+ * written prior permission.
+ *
+ * THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS"
+ * AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE,
+ * INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR
+ * FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
+ * GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT,
+ * SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY
+ * KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION,
+ * LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF
+ * THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC. HAS BEEN
+ * ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE
+ * POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ * US Government Users Restricted Rights
+ * Use, duplication, or disclosure by the Government is subject to
+ * restrictions set forth in FAR 52.227.19(c)(2) or subparagraph
+ * (c)(1)(ii) of the Rights in Technical Data and Computer Software
+ * clause at DFARS 252.227-7013 and/or in similar or successor
+ * clauses in the FAR or the DOD or NASA FAR Supplement.
+ * Unpublished-- rights reserved under the copyright laws of the
+ * United States. Contractor/manufacturer is Silicon Graphics,
+ * Inc., 2011 N. Shoreline Blvd., Mountain View, CA 94039-7311.
+ *
+ * OpenGL(R) is a registered trademark of Silicon Graphics, Inc.
+ */
+
+/*
+ * alpha.c
+ * This program draws several overlapping filled polygons
+ * to demonstrate the effect order has on alpha blending results.
+ * Use the 't' key to toggle the order of drawing polygons.
+ */
+#include <stdlib.h>
+#include <GL/glew.h>
+#include <GL/glut.h>
+
+static int leftFirst = GL_TRUE;
+
+/* Initialize alpha blending function.
+ */
+static void init(void)
+{
+ glBlendEquation (GL_MAX);
+ glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+ glShadeModel (GL_FLAT);
+ glClearColor (1.0, 0.0, 0.0, 0.0);
+}
+
+static void drawLeftTriangle(void)
+{
+ /* draw yellow triangle on LHS of screen */
+
+ glBegin (GL_TRIANGLES);
+ glColor4f(1.0, 1.0, 0.0, 0.75);
+ glVertex3f(0.1, 0.9, 0.0);
+ glVertex3f(0.1, 0.1, 0.0);
+ glVertex3f(0.7, 0.5, 0.0);
+ glEnd();
+}
+
+static void drawRightTriangle(void)
+{
+ /* draw cyan triangle on RHS of screen */
+
+ glEnable (GL_BLEND);
+ glBegin (GL_TRIANGLES);
+ glColor4f(0.0, 1.0, 1.0, 0.75);
+ glVertex3f(0.9, 0.9, 0.0);
+ glVertex3f(0.3, 0.5, 0.0);
+ glVertex3f(0.9, 0.1, 0.0);
+ glEnd();
+ glDisable (GL_BLEND);
+}
+
+void display(void)
+{
+ glClear(GL_COLOR_BUFFER_BIT);
+
+ if (leftFirst) {
+ drawLeftTriangle();
+ drawRightTriangle();
+ }
+ else {
+ drawRightTriangle();
+ drawLeftTriangle();
+ }
+
+ glFlush();
+}
+
+void reshape(int w, int h)
+{
+ glViewport(0, 0, (GLsizei) w, (GLsizei) h);
+ glMatrixMode(GL_PROJECTION);
+ glLoadIdentity();
+ if (w <= h)
+ gluOrtho2D (0.0, 1.0, 0.0, 1.0*(GLfloat)h/(GLfloat)w);
+ else
+ gluOrtho2D (0.0, 1.0*(GLfloat)w/(GLfloat)h, 0.0, 1.0);
+}
+
+/* ARGSUSED1 */
+void keyboard(unsigned char key, int x, int y)
+{
+ switch (key) {
+ case 't':
+ case 'T':
+ leftFirst = !leftFirst;
+ glutPostRedisplay();
+ break;
+ case 27: /* Escape key */
+ exit(0);
+ break;
+ default:
+ break;
+ }
+}
+
+/* Main Loop
+ * Open window with initial window size, title bar,
+ * RGBA display mode, and handle input events.
+ */
+int main(int argc, char** argv)
+{
+ glutInit(&argc, argv);
+ glutInitDisplayMode (GLUT_SINGLE | GLUT_RGB);
+ glutInitWindowSize (200, 200);
+ glutCreateWindow (argv[0]);
+ glewInit();
+ init();
+ glutReshapeFunc (reshape);
+ glutKeyboardFunc (keyboard);
+ glutDisplayFunc (display);
+ glutMainLoop();
+ return 0;
+}
diff --git a/progs/trivial/tri-blend-min.c b/progs/trivial/tri-blend-min.c
new file mode 100644
index 00000000000..656297c0ce0
--- /dev/null
+++ b/progs/trivial/tri-blend-min.c
@@ -0,0 +1,147 @@
+/*
+ * Copyright (c) 1993-1997, Silicon Graphics, Inc.
+ * ALL RIGHTS RESERVED
+ * Permission to use, copy, modify, and distribute this software for
+ * any purpose and without fee is hereby granted, provided that the above
+ * copyright notice appear in all copies and that both the copyright notice
+ * and this permission notice appear in supporting documentation, and that
+ * the name of Silicon Graphics, Inc. not be used in advertising
+ * or publicity pertaining to distribution of the software without specific,
+ * written prior permission.
+ *
+ * THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS"
+ * AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE,
+ * INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR
+ * FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
+ * GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT,
+ * SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY
+ * KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION,
+ * LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF
+ * THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC. HAS BEEN
+ * ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE
+ * POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ * US Government Users Restricted Rights
+ * Use, duplication, or disclosure by the Government is subject to
+ * restrictions set forth in FAR 52.227.19(c)(2) or subparagraph
+ * (c)(1)(ii) of the Rights in Technical Data and Computer Software
+ * clause at DFARS 252.227-7013 and/or in similar or successor
+ * clauses in the FAR or the DOD or NASA FAR Supplement.
+ * Unpublished-- rights reserved under the copyright laws of the
+ * United States. Contractor/manufacturer is Silicon Graphics,
+ * Inc., 2011 N. Shoreline Blvd., Mountain View, CA 94039-7311.
+ *
+ * OpenGL(R) is a registered trademark of Silicon Graphics, Inc.
+ */
+
+/*
+ * alpha.c
+ * This program draws several overlapping filled polygons
+ * to demonstrate the effect order has on alpha blending results.
+ * Use the 't' key to toggle the order of drawing polygons.
+ */
+#include <stdlib.h>
+#include <GL/glew.h>
+#include <GL/glut.h>
+
+static int leftFirst = GL_TRUE;
+
+/* Initialize alpha blending function.
+ */
+static void init(void)
+{
+ glBlendEquation (GL_MIN);
+ glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+ glShadeModel (GL_FLAT);
+ glClearColor (1.0, 0.0, 0.0, 0.0);
+}
+
+static void drawLeftTriangle(void)
+{
+ /* draw yellow triangle on LHS of screen */
+
+ glBegin (GL_TRIANGLES);
+ glColor4f(1.0, 1.0, 0.0, 0.75);
+ glVertex3f(0.1, 0.9, 0.0);
+ glVertex3f(0.1, 0.1, 0.0);
+ glVertex3f(0.7, 0.5, 0.0);
+ glEnd();
+}
+
+static void drawRightTriangle(void)
+{
+ /* draw cyan triangle on RHS of screen */
+
+ glEnable (GL_BLEND);
+ glBegin (GL_TRIANGLES);
+ glColor4f(0.0, 1.0, 1.0, 0.75);
+ glVertex3f(0.9, 0.9, 0.0);
+ glVertex3f(0.3, 0.5, 0.0);
+ glVertex3f(0.9, 0.1, 0.0);
+ glEnd();
+ glDisable (GL_BLEND);
+}
+
+void display(void)
+{
+ glClear(GL_COLOR_BUFFER_BIT);
+
+ if (leftFirst) {
+ drawLeftTriangle();
+ drawRightTriangle();
+ }
+ else {
+ drawRightTriangle();
+ drawLeftTriangle();
+ }
+
+ glFlush();
+}
+
+void reshape(int w, int h)
+{
+ glViewport(0, 0, (GLsizei) w, (GLsizei) h);
+ glMatrixMode(GL_PROJECTION);
+ glLoadIdentity();
+ if (w <= h)
+ gluOrtho2D (0.0, 1.0, 0.0, 1.0*(GLfloat)h/(GLfloat)w);
+ else
+ gluOrtho2D (0.0, 1.0*(GLfloat)w/(GLfloat)h, 0.0, 1.0);
+}
+
+/* ARGSUSED1 */
+void keyboard(unsigned char key, int x, int y)
+{
+ switch (key) {
+ case 't':
+ case 'T':
+ leftFirst = !leftFirst;
+ glutPostRedisplay();
+ break;
+ case 27: /* Escape key */
+ exit(0);
+ break;
+ default:
+ break;
+ }
+}
+
+/* Main Loop
+ * Open window with initial window size, title bar,
+ * RGBA display mode, and handle input events.
+ */
+int main(int argc, char** argv)
+{
+ glutInit(&argc, argv);
+ glutInitDisplayMode (GLUT_SINGLE | GLUT_RGB);
+ glutInitWindowSize (200, 200);
+ glutCreateWindow (argv[0]);
+ glewInit();
+ init();
+ glutReshapeFunc (reshape);
+ glutKeyboardFunc (keyboard);
+ glutDisplayFunc (display);
+ glutMainLoop();
+ return 0;
+}
diff --git a/progs/trivial/tri-blend-revsub.c b/progs/trivial/tri-blend-revsub.c
new file mode 100644
index 00000000000..fe225f1f4e0
--- /dev/null
+++ b/progs/trivial/tri-blend-revsub.c
@@ -0,0 +1,147 @@
+/*
+ * Copyright (c) 1993-1997, Silicon Graphics, Inc.
+ * ALL RIGHTS RESERVED
+ * Permission to use, copy, modify, and distribute this software for
+ * any purpose and without fee is hereby granted, provided that the above
+ * copyright notice appear in all copies and that both the copyright notice
+ * and this permission notice appear in supporting documentation, and that
+ * the name of Silicon Graphics, Inc. not be used in advertising
+ * or publicity pertaining to distribution of the software without specific,
+ * written prior permission.
+ *
+ * THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS"
+ * AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE,
+ * INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR
+ * FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
+ * GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT,
+ * SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY
+ * KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION,
+ * LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF
+ * THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC. HAS BEEN
+ * ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE
+ * POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ * US Government Users Restricted Rights
+ * Use, duplication, or disclosure by the Government is subject to
+ * restrictions set forth in FAR 52.227.19(c)(2) or subparagraph
+ * (c)(1)(ii) of the Rights in Technical Data and Computer Software
+ * clause at DFARS 252.227-7013 and/or in similar or successor
+ * clauses in the FAR or the DOD or NASA FAR Supplement.
+ * Unpublished-- rights reserved under the copyright laws of the
+ * United States. Contractor/manufacturer is Silicon Graphics,
+ * Inc., 2011 N. Shoreline Blvd., Mountain View, CA 94039-7311.
+ *
+ * OpenGL(R) is a registered trademark of Silicon Graphics, Inc.
+ */
+
+/*
+ * alpha.c
+ * This program draws several overlapping filled polygons
+ * to demonstrate the effect order has on alpha blending results.
+ * Use the 't' key to toggle the order of drawing polygons.
+ */
+#include <stdlib.h>
+#include <GL/glew.h>
+#include <GL/glut.h>
+
+static int leftFirst = GL_TRUE;
+
+/* Initialize alpha blending function.
+ */
+static void init(void)
+{
+ glBlendEquation (GL_FUNC_REVERSE_SUBTRACT);
+ glBlendFunc (GL_ONE_MINUS_SRC_ALPHA, GL_SRC_ALPHA);
+ glShadeModel (GL_FLAT);
+ glClearColor (1.0, 0.0, 0.0, 0.0);
+}
+
+static void drawLeftTriangle(void)
+{
+ /* draw yellow triangle on LHS of screen */
+
+ glBegin (GL_TRIANGLES);
+ glColor4f(1.0, 1.0, 0.0, 0.75);
+ glVertex3f(0.1, 0.9, 0.0);
+ glVertex3f(0.1, 0.1, 0.0);
+ glVertex3f(0.7, 0.5, 0.0);
+ glEnd();
+}
+
+static void drawRightTriangle(void)
+{
+ /* draw cyan triangle on RHS of screen */
+
+ glEnable (GL_BLEND);
+ glBegin (GL_TRIANGLES);
+ glColor4f(0.0, 1.0, 1.0, 0.75);
+ glVertex3f(0.9, 0.9, 0.0);
+ glVertex3f(0.3, 0.5, 0.0);
+ glVertex3f(0.9, 0.1, 0.0);
+ glEnd();
+ glDisable (GL_BLEND);
+}
+
+void display(void)
+{
+ glClear(GL_COLOR_BUFFER_BIT);
+
+ if (leftFirst) {
+ drawLeftTriangle();
+ drawRightTriangle();
+ }
+ else {
+ drawRightTriangle();
+ drawLeftTriangle();
+ }
+
+ glFlush();
+}
+
+void reshape(int w, int h)
+{
+ glViewport(0, 0, (GLsizei) w, (GLsizei) h);
+ glMatrixMode(GL_PROJECTION);
+ glLoadIdentity();
+ if (w <= h)
+ gluOrtho2D (0.0, 1.0, 0.0, 1.0*(GLfloat)h/(GLfloat)w);
+ else
+ gluOrtho2D (0.0, 1.0*(GLfloat)w/(GLfloat)h, 0.0, 1.0);
+}
+
+/* ARGSUSED1 */
+void keyboard(unsigned char key, int x, int y)
+{
+ switch (key) {
+ case 't':
+ case 'T':
+ leftFirst = !leftFirst;
+ glutPostRedisplay();
+ break;
+ case 27: /* Escape key */
+ exit(0);
+ break;
+ default:
+ break;
+ }
+}
+
+/* Main Loop
+ * Open window with initial window size, title bar,
+ * RGBA display mode, and handle input events.
+ */
+int main(int argc, char** argv)
+{
+ glutInit(&argc, argv);
+ glutInitDisplayMode (GLUT_SINGLE | GLUT_RGB);
+ glutInitWindowSize (200, 200);
+ glutCreateWindow (argv[0]);
+ glewInit();
+ init();
+ glutReshapeFunc (reshape);
+ glutKeyboardFunc (keyboard);
+ glutDisplayFunc (display);
+ glutMainLoop();
+ return 0;
+}
diff --git a/progs/trivial/tri-blend-sub.c b/progs/trivial/tri-blend-sub.c
new file mode 100644
index 00000000000..cc1aeaf4a48
--- /dev/null
+++ b/progs/trivial/tri-blend-sub.c
@@ -0,0 +1,147 @@
+/*
+ * Copyright (c) 1993-1997, Silicon Graphics, Inc.
+ * ALL RIGHTS RESERVED
+ * Permission to use, copy, modify, and distribute this software for
+ * any purpose and without fee is hereby granted, provided that the above
+ * copyright notice appear in all copies and that both the copyright notice
+ * and this permission notice appear in supporting documentation, and that
+ * the name of Silicon Graphics, Inc. not be used in advertising
+ * or publicity pertaining to distribution of the software without specific,
+ * written prior permission.
+ *
+ * THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS"
+ * AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE,
+ * INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR
+ * FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
+ * GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT,
+ * SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY
+ * KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION,
+ * LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF
+ * THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC. HAS BEEN
+ * ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE
+ * POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ * US Government Users Restricted Rights
+ * Use, duplication, or disclosure by the Government is subject to
+ * restrictions set forth in FAR 52.227.19(c)(2) or subparagraph
+ * (c)(1)(ii) of the Rights in Technical Data and Computer Software
+ * clause at DFARS 252.227-7013 and/or in similar or successor
+ * clauses in the FAR or the DOD or NASA FAR Supplement.
+ * Unpublished-- rights reserved under the copyright laws of the
+ * United States. Contractor/manufacturer is Silicon Graphics,
+ * Inc., 2011 N. Shoreline Blvd., Mountain View, CA 94039-7311.
+ *
+ * OpenGL(R) is a registered trademark of Silicon Graphics, Inc.
+ */
+
+/*
+ * alpha.c
+ * This program draws several overlapping filled polygons
+ * to demonstrate the effect order has on alpha blending results.
+ * Use the 't' key to toggle the order of drawing polygons.
+ */
+#include <stdlib.h>
+#include <GL/glew.h>
+#include <GL/glut.h>
+
+static int leftFirst = GL_TRUE;
+
+/* Initialize alpha blending function.
+ */
+static void init(void)
+{
+ glBlendEquation (GL_FUNC_SUBTRACT);
+ glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+ glShadeModel (GL_FLAT);
+ glClearColor (1.0, 0.0, 0.0, 0.0);
+}
+
+static void drawLeftTriangle(void)
+{
+ /* draw yellow triangle on LHS of screen */
+
+ glBegin (GL_TRIANGLES);
+ glColor4f(1.0, 1.0, 0.0, 0.75);
+ glVertex3f(0.1, 0.9, 0.0);
+ glVertex3f(0.1, 0.1, 0.0);
+ glVertex3f(0.7, 0.5, 0.0);
+ glEnd();
+}
+
+static void drawRightTriangle(void)
+{
+ /* draw cyan triangle on RHS of screen */
+
+ glEnable (GL_BLEND);
+ glBegin (GL_TRIANGLES);
+ glColor4f(0.0, 1.0, 1.0, 0.75);
+ glVertex3f(0.9, 0.9, 0.0);
+ glVertex3f(0.3, 0.5, 0.0);
+ glVertex3f(0.9, 0.1, 0.0);
+ glEnd();
+ glDisable (GL_BLEND);
+}
+
+void display(void)
+{
+ glClear(GL_COLOR_BUFFER_BIT);
+
+ if (leftFirst) {
+ drawLeftTriangle();
+ drawRightTriangle();
+ }
+ else {
+ drawRightTriangle();
+ drawLeftTriangle();
+ }
+
+ glFlush();
+}
+
+void reshape(int w, int h)
+{
+ glViewport(0, 0, (GLsizei) w, (GLsizei) h);
+ glMatrixMode(GL_PROJECTION);
+ glLoadIdentity();
+ if (w <= h)
+ gluOrtho2D (0.0, 1.0, 0.0, 1.0*(GLfloat)h/(GLfloat)w);
+ else
+ gluOrtho2D (0.0, 1.0*(GLfloat)w/(GLfloat)h, 0.0, 1.0);
+}
+
+/* ARGSUSED1 */
+void keyboard(unsigned char key, int x, int y)
+{
+ switch (key) {
+ case 't':
+ case 'T':
+ leftFirst = !leftFirst;
+ glutPostRedisplay();
+ break;
+ case 27: /* Escape key */
+ exit(0);
+ break;
+ default:
+ break;
+ }
+}
+
+/* Main Loop
+ * Open window with initial window size, title bar,
+ * RGBA display mode, and handle input events.
+ */
+int main(int argc, char** argv)
+{
+ glutInit(&argc, argv);
+ glutInitDisplayMode (GLUT_SINGLE | GLUT_RGB);
+ glutInitWindowSize (200, 200);
+ glutCreateWindow (argv[0]);
+ glewInit();
+ init();
+ glutReshapeFunc (reshape);
+ glutKeyboardFunc (keyboard);
+ glutDisplayFunc (display);
+ glutMainLoop();
+ return 0;
+}
diff --git a/progs/trivial/tri-blend.c b/progs/trivial/tri-blend.c
index 284d15fd3c9..58c451c9769 100644
--- a/progs/trivial/tri-blend.c
+++ b/progs/trivial/tri-blend.c
@@ -132,7 +132,7 @@ void keyboard(unsigned char key, int x, int y)
int main(int argc, char** argv)
{
glutInit(&argc, argv);
- glutInitDisplayMode (GLUT_SINGLE | GLUT_RGB);
+ glutInitDisplayMode (GLUT_SINGLE | GLUT_RGB | GLUT_ALPHA);
glutInitWindowSize (200, 200);
glutCreateWindow (argv[0]);
init();
diff --git a/progs/trivial/tri-clear.c b/progs/trivial/tri-clear.c
new file mode 100644
index 00000000000..25ea77cfa75
--- /dev/null
+++ b/progs/trivial/tri-clear.c
@@ -0,0 +1,143 @@
+/*
+ * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and
+ * its documentation for any purpose is hereby granted without fee, provided
+ * that (i) the above copyright notices and this permission notice appear in
+ * all copies of the software and related documentation, and (ii) the name of
+ * Silicon Graphics may not be used in any advertising or
+ * publicity relating to the software without the specific, prior written
+ * permission of Silicon Graphics.
+ *
+ * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF
+ * ANY KIND,
+ * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
+ * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * IN NO EVENT SHALL SILICON GRAPHICS BE LIABLE FOR
+ * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
+ * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
+ * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+ * OF THIS SOFTWARE.
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <GL/glut.h>
+
+
+#define CI_OFFSET_1 16
+#define CI_OFFSET_2 32
+
+GLint Width = 250, Height = 250;
+
+GLenum doubleBuffer;
+
+static void Init(void)
+{
+ fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
+ fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
+ fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
+
+ glClearColor(0.0, 0.0, 1.0, 0.0);
+}
+
+static void Reshape(int width, int height)
+{
+
+ glViewport(0, 0, (GLint)width, (GLint)height);
+
+ glMatrixMode(GL_PROJECTION);
+ glLoadIdentity();
+ glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
+ glMatrixMode(GL_MODELVIEW);
+}
+
+static void Key(unsigned char key, int x, int y)
+{
+
+ switch (key) {
+ case 27:
+ exit(1);
+ default:
+ return;
+ }
+
+ glutPostRedisplay();
+}
+
+static void Draw(void)
+{
+ glClear(GL_COLOR_BUFFER_BIT);
+
+ glBegin(GL_TRIANGLES);
+ glColor3f(0,0,.7);
+ glVertex3f( 0.9, -0.9, -30.0);
+ glColor3f(.8,0,0);
+ glVertex3f( 0.9, 0.9, -30.0);
+ glColor3f(0,.9,0);
+ glVertex3f(-0.9, 0.0, -30.0);
+ glEnd();
+
+ glEnable(GL_SCISSOR_TEST);
+ glClearColor(1, 0, 1, 0);
+ glScissor(Width / 2, Height / 2, Width - Width / 2, Height - Height / 2);
+ glClear(GL_COLOR_BUFFER_BIT);
+ glDisable(GL_SCISSOR_TEST);
+
+ glFlush();
+
+ if (doubleBuffer) {
+ glutSwapBuffers();
+ }
+}
+
+static GLenum Args(int argc, char **argv)
+{
+ GLint i;
+
+ doubleBuffer = GL_FALSE;
+
+ for (i = 1; i < argc; i++) {
+ if (strcmp(argv[i], "-sb") == 0) {
+ doubleBuffer = GL_FALSE;
+ } else if (strcmp(argv[i], "-db") == 0) {
+ doubleBuffer = GL_TRUE;
+ } else {
+ fprintf(stderr, "%s (Bad option).\n", argv[i]);
+ return GL_FALSE;
+ }
+ }
+ return GL_TRUE;
+}
+
+int main(int argc, char **argv)
+{
+ GLenum type;
+
+ glutInit(&argc, argv);
+
+ if (Args(argc, argv) == GL_FALSE) {
+ exit(1);
+ }
+
+ glutInitWindowPosition(100, 0); glutInitWindowSize( Width, Height);
+
+ type = GLUT_RGB;
+ type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
+ glutInitDisplayMode(type);
+
+ if (glutCreateWindow("First Tri") == GL_FALSE) {
+ exit(1);
+ }
+
+ Init();
+
+ glutReshapeFunc(Reshape);
+ glutKeyboardFunc(Key);
+ glutDisplayFunc(Draw);
+ glutMainLoop();
+ return 0;
+}
diff --git a/progs/trivial/tri-clip.c b/progs/trivial/tri-clip.c
index bf48533adcc..f30445cdba1 100644
--- a/progs/trivial/tri-clip.c
+++ b/progs/trivial/tri-clip.c
@@ -28,26 +28,21 @@
#include <GL/glut.h>
-#define CI_OFFSET_1 16
-#define CI_OFFSET_2 32
+static GLenum doubleBuffer;
+static GLfloat Xpos = 0, Ypos = 0;
-GLenum doubleBuffer;
-
static void Init(void)
{
fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
-
- glClearColor(0.0, 0.0, 1.0, 0.0);
+ glClearColor(0.0, 0.0, 1.0, 0.0);
}
static void Reshape(int width, int height)
{
-
glViewport(0, 0, (GLint)width, (GLint)height);
-
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
@@ -56,21 +51,45 @@ static void Reshape(int width, int height)
static void Key(unsigned char key, int x, int y)
{
-
switch (key) {
case 27:
exit(1);
default:
return;
}
-
glutPostRedisplay();
}
+static void
+SpecialKey(int key, int x, int y)
+{
+ const GLfloat step = 0.25;
+ (void) x;
+ (void) y;
+ switch (key) {
+ case GLUT_KEY_UP:
+ Ypos += step;
+ break;
+ case GLUT_KEY_DOWN:
+ Ypos -= step;
+ break;
+ case GLUT_KEY_LEFT:
+ Xpos -= step;
+ break;
+ case GLUT_KEY_RIGHT:
+ Xpos += step;
+ break;
+ }
+ glutPostRedisplay();
+}
+
static void Draw(void)
{
glClear(GL_COLOR_BUFFER_BIT);
+ glPushMatrix();
+ glTranslatef(Xpos, Ypos, 0);
+
glBegin(GL_TRIANGLES);
glColor3f(0,0,.7);
glVertex3f( 0.9, -0.9, -30.0);
@@ -80,12 +99,13 @@ static void Draw(void)
glVertex3f(-1.9, 0.0, -30.0);
glEnd();
+ glPopMatrix();
+
glFlush();
if (doubleBuffer) {
glutSwapBuffers();
}
-
}
static GLenum Args(int argc, char **argv)
@@ -131,7 +151,8 @@ int main(int argc, char **argv)
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
+ glutSpecialFunc(SpecialKey);
glutDisplayFunc(Draw);
glutMainLoop();
- return 0;
+ return 0;
}
diff --git a/progs/trivial/tri-cull-both.c b/progs/trivial/tri-cull-both.c
new file mode 100644
index 00000000000..51b5865ae5c
--- /dev/null
+++ b/progs/trivial/tri-cull-both.c
@@ -0,0 +1,141 @@
+/*
+ * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and
+ * its documentation for any purpose is hereby granted without fee, provided
+ * that (i) the above copyright notices and this permission notice appear in
+ * all copies of the software and related documentation, and (ii) the name of
+ * Silicon Graphics may not be used in any advertising or
+ * publicity relating to the software without the specific, prior written
+ * permission of Silicon Graphics.
+ *
+ * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF
+ * ANY KIND,
+ * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
+ * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * IN NO EVENT SHALL SILICON GRAPHICS BE LIABLE FOR
+ * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
+ * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
+ * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+ * OF THIS SOFTWARE.
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <GL/glut.h>
+
+
+#define CI_OFFSET_1 16
+#define CI_OFFSET_2 32
+
+
+GLenum doubleBuffer;
+
+static void Init(void)
+{
+ fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
+ fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
+ fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
+
+ glClearColor(0.0, 0.0, 1.0, 0.0);
+ glCullFace(GL_FRONT_AND_BACK);
+ glEnable(GL_CULL_FACE);
+
+}
+
+static void Reshape(int width, int height)
+{
+
+ glViewport(0, 0, (GLint)width, (GLint)height);
+
+ glMatrixMode(GL_PROJECTION);
+ glLoadIdentity();
+ glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
+ glMatrixMode(GL_MODELVIEW);
+}
+
+static void Key(unsigned char key, int x, int y)
+{
+
+ switch (key) {
+ case 27:
+ exit(1);
+ default:
+ return;
+ }
+
+ glutPostRedisplay();
+}
+
+static void Draw(void)
+{
+ glClear(GL_COLOR_BUFFER_BIT);
+
+
+
+ glBegin(GL_TRIANGLES);
+ glColor3f(.8,0,0);
+ glVertex3f( 0.93, 0.9, -30.0);
+ glColor3f(0,.9,0);
+ glVertex3f(-0.93, 0.0, -30.0);
+ glColor3f(0,0,.7);
+ glVertex3f( 0.93, -0.8, -30.0);
+ glEnd();
+
+ glFlush();
+
+ if (doubleBuffer) {
+ glutSwapBuffers();
+ }
+}
+
+static GLenum Args(int argc, char **argv)
+{
+ GLint i;
+
+ doubleBuffer = GL_FALSE;
+
+ for (i = 1; i < argc; i++) {
+ if (strcmp(argv[i], "-sb") == 0) {
+ doubleBuffer = GL_FALSE;
+ } else if (strcmp(argv[i], "-db") == 0) {
+ doubleBuffer = GL_TRUE;
+ } else {
+ fprintf(stderr, "%s (Bad option).\n", argv[i]);
+ return GL_FALSE;
+ }
+ }
+ return GL_TRUE;
+}
+
+int main(int argc, char **argv)
+{
+ GLenum type;
+
+ glutInit(&argc, argv);
+
+ if (Args(argc, argv) == GL_FALSE) {
+ exit(1);
+ }
+
+ glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
+
+ type = GLUT_RGB;
+ type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
+ glutInitDisplayMode(type);
+
+ if (glutCreateWindow("First Tri") == GL_FALSE) {
+ exit(1);
+ }
+
+ Init();
+
+ glutReshapeFunc(Reshape);
+ glutKeyboardFunc(Key);
+ glutDisplayFunc(Draw);
+ glutMainLoop();
+ return 0;
+}
diff --git a/progs/trivial/tri-cull.c b/progs/trivial/tri-cull.c
index 20aeaf1d7cd..2eead841155 100644
--- a/progs/trivial/tri-cull.c
+++ b/progs/trivial/tri-cull.c
@@ -27,25 +27,45 @@
#include <stdlib.h>
#include <GL/glut.h>
+static GLenum doubleBuffer;
+static GLint cullmode = 0;
+static GLenum front = GL_CCW; /* GL default */
-#define CI_OFFSET_1 16
-#define CI_OFFSET_2 32
-
-
-GLenum doubleBuffer;
+static void cull(void)
+{
+ cullmode = (cullmode + 1) % 4;
+ if (cullmode == 0) {
+ glCullFace(GL_FRONT);
+ glEnable(GL_CULL_FACE);
+ printf("cull GL_FRONT\n");
+ }
+ else if (cullmode == 1) {
+ glCullFace(GL_BACK);
+ glEnable(GL_CULL_FACE);
+ printf("cull GL_BACK\n");
+ }
+ else if (cullmode == 2) {
+ glCullFace(GL_FRONT_AND_BACK);
+ glEnable(GL_CULL_FACE);
+ printf("cull GL_FRONT_AND_BACK\n");
+ }
+ else {
+ glDisable(GL_CULL_FACE);
+ printf("cull none\n");
+ }
+}
static void Init(void)
{
fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
-
- glClearColor(0.0, 0.0, 1.0, 0.0);
+ glClearColor(0.0, 0.0, 1.0, 0.0);
+ cull();
}
static void Reshape(int width, int height)
{
-
glViewport(0, 0, (GLint)width, (GLint)height);
glMatrixMode(GL_PROJECTION);
@@ -56,15 +76,21 @@ static void Reshape(int width, int height)
static void Key(unsigned char key, int x, int y)
{
-
- switch (key) {
- case 27:
- exit(1);
- default:
- return;
- }
-
- glutPostRedisplay();
+ switch (key) {
+ case 27:
+ exit(1);
+ case 'c':
+ cull();
+ break;
+ case 'f':
+ front = ((front == GL_CCW) ? GL_CW : GL_CCW);
+ glFrontFace(front);
+ printf("front face = %s\n", front == GL_CCW ? "GL_CCW" : "GL_CW");
+ break;
+ default:
+ return;
+ }
+ glutPostRedisplay();
}
static void Draw(void)
@@ -72,12 +98,22 @@ static void Draw(void)
glClear(GL_COLOR_BUFFER_BIT);
glBegin(GL_TRIANGLES);
- glColor3f(0,0,1);
- glVertex3f( -1.5, 0.5, -30.0);
- glColor3f(1,0,0);
- glVertex3f( 0, 2.0, -30.0);
- glColor3f(0,1,0);
- glVertex3f(-1.5, 2.0, -30.0);
+ /* CCW / front-facing */
+ glColor3f(0,0,.7);
+ glVertex3f(-0.1, -0.9, -30.0);
+ glColor3f(.8,0,0);
+ glVertex3f(-0.1, 0.9, -30.0);
+ glColor3f(0,.9,0);
+ glVertex3f(-0.9, 0.0, -30.0);
+
+ /* CW / back-facing */
+ glColor3f(0,0,.7);
+ glVertex3f( 0.1, -0.9, -30.0);
+ glColor3f(.8,0,0);
+ glVertex3f( 0.1, 0.9, -30.0);
+ glColor3f(0,.9,0);
+ glVertex3f( 0.9, 0.0, -30.0);
+
glEnd();
glFlush();
@@ -118,7 +154,7 @@ int main(int argc, char **argv)
glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
- type = GLUT_RGB;
+ type = GLUT_RGB | GLUT_ALPHA;
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
@@ -132,5 +168,5 @@ int main(int argc, char **argv)
glutKeyboardFunc(Key);
glutDisplayFunc(Draw);
glutMainLoop();
- return 0;
+ return 0;
}
diff --git a/progs/trivial/tri-dlist.c b/progs/trivial/tri-dlist.c
index e0ab285eff4..c21c4714adf 100644
--- a/progs/trivial/tri-dlist.c
+++ b/progs/trivial/tri-dlist.c
@@ -132,7 +132,7 @@ int main(int argc, char **argv)
glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
- type = GLUT_RGB;
+ type = GLUT_RGB | GLUT_ALPHA;
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
diff --git a/progs/trivial/tri-edgeflag.c b/progs/trivial/tri-edgeflag.c
index bdc0eaa253a..41899c2eb4f 100644
--- a/progs/trivial/tri-edgeflag.c
+++ b/progs/trivial/tri-edgeflag.c
@@ -27,25 +27,18 @@
#include <stdlib.h>
#include <GL/glut.h>
-
-#define CI_OFFSET_1 16
-#define CI_OFFSET_2 32
-
-
-GLenum doubleBuffer;
+static GLenum doubleBuffer;
+static GLenum frontface = GL_CCW;
static void Init(void)
{
fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
-
- glClearColor(0.0, 0.0, 1.0, 0.0);
}
static void Reshape(int width, int height)
{
-
glViewport(0, 0, (GLint)width, (GLint)height);
glMatrixMode(GL_PROJECTION);
@@ -56,13 +49,16 @@ static void Reshape(int width, int height)
static void Key(unsigned char key, int x, int y)
{
-
- switch (key) {
- case 27:
- exit(1);
- default:
- return;
- }
+ switch (key) {
+ case 'f':
+ frontface = (frontface == GL_CCW) ? GL_CW : GL_CCW;
+ glFrontFace(frontface);
+ break;
+ case 27:
+ exit(1);
+ default:
+ return;
+ }
glutPostRedisplay();
}
@@ -75,7 +71,7 @@ static void Draw(void)
glBegin(GL_TRIANGLES);
glEdgeFlag(1);
- glColor3f(0,0,.7);
+ glColor3f(0.3,0.3,.9);
glVertex3f( 0.9, -0.9, -0.0);
glEdgeFlag(0);
glColor3f(.8,0,0);
@@ -123,7 +119,7 @@ int main(int argc, char **argv)
glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
- type = GLUT_RGB;
+ type = GLUT_RGB | GLUT_ALPHA;
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
@@ -137,5 +133,5 @@ int main(int argc, char **argv)
glutKeyboardFunc(Key);
glutDisplayFunc(Draw);
glutMainLoop();
- return 0;
+ return 0;
}
diff --git a/progs/trivial/tri-fbo-tex.c b/progs/trivial/tri-fbo-tex.c
new file mode 100644
index 00000000000..253f9310db4
--- /dev/null
+++ b/progs/trivial/tri-fbo-tex.c
@@ -0,0 +1,268 @@
+/*
+ * Test GL_EXT_framebuffer_object render-to-texture
+ *
+ * Draw a teapot into a texture image with stenciling.
+ * Then draw a textured quad using that texture.
+ *
+ * Brian Paul
+ * 18 Apr 2005
+ */
+
+
+#include <GL/glew.h>
+#include <GL/glut.h>
+#include <assert.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <math.h>
+
+/* For debug */
+
+
+static int Win = 0;
+static int Width = 512, Height = 512;
+
+static GLenum TexTarget = GL_TEXTURE_2D;
+static int TexWidth = 512, TexHeight = 512;
+
+static GLuint MyFB;
+static GLuint TexObj;
+static GLboolean Anim = GL_FALSE;
+static GLfloat Rot = 0.0;
+static GLuint TextureLevel = 0; /* which texture level to render to */
+static GLenum TexIntFormat = GL_RGB; /* either GL_RGB or GL_RGBA */
+
+
+static void
+CheckError(int line)
+{
+ GLenum err = glGetError();
+ if (err) {
+ printf("GL Error 0x%x at line %d\n", (int) err, line);
+ }
+}
+
+
+static void
+Idle(void)
+{
+ Rot = glutGet(GLUT_ELAPSED_TIME) * 0.1;
+ glutPostRedisplay();
+}
+
+
+static void
+RenderTexture(void)
+{
+ GLenum status;
+
+ glMatrixMode(GL_PROJECTION);
+ glLoadIdentity();
+ glOrtho(-1.0, 1.0, -1.0, 1.0, 5.0, 25.0);
+ glMatrixMode(GL_MODELVIEW);
+ glLoadIdentity();
+ glTranslatef(0.0, 0.0, -15.0);
+
+ if (1) {
+ /* draw to texture image */
+ glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, MyFB);
+
+ status = glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT);
+ if (status != GL_FRAMEBUFFER_COMPLETE_EXT) {
+ printf("Framebuffer incomplete!!!\n");
+ }
+
+ glViewport(0, 0, TexWidth, TexHeight);
+
+ glClearColor(0.5, 0.5, 1.0, 0.0);
+ glClear(GL_COLOR_BUFFER_BIT);
+
+ CheckError(__LINE__);
+
+ glBegin(GL_POLYGON);
+ glColor3f(1, 0, 0);
+ glVertex2f(-1, -1);
+ glColor3f(0, 1, 0);
+ glVertex2f(1, -1);
+ glColor3f(0, 0, 1);
+ glVertex2f(0, 1);
+ glEnd();
+
+ /* Bind normal framebuffer */
+ glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
+ }
+ else {
+ }
+
+ CheckError(__LINE__);
+}
+
+
+
+static void
+Display(void)
+{
+ float ar = (float) Width / (float) Height;
+
+ RenderTexture();
+
+ /* draw textured quad in the window */
+ glMatrixMode(GL_PROJECTION);
+ glLoadIdentity();
+ glFrustum(-ar, ar, -1.0, 1.0, 5.0, 25.0);
+ glMatrixMode(GL_MODELVIEW);
+ glLoadIdentity();
+ glTranslatef(0.0, 0.0, -7.0);
+
+ glViewport(0, 0, Width, Height);
+
+ glClearColor(0.25, 0.25, 0.25, 0);
+ glClear(GL_COLOR_BUFFER_BIT);
+
+ glPushMatrix();
+ glRotatef(Rot, 0, 1, 0);
+ glEnable(TexTarget);
+ glBindTexture(TexTarget, TexObj);
+
+ {
+ glBegin(GL_POLYGON);
+ glColor3f(0.25, 0.25, 0.25);
+ glTexCoord2f(0, 0);
+ glVertex2f(-1, -1);
+ glTexCoord2f(1, 0);
+ glVertex2f(1, -1);
+ glColor3f(1.0, 1.0, 1.0);
+ glTexCoord2f(1, 1);
+ glVertex2f(1, 1);
+ glTexCoord2f(0, 1);
+ glVertex2f(-1, 1);
+ glEnd();
+ }
+
+ glPopMatrix();
+ glDisable(TexTarget);
+
+ glutSwapBuffers();
+ CheckError(__LINE__);
+}
+
+
+static void
+Reshape(int width, int height)
+{
+ glViewport(0, 0, width, height);
+ Width = width;
+ Height = height;
+}
+
+
+static void
+CleanUp(void)
+{
+ glDeleteFramebuffersEXT(1, &MyFB);
+
+ glDeleteTextures(1, &TexObj);
+
+ glutDestroyWindow(Win);
+
+ exit(0);
+}
+
+
+static void
+Key(unsigned char key, int x, int y)
+{
+ (void) x;
+ (void) y;
+ switch (key) {
+ case 'a':
+ Anim = !Anim;
+ if (Anim)
+ glutIdleFunc(Idle);
+ else
+ glutIdleFunc(NULL);
+ break;
+ case 's':
+ Rot += 2.0;
+ break;
+ case 27:
+ CleanUp();
+ break;
+ }
+ glutPostRedisplay();
+}
+
+
+static void
+Init(int argc, char *argv[])
+{
+ static const GLfloat mat[4] = { 1.0, 0.5, 0.5, 1.0 };
+ GLint i;
+
+ if (!glutExtensionSupported("GL_EXT_framebuffer_object")) {
+ printf("GL_EXT_framebuffer_object not found!\n");
+ exit(0);
+ }
+
+ printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
+
+
+ /* Make texture object/image */
+ glGenTextures(1, &TexObj);
+ glBindTexture(TexTarget, TexObj);
+ glTexParameteri(TexTarget, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
+ glTexParameteri(TexTarget, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
+ glTexParameteri(TexTarget, GL_TEXTURE_BASE_LEVEL, TextureLevel);
+ glTexParameteri(TexTarget, GL_TEXTURE_MAX_LEVEL, TextureLevel);
+
+ glTexImage2D(TexTarget, 0, TexIntFormat, TexWidth, TexHeight, 0,
+ GL_RGBA, GL_UNSIGNED_BYTE, NULL);
+
+
+ glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
+
+
+
+
+ /* gen framebuffer id, delete it, do some assertions, just for testing */
+ glGenFramebuffersEXT(1, &MyFB);
+ glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, MyFB);
+ assert(glIsFramebufferEXT(MyFB));
+
+
+ CheckError(__LINE__);
+
+ /* Render color to texture */
+ glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT,
+ TexTarget, TexObj, TextureLevel);
+
+
+
+ CheckError(__LINE__);
+
+ /* bind regular framebuffer */
+ glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
+
+
+}
+
+
+int
+main(int argc, char *argv[])
+{
+ glutInit(&argc, argv);
+ glutInitWindowPosition(0, 0);
+ glutInitWindowSize(Width, Height);
+ glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE);
+ Win = glutCreateWindow(argv[0]);
+ glewInit();
+ glutReshapeFunc(Reshape);
+ glutKeyboardFunc(Key);
+ glutDisplayFunc(Display);
+ if (Anim)
+ glutIdleFunc(Idle);
+ Init(argc, argv);
+ glutMainLoop();
+ return 0;
+}
diff --git a/progs/trivial/tri-fbo.c b/progs/trivial/tri-fbo.c
new file mode 100644
index 00000000000..7a38f2124cc
--- /dev/null
+++ b/progs/trivial/tri-fbo.c
@@ -0,0 +1,202 @@
+
+#include <assert.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <string.h>
+
+#include <GL/glew.h>
+#include <GL/glut.h>
+
+
+
+static int Width = 400, Height = 400;
+static GLuint MyFB, MyRB;
+
+
+#define CheckError() assert(glGetError() == 0)
+
+GLenum doubleBuffer;
+
+static void Init(void)
+{
+ fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
+ fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
+ fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
+
+
+ if (!glutExtensionSupported("GL_EXT_framebuffer_object")) {
+ printf("GL_EXT_framebuffer_object not found!\n");
+ exit(0);
+ }
+
+
+ glGenFramebuffersEXT(1, &MyFB);
+ glGenRenderbuffersEXT(1, &MyRB);
+
+ {
+ glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, MyFB);
+
+ glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, MyRB);
+
+ glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT1_EXT,
+ GL_RENDERBUFFER_EXT, MyRB);
+
+ glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_RGB, Width, Height);
+
+ glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
+ }
+
+ glClearColor(0.0, 0.0, 1.0, 0.0);
+}
+
+
+
+static void
+Reshape( int width, int height )
+{
+ glViewport( 0, 0, width, height );
+ glMatrixMode( GL_PROJECTION );
+ glLoadIdentity();
+ glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
+ glMatrixMode( GL_MODELVIEW );
+
+ Width = width;
+ Height = height;
+ glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_RGB, Width, Height);
+}
+
+
+static void Key(unsigned char key, int x, int y)
+{
+
+ switch (key) {
+ case 27:
+ exit(1);
+ default:
+ return;
+ }
+
+ glutPostRedisplay();
+}
+
+
+
+static void Draw( void )
+{
+
+ /* draw to user framebuffer */
+ glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, MyFB);
+ glDrawBuffer(GL_COLOR_ATTACHMENT1_EXT);
+ glReadBuffer(GL_COLOR_ATTACHMENT1_EXT);
+
+ glClearColor(0.5, 0.5, 1.0, 0.0);
+ glClear(GL_COLOR_BUFFER_BIT);
+ CheckError();
+
+ glBegin(GL_TRIANGLES);
+ glColor3f(0,0,.7);
+ glVertex3f( 0.9, -0.9, -30.0);
+ glColor3f(.8,0,0);
+ glVertex3f( 0.9, 0.9, -30.0);
+ glColor3f(0,.9,0);
+ glVertex3f(-0.9, 0.0, -30.0);
+ glEnd();
+
+
+ {
+ GLubyte *buffer = malloc(Width * Height * 4);
+
+ /* read from user framebuffer */
+ glReadPixels(0, 0, Width-60, Height-60, GL_RGBA, GL_UNSIGNED_BYTE, buffer);
+ CheckError();
+
+ /* draw to window */
+ glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
+ /* Try to clear the window, but will overwrite:
+ */
+ glClearColor(0.8, 0.8, 0, 0.0);
+ glClear(GL_COLOR_BUFFER_BIT);
+
+ glWindowPos2iARB(30, 30);
+ glDrawPixels(Width-60, Height-60, GL_RGBA, GL_UNSIGNED_BYTE, buffer);
+
+
+ free(buffer);
+ }
+
+ /* Bind normal framebuffer */
+ glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
+
+ if (1) {
+ glBegin(GL_TRIANGLES);
+ glColor3f(0,.7,0);
+ glVertex3f( 0.5, -0.5, -30.0);
+ glColor3f(0,0,.8);
+ glVertex3f( 0.5, 0.5, -30.0);
+ glColor3f(.9,0,0);
+ glVertex3f(-0.5, 0.0, -30.0);
+ glEnd();
+ }
+
+ if (doubleBuffer)
+ glutSwapBuffers();
+ else
+ glFinish();
+
+ CheckError();
+}
+
+
+static GLenum Args(int argc, char **argv)
+{
+ GLint i;
+
+ doubleBuffer = GL_FALSE;
+
+ for (i = 1; i < argc; i++) {
+ if (strcmp(argv[i], "-sb") == 0) {
+ doubleBuffer = GL_FALSE;
+ } else if (strcmp(argv[i], "-db") == 0) {
+ doubleBuffer = GL_TRUE;
+ } else {
+ fprintf(stderr, "%s (Bad option).\n", argv[i]);
+ return GL_FALSE;
+ }
+ }
+ return GL_TRUE;
+}
+
+
+
+int
+main( int argc, char *argv[] )
+{
+ GLenum type;
+
+ glutInit(&argc, argv);
+
+ if (Args(argc, argv) == GL_FALSE) {
+ exit(1);
+ }
+
+ glutInitWindowPosition(100, 0); glutInitWindowSize( Width, Height );
+
+ type = GLUT_RGB;
+ type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
+ glutInitDisplayMode(type);
+
+ if (glutCreateWindow(argv[0]) == GL_FALSE) {
+ exit(1);
+ }
+
+ glewInit();
+
+ Init();
+
+ glutReshapeFunc(Reshape);
+ glutKeyboardFunc(Key);
+ glutDisplayFunc(Draw);
+ glutMainLoop();
+ return 0;
+}
diff --git a/progs/trivial/tri-flat-clip.c b/progs/trivial/tri-flat-clip.c
index fafa64914d4..155b0c4f8d4 100644
--- a/progs/trivial/tri-flat-clip.c
+++ b/progs/trivial/tri-flat-clip.c
@@ -119,7 +119,7 @@ int main(int argc, char **argv)
glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
- type = GLUT_RGB;
+ type = GLUT_RGB | GLUT_ALPHA;
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
diff --git a/progs/trivial/tri-flat.c b/progs/trivial/tri-flat.c
index fb2cdbd7bba..0583a2a99a1 100644
--- a/progs/trivial/tri-flat.c
+++ b/progs/trivial/tri-flat.c
@@ -119,7 +119,7 @@ int main(int argc, char **argv)
glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
- type = GLUT_RGB;
+ type = GLUT_RGB | GLUT_ALPHA;
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
diff --git a/progs/trivial/tri-fog.c b/progs/trivial/tri-fog.c
new file mode 100644
index 00000000000..75f3262ecf4
--- /dev/null
+++ b/progs/trivial/tri-fog.c
@@ -0,0 +1,152 @@
+/*
+ * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and
+ * its documentation for any purpose is hereby granted without fee, provided
+ * that (i) the above copyright notices and this permission notice appear in
+ * all copies of the software and related documentation, and (ii) the name of
+ * Silicon Graphics may not be used in any advertising or
+ * publicity relating to the software without the specific, prior written
+ * permission of Silicon Graphics.
+ *
+ * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF
+ * ANY KIND,
+ * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
+ * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * IN NO EVENT SHALL SILICON GRAPHICS BE LIABLE FOR
+ * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
+ * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
+ * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+ * OF THIS SOFTWARE.
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <GL/glut.h>
+
+
+#define CI_OFFSET_1 16
+#define CI_OFFSET_2 32
+
+GLint Width = 250, Height = 250;
+
+GLenum doubleBuffer;
+
+static void Init(void)
+{
+ fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
+ fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
+ fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
+
+ glClearColor(0.0, 0.0, 1.0, 0.0);
+}
+
+static void Reshape(int width, int height)
+{
+
+ glViewport(0, 0, (GLint)width, (GLint)height);
+
+ glMatrixMode(GL_PROJECTION);
+ glLoadIdentity();
+ glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
+ glMatrixMode(GL_MODELVIEW);
+}
+
+static void Key(unsigned char key, int x, int y)
+{
+
+ switch (key) {
+ case 27:
+ exit(1);
+ default:
+ return;
+ }
+
+ glutPostRedisplay();
+}
+
+static void Draw(void)
+{
+ glClear(GL_COLOR_BUFFER_BIT);
+
+ glEnable(GL_FOG);
+
+ glBegin(GL_TRIANGLES);
+ glColor3f(0,0,.7);
+ glVertex3f( 0.9, -0.9, -30.0);
+ glColor3f(.8,0,0);
+ glVertex3f( 0.9, 0.9, -30.0);
+ glColor3f(0,.9,0);
+ glVertex3f(-0.9, 0.0, -30.0);
+ glEnd();
+
+#if 0
+ glBegin(GL_TRIANGLES);
+ glColor3f(0,0,.7);
+ glVertex3f(-0.9, -0.9, -30.0);
+ glColor3f(.8,0,0);
+ glVertex3f(-0.9, 0.9, -30.0);
+ glColor3f(0,.9,0);
+ glVertex3f( 0.9, 0.0, -30.0);
+ glEnd();
+#endif
+
+ glDisable(GL_FOG);
+
+ glFlush();
+
+ if (doubleBuffer) {
+ glutSwapBuffers();
+ }
+}
+
+static GLenum Args(int argc, char **argv)
+{
+ GLint i;
+
+ doubleBuffer = GL_FALSE;
+
+ for (i = 1; i < argc; i++) {
+ if (strcmp(argv[i], "-sb") == 0) {
+ doubleBuffer = GL_FALSE;
+ } else if (strcmp(argv[i], "-db") == 0) {
+ doubleBuffer = GL_TRUE;
+ } else {
+ fprintf(stderr, "%s (Bad option).\n", argv[i]);
+ return GL_FALSE;
+ }
+ }
+ return GL_TRUE;
+}
+
+int main(int argc, char **argv)
+{
+ GLenum type;
+
+ glutInit(&argc, argv);
+
+ if (Args(argc, argv) == GL_FALSE) {
+ exit(1);
+ }
+
+ glutInitWindowPosition(100, 0); glutInitWindowSize(Width, Height);
+
+ type = GLUT_RGB;
+ type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
+ glutInitDisplayMode(type);
+
+ if (glutCreateWindow("First Tri") == GL_FALSE) {
+ exit(1);
+ }
+
+ Init();
+
+ glutReshapeFunc(Reshape);
+ glutKeyboardFunc(Key);
+ glutDisplayFunc(Draw);
+ glutMainLoop();
+ return 0;
+}
diff --git a/progs/trivial/tri-fp-const-imm.c b/progs/trivial/tri-fp-const-imm.c
new file mode 100644
index 00000000000..9e2c63a22af
--- /dev/null
+++ b/progs/trivial/tri-fp-const-imm.c
@@ -0,0 +1,171 @@
+/*
+ * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and
+ * its documentation for any purpose is hereby granted without fee, provided
+ * that (i) the above copyright notices and this permission notice appear in
+ * all copies of the software and related documentation, and (ii) the name of
+ * Silicon Graphics may not be used in any advertising or
+ * publicity relating to the software without the specific, prior written
+ * permission of Silicon Graphics.
+ *
+ * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF
+ * ANY KIND,
+ * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
+ * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * IN NO EVENT SHALL SILICON GRAPHICS BE LIABLE FOR
+ * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
+ * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
+ * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+ * OF THIS SOFTWARE.
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <GL/glew.h>
+#include <GL/glut.h>
+
+
+#define CI_OFFSET_1 16
+#define CI_OFFSET_2 32
+
+
+GLenum doubleBuffer;
+
+static void Init(void)
+{
+ GLint errno;
+ GLuint prognum;
+ static const char *prog1 =
+ "!!ARBfp1.0\n"
+ "TEMP R1;\n"
+ "MOV R1, state.material.emission;\n"
+ "MUL R1, R1, {0.9}.x;\n"
+ "MOV result.color, R1;\n"
+ "END\n";
+
+
+ fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
+ fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
+ fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
+
+ /* Setup the fragment program */
+ glGenProgramsARB(1, &prognum);
+ glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, prognum);
+ glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB,
+ strlen(prog1), (const GLubyte *)prog1);
+
+ errno = glGetError();
+ printf("glGetError = 0x%x\n", errno);
+ if (errno != GL_NO_ERROR) {
+ GLint errorpos;
+
+ glGetIntegerv(GL_PROGRAM_ERROR_POSITION_ARB, &errorpos);
+ printf("errorpos: %d\n", errorpos);
+ printf("glError(GL_PROGRAM_ERROR_STRING_ARB) = %s\n",
+ (char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB));
+ }
+ glEnable(GL_FRAGMENT_PROGRAM_ARB);
+
+ glClearColor(0.0, 0.0, 1.0, 0.0);
+}
+
+static void Reshape(int width, int height)
+{
+
+ glViewport(0, 0, (GLint)width, (GLint)height);
+
+ glMatrixMode(GL_PROJECTION);
+ glLoadIdentity();
+/* glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0); */
+ glMatrixMode(GL_MODELVIEW);
+}
+
+static void Key(unsigned char key, int x, int y)
+{
+
+ switch (key) {
+ case 27:
+ exit(1);
+ default:
+ return;
+ }
+
+ glutPostRedisplay();
+}
+
+static void Draw(void)
+{
+ glClear(GL_COLOR_BUFFER_BIT);
+
+ glBegin(GL_TRIANGLES);
+ glColor3f(0,0,.7);
+ glTexCoord3f(0,0,.7);
+ glVertex3f( 0.9, -0.9, -0.0);
+ glColor3f(.8,0,0);
+ glTexCoord3f(.8,0,0);
+ glVertex3f( 0.9, 0.9, -0.0);
+ glColor3f(0,.9,0);
+ glTexCoord3f(0,.9,0);
+ glVertex3f(-0.9, 0.0, -0.0);
+ glEnd();
+
+ glFlush();
+
+ if (doubleBuffer) {
+ glutSwapBuffers();
+ }
+}
+
+static GLenum Args(int argc, char **argv)
+{
+ GLint i;
+
+ doubleBuffer = GL_FALSE;
+
+ for (i = 1; i < argc; i++) {
+ if (strcmp(argv[i], "-sb") == 0) {
+ doubleBuffer = GL_FALSE;
+ } else if (strcmp(argv[i], "-db") == 0) {
+ doubleBuffer = GL_TRUE;
+ } else {
+ fprintf(stderr, "%s (Bad option).\n", argv[i]);
+ return GL_FALSE;
+ }
+ }
+ return GL_TRUE;
+}
+
+int main(int argc, char **argv)
+{
+ GLenum type;
+
+ glutInit(&argc, argv);
+
+ if (Args(argc, argv) == GL_FALSE) {
+ exit(1);
+ }
+
+ glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
+
+ type = GLUT_RGB | GLUT_ALPHA;
+ type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
+ glutInitDisplayMode(type);
+
+ if (glutCreateWindow("First Tri") == GL_FALSE) {
+ exit(1);
+ }
+
+ glewInit();
+
+ Init();
+
+ glutReshapeFunc(Reshape);
+ glutKeyboardFunc(Key);
+ glutDisplayFunc(Draw);
+ glutMainLoop();
+ return 0;
+}
diff --git a/progs/trivial/tri-fp.c b/progs/trivial/tri-fp.c
new file mode 100644
index 00000000000..fcf57f5a85f
--- /dev/null
+++ b/progs/trivial/tri-fp.c
@@ -0,0 +1,169 @@
+/*
+ * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and
+ * its documentation for any purpose is hereby granted without fee, provided
+ * that (i) the above copyright notices and this permission notice appear in
+ * all copies of the software and related documentation, and (ii) the name of
+ * Silicon Graphics may not be used in any advertising or
+ * publicity relating to the software without the specific, prior written
+ * permission of Silicon Graphics.
+ *
+ * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF
+ * ANY KIND,
+ * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
+ * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * IN NO EVENT SHALL SILICON GRAPHICS BE LIABLE FOR
+ * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
+ * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
+ * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+ * OF THIS SOFTWARE.
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <GL/glew.h>
+#include <GL/glut.h>
+
+
+#define CI_OFFSET_1 16
+#define CI_OFFSET_2 32
+
+
+GLenum doubleBuffer;
+
+static void Init(void)
+{
+ GLint errno;
+ GLuint prognum;
+ static const char *prog1 =
+ "!!ARBfp1.0\n"
+ "MOV result.color, fragment.texcoord[1];\n"
+// "MOV result.color, fragment.color;\n"
+ "END\n";
+
+
+ fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
+ fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
+ fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
+
+ /* Setup the fragment program */
+ glGenProgramsARB(1, &prognum);
+ glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, prognum);
+ glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB,
+ strlen(prog1), (const GLubyte *)prog1);
+
+ errno = glGetError();
+ printf("glGetError = 0x%x\n", errno);
+ if (errno != GL_NO_ERROR) {
+ GLint errorpos;
+
+ glGetIntegerv(GL_PROGRAM_ERROR_POSITION_ARB, &errorpos);
+ printf("errorpos: %d\n", errorpos);
+ printf("glError(GL_PROGRAM_ERROR_STRING_ARB) = %s\n",
+ (char *) glGetString(GL_PROGRAM_ERROR_STRING_ARB));
+ }
+ glEnable(GL_FRAGMENT_PROGRAM_ARB);
+
+ glClearColor(0.0, 0.0, 1.0, 0.0);
+}
+
+static void Reshape(int width, int height)
+{
+
+ glViewport(0, 0, (GLint)width, (GLint)height);
+
+ glMatrixMode(GL_PROJECTION);
+ glLoadIdentity();
+/* glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0); */
+ glMatrixMode(GL_MODELVIEW);
+}
+
+static void Key(unsigned char key, int x, int y)
+{
+
+ switch (key) {
+ case 27:
+ exit(1);
+ default:
+ return;
+ }
+
+ glutPostRedisplay();
+}
+
+static void Draw(void)
+{
+ glClear(GL_COLOR_BUFFER_BIT);
+
+ glBegin(GL_TRIANGLES);
+ glColor3f(0,0,.7);
+ glTexCoord3f(0,0,.7);
+ glVertex3f( 0.9, -0.9, -0.0);
+ glColor3f(.8,0,0);
+ glTexCoord3f(.8,0,0);
+ glVertex3f( 0.9, 0.9, -0.0);
+ glColor3f(0,.9,0);
+ glTexCoord3f(0,.9,0);
+ glVertex3f(-0.9, 0.0, -0.0);
+ glEnd();
+
+ glFlush();
+
+ if (doubleBuffer) {
+ glutSwapBuffers();
+ }
+}
+
+static GLenum Args(int argc, char **argv)
+{
+ GLint i;
+
+ doubleBuffer = GL_FALSE;
+
+ for (i = 1; i < argc; i++) {
+ if (strcmp(argv[i], "-sb") == 0) {
+ doubleBuffer = GL_FALSE;
+ } else if (strcmp(argv[i], "-db") == 0) {
+ doubleBuffer = GL_TRUE;
+ } else {
+ fprintf(stderr, "%s (Bad option).\n", argv[i]);
+ return GL_FALSE;
+ }
+ }
+ return GL_TRUE;
+}
+
+int main(int argc, char **argv)
+{
+ GLenum type;
+
+ glutInit(&argc, argv);
+
+ if (Args(argc, argv) == GL_FALSE) {
+ exit(1);
+ }
+
+ glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
+
+ type = GLUT_RGB | GLUT_ALPHA;
+ type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
+ glutInitDisplayMode(type);
+
+ if (glutCreateWindow("First Tri") == GL_FALSE) {
+ exit(1);
+ }
+
+ glewInit();
+
+ Init();
+
+ glutReshapeFunc(Reshape);
+ glutKeyboardFunc(Key);
+ glutDisplayFunc(Draw);
+ glutMainLoop();
+ return 0;
+}
diff --git a/progs/trivial/tri-lit.c b/progs/trivial/tri-lit.c
new file mode 100644
index 00000000000..22f199c9828
--- /dev/null
+++ b/progs/trivial/tri-lit.c
@@ -0,0 +1,139 @@
+/*
+ * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and
+ * its documentation for any purpose is hereby granted without fee, provided
+ * that (i) the above copyright notices and this permission notice appear in
+ * all copies of the software and related documentation, and (ii) the name of
+ * Silicon Graphics may not be used in any advertising or
+ * publicity relating to the software without the specific, prior written
+ * permission of Silicon Graphics.
+ *
+ * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF
+ * ANY KIND,
+ * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
+ * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * IN NO EVENT SHALL SILICON GRAPHICS BE LIABLE FOR
+ * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
+ * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
+ * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+ * OF THIS SOFTWARE.
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <GL/glut.h>
+
+
+#define CI_OFFSET_1 16
+#define CI_OFFSET_2 32
+
+
+GLenum doubleBuffer;
+
+static void Init(void)
+{
+ fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
+ fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
+ fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
+
+ glEnable(GL_LIGHTING);
+ glEnable(GL_LIGHT0);
+
+ glClearColor(0.0, 0.0, 1.0, 0.0);
+}
+
+static void Reshape(int width, int height)
+{
+
+ glViewport(0, 0, (GLint)width, (GLint)height);
+
+ glMatrixMode(GL_PROJECTION);
+ glLoadIdentity();
+/* glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0); */
+ glMatrixMode(GL_MODELVIEW);
+}
+
+static void Key(unsigned char key, int x, int y)
+{
+
+ switch (key) {
+ case 27:
+ exit(1);
+ default:
+ return;
+ }
+
+ glutPostRedisplay();
+}
+
+static void Draw(void)
+{
+ glClear(GL_COLOR_BUFFER_BIT);
+
+ glBegin(GL_TRIANGLES);
+ glNormal3f(0,0,.7);
+ glVertex3f( 0.9, -0.9, -0.0);
+ glNormal3f(.8,0,0);
+ glVertex3f( 0.9, 0.9, -0.0);
+ glNormal3f(0,.9,0);
+ glVertex3f(-0.9, 0.0, -0.0);
+ glEnd();
+
+ glFlush();
+
+ if (doubleBuffer) {
+ glutSwapBuffers();
+ }
+}
+
+static GLenum Args(int argc, char **argv)
+{
+ GLint i;
+
+ doubleBuffer = GL_FALSE;
+
+ for (i = 1; i < argc; i++) {
+ if (strcmp(argv[i], "-sb") == 0) {
+ doubleBuffer = GL_FALSE;
+ } else if (strcmp(argv[i], "-db") == 0) {
+ doubleBuffer = GL_TRUE;
+ } else {
+ fprintf(stderr, "%s (Bad option).\n", argv[i]);
+ return GL_FALSE;
+ }
+ }
+ return GL_TRUE;
+}
+
+int main(int argc, char **argv)
+{
+ GLenum type;
+
+ glutInit(&argc, argv);
+
+ if (Args(argc, argv) == GL_FALSE) {
+ exit(1);
+ }
+
+ glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
+
+ type = GLUT_RGB | GLUT_ALPHA;
+ type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
+ glutInitDisplayMode(type);
+
+ if (glutCreateWindow("First Tri") == GL_FALSE) {
+ exit(1);
+ }
+
+ Init();
+
+ glutReshapeFunc(Reshape);
+ glutKeyboardFunc(Key);
+ glutDisplayFunc(Draw);
+ glutMainLoop();
+ return 0;
+}
diff --git a/progs/trivial/tri-mask-tri.c b/progs/trivial/tri-mask-tri.c
new file mode 100644
index 00000000000..8333f7ed8ab
--- /dev/null
+++ b/progs/trivial/tri-mask-tri.c
@@ -0,0 +1,153 @@
+/*
+ * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and
+ * its documentation for any purpose is hereby granted without fee, provided
+ * that (i) the above copyright notices and this permission notice appear in
+ * all copies of the software and related documentation, and (ii) the name of
+ * Silicon Graphics may not be used in any advertising or
+ * publicity relating to the software without the specific, prior written
+ * permission of Silicon Graphics.
+ *
+ * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF
+ * ANY KIND,
+ * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
+ * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * IN NO EVENT SHALL SILICON GRAPHICS BE LIABLE FOR
+ * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
+ * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
+ * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+ * OF THIS SOFTWARE.
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <GL/glut.h>
+
+
+GLint Width = 250, Height = 250;
+GLenum doubleBuffer;
+GLint Win;
+GLboolean Rmask = GL_TRUE, Gmask = GL_FALSE, Bmask = GL_TRUE;
+
+
+static void Init(void)
+{
+ fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
+ fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
+ fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
+ glClearColor(0.0, 0.0, 1.0, 0.0);
+}
+
+static void Reshape(int width, int height)
+{
+ glViewport(0, 0, (GLint)width, (GLint)height);
+ glMatrixMode(GL_PROJECTION);
+ glLoadIdentity();
+ glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
+ glMatrixMode(GL_MODELVIEW);
+}
+
+static void Key(unsigned char key, int x, int y)
+{
+ switch (key) {
+ case 'r':
+ Rmask = !Rmask;
+ break;
+ case 'g':
+ Gmask = !Gmask;
+ break;
+ case 'b':
+ Bmask = !Bmask;
+ break;
+ case 27:
+ glutDestroyWindow(Win);
+ exit(1);
+ default:
+ return;
+ }
+ glutPostRedisplay();
+}
+
+static void Draw(void)
+{
+ printf("ColorMask = %d, %d, %d\n", Rmask, Gmask, Bmask);
+ glColorMask(1,1,1,1);
+
+ glClear(GL_COLOR_BUFFER_BIT);
+
+ /* right triangle: green */
+ glBegin(GL_TRIANGLES);
+ glColor3f(0,1,0);
+ glVertex3f( 0.9, -0.9, -30.0);
+ glVertex3f( 0.9, 0.9, -30.0);
+ glVertex3f(-0.9, 0.0, -30.0);
+ glEnd();
+
+ glColorMask(Rmask, Gmask, Bmask, 0);
+
+ /* left triangle: white&mask: purple middle region: white */
+ glBegin(GL_TRIANGLES);
+ glColor3f(1,1,1);
+ glVertex3f(-0.9, -0.9, -30.0);
+ glVertex3f(-0.9, 0.9, -30.0);
+ glVertex3f( 0.9, 0.0, -30.0);
+ glEnd();
+
+ glDisable(GL_SCISSOR_TEST);
+
+ glFlush();
+
+ if (doubleBuffer) {
+ glutSwapBuffers();
+ }
+}
+
+static GLenum Args(int argc, char **argv)
+{
+ GLint i;
+
+ doubleBuffer = GL_FALSE;
+
+ for (i = 1; i < argc; i++) {
+ if (strcmp(argv[i], "-sb") == 0) {
+ doubleBuffer = GL_FALSE;
+ }
+ else if (strcmp(argv[i], "-db") == 0) {
+ doubleBuffer = GL_TRUE;
+ }
+ else {
+ fprintf(stderr, "%s (Bad option).\n", argv[i]);
+ return GL_FALSE;
+ }
+ }
+ return GL_TRUE;
+}
+
+
+int main(int argc, char **argv)
+{
+ GLenum type;
+
+ glutInit(&argc, argv);
+
+ if (Args(argc, argv) == GL_FALSE) {
+ exit(1);
+ }
+
+ type = GLUT_RGB;
+ type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
+
+ glutInitWindowPosition(100, 0); glutInitWindowSize(Width, Height);
+ glutInitDisplayMode(type);
+ Win = glutCreateWindow("First Tri");
+ Init();
+ glutReshapeFunc(Reshape);
+ glutKeyboardFunc(Key);
+ glutDisplayFunc(Draw);
+ glutMainLoop();
+ return 0;
+}
diff --git a/progs/trivial/tri-orig.c b/progs/trivial/tri-orig.c
new file mode 100644
index 00000000000..d5e6742ce1a
--- /dev/null
+++ b/progs/trivial/tri-orig.c
@@ -0,0 +1,136 @@
+/*
+ * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and
+ * its documentation for any purpose is hereby granted without fee, provided
+ * that (i) the above copyright notices and this permission notice appear in
+ * all copies of the software and related documentation, and (ii) the name of
+ * Silicon Graphics may not be used in any advertising or
+ * publicity relating to the software without the specific, prior written
+ * permission of Silicon Graphics.
+ *
+ * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF
+ * ANY KIND,
+ * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
+ * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * IN NO EVENT SHALL SILICON GRAPHICS BE LIABLE FOR
+ * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
+ * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
+ * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+ * OF THIS SOFTWARE.
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <GL/glut.h>
+
+
+#define CI_OFFSET_1 16
+#define CI_OFFSET_2 32
+
+
+GLenum doubleBuffer;
+
+static void Init(void)
+{
+ fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
+ fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
+ fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
+
+ glClearColor(0.0, 0.0, 1.0, 0.0);
+}
+
+static void Reshape(int width, int height)
+{
+
+ glViewport(0, 0, (GLint)width, (GLint)height);
+
+ glMatrixMode(GL_PROJECTION);
+ glLoadIdentity();
+/* glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0); */
+ glMatrixMode(GL_MODELVIEW);
+}
+
+static void Key(unsigned char key, int x, int y)
+{
+
+ switch (key) {
+ case 27:
+ exit(1);
+ default:
+ return;
+ }
+
+ glutPostRedisplay();
+}
+
+static void Draw(void)
+{
+ glClear(GL_COLOR_BUFFER_BIT);
+
+ glBegin(GL_TRIANGLES);
+ glColor3f(0,0,.7);
+ glVertex3f( 0.9, -0.9, -0.0);
+ glColor3f(.8,0,0);
+ glVertex3f( 0.9, 0.9, -0.0);
+ glColor3f(0,.9,0);
+ glVertex3f(-0.9, 0.0, -0.0);
+ glEnd();
+
+ glFlush();
+
+ if (doubleBuffer) {
+ glutSwapBuffers();
+ }
+}
+
+static GLenum Args(int argc, char **argv)
+{
+ GLint i;
+
+ doubleBuffer = GL_FALSE;
+
+ for (i = 1; i < argc; i++) {
+ if (strcmp(argv[i], "-sb") == 0) {
+ doubleBuffer = GL_FALSE;
+ } else if (strcmp(argv[i], "-db") == 0) {
+ doubleBuffer = GL_TRUE;
+ } else {
+ fprintf(stderr, "%s (Bad option).\n", argv[i]);
+ return GL_FALSE;
+ }
+ }
+ return GL_TRUE;
+}
+
+int main(int argc, char **argv)
+{
+ GLenum type;
+
+ glutInit(&argc, argv);
+
+ if (Args(argc, argv) == GL_FALSE) {
+ exit(1);
+ }
+
+ glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
+
+ type = GLUT_RGB | GLUT_ALPHA;
+ type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
+ glutInitDisplayMode(type);
+
+ if (glutCreateWindow("First Tri") == GL_FALSE) {
+ exit(1);
+ }
+
+ Init();
+
+ glutReshapeFunc(Reshape);
+ glutKeyboardFunc(Key);
+ glutDisplayFunc(Draw);
+ glutMainLoop();
+ return 0;
+}
diff --git a/progs/trivial/tri-query.c b/progs/trivial/tri-query.c
new file mode 100644
index 00000000000..25cfcb8e148
--- /dev/null
+++ b/progs/trivial/tri-query.c
@@ -0,0 +1,160 @@
+/*
+ * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and
+ * its documentation for any purpose is hereby granted without fee, provided
+ * that (i) the above copyright notices and this permission notice appear in
+ * all copies of the software and related documentation, and (ii) the name of
+ * Silicon Graphics may not be used in any advertising or
+ * publicity relating to the software without the specific, prior written
+ * permission of Silicon Graphics.
+ *
+ * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF
+ * ANY KIND,
+ * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
+ * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * IN NO EVENT SHALL SILICON GRAPHICS BE LIABLE FOR
+ * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
+ * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
+ * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+ * OF THIS SOFTWARE.
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <GL/glew.h>
+#include <GL/glut.h>
+
+
+
+#define CI_OFFSET_1 16
+#define CI_OFFSET_2 32
+
+static GLuint OccQuery;
+
+GLenum doubleBuffer;
+
+static void Init(void)
+{
+ fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
+ fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
+ fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
+
+ glClearColor(0.0, 0.0, 1.0, 0.0);
+
+ glGenQueriesARB(1, &OccQuery);
+}
+
+static void Reshape(int width, int height)
+{
+
+ glViewport(0, 0, (GLint)width, (GLint)height);
+
+ glMatrixMode(GL_PROJECTION);
+ glLoadIdentity();
+ glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
+ glMatrixMode(GL_MODELVIEW);
+}
+
+static void Key(unsigned char key, int x, int y)
+{
+
+ switch (key) {
+ case 27:
+ exit(1);
+ default:
+ return;
+ }
+
+ glutPostRedisplay();
+}
+
+static void Draw(void)
+{
+ GLuint passed;
+ GLint ready;
+
+ glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
+
+ glEnable(GL_DEPTH_TEST);
+
+ glBeginQueryARB(GL_SAMPLES_PASSED_ARB, OccQuery);
+
+ glBegin(GL_TRIANGLES);
+ glColor3f(0,0,.7);
+ glVertex3f( 0.9, -0.9, -30.0);
+ glColor3f(.8,0,0);
+ glVertex3f( 0.9, 0.9, -30.0);
+ glColor3f(0,.9,0);
+ glVertex3f(-0.9, 0.0, -30.0);
+ glEnd();
+
+ glEndQueryARB(GL_SAMPLES_PASSED_ARB);
+
+ do {
+ /* do useful work here, if any */
+ glGetQueryObjectivARB(OccQuery, GL_QUERY_RESULT_AVAILABLE_ARB, &ready);
+ } while (!ready);
+ glGetQueryObjectuivARB(OccQuery, GL_QUERY_RESULT_ARB, &passed);
+
+ fprintf(stderr, " %d Fragments Visible\n", passed);
+
+ glFlush();
+
+ if (doubleBuffer) {
+ glutSwapBuffers();
+ }
+}
+
+static GLenum Args(int argc, char **argv)
+{
+ GLint i;
+
+ doubleBuffer = GL_FALSE;
+
+ for (i = 1; i < argc; i++) {
+ if (strcmp(argv[i], "-sb") == 0) {
+ doubleBuffer = GL_FALSE;
+ } else if (strcmp(argv[i], "-db") == 0) {
+ doubleBuffer = GL_TRUE;
+ } else {
+ fprintf(stderr, "%s (Bad option).\n", argv[i]);
+ return GL_FALSE;
+ }
+ }
+ return GL_TRUE;
+}
+
+int main(int argc, char **argv)
+{
+ GLenum type;
+
+ glutInit(&argc, argv);
+
+ if (Args(argc, argv) == GL_FALSE) {
+ exit(1);
+ }
+
+ glutInitWindowPosition(100, 0); glutInitWindowSize( 250, 250);
+
+ type = GLUT_RGB | GLUT_DEPTH;
+ type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
+ glutInitDisplayMode(type);
+
+ if (glutCreateWindow("First Tri") == GL_FALSE) {
+ exit(1);
+ }
+
+ glewInit();
+
+ Init();
+
+ glutReshapeFunc(Reshape);
+ glutKeyboardFunc(Key);
+ glutDisplayFunc(Draw);
+ glutMainLoop();
+ return 0;
+}
diff --git a/progs/trivial/tri-repeat.c b/progs/trivial/tri-repeat.c
new file mode 100644
index 00000000000..e894269e84b
--- /dev/null
+++ b/progs/trivial/tri-repeat.c
@@ -0,0 +1,118 @@
+/*
+ * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and
+ * its documentation for any purpose is hereby granted without fee, provided
+ * that (i) the above copyright notices and this permission notice appear in
+ * all copies of the software and related documentation, and (ii) the name of
+ * Silicon Graphics may not be used in any advertising or
+ * publicity relating to the software without the specific, prior written
+ * permission of Silicon Graphics.
+ *
+ * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF
+ * ANY KIND,
+ * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
+ * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * IN NO EVENT SHALL SILICON GRAPHICS BE LIABLE FOR
+ * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
+ * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
+ * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+ * OF THIS SOFTWARE.
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <math.h>
+#include <GL/glut.h>
+
+
+#define CI_OFFSET_1 16
+#define CI_OFFSET_2 32
+
+
+static void Init(void)
+{
+ fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
+ fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
+ fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
+
+ glClearColor(0.3, 0.1, 0.3, 0.0);
+}
+
+static void Reshape(int width, int height)
+{
+
+ glViewport(0, 0, (GLint)width, (GLint)height);
+
+ glMatrixMode(GL_PROJECTION);
+ glLoadIdentity();
+ glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
+ glMatrixMode(GL_MODELVIEW);
+}
+
+static void Key(unsigned char key, int x, int y)
+{
+ switch (key) {
+ case 27:
+ exit(0);
+ default:
+ glutPostRedisplay();
+ return;
+ }
+}
+
+static void Draw(void)
+{
+ static float f = 0;
+ f += .1;
+ glClear(GL_COLOR_BUFFER_BIT);
+
+ glBegin(GL_TRIANGLES);
+ glColor3f((sin(f)+1)/2.0,0,0);
+ glVertex3f(-0.9, -0.9, -30.0);
+ glColor3f(0,(cos(f)+1)/2.0,0);
+ glVertex3f( 0.9, -0.9, -30.0);
+ glColor3f(0,0,.7);
+ glVertex3f( 0.0, 0.9, -30.0);
+ glEnd();
+
+ glutSwapBuffers();
+ glutPostRedisplay();
+}
+
+static GLenum Args(int argc, char **argv)
+{
+ return GL_TRUE;
+}
+
+int main(int argc, char **argv)
+{
+ GLenum type;
+
+ glutInit(&argc, argv);
+
+ if (Args(argc, argv) == GL_FALSE) {
+ exit(1);
+ }
+
+ glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
+
+ type = GLUT_RGB | GLUT_ALPHA;
+ type |= GLUT_DOUBLE;
+ glutInitDisplayMode(type);
+
+ if (glutCreateWindow("First Tri") == GL_FALSE) {
+ exit(1);
+ }
+
+ Init();
+
+ glutReshapeFunc(Reshape);
+ glutKeyboardFunc(Key);
+ glutDisplayFunc(Draw);
+ glutMainLoop();
+ return 0;
+}
diff --git a/progs/trivial/tri-scissor-tri.c b/progs/trivial/tri-scissor-tri.c
new file mode 100644
index 00000000000..dcc6d282dc2
--- /dev/null
+++ b/progs/trivial/tri-scissor-tri.c
@@ -0,0 +1,151 @@
+/*
+ * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and
+ * its documentation for any purpose is hereby granted without fee, provided
+ * that (i) the above copyright notices and this permission notice appear in
+ * all copies of the software and related documentation, and (ii) the name of
+ * Silicon Graphics may not be used in any advertising or
+ * publicity relating to the software without the specific, prior written
+ * permission of Silicon Graphics.
+ *
+ * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF
+ * ANY KIND,
+ * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
+ * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * IN NO EVENT SHALL SILICON GRAPHICS BE LIABLE FOR
+ * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
+ * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
+ * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+ * OF THIS SOFTWARE.
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <GL/glut.h>
+
+
+#define CI_OFFSET_1 16
+#define CI_OFFSET_2 32
+
+GLint Width = 250, Height = 250;
+
+GLenum doubleBuffer;
+
+static void Init(void)
+{
+ fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
+ fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
+ fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
+
+ glClearColor(0.0, 0.0, 1.0, 0.0);
+}
+
+static void Reshape(int width, int height)
+{
+
+ glViewport(0, 0, (GLint)width, (GLint)height);
+
+ glMatrixMode(GL_PROJECTION);
+ glLoadIdentity();
+ glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
+ glMatrixMode(GL_MODELVIEW);
+}
+
+static void Key(unsigned char key, int x, int y)
+{
+
+ switch (key) {
+ case 27:
+ exit(1);
+ default:
+ return;
+ }
+
+ glutPostRedisplay();
+}
+
+static void Draw(void)
+{
+ glClear(GL_COLOR_BUFFER_BIT);
+
+ glBegin(GL_TRIANGLES);
+ glColor3f(0,0,.7);
+ glVertex3f( 0.9, -0.9, -30.0);
+ glColor3f(.8,0,0);
+ glVertex3f( 0.9, 0.9, -30.0);
+ glColor3f(0,.9,0);
+ glVertex3f(-0.9, 0.0, -30.0);
+ glEnd();
+
+ glScissor(Width / 4, Height / 4, Width / 2, Height / 2);
+ glEnable(GL_SCISSOR_TEST);
+
+ glBegin(GL_TRIANGLES);
+ glColor3f(0,0,.7);
+ glVertex3f(-0.9, -0.9, -30.0);
+ glColor3f(.8,0,0);
+ glVertex3f(-0.9, 0.9, -30.0);
+ glColor3f(0,.9,0);
+ glVertex3f( 0.9, 0.0, -30.0);
+ glEnd();
+
+ glDisable(GL_SCISSOR_TEST);
+
+ glFlush();
+
+ if (doubleBuffer) {
+ glutSwapBuffers();
+ }
+}
+
+static GLenum Args(int argc, char **argv)
+{
+ GLint i;
+
+ doubleBuffer = GL_FALSE;
+
+ for (i = 1; i < argc; i++) {
+ if (strcmp(argv[i], "-sb") == 0) {
+ doubleBuffer = GL_FALSE;
+ } else if (strcmp(argv[i], "-db") == 0) {
+ doubleBuffer = GL_TRUE;
+ } else {
+ fprintf(stderr, "%s (Bad option).\n", argv[i]);
+ return GL_FALSE;
+ }
+ }
+ return GL_TRUE;
+}
+
+int main(int argc, char **argv)
+{
+ GLenum type;
+
+ glutInit(&argc, argv);
+
+ if (Args(argc, argv) == GL_FALSE) {
+ exit(1);
+ }
+
+ glutInitWindowPosition(100, 0); glutInitWindowSize(Width, Height);
+
+ type = GLUT_RGB;
+ type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
+ glutInitDisplayMode(type);
+
+ if (glutCreateWindow("First Tri") == GL_FALSE) {
+ exit(1);
+ }
+
+ Init();
+
+ glutReshapeFunc(Reshape);
+ glutKeyboardFunc(Key);
+ glutDisplayFunc(Draw);
+ glutMainLoop();
+ return 0;
+}
diff --git a/progs/trivial/tri-square.c b/progs/trivial/tri-square.c
new file mode 100644
index 00000000000..ef9ea63048f
--- /dev/null
+++ b/progs/trivial/tri-square.c
@@ -0,0 +1,136 @@
+/*
+ * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and
+ * its documentation for any purpose is hereby granted without fee, provided
+ * that (i) the above copyright notices and this permission notice appear in
+ * all copies of the software and related documentation, and (ii) the name of
+ * Silicon Graphics may not be used in any advertising or
+ * publicity relating to the software without the specific, prior written
+ * permission of Silicon Graphics.
+ *
+ * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF
+ * ANY KIND,
+ * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
+ * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * IN NO EVENT SHALL SILICON GRAPHICS BE LIABLE FOR
+ * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
+ * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
+ * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+ * OF THIS SOFTWARE.
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <GL/glut.h>
+
+
+#define CI_OFFSET_1 16
+#define CI_OFFSET_2 32
+
+
+GLenum doubleBuffer;
+
+static void Init(void)
+{
+ fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
+ fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
+ fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
+
+ glClearColor(0.0, 0.0, 1.0, 0.0);
+}
+
+static void Reshape(int width, int height)
+{
+
+ glViewport(0, 0, (GLint)width, (GLint)height);
+
+ glMatrixMode(GL_PROJECTION);
+ glLoadIdentity();
+ gluOrtho2D(0, (GLdouble)width, 0, (GLdouble)height);
+ glMatrixMode(GL_MODELVIEW);
+ glLoadIdentity();
+}
+
+static void Key(unsigned char key, int x, int y)
+{
+
+ switch (key) {
+ case 27:
+ exit(1);
+ default:
+ return;
+ }
+
+ glutPostRedisplay();
+}
+
+static void Draw(void)
+{
+ glClear(GL_COLOR_BUFFER_BIT);
+
+ glColor3f(1,1,1);
+
+ glBegin(GL_TRIANGLES);
+ glVertex3f( 10, 10, -30.0);
+ glVertex3f( 200, 150, -30.0);
+ glVertex3f( 10, 200, -30.0);
+ glEnd();
+
+ glFlush();
+
+ if (doubleBuffer) {
+ glutSwapBuffers();
+ }
+}
+
+static GLenum Args(int argc, char **argv)
+{
+ GLint i;
+
+ doubleBuffer = GL_FALSE;
+
+ for (i = 1; i < argc; i++) {
+ if (strcmp(argv[i], "-sb") == 0) {
+ doubleBuffer = GL_FALSE;
+ } else if (strcmp(argv[i], "-db") == 0) {
+ doubleBuffer = GL_TRUE;
+ } else {
+ fprintf(stderr, "%s (Bad option).\n", argv[i]);
+ return GL_FALSE;
+ }
+ }
+ return GL_TRUE;
+}
+
+int main(int argc, char **argv)
+{
+ GLenum type;
+
+ glutInit(&argc, argv);
+
+ if (Args(argc, argv) == GL_FALSE) {
+ exit(1);
+ }
+
+ glutInitWindowPosition(100, 0); glutInitWindowSize( 250, 250);
+
+ type = GLUT_RGB;
+ type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
+ glutInitDisplayMode(type);
+
+ if (glutCreateWindow("First Tri") == GL_FALSE) {
+ exit(1);
+ }
+
+ Init();
+
+ glutReshapeFunc(Reshape);
+ glutKeyboardFunc(Key);
+ glutDisplayFunc(Draw);
+ glutMainLoop();
+ return 0;
+}
diff --git a/progs/trivial/tri-stencil.c b/progs/trivial/tri-stencil.c
new file mode 100644
index 00000000000..7686e16aef1
--- /dev/null
+++ b/progs/trivial/tri-stencil.c
@@ -0,0 +1,158 @@
+/*
+ * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and
+ * its documentation for any purpose is hereby granted without fee, provided
+ * that (i) the above copyright notices and this permission notice appear in
+ * all copies of the software and related documentation, and (ii) the name of
+ * Silicon Graphics may not be used in any advertising or
+ * publicity relating to the software without the specific, prior written
+ * permission of Silicon Graphics.
+ *
+ * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF
+ * ANY KIND,
+ * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
+ * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * IN NO EVENT SHALL SILICON GRAPHICS BE LIABLE FOR
+ * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
+ * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
+ * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+ * OF THIS SOFTWARE.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <math.h>
+#include <GL/glut.h>
+
+
+static void Init(void)
+{
+}
+
+static void Reshape(int width, int height)
+{
+
+ glViewport(0, 0, (GLint)width, (GLint)height);
+
+ glMatrixMode(GL_PROJECTION);
+ glLoadIdentity();
+ glOrtho(-5.0, 5.0, -5.0, 5.0, -5.0, 5.0);
+ glMatrixMode(GL_MODELVIEW);
+}
+
+static void Key(unsigned char key, int x, int y)
+{
+
+ switch (key) {
+ case 27:
+ printf("Exiting...\n");
+ exit(1);
+ case 'r':
+ printf("Redisplaying...\n");
+ glutPostRedisplay();
+ break;
+ default:
+ printf("No such key '%c'...\n", key);
+ break;
+ }
+}
+
+static void Draw(void)
+{
+ glShadeModel(GL_FLAT);
+
+ {
+ glClearColor(0.0, 0.0, 0.0, 0.0);
+ glClearStencil(0);
+ glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT|GL_STENCIL_BUFFER_BIT);
+ }
+
+
+ glStencilMask(1);
+ glEnable(GL_STENCIL_TEST);
+ glStencilFunc(GL_ALWAYS, 1, 1);
+ glStencilOp(GL_KEEP, GL_KEEP, GL_REPLACE);
+
+ glColor3ub(200, 0, 0);
+ glBegin(GL_POLYGON);
+ glVertex3i(-4, -4, 0);
+ glVertex3i( 4, -4, 0);
+ glVertex3i( 0, 4, 0);
+ glEnd();
+
+#if 1
+ glStencilFunc(GL_EQUAL, 1, 1);
+ glStencilOp(GL_INCR, GL_KEEP, GL_DECR);
+
+ glColor3ub(0, 200, 0);
+ glBegin(GL_POLYGON);
+ glVertex3i(3, 3, 0);
+ glVertex3i(-3, 3, 0);
+ glVertex3i(-3, -3, 0);
+ glVertex3i(3, -3, 0);
+ glEnd();
+#endif
+
+#if 1
+ glStencilFunc(GL_EQUAL, 1, 1);
+ glStencilOp(GL_KEEP, GL_KEEP, GL_KEEP);
+
+ glColor3ub(0, 0, 200);
+ glBegin(GL_POLYGON);
+ glVertex3f(2.5, 2.5, 0);
+ glVertex3f(-2.5, 2.5, 0);
+ glVertex3f(-2.5, -2.5, 0);
+ glVertex3f(2.5, -2.5, 0);
+ glEnd();
+#endif
+
+ glFlush();
+}
+
+static GLenum Args(int argc, char **argv)
+{
+ GLint i;
+
+
+ for (i = 1; i < argc; i++) {
+ if (strcmp(argv[i], "-dr") == 0) {
+ } else {
+ printf("%s (Bad option).\n", argv[i]);
+ return GL_FALSE;
+ }
+ }
+ return GL_TRUE;
+}
+
+int main(int argc, char **argv)
+{
+ GLenum type;
+
+ glutInit(&argc, argv);
+
+ if (Args(argc, argv) == GL_FALSE) {
+ exit(1);
+ }
+
+ glutInitWindowPosition(0, 0);
+ glutInitWindowSize( 300, 300);
+
+ type = GLUT_RGB | GLUT_SINGLE | GLUT_DEPTH | GLUT_STENCIL;
+ glutInitDisplayMode(type);
+
+ if (glutCreateWindow("Stencil Test") == GL_FALSE) {
+ exit(1);
+ }
+
+ Init();
+
+ glutReshapeFunc(Reshape);
+ glutKeyboardFunc(Key);
+ glutDisplayFunc(Draw);
+ glutMainLoop();
+ return 0;
+}
diff --git a/progs/trivial/tri-stipple.c b/progs/trivial/tri-stipple.c
new file mode 100644
index 00000000000..887de550e2c
--- /dev/null
+++ b/progs/trivial/tri-stipple.c
@@ -0,0 +1,151 @@
+/*
+ * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and
+ * its documentation for any purpose is hereby granted without fee, provided
+ * that (i) the above copyright notices and this permission notice appear in
+ * all copies of the software and related documentation, and (ii) the name of
+ * Silicon Graphics may not be used in any advertising or
+ * publicity relating to the software without the specific, prior written
+ * permission of Silicon Graphics.
+ *
+ * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF
+ * ANY KIND,
+ * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
+ * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * IN NO EVENT SHALL SILICON GRAPHICS BE LIABLE FOR
+ * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
+ * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
+ * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+ * OF THIS SOFTWARE.
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <GL/glut.h>
+
+
+#define CI_OFFSET_1 16
+#define CI_OFFSET_2 32
+
+static GLubyte fly[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x03, 0x80, 0x01, 0xC0, 0x06, 0xC0, 0x03, 0x60, 0x04, 0x60, 0x06, 0x20,
+0x04, 0x30, 0x0C, 0x20, 0x04, 0x18, 0x18, 0x20, 0x04, 0x0C, 0x30, 0x20,
+0x04, 0x06, 0x60, 0x20, 0x44, 0x03, 0xC0, 0x22, 0x44, 0x01, 0x80, 0x22,
+0x44, 0x01, 0x80, 0x22, 0x44, 0x01, 0x80, 0x22, 0x44, 0x01, 0x80, 0x22,
+0x44, 0x01, 0x80, 0x22, 0x44, 0x01, 0x80, 0x22, 0x66, 0x01, 0x80, 0x66,
+0x33, 0x01, 0x80, 0xCC, 0x19, 0x81, 0x81, 0x98, 0x0C, 0xC1, 0x83, 0x30,
+0x07, 0xe1, 0x87, 0xe0, 0x03, 0x3f, 0xfc, 0xc0, 0x03, 0x31, 0x8c, 0xc0,
+0x03, 0x33, 0xcc, 0xc0, 0x06, 0x64, 0x26, 0x60, 0x0c, 0xcc, 0x33, 0x30,
+0x18, 0xcc, 0x33, 0x18, 0x10, 0xc4, 0x23, 0x08, 0x10, 0x63, 0xC6, 0x08,
+0x10, 0x30, 0x0c, 0x08, 0x10, 0x18, 0x18, 0x08, 0x10, 0x00, 0x00, 0x08};
+
+
+GLenum doubleBuffer;
+
+static void Init(void)
+{
+ fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
+ fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
+ fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
+
+ glEnable (GL_POLYGON_STIPPLE);
+ glPolygonStipple (fly);
+
+ glClearColor(0.0, 0.0, 1.0, 0.0);
+}
+
+static void Reshape(int width, int height)
+{
+
+ glViewport(0, 0, (GLint)width, (GLint)height);
+
+ glMatrixMode(GL_PROJECTION);
+ glLoadIdentity();
+/* glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0); */
+ glMatrixMode(GL_MODELVIEW);
+}
+
+static void Key(unsigned char key, int x, int y)
+{
+
+ switch (key) {
+ case 27:
+ exit(1);
+ default:
+ return;
+ }
+
+ glutPostRedisplay();
+}
+
+static void Draw(void)
+{
+ glClear(GL_COLOR_BUFFER_BIT);
+
+ glBegin(GL_TRIANGLES);
+ glColor3f(0,0,.7);
+ glVertex3f( 0.9, -0.9, -0.0);
+ glColor3f(.8,0,0);
+ glVertex3f( 0.9, 0.9, -0.0);
+ glColor3f(0,.9,0);
+ glVertex3f(-0.9, 0.0, -0.0);
+ glEnd();
+
+ glFlush();
+
+ if (doubleBuffer) {
+ glutSwapBuffers();
+ }
+}
+
+static GLenum Args(int argc, char **argv)
+{
+ GLint i;
+
+ doubleBuffer = GL_FALSE;
+
+ for (i = 1; i < argc; i++) {
+ if (strcmp(argv[i], "-sb") == 0) {
+ doubleBuffer = GL_FALSE;
+ } else if (strcmp(argv[i], "-db") == 0) {
+ doubleBuffer = GL_TRUE;
+ } else {
+ fprintf(stderr, "%s (Bad option).\n", argv[i]);
+ return GL_FALSE;
+ }
+ }
+ return GL_TRUE;
+}
+
+int main(int argc, char **argv)
+{
+ GLenum type;
+
+ glutInit(&argc, argv);
+
+ if (Args(argc, argv) == GL_FALSE) {
+ exit(1);
+ }
+
+ glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
+
+ type = GLUT_RGB | GLUT_ALPHA;
+ type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
+ glutInitDisplayMode(type);
+
+ if (glutCreateWindow("First Tri") == GL_FALSE) {
+ exit(1);
+ }
+
+ Init();
+
+ glutReshapeFunc(Reshape);
+ glutKeyboardFunc(Key);
+ glutDisplayFunc(Draw);
+ glutMainLoop();
+ return 0;
+}
diff --git a/progs/trivial/tri-tex-3d.c b/progs/trivial/tri-tex-3d.c
index 6a9d1d1bf6d..50f6a754189 100644
--- a/progs/trivial/tri-tex-3d.c
+++ b/progs/trivial/tri-tex-3d.c
@@ -25,6 +25,7 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
+#include <GL/glew.h>
#include <GL/glut.h>
@@ -152,7 +153,7 @@ int main(int argc, char **argv)
glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
- type = GLUT_RGB;
+ type = GLUT_RGB | GLUT_ALPHA;
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
@@ -160,6 +161,8 @@ int main(int argc, char **argv)
exit(1);
}
+ glewInit();
+
Init();
glutReshapeFunc(Reshape);
diff --git a/progs/trivial/tri-tex.c b/progs/trivial/tri-tex.c
new file mode 100644
index 00000000000..a0d75b4a331
--- /dev/null
+++ b/progs/trivial/tri-tex.c
@@ -0,0 +1,168 @@
+/*
+ * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and
+ * its documentation for any purpose is hereby granted without fee, provided
+ * that (i) the above copyright notices and this permission notice appear in
+ * all copies of the software and related documentation, and (ii) the name of
+ * Silicon Graphics may not be used in any advertising or
+ * publicity relating to the software without the specific, prior written
+ * permission of Silicon Graphics.
+ *
+ * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF
+ * ANY KIND,
+ * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
+ * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * IN NO EVENT SHALL SILICON GRAPHICS BE LIABLE FOR
+ * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
+ * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
+ * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+ * OF THIS SOFTWARE.
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <GL/glut.h>
+
+
+
+GLenum doubleBuffer;
+
+static void Init(void)
+{
+ fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
+ fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
+ fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
+
+ glClearColor(0.0, 0.0, 1.0, 0.0);
+
+
+#define SIZE 32
+ {
+ GLubyte tex2d[SIZE][SIZE][3];
+ GLint s, t;
+
+ for (s = 0; s < SIZE; s++) {
+ for (t = 0; t < SIZE; t++) {
+#if 0
+ tex2d[t][s][0] = (s < SIZE/2) ? 0 : 255;
+ tex2d[t][s][1] = (t < SIZE/2) ? 0 : 255;
+ tex2d[t][s][2] = 0;
+#else
+ tex2d[t][s][0] = s*255/(SIZE-1);
+ tex2d[t][s][1] = t*255/(SIZE-1);
+ tex2d[t][s][2] = 0;
+#endif
+ }
+ }
+
+ glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
+
+ glTexImage2D(GL_TEXTURE_2D, 0, 3, SIZE, SIZE, 0,
+ GL_RGB, GL_UNSIGNED_BYTE, tex2d);
+
+ glEnable(GL_TEXTURE_2D);
+ glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
+ glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_R, GL_REPEAT);
+ glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
+ glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
+
+ glPixelStorei(GL_UNPACK_ALIGNMENT, 4);
+ }
+
+}
+
+static void Reshape(int width, int height)
+{
+
+ glViewport(0, 0, (GLint)width, (GLint)height);
+
+ glMatrixMode(GL_PROJECTION);
+ glLoadIdentity();
+/* glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0); */
+ glMatrixMode(GL_MODELVIEW);
+}
+
+static void Key(unsigned char key, int x, int y)
+{
+
+ switch (key) {
+ case 27:
+ exit(1);
+ default:
+ return;
+ }
+
+ glutPostRedisplay();
+}
+
+static void Draw(void)
+{
+ glClear(GL_COLOR_BUFFER_BIT);
+
+ glBegin(GL_TRIANGLES);
+ glTexCoord2f(1,-1);
+ glVertex3f( 0.9, -0.9, -0.0);
+ glTexCoord2f(1,1);
+ glVertex3f( 0.9, 0.9, -0.0);
+ glTexCoord2f(-1,0);
+ glVertex3f(-0.9, 0.0, -0.0);
+ glEnd();
+
+ glFlush();
+
+ if (doubleBuffer) {
+ glutSwapBuffers();
+ }
+}
+
+static GLenum Args(int argc, char **argv)
+{
+ GLint i;
+
+ doubleBuffer = GL_FALSE;
+
+ for (i = 1; i < argc; i++) {
+ if (strcmp(argv[i], "-sb") == 0) {
+ doubleBuffer = GL_FALSE;
+ } else if (strcmp(argv[i], "-db") == 0) {
+ doubleBuffer = GL_TRUE;
+ } else {
+ fprintf(stderr, "%s (Bad option).\n", argv[i]);
+ return GL_FALSE;
+ }
+ }
+ return GL_TRUE;
+}
+
+int main(int argc, char **argv)
+{
+ GLenum type;
+
+ glutInit(&argc, argv);
+
+ if (Args(argc, argv) == GL_FALSE) {
+ exit(1);
+ }
+
+ glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
+
+ type = GLUT_RGB | GLUT_ALPHA;
+ type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
+ glutInitDisplayMode(type);
+
+ if (glutCreateWindow("First Tri") == GL_FALSE) {
+ exit(1);
+ }
+
+ Init();
+
+ glutReshapeFunc(Reshape);
+ glutKeyboardFunc(Key);
+ glutDisplayFunc(Draw);
+ glutMainLoop();
+ return 0;
+}
diff --git a/progs/trivial/tri-tri.c b/progs/trivial/tri-tri.c
new file mode 100644
index 00000000000..06a0528eb87
--- /dev/null
+++ b/progs/trivial/tri-tri.c
@@ -0,0 +1,145 @@
+/*
+ * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and
+ * its documentation for any purpose is hereby granted without fee, provided
+ * that (i) the above copyright notices and this permission notice appear in
+ * all copies of the software and related documentation, and (ii) the name of
+ * Silicon Graphics may not be used in any advertising or
+ * publicity relating to the software without the specific, prior written
+ * permission of Silicon Graphics.
+ *
+ * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF
+ * ANY KIND,
+ * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
+ * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * IN NO EVENT SHALL SILICON GRAPHICS BE LIABLE FOR
+ * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
+ * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
+ * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+ * OF THIS SOFTWARE.
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <GL/glut.h>
+
+
+#define CI_OFFSET_1 16
+#define CI_OFFSET_2 32
+
+
+GLenum doubleBuffer;
+
+static void Init(void)
+{
+ fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
+ fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
+ fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
+
+ glClearColor(0.0, 0.0, 1.0, 0.0);
+}
+
+static void Reshape(int width, int height)
+{
+
+ glViewport(0, 0, (GLint)width, (GLint)height);
+
+ glMatrixMode(GL_PROJECTION);
+ glLoadIdentity();
+ glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
+ glMatrixMode(GL_MODELVIEW);
+}
+
+static void Key(unsigned char key, int x, int y)
+{
+
+ switch (key) {
+ case 27:
+ exit(1);
+ default:
+ return;
+ }
+
+ glutPostRedisplay();
+}
+
+static void Draw(void)
+{
+ glClear(GL_COLOR_BUFFER_BIT);
+
+ glBegin(GL_TRIANGLES);
+ glColor3f(0,0,.7);
+ glVertex3f( 0.9, -0.9, -30.0);
+ glColor3f(.8,0,0);
+ glVertex3f( 0.9, 0.9, -30.0);
+ glColor3f(0,.9,0);
+ glVertex3f(-0.9, 0.0, -30.0);
+ glEnd();
+
+ glBegin(GL_TRIANGLES);
+ glColor3f(0,0,.7);
+ glVertex3f(-0.9, -0.9, -30.0);
+ glColor3f(.8,0,0);
+ glVertex3f(-0.9, 0.9, -30.0);
+ glColor3f(0,.9,0);
+ glVertex3f( 0.9, 0.0, -30.0);
+ glEnd();
+
+ glFlush();
+
+ if (doubleBuffer) {
+ glutSwapBuffers();
+ }
+}
+
+static GLenum Args(int argc, char **argv)
+{
+ GLint i;
+
+ doubleBuffer = GL_FALSE;
+
+ for (i = 1; i < argc; i++) {
+ if (strcmp(argv[i], "-sb") == 0) {
+ doubleBuffer = GL_FALSE;
+ } else if (strcmp(argv[i], "-db") == 0) {
+ doubleBuffer = GL_TRUE;
+ } else {
+ fprintf(stderr, "%s (Bad option).\n", argv[i]);
+ return GL_FALSE;
+ }
+ }
+ return GL_TRUE;
+}
+
+int main(int argc, char **argv)
+{
+ GLenum type;
+
+ glutInit(&argc, argv);
+
+ if (Args(argc, argv) == GL_FALSE) {
+ exit(1);
+ }
+
+ glutInitWindowPosition(100, 0); glutInitWindowSize( 250, 250);
+
+ type = GLUT_RGB;
+ type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
+ glutInitDisplayMode(type);
+
+ if (glutCreateWindow("First Tri") == GL_FALSE) {
+ exit(1);
+ }
+
+ Init();
+
+ glutReshapeFunc(Reshape);
+ glutKeyboardFunc(Key);
+ glutDisplayFunc(Draw);
+ glutMainLoop();
+ return 0;
+}
diff --git a/progs/trivial/tri-unfilled-clip.c b/progs/trivial/tri-unfilled-clip.c
index d486af23655..df161df3fb8 100644
--- a/progs/trivial/tri-unfilled-clip.c
+++ b/progs/trivial/tri-unfilled-clip.c
@@ -119,7 +119,7 @@ int main(int argc, char **argv)
glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
- type = GLUT_RGB;
+ type = GLUT_RGB | GLUT_ALPHA;
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
diff --git a/progs/trivial/tri-unfilled-edgeflag.c b/progs/trivial/tri-unfilled-edgeflag.c
new file mode 100644
index 00000000000..31f41f6220b
--- /dev/null
+++ b/progs/trivial/tri-unfilled-edgeflag.c
@@ -0,0 +1,141 @@
+/*
+ * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and
+ * its documentation for any purpose is hereby granted without fee, provided
+ * that (i) the above copyright notices and this permission notice appear in
+ * all copies of the software and related documentation, and (ii) the name of
+ * Silicon Graphics may not be used in any advertising or
+ * publicity relating to the software without the specific, prior written
+ * permission of Silicon Graphics.
+ *
+ * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF
+ * ANY KIND,
+ * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
+ * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * IN NO EVENT SHALL SILICON GRAPHICS BE LIABLE FOR
+ * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
+ * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
+ * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+ * OF THIS SOFTWARE.
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <GL/glut.h>
+
+
+#define CI_OFFSET_1 16
+#define CI_OFFSET_2 32
+
+
+GLenum doubleBuffer;
+
+static void Init(void)
+{
+ fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
+ fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
+ fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
+
+ glClearColor(0.0, 0.0, 1.0, 0.0);
+}
+
+static void Reshape(int width, int height)
+{
+
+ glViewport(0, 0, (GLint)width, (GLint)height);
+
+ glMatrixMode(GL_PROJECTION);
+ glLoadIdentity();
+/* glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0); */
+ glMatrixMode(GL_MODELVIEW);
+}
+
+static void Key(unsigned char key, int x, int y)
+{
+
+ switch (key) {
+ case 27:
+ exit(1);
+ default:
+ return;
+ }
+
+ glutPostRedisplay();
+}
+
+static void Draw(void)
+{
+ glClear(GL_COLOR_BUFFER_BIT);
+ glPolygonMode(GL_FRONT, GL_LINE);
+ glPolygonMode(GL_BACK, GL_LINE);
+
+ glBegin(GL_TRIANGLES);
+ glEdgeFlag(1);
+ glColor3f(0,0,.7);
+ glVertex3f( 0.9, -0.9, -0.0);
+ glEdgeFlag(0);
+ glColor3f(.8,0,0);
+ glVertex3f( 0.9, 0.9, -0.0);
+ glEdgeFlag(1);
+ glColor3f(0,.9,0);
+ glVertex3f(-0.9, 0.0, -0.0);
+ glEnd();
+
+ glFlush();
+
+ if (doubleBuffer) {
+ glutSwapBuffers();
+ }
+}
+
+static GLenum Args(int argc, char **argv)
+{
+ GLint i;
+
+ doubleBuffer = GL_FALSE;
+
+ for (i = 1; i < argc; i++) {
+ if (strcmp(argv[i], "-sb") == 0) {
+ doubleBuffer = GL_FALSE;
+ } else if (strcmp(argv[i], "-db") == 0) {
+ doubleBuffer = GL_TRUE;
+ } else {
+ fprintf(stderr, "%s (Bad option).\n", argv[i]);
+ return GL_FALSE;
+ }
+ }
+ return GL_TRUE;
+}
+
+int main(int argc, char **argv)
+{
+ GLenum type;
+
+ glutInit(&argc, argv);
+
+ if (Args(argc, argv) == GL_FALSE) {
+ exit(1);
+ }
+
+ glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
+
+ type = GLUT_RGB | GLUT_ALPHA;
+ type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
+ glutInitDisplayMode(type);
+
+ if (glutCreateWindow("First Tri") == GL_FALSE) {
+ exit(1);
+ }
+
+ Init();
+
+ glutReshapeFunc(Reshape);
+ glutKeyboardFunc(Key);
+ glutDisplayFunc(Draw);
+ glutMainLoop();
+ return 0;
+}
diff --git a/progs/trivial/tri-unfilled-point.c b/progs/trivial/tri-unfilled-point.c
new file mode 100644
index 00000000000..71ac453d603
--- /dev/null
+++ b/progs/trivial/tri-unfilled-point.c
@@ -0,0 +1,138 @@
+/*
+ * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and
+ * its documentation for any purpose is hereby granted without fee, provided
+ * that (i) the above copyright notices and this permission notice appear in
+ * all copies of the software and related documentation, and (ii) the name of
+ * Silicon Graphics may not be used in any advertising or
+ * publicity relating to the software without the specific, prior written
+ * permission of Silicon Graphics.
+ *
+ * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF
+ * ANY KIND,
+ * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
+ * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * IN NO EVENT SHALL SILICON GRAPHICS BE LIABLE FOR
+ * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
+ * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
+ * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+ * OF THIS SOFTWARE.
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <GL/glut.h>
+
+
+#define CI_OFFSET_1 16
+#define CI_OFFSET_2 32
+
+
+GLenum doubleBuffer;
+
+static void Init(void)
+{
+ fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
+ fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
+ fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
+
+ glClearColor(0.0, 0.0, 1.0, 0.0);
+}
+
+static void Reshape(int width, int height)
+{
+
+ glViewport(0, 0, (GLint)width, (GLint)height);
+
+ glMatrixMode(GL_PROJECTION);
+ glLoadIdentity();
+/* glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0); */
+ glMatrixMode(GL_MODELVIEW);
+}
+
+static void Key(unsigned char key, int x, int y)
+{
+
+ switch (key) {
+ case 27:
+ exit(1);
+ default:
+ return;
+ }
+
+ glutPostRedisplay();
+}
+
+static void Draw(void)
+{
+ glClear(GL_COLOR_BUFFER_BIT);
+ glPolygonMode(GL_FRONT, GL_POINT);
+ glPolygonMode(GL_BACK, GL_POINT);
+
+ glBegin(GL_TRIANGLES);
+ glColor3f(0,0,.7);
+ glVertex3f( 0.9, -0.9, -0.0);
+ glColor3f(.8,0,0);
+ glVertex3f( 0.9, 0.9, -0.0);
+ glColor3f(0,.9,0);
+ glVertex3f(-0.9, 0.0, -0.0);
+ glEnd();
+
+ glFlush();
+
+ if (doubleBuffer) {
+ glutSwapBuffers();
+ }
+}
+
+static GLenum Args(int argc, char **argv)
+{
+ GLint i;
+
+ doubleBuffer = GL_FALSE;
+
+ for (i = 1; i < argc; i++) {
+ if (strcmp(argv[i], "-sb") == 0) {
+ doubleBuffer = GL_FALSE;
+ } else if (strcmp(argv[i], "-db") == 0) {
+ doubleBuffer = GL_TRUE;
+ } else {
+ fprintf(stderr, "%s (Bad option).\n", argv[i]);
+ return GL_FALSE;
+ }
+ }
+ return GL_TRUE;
+}
+
+int main(int argc, char **argv)
+{
+ GLenum type;
+
+ glutInit(&argc, argv);
+
+ if (Args(argc, argv) == GL_FALSE) {
+ exit(1);
+ }
+
+ glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
+
+ type = GLUT_RGB;
+ type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
+ glutInitDisplayMode(type);
+
+ if (glutCreateWindow("First Tri") == GL_FALSE) {
+ exit(1);
+ }
+
+ Init();
+
+ glutReshapeFunc(Reshape);
+ glutKeyboardFunc(Key);
+ glutDisplayFunc(Draw);
+ glutMainLoop();
+ return 0;
+}
diff --git a/progs/trivial/tri-unfilled-smooth.c b/progs/trivial/tri-unfilled-smooth.c
index e41903a3d50..f70c1cd9d4d 100644
--- a/progs/trivial/tri-unfilled-smooth.c
+++ b/progs/trivial/tri-unfilled-smooth.c
@@ -132,7 +132,7 @@ int main(int argc, char **argv)
glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
- type = GLUT_RGB;
+ type = GLUT_RGB | GLUT_ALPHA;
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
diff --git a/progs/trivial/tri-unfilled-tri-lit.c b/progs/trivial/tri-unfilled-tri-lit.c
new file mode 100644
index 00000000000..f9e1d009884
--- /dev/null
+++ b/progs/trivial/tri-unfilled-tri-lit.c
@@ -0,0 +1,178 @@
+/*
+ * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and
+ * its documentation for any purpose is hereby granted without fee, provided
+ * that (i) the above copyright notices and this permission notice appear in
+ * all copies of the software and related documentation, and (ii) the name of
+ * Silicon Graphics may not be used in any advertising or
+ * publicity relating to the software without the specific, prior written
+ * permission of Silicon Graphics.
+ *
+ * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF
+ * ANY KIND,
+ * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
+ * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * IN NO EVENT SHALL SILICON GRAPHICS BE LIABLE FOR
+ * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
+ * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
+ * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+ * OF THIS SOFTWARE.
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <GL/glut.h>
+
+
+#define CI_OFFSET_1 16
+#define CI_OFFSET_2 32
+
+
+GLenum doubleBuffer;
+
+static void Init(void)
+{
+ fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
+ fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
+ fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
+
+ glEnable(GL_LIGHTING);
+ glEnable(GL_LIGHT0);
+
+ glClearColor(0.0, 0.0, 1.0, 0.0);
+}
+
+static void Reshape(int width, int height)
+{
+
+ glViewport(0, 0, (GLint)width, (GLint)height);
+
+ glMatrixMode(GL_PROJECTION);
+ glLoadIdentity();
+/* glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0); */
+ glMatrixMode(GL_MODELVIEW);
+}
+
+static void Key(unsigned char key, int x, int y)
+{
+
+ switch (key) {
+ case 27:
+ exit(1);
+ default:
+ return;
+ }
+
+ glutPostRedisplay();
+}
+
+static void Draw(void)
+{
+ glClear(GL_COLOR_BUFFER_BIT);
+
+ glPolygonMode(GL_FRONT, GL_LINE);
+ glPolygonMode(GL_BACK, GL_LINE);
+
+ glBegin(GL_TRIANGLES);
+ glNormal3f(0,0,.7);
+ glVertex3f( 0.9, -0.9, -0.0);
+ glNormal3f(.8,0,0);
+ glVertex3f( 0.9, 0.9, -0.0);
+ glNormal3f(0,.9,0);
+ glVertex3f(-0.9, 0.0, -0.0);
+ glEnd();
+
+ glPolygonMode(GL_FRONT, GL_FILL);
+ glPolygonMode(GL_BACK, GL_FILL);
+
+ glBegin(GL_TRIANGLES);
+ glNormal3f(0,0,.7);
+ glVertex3f( 0.8, -0.8, -0.0);
+ glNormal3f(.8,0,0);
+ glVertex3f( 0.8, 0.8, -0.0);
+ glNormal3f(0,.9,0);
+ glVertex3f(-0.8, 0.0, -0.0);
+ glEnd();
+
+ glPolygonMode(GL_FRONT, GL_LINE);
+ glPolygonMode(GL_BACK, GL_LINE);
+
+ glBegin(GL_TRIANGLES);
+ glNormal3f(.8,0,0);
+ glVertex3f( -0.9, 0.9, -0.0);
+ glNormal3f(0,0,.7);
+ glVertex3f( -0.9, -0.9, -0.0);
+ glNormal3f(0,.9,0);
+ glVertex3f( 0.9, 0.0, -0.0);
+ glEnd();
+
+ glPolygonMode(GL_FRONT, GL_FILL);
+ glPolygonMode(GL_BACK, GL_FILL);
+
+ glBegin(GL_TRIANGLES);
+ glNormal3f(.8,0,0);
+ glVertex3f( -0.8, 0.8, -0.0);
+ glNormal3f(0,0,.7);
+ glVertex3f( -0.8, -0.8, -0.0);
+ glNormal3f(0,.9,0);
+ glVertex3f( 0.8, 0.0, -0.0);
+ glEnd();
+
+ glFlush();
+
+ if (doubleBuffer) {
+ glutSwapBuffers();
+ }
+}
+
+static GLenum Args(int argc, char **argv)
+{
+ GLint i;
+
+ doubleBuffer = GL_FALSE;
+
+ for (i = 1; i < argc; i++) {
+ if (strcmp(argv[i], "-sb") == 0) {
+ doubleBuffer = GL_FALSE;
+ } else if (strcmp(argv[i], "-db") == 0) {
+ doubleBuffer = GL_TRUE;
+ } else {
+ fprintf(stderr, "%s (Bad option).\n", argv[i]);
+ return GL_FALSE;
+ }
+ }
+ return GL_TRUE;
+}
+
+int main(int argc, char **argv)
+{
+ GLenum type;
+
+ glutInit(&argc, argv);
+
+ if (Args(argc, argv) == GL_FALSE) {
+ exit(1);
+ }
+
+ glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
+
+ type = GLUT_RGB | GLUT_ALPHA;
+ type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
+ glutInitDisplayMode(type);
+
+ if (glutCreateWindow("First Tri") == GL_FALSE) {
+ exit(1);
+ }
+
+ Init();
+
+ glutReshapeFunc(Reshape);
+ glutKeyboardFunc(Key);
+ glutDisplayFunc(Draw);
+ glutMainLoop();
+ return 0;
+}
diff --git a/progs/trivial/tri-unfilled-tri.c b/progs/trivial/tri-unfilled-tri.c
new file mode 100644
index 00000000000..d9a9faeb9f5
--- /dev/null
+++ b/progs/trivial/tri-unfilled-tri.c
@@ -0,0 +1,175 @@
+/*
+ * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and
+ * its documentation for any purpose is hereby granted without fee, provided
+ * that (i) the above copyright notices and this permission notice appear in
+ * all copies of the software and related documentation, and (ii) the name of
+ * Silicon Graphics may not be used in any advertising or
+ * publicity relating to the software without the specific, prior written
+ * permission of Silicon Graphics.
+ *
+ * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF
+ * ANY KIND,
+ * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
+ * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * IN NO EVENT SHALL SILICON GRAPHICS BE LIABLE FOR
+ * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
+ * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
+ * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+ * OF THIS SOFTWARE.
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <GL/glut.h>
+
+
+#define CI_OFFSET_1 16
+#define CI_OFFSET_2 32
+
+
+GLenum doubleBuffer;
+
+static void Init(void)
+{
+ fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
+ fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
+ fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
+
+ glClearColor(0.0, 0.0, 1.0, 0.0);
+}
+
+static void Reshape(int width, int height)
+{
+
+ glViewport(0, 0, (GLint)width, (GLint)height);
+
+ glMatrixMode(GL_PROJECTION);
+ glLoadIdentity();
+/* glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0); */
+ glMatrixMode(GL_MODELVIEW);
+}
+
+static void Key(unsigned char key, int x, int y)
+{
+
+ switch (key) {
+ case 27:
+ exit(1);
+ default:
+ return;
+ }
+
+ glutPostRedisplay();
+}
+
+static void Draw(void)
+{
+ glClear(GL_COLOR_BUFFER_BIT);
+
+ glPolygonMode(GL_FRONT, GL_LINE);
+ glPolygonMode(GL_BACK, GL_LINE);
+
+ glBegin(GL_TRIANGLES);
+ glColor3f(0,0,.7);
+ glVertex3f( 0.9, -0.9, -0.0);
+ glColor3f(.8,0,0);
+ glVertex3f( 0.9, 0.9, -0.0);
+ glColor3f(0,.9,0);
+ glVertex3f(-0.9, 0.0, -0.0);
+ glEnd();
+
+ glPolygonMode(GL_FRONT, GL_FILL);
+ glPolygonMode(GL_BACK, GL_FILL);
+
+ glBegin(GL_TRIANGLES);
+ glColor3f(0,0,.7);
+ glVertex3f( 0.8, -0.8, -0.0);
+ glColor3f(.8,0,0);
+ glVertex3f( 0.8, 0.8, -0.0);
+ glColor3f(0,.9,0);
+ glVertex3f(-0.8, 0.0, -0.0);
+ glEnd();
+
+ glPolygonMode(GL_FRONT, GL_LINE);
+ glPolygonMode(GL_BACK, GL_LINE);
+
+ glBegin(GL_TRIANGLES);
+ glColor3f(.8,0,0);
+ glVertex3f( -0.9, 0.9, -0.0);
+ glColor3f(0,0,.7);
+ glVertex3f( -0.9, -0.9, -0.0);
+ glColor3f(0,.9,0);
+ glVertex3f( 0.9, 0.0, -0.0);
+ glEnd();
+
+ glPolygonMode(GL_FRONT, GL_FILL);
+ glPolygonMode(GL_BACK, GL_FILL);
+
+ glBegin(GL_TRIANGLES);
+ glColor3f(.8,0,0);
+ glVertex3f( -0.8, 0.8, -0.0);
+ glColor3f(0,0,.7);
+ glVertex3f( -0.8, -0.8, -0.0);
+ glColor3f(0,.9,0);
+ glVertex3f( 0.8, 0.0, -0.0);
+ glEnd();
+
+ glFlush();
+
+ if (doubleBuffer) {
+ glutSwapBuffers();
+ }
+}
+
+static GLenum Args(int argc, char **argv)
+{
+ GLint i;
+
+ doubleBuffer = GL_FALSE;
+
+ for (i = 1; i < argc; i++) {
+ if (strcmp(argv[i], "-sb") == 0) {
+ doubleBuffer = GL_FALSE;
+ } else if (strcmp(argv[i], "-db") == 0) {
+ doubleBuffer = GL_TRUE;
+ } else {
+ fprintf(stderr, "%s (Bad option).\n", argv[i]);
+ return GL_FALSE;
+ }
+ }
+ return GL_TRUE;
+}
+
+int main(int argc, char **argv)
+{
+ GLenum type;
+
+ glutInit(&argc, argv);
+
+ if (Args(argc, argv) == GL_FALSE) {
+ exit(1);
+ }
+
+ glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
+
+ type = GLUT_RGB | GLUT_ALPHA;
+ type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
+ glutInitDisplayMode(type);
+
+ if (glutCreateWindow("First Tri") == GL_FALSE) {
+ exit(1);
+ }
+
+ Init();
+
+ glutReshapeFunc(Reshape);
+ glutKeyboardFunc(Key);
+ glutDisplayFunc(Draw);
+ glutMainLoop();
+ return 0;
+}
diff --git a/progs/trivial/tri-unfilled-userclip-stip.c b/progs/trivial/tri-unfilled-userclip-stip.c
new file mode 100644
index 00000000000..4aefa85032f
--- /dev/null
+++ b/progs/trivial/tri-unfilled-userclip-stip.c
@@ -0,0 +1,147 @@
+/*
+ * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and
+ * its documentation for any purpose is hereby granted without fee, provided
+ * that (i) the above copyright notices and this permission notice appear in
+ * all copies of the software and related documentation, and (ii) the name of
+ * Silicon Graphics may not be used in any advertising or
+ * publicity relating to the software without the specific, prior written
+ * permission of Silicon Graphics.
+ *
+ * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF
+ * ANY KIND,
+ * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
+ * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * IN NO EVENT SHALL SILICON GRAPHICS BE LIABLE FOR
+ * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
+ * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
+ * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+ * OF THIS SOFTWARE.
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <GL/glut.h>
+
+
+#define CI_OFFSET_1 16
+#define CI_OFFSET_2 32
+
+
+GLenum doubleBuffer;
+
+static void Init(void)
+{
+ static GLdouble plane[4] = { -.5, 0, 1, 0 };
+
+ fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
+ fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
+ fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
+
+ glClearColor(0.0, 0.0, 1.0, 0.0);
+ glClipPlane(GL_CLIP_PLANE0, plane);
+ glEnable(GL_CLIP_PLANE0);
+ glLineWidth( 4 );
+}
+
+static void Reshape(int width, int height)
+{
+
+ glViewport(0, 0, (GLint)width, (GLint)height);
+
+ glMatrixMode(GL_PROJECTION);
+ glLoadIdentity();
+/* glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0); */
+ glMatrixMode(GL_MODELVIEW);
+}
+
+static void Key(unsigned char key, int x, int y)
+{
+
+ switch (key) {
+ case 27:
+ exit(1);
+ default:
+ return;
+ }
+
+ glutPostRedisplay();
+}
+
+static void Draw(void)
+{
+ glClear(GL_COLOR_BUFFER_BIT);
+ glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
+
+ glEnable(GL_LINE_STIPPLE);
+ glLineStipple( 5, 0xfffe );
+
+
+
+ glBegin(GL_TRIANGLES);
+ glColor3f(0,0,.7);
+ glVertex3f( 0.9, -0.9, 0.0);
+ glColor3f(.8,0,0);
+ glVertex3f( 0.9, 0.9, 0.0);
+ glColor3f(0,.9,0);
+ glVertex3f(-0.9, 0.0, 0.0);
+ glEnd();
+
+ glFlush();
+
+ if (doubleBuffer) {
+ glutSwapBuffers();
+ }
+}
+
+static GLenum Args(int argc, char **argv)
+{
+ GLint i;
+
+ doubleBuffer = GL_FALSE;
+
+ for (i = 1; i < argc; i++) {
+ if (strcmp(argv[i], "-sb") == 0) {
+ doubleBuffer = GL_FALSE;
+ } else if (strcmp(argv[i], "-db") == 0) {
+ doubleBuffer = GL_TRUE;
+ } else {
+ fprintf(stderr, "%s (Bad option).\n", argv[i]);
+ return GL_FALSE;
+ }
+ }
+ return GL_TRUE;
+}
+
+int main(int argc, char **argv)
+{
+ GLenum type;
+
+ glutInit(&argc, argv);
+
+ if (Args(argc, argv) == GL_FALSE) {
+ exit(1);
+ }
+
+ glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
+
+ type = GLUT_RGB;
+ type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
+ glutInitDisplayMode(type);
+
+ if (glutCreateWindow("First Tri") == GL_FALSE) {
+ exit(1);
+ }
+
+ Init();
+
+ glutReshapeFunc(Reshape);
+ glutKeyboardFunc(Key);
+ glutDisplayFunc(Draw);
+ glutMainLoop();
+ return 0;
+}
diff --git a/progs/trivial/tri-unfilled-userclip.c b/progs/trivial/tri-unfilled-userclip.c
index dc93a8f1abf..9201f9d433c 100644
--- a/progs/trivial/tri-unfilled-userclip.c
+++ b/progs/trivial/tri-unfilled-userclip.c
@@ -123,7 +123,7 @@ int main(int argc, char **argv)
glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
- type = GLUT_RGB;
+ type = GLUT_RGB | GLUT_ALPHA;
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
diff --git a/progs/trivial/tri-unfilled.c b/progs/trivial/tri-unfilled.c
index 73961bc93a6..1e44823db5a 100644
--- a/progs/trivial/tri-unfilled.c
+++ b/progs/trivial/tri-unfilled.c
@@ -120,7 +120,7 @@ int main(int argc, char **argv)
glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
- type = GLUT_RGB;
+ type = GLUT_RGB | GLUT_ALPHA;
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
diff --git a/progs/trivial/tri-userclip.c b/progs/trivial/tri-userclip.c
index cde9662ace9..ccf631dff80 100644
--- a/progs/trivial/tri-userclip.c
+++ b/progs/trivial/tri-userclip.c
@@ -122,7 +122,7 @@ int main(int argc, char **argv)
glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
- type = GLUT_RGB;
+ type = GLUT_RGB | GLUT_ALPHA;
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
diff --git a/progs/trivial/tri-z-9.c b/progs/trivial/tri-z-9.c
new file mode 100644
index 00000000000..4bd99861660
--- /dev/null
+++ b/progs/trivial/tri-z-9.c
@@ -0,0 +1,139 @@
+/*
+ * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and
+ * its documentation for any purpose is hereby granted without fee, provided
+ * that (i) the above copyright notices and this permission notice appear in
+ * all copies of the software and related documentation, and (ii) the name of
+ * Silicon Graphics may not be used in any advertising or
+ * publicity relating to the software without the specific, prior written
+ * permission of Silicon Graphics.
+ *
+ * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF
+ * ANY KIND,
+ * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
+ * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * IN NO EVENT SHALL SILICON GRAPHICS BE LIABLE FOR
+ * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
+ * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
+ * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+ * OF THIS SOFTWARE.
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <GL/glut.h>
+
+
+#define CI_OFFSET_1 16
+#define CI_OFFSET_2 32
+
+
+GLenum doubleBuffer;
+
+static void Init(void)
+{
+ fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
+ fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
+ fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
+
+}
+
+static void Reshape(int width, int height)
+{
+
+ glViewport(0, 0, (GLint)width, (GLint)height);
+
+ glMatrixMode(GL_PROJECTION);
+ glLoadIdentity();
+ glOrtho(-1.0, 1.0, -1.0, 1.0, 1, -1);
+ glMatrixMode(GL_MODELVIEW);
+}
+
+static void Key(unsigned char key, int x, int y)
+{
+
+ switch (key) {
+ case 27:
+ exit(1);
+ default:
+ return;
+ }
+
+ glutPostRedisplay();
+}
+
+static void Draw(void)
+{
+ glClearColor(0.0, 0.0, 1.0, 0.0);
+ glClearDepth(1.0);
+ glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+ glDepthFunc(GL_EQUAL);
+ glEnable(GL_DEPTH_TEST);
+
+ glBegin(GL_TRIANGLES);
+ glColor3f(0,0,.7);
+ glVertex3f( 0.9, -0.9, .5);
+ glColor3f(.8,0,0);
+ glVertex3f( 0.9, 0.9, .5);
+ glColor3f(0,.9,0);
+ glVertex3f(-0.9, 0.0, .5);
+ glEnd();
+
+ glFlush();
+
+ if (doubleBuffer) {
+ glutSwapBuffers();
+ }
+}
+
+static GLenum Args(int argc, char **argv)
+{
+ GLint i;
+
+ doubleBuffer = GL_FALSE;
+
+ for (i = 1; i < argc; i++) {
+ if (strcmp(argv[i], "-sb") == 0) {
+ doubleBuffer = GL_FALSE;
+ } else if (strcmp(argv[i], "-db") == 0) {
+ doubleBuffer = GL_TRUE;
+ } else {
+ fprintf(stderr, "%s (Bad option).\n", argv[i]);
+ return GL_FALSE;
+ }
+ }
+ return GL_TRUE;
+}
+
+int main(int argc, char **argv)
+{
+ GLenum type;
+
+ glutInit(&argc, argv);
+
+ if (Args(argc, argv) == GL_FALSE) {
+ exit(1);
+ }
+
+ glutInitWindowPosition(100, 0); glutInitWindowSize( 250, 250);
+
+ type = GLUT_RGB | GLUT_DEPTH;
+ type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
+ glutInitDisplayMode(type);
+
+ if (glutCreateWindow("First Tri") == GL_FALSE) {
+ exit(1);
+ }
+
+ Init();
+
+ glutReshapeFunc(Reshape);
+ glutKeyboardFunc(Key);
+ glutDisplayFunc(Draw);
+ glutMainLoop();
+ return 0;
+}
diff --git a/progs/trivial/tri-z-eq.c b/progs/trivial/tri-z-eq.c
new file mode 100644
index 00000000000..ad5f31a5588
--- /dev/null
+++ b/progs/trivial/tri-z-eq.c
@@ -0,0 +1,139 @@
+/*
+ * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and
+ * its documentation for any purpose is hereby granted without fee, provided
+ * that (i) the above copyright notices and this permission notice appear in
+ * all copies of the software and related documentation, and (ii) the name of
+ * Silicon Graphics may not be used in any advertising or
+ * publicity relating to the software without the specific, prior written
+ * permission of Silicon Graphics.
+ *
+ * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF
+ * ANY KIND,
+ * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
+ * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * IN NO EVENT SHALL SILICON GRAPHICS BE LIABLE FOR
+ * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
+ * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
+ * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+ * OF THIS SOFTWARE.
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <GL/glut.h>
+
+
+#define CI_OFFSET_1 16
+#define CI_OFFSET_2 32
+
+
+GLenum doubleBuffer;
+
+static void Init(void)
+{
+ fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
+ fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
+ fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
+
+}
+
+static void Reshape(int width, int height)
+{
+
+ glViewport(0, 0, (GLint)width, (GLint)height);
+
+ glMatrixMode(GL_PROJECTION);
+ glLoadIdentity();
+ glOrtho(-1.0, 1.0, -1.0, 1.0, 1, -1);
+ glMatrixMode(GL_MODELVIEW);
+}
+
+static void Key(unsigned char key, int x, int y)
+{
+
+ switch (key) {
+ case 27:
+ exit(1);
+ default:
+ return;
+ }
+
+ glutPostRedisplay();
+}
+
+static void Draw(void)
+{
+ glClearColor(0.0, 0.0, 1.0, 0.0);
+ glClearDepth(1.0);
+ glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+ glDepthFunc(GL_EQUAL);
+ glEnable(GL_DEPTH_TEST);
+
+ glBegin(GL_TRIANGLES);
+ glColor3f(0,0,.7);
+ glVertex3f( 0.9, -0.9, 1.0);
+ glColor3f(.8,0,0);
+ glVertex3f( 0.9, 0.9, 1.0);
+ glColor3f(0,.9,0);
+ glVertex3f(-0.9, 0.0, 1.0);
+ glEnd();
+
+ glFlush();
+
+ if (doubleBuffer) {
+ glutSwapBuffers();
+ }
+}
+
+static GLenum Args(int argc, char **argv)
+{
+ GLint i;
+
+ doubleBuffer = GL_FALSE;
+
+ for (i = 1; i < argc; i++) {
+ if (strcmp(argv[i], "-sb") == 0) {
+ doubleBuffer = GL_FALSE;
+ } else if (strcmp(argv[i], "-db") == 0) {
+ doubleBuffer = GL_TRUE;
+ } else {
+ fprintf(stderr, "%s (Bad option).\n", argv[i]);
+ return GL_FALSE;
+ }
+ }
+ return GL_TRUE;
+}
+
+int main(int argc, char **argv)
+{
+ GLenum type;
+
+ glutInit(&argc, argv);
+
+ if (Args(argc, argv) == GL_FALSE) {
+ exit(1);
+ }
+
+ glutInitWindowPosition(100, 0); glutInitWindowSize( 250, 250);
+
+ type = GLUT_RGB | GLUT_DEPTH;
+ type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
+ glutInitDisplayMode(type);
+
+ if (glutCreateWindow("First Tri") == GL_FALSE) {
+ exit(1);
+ }
+
+ Init();
+
+ glutReshapeFunc(Reshape);
+ glutKeyboardFunc(Key);
+ glutDisplayFunc(Draw);
+ glutMainLoop();
+ return 0;
+}
diff --git a/progs/trivial/tri-z.c b/progs/trivial/tri-z.c
new file mode 100644
index 00000000000..335d2b90e2b
--- /dev/null
+++ b/progs/trivial/tri-z.c
@@ -0,0 +1,174 @@
+/*
+ * Copyright (c) 1993-1997, Silicon Graphics, Inc.
+ * ALL RIGHTS RESERVED
+ * Permission to use, copy, modify, and distribute this software for
+ * any purpose and without fee is hereby granted, provided that the above
+ * copyright notice appear in all copies and that both the copyright notice
+ * and this permission notice appear in supporting documentation, and that
+ * the name of Silicon Graphics, Inc. not be used in advertising
+ * or publicity pertaining to distribution of the software without specific,
+ * written prior permission.
+ *
+ * THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS"
+ * AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE,
+ * INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR
+ * FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
+ * GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT,
+ * SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY
+ * KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION,
+ * LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF
+ * THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC. HAS BEEN
+ * ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE
+ * POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ * US Government Users Restricted Rights
+ * Use, duplication, or disclosure by the Government is subject to
+ * restrictions set forth in FAR 52.227.19(c)(2) or subparagraph
+ * (c)(1)(ii) of the Rights in Technical Data and Computer Software
+ * clause at DFARS 252.227-7013 and/or in similar or successor
+ * clauses in the FAR or the DOD or NASA FAR Supplement.
+ * Unpublished-- rights reserved under the copyright laws of the
+ * United States. Contractor/manufacturer is Silicon Graphics,
+ * Inc., 2011 N. Shoreline Blvd., Mountain View, CA 94039-7311.
+ *
+ * OpenGL(R) is a registered trademark of Silicon Graphics, Inc.
+ */
+
+#include <GL/glut.h>
+#include <stdlib.h>
+#include <stdio.h>
+
+static int leftFirst = GL_TRUE;
+
+static struct { GLenum func; const char *str; } funcs[] =
+ {
+ { GL_LESS, "GL_LESS" },
+ { GL_LEQUAL, "GL_LEQUAL" },
+ { GL_GREATER, "GL_GREATER" },
+ { GL_GEQUAL, "GL_GEQUAL" },
+ { GL_EQUAL, "GL_EQUAL" },
+ { GL_NOTEQUAL, "GL_NOTEQUAL" },
+ { GL_ALWAYS, "GL_ALWAYS" },
+ { GL_NEVER, "GL_NEVER" },
+ };
+
+#define NUM_FUNCS (sizeof(funcs) / sizeof(funcs[0]))
+
+static int curFunc = 0;
+static double clearVal = 1.0;
+
+
+static void usage(void)
+{
+ printf("t - toggle rendering order of triangles\n");
+ printf("c - toggle Z clear value between 0, 1\n");
+ printf("f - cycle through depth test functions\n");
+}
+
+
+static void init(void)
+{
+ glEnable(GL_DEPTH_TEST);
+ glClearColor (1.0, 0.0, 0.0, 0.0);
+}
+
+static void drawLeftTriangle(void)
+{
+ /* draw yellow triangle on LHS of screen */
+ glBegin (GL_TRIANGLES);
+ glColor4f(1.0, 1.0, 0.0, 0.75);
+ glVertex3f(0.1, 0.9, -1.0);
+ glVertex3f(0.1, 0.1, -1.0);
+ glVertex3f(0.8, 0.5, 1.0);
+ glEnd();
+}
+
+static void drawRightTriangle(void)
+{
+ /* draw cyan triangle on RHS of screen */
+ glBegin (GL_TRIANGLES);
+ glColor4f(0.0, 1.0, 1.0, 0.75);
+ glVertex3f(0.9, 0.9, 0.0);
+ glVertex3f(0.2, 0.5, 0.0);
+ glVertex3f(0.9, 0.1, 0.0);
+ glEnd();
+}
+
+void display(void)
+{
+ printf("GL_CLEAR_DEPTH = %f GL_DEPTH_FUNC = %s\n",
+ clearVal, funcs[curFunc].str);
+ glClearDepth(clearVal);
+ glDepthFunc(funcs[curFunc].func);
+
+ glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+
+ if (leftFirst) {
+ drawLeftTriangle();
+ drawRightTriangle();
+ }
+ else {
+ drawRightTriangle();
+ drawLeftTriangle();
+ }
+
+ glFlush();
+}
+
+void reshape(int w, int h)
+{
+ glViewport(0, 0, (GLsizei) w, (GLsizei) h);
+ glMatrixMode(GL_PROJECTION);
+ glLoadIdentity();
+ if (w <= h)
+ gluOrtho2D (0.0, 1.0, 0.0, 1.0*(GLfloat)h/(GLfloat)w);
+ else
+ gluOrtho2D (0.0, 1.0*(GLfloat)w/(GLfloat)h, 0.0, 1.0);
+}
+
+/* ARGSUSED1 */
+void keyboard(unsigned char key, int x, int y)
+{
+ switch (key) {
+ case 'c':
+ case 'C':
+ clearVal = 1.0 - clearVal;
+ glutPostRedisplay();
+ break;
+ case 'f':
+ case 'F':
+ curFunc = (curFunc + 1) % NUM_FUNCS;
+ glutPostRedisplay();
+ break;
+ case 't':
+ case 'T':
+ leftFirst = !leftFirst;
+ glutPostRedisplay();
+ break;
+ case 27: /* Escape key */
+ exit(0);
+ break;
+ default:
+ break;
+ }
+}
+
+/* Main Loop
+ * Open window with initial window size, title bar,
+ * RGBA display mode, and handle input events.
+ */
+int main(int argc, char** argv)
+{
+ glutInit(&argc, argv);
+ glutInitDisplayMode (GLUT_SINGLE | GLUT_RGB | GLUT_DEPTH);
+ glutInitWindowSize (200, 200);
+ glutCreateWindow (argv[0]);
+ glutReshapeFunc (reshape);
+ glutKeyboardFunc (keyboard);
+ glutDisplayFunc (display);
+ init();
+ usage();
+ glutMainLoop();
+ return 0;
+}
diff --git a/progs/trivial/tri.c b/progs/trivial/tri.c
index d4a7f08ae34..d3c6b59ea5d 100644
--- a/progs/trivial/tri.c
+++ b/progs/trivial/tri.c
@@ -32,7 +32,7 @@
#define CI_OFFSET_2 32
-GLenum doubleBuffer;
+GLenum doubleBuffer = 1;
int win;
static void Init(void)
@@ -41,7 +41,7 @@ static void Init(void)
fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
- glClearColor(0.0, 0.0, 1.0, 0.0);
+ glClearColor(0.3, 0.1, 0.3, 0.0);
}
static void Reshape(int width, int height)
@@ -57,16 +57,13 @@ static void Reshape(int width, int height)
static void Key(unsigned char key, int x, int y)
{
-
- switch (key) {
- case 27:
- glutDestroyWindow(win);
- exit(0);
- default:
- return;
- }
-
- glutPostRedisplay();
+ switch (key) {
+ case 27:
+ exit(0);
+ default:
+ glutPostRedisplay();
+ return;
+ }
}
static void Draw(void)
@@ -74,12 +71,12 @@ static void Draw(void)
glClear(GL_COLOR_BUFFER_BIT);
glBegin(GL_TRIANGLES);
- glColor3f(0,0,.7);
- glVertex3f( 0.9, -0.9, -30.0);
glColor3f(.8,0,0);
- glVertex3f( 0.9, 0.9, -30.0);
+ glVertex3f(-0.9, -0.9, -30.0);
glColor3f(0,.9,0);
- glVertex3f(-0.9, 0.0, -30.0);
+ glVertex3f( 0.9, -0.9, -30.0);
+ glColor3f(0,0,.7);
+ glVertex3f( 0.0, 0.9, -30.0);
glEnd();
glFlush();
@@ -93,8 +90,6 @@ static GLenum Args(int argc, char **argv)
{
GLint i;
- doubleBuffer = GL_FALSE;
-
for (i = 1; i < argc; i++) {
if (strcmp(argv[i], "-sb") == 0) {
doubleBuffer = GL_FALSE;
@@ -120,7 +115,7 @@ int main(int argc, char **argv)
glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
- type = GLUT_RGB;
+ type = GLUT_RGB | GLUT_ALPHA;
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
@@ -135,5 +130,5 @@ int main(int argc, char **argv)
glutKeyboardFunc(Key);
glutDisplayFunc(Draw);
glutMainLoop();
- return 0;
+ return 0;
}
diff --git a/progs/trivial/trifan-flat-clip.c b/progs/trivial/trifan-flat-clip.c
new file mode 100644
index 00000000000..04042fac704
--- /dev/null
+++ b/progs/trivial/trifan-flat-clip.c
@@ -0,0 +1,140 @@
+/*
+ * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and
+ * its documentation for any purpose is hereby granted without fee, provided
+ * that (i) the above copyright notices and this permission notice appear in
+ * all copies of the software and related documentation, and (ii) the name of
+ * Silicon Graphics may not be used in any advertising or
+ * publicity relating to the software without the specific, prior written
+ * permission of Silicon Graphics.
+ *
+ * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF
+ * ANY KIND,
+ * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
+ * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * IN NO EVENT SHALL SILICON GRAPHICS BE LIABLE FOR
+ * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
+ * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
+ * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+ * OF THIS SOFTWARE.
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <GL/glut.h>
+
+
+#define CI_OFFSET_1 16
+#define CI_OFFSET_2 32
+
+
+GLenum doubleBuffer;
+
+static void Init(void)
+{
+ fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
+ fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
+ fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
+
+ glClearColor(0.0, 0.0, 1.0, 0.0);
+}
+
+static void Reshape(int width, int height)
+{
+
+ glViewport(0, 0, (GLint)width, (GLint)height);
+
+ glMatrixMode(GL_PROJECTION);
+ glLoadIdentity();
+ glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
+ glMatrixMode(GL_MODELVIEW);
+}
+
+static void Key(unsigned char key, int x, int y)
+{
+
+ switch (key) {
+ case 27:
+ exit(1);
+ default:
+ return;
+ }
+
+ glutPostRedisplay();
+}
+
+static void Draw(void)
+{
+ glClear(GL_COLOR_BUFFER_BIT);
+ glShadeModel(GL_FLAT);
+
+
+ glBegin(GL_TRIANGLE_FAN);
+ glColor3f(1,0,0);
+ glVertex3f( 0, 0, -30.0);
+ glColor3f(1,1,0);
+ glVertex3f( 1.3, 1.1, -30.0);
+ glColor3f(1,0,1);
+ glVertex3f(-.9, .9, -30.0);
+ glColor3f(0,1,1);
+ glVertex3f(-1.1, -1.3, -30.0);
+ glEnd();
+
+ glFlush();
+
+ if (doubleBuffer) {
+ glutSwapBuffers();
+ }
+}
+
+static GLenum Args(int argc, char **argv)
+{
+ GLint i;
+
+ doubleBuffer = GL_FALSE;
+
+ for (i = 1; i < argc; i++) {
+ if (strcmp(argv[i], "-sb") == 0) {
+ doubleBuffer = GL_FALSE;
+ } else if (strcmp(argv[i], "-db") == 0) {
+ doubleBuffer = GL_TRUE;
+ } else {
+ fprintf(stderr, "%s (Bad option).\n", argv[i]);
+ return GL_FALSE;
+ }
+ }
+ return GL_TRUE;
+}
+
+int main(int argc, char **argv)
+{
+ GLenum type;
+
+ glutInit(&argc, argv);
+
+ if (Args(argc, argv) == GL_FALSE) {
+ exit(1);
+ }
+
+ glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
+
+ type = GLUT_RGB;
+ type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
+ glutInitDisplayMode(type);
+
+ if (glutCreateWindow("First Tri") == GL_FALSE) {
+ exit(1);
+ }
+
+ Init();
+
+ glutReshapeFunc(Reshape);
+ glutKeyboardFunc(Key);
+ glutDisplayFunc(Draw);
+ glutMainLoop();
+ return 0;
+}
diff --git a/progs/trivial/trifan-flat-unfilled-clip.c b/progs/trivial/trifan-flat-unfilled-clip.c
new file mode 100644
index 00000000000..25224412cc9
--- /dev/null
+++ b/progs/trivial/trifan-flat-unfilled-clip.c
@@ -0,0 +1,144 @@
+/*
+ * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and
+ * its documentation for any purpose is hereby granted without fee, provided
+ * that (i) the above copyright notices and this permission notice appear in
+ * all copies of the software and related documentation, and (ii) the name of
+ * Silicon Graphics may not be used in any advertising or
+ * publicity relating to the software without the specific, prior written
+ * permission of Silicon Graphics.
+ *
+ * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF
+ * ANY KIND,
+ * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
+ * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * IN NO EVENT SHALL SILICON GRAPHICS BE LIABLE FOR
+ * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
+ * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
+ * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+ * OF THIS SOFTWARE.
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <GL/glut.h>
+
+
+#define CI_OFFSET_1 16
+#define CI_OFFSET_2 32
+
+
+GLenum doubleBuffer;
+
+static void Init(void)
+{
+ fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
+ fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
+ fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
+
+ glClearColor(0.0, 0.0, 1.0, 0.0);
+}
+
+static void Reshape(int width, int height)
+{
+
+ glViewport(0, 0, (GLint)width, (GLint)height);
+
+ glMatrixMode(GL_PROJECTION);
+ glLoadIdentity();
+ glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
+ glMatrixMode(GL_MODELVIEW);
+}
+
+static void Key(unsigned char key, int x, int y)
+{
+
+ switch (key) {
+ case 27:
+ exit(1);
+ default:
+ return;
+ }
+
+ glutPostRedisplay();
+}
+
+static void Draw(void)
+{
+ glClear(GL_COLOR_BUFFER_BIT);
+ glShadeModel(GL_FLAT);
+
+ glPolygonMode(GL_FRONT, GL_LINE);
+ glPolygonMode(GL_BACK, GL_LINE);
+ glLineWidth(4.0);
+
+
+ glBegin(GL_TRIANGLE_FAN);
+ glColor3f(1,0,0);
+ glVertex3f( 0, 0, -30.0);
+ glColor3f(1,1,0);
+ glVertex3f( 1.3, 1.1, -30.0);
+ glColor3f(1,0,1);
+ glVertex3f(-.9, .9, -30.0);
+ glColor3f(0,1,1);
+ glVertex3f(-1.1, -1.3, -30.0);
+ glEnd();
+
+ glFlush();
+
+ if (doubleBuffer) {
+ glutSwapBuffers();
+ }
+}
+
+static GLenum Args(int argc, char **argv)
+{
+ GLint i;
+
+ doubleBuffer = GL_FALSE;
+
+ for (i = 1; i < argc; i++) {
+ if (strcmp(argv[i], "-sb") == 0) {
+ doubleBuffer = GL_FALSE;
+ } else if (strcmp(argv[i], "-db") == 0) {
+ doubleBuffer = GL_TRUE;
+ } else {
+ fprintf(stderr, "%s (Bad option).\n", argv[i]);
+ return GL_FALSE;
+ }
+ }
+ return GL_TRUE;
+}
+
+int main(int argc, char **argv)
+{
+ GLenum type;
+
+ glutInit(&argc, argv);
+
+ if (Args(argc, argv) == GL_FALSE) {
+ exit(1);
+ }
+
+ glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
+
+ type = GLUT_RGB;
+ type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
+ glutInitDisplayMode(type);
+
+ if (glutCreateWindow("First Tri") == GL_FALSE) {
+ exit(1);
+ }
+
+ Init();
+
+ glutReshapeFunc(Reshape);
+ glutKeyboardFunc(Key);
+ glutDisplayFunc(Draw);
+ glutMainLoop();
+ return 0;
+}
diff --git a/progs/trivial/trifan-flat.c b/progs/trivial/trifan-flat.c
new file mode 100644
index 00000000000..737eccdcae7
--- /dev/null
+++ b/progs/trivial/trifan-flat.c
@@ -0,0 +1,140 @@
+/*
+ * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and
+ * its documentation for any purpose is hereby granted without fee, provided
+ * that (i) the above copyright notices and this permission notice appear in
+ * all copies of the software and related documentation, and (ii) the name of
+ * Silicon Graphics may not be used in any advertising or
+ * publicity relating to the software without the specific, prior written
+ * permission of Silicon Graphics.
+ *
+ * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF
+ * ANY KIND,
+ * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
+ * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * IN NO EVENT SHALL SILICON GRAPHICS BE LIABLE FOR
+ * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
+ * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
+ * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+ * OF THIS SOFTWARE.
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <GL/glut.h>
+
+
+#define CI_OFFSET_1 16
+#define CI_OFFSET_2 32
+
+
+GLenum doubleBuffer;
+
+static void Init(void)
+{
+ fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
+ fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
+ fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
+
+ glClearColor(0.0, 0.0, 1.0, 0.0);
+}
+
+static void Reshape(int width, int height)
+{
+
+ glViewport(0, 0, (GLint)width, (GLint)height);
+
+ glMatrixMode(GL_PROJECTION);
+ glLoadIdentity();
+ glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
+ glMatrixMode(GL_MODELVIEW);
+}
+
+static void Key(unsigned char key, int x, int y)
+{
+
+ switch (key) {
+ case 27:
+ exit(1);
+ default:
+ return;
+ }
+
+ glutPostRedisplay();
+}
+
+static void Draw(void)
+{
+ glClear(GL_COLOR_BUFFER_BIT);
+ glShadeModel(GL_FLAT);
+
+
+ glBegin(GL_TRIANGLE_FAN);
+ glColor3f(1,0,0);
+ glVertex3f( 0.9, -0.9, -30.0);
+ glColor3f(1,1,0);
+ glVertex3f( 0.9, 0.9, -30.0);
+ glColor3f(1,0,1);
+ glVertex3f(-0.9, 0.9, -30.0);
+ glColor3f(0,1,1);
+ glVertex3f(-0.9, -0.9, -30.0);
+ glEnd();
+
+ glFlush();
+
+ if (doubleBuffer) {
+ glutSwapBuffers();
+ }
+}
+
+static GLenum Args(int argc, char **argv)
+{
+ GLint i;
+
+ doubleBuffer = GL_FALSE;
+
+ for (i = 1; i < argc; i++) {
+ if (strcmp(argv[i], "-sb") == 0) {
+ doubleBuffer = GL_FALSE;
+ } else if (strcmp(argv[i], "-db") == 0) {
+ doubleBuffer = GL_TRUE;
+ } else {
+ fprintf(stderr, "%s (Bad option).\n", argv[i]);
+ return GL_FALSE;
+ }
+ }
+ return GL_TRUE;
+}
+
+int main(int argc, char **argv)
+{
+ GLenum type;
+
+ glutInit(&argc, argv);
+
+ if (Args(argc, argv) == GL_FALSE) {
+ exit(1);
+ }
+
+ glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
+
+ type = GLUT_RGB | GLUT_ALPHA;
+ type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
+ glutInitDisplayMode(type);
+
+ if (glutCreateWindow("First Tri") == GL_FALSE) {
+ exit(1);
+ }
+
+ Init();
+
+ glutReshapeFunc(Reshape);
+ glutKeyboardFunc(Key);
+ glutDisplayFunc(Draw);
+ glutMainLoop();
+ return 0;
+}
diff --git a/progs/trivial/trifan-unfilled.c b/progs/trivial/trifan-unfilled.c
new file mode 100644
index 00000000000..8e7454108c0
--- /dev/null
+++ b/progs/trivial/trifan-unfilled.c
@@ -0,0 +1,139 @@
+/*
+ * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and
+ * its documentation for any purpose is hereby granted without fee, provided
+ * that (i) the above copyright notices and this permission notice appear in
+ * all copies of the software and related documentation, and (ii) the name of
+ * Silicon Graphics may not be used in any advertising or
+ * publicity relating to the software without the specific, prior written
+ * permission of Silicon Graphics.
+ *
+ * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF
+ * ANY KIND,
+ * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
+ * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * IN NO EVENT SHALL SILICON GRAPHICS BE LIABLE FOR
+ * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
+ * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
+ * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+ * OF THIS SOFTWARE.
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <GL/glut.h>
+
+
+#define CI_OFFSET_1 16
+#define CI_OFFSET_2 32
+
+
+GLenum doubleBuffer;
+
+static void Init(void)
+{
+ fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
+ fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
+ fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
+
+ glClearColor(0.0, 0.0, 1.0, 0.0);
+}
+
+static void Reshape(int width, int height)
+{
+
+ glViewport(0, 0, (GLint)width, (GLint)height);
+
+ glMatrixMode(GL_PROJECTION);
+ glLoadIdentity();
+ glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
+ glMatrixMode(GL_MODELVIEW);
+}
+
+static void Key(unsigned char key, int x, int y)
+{
+
+ switch (key) {
+ case 27:
+ exit(1);
+ default:
+ return;
+ }
+
+ glutPostRedisplay();
+}
+
+static void Draw(void)
+{
+ glClear(GL_COLOR_BUFFER_BIT);
+ glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
+
+ glBegin(GL_TRIANGLE_FAN);
+ glColor3f(1,0,0);
+ glVertex3f( 0.9, -0.9, -30.0);
+ glColor3f(1,1,0);
+ glVertex3f( 0.9, 0.9, -30.0);
+ glColor3f(1,0,1);
+ glVertex3f(-0.9, 0.9, -30.0);
+ glColor3f(0,1,1);
+ glVertex3f(-0.9, -0.9, -30.0);
+ glEnd();
+
+ glFlush();
+
+ if (doubleBuffer) {
+ glutSwapBuffers();
+ }
+}
+
+static GLenum Args(int argc, char **argv)
+{
+ GLint i;
+
+ doubleBuffer = GL_FALSE;
+
+ for (i = 1; i < argc; i++) {
+ if (strcmp(argv[i], "-sb") == 0) {
+ doubleBuffer = GL_FALSE;
+ } else if (strcmp(argv[i], "-db") == 0) {
+ doubleBuffer = GL_TRUE;
+ } else {
+ fprintf(stderr, "%s (Bad option).\n", argv[i]);
+ return GL_FALSE;
+ }
+ }
+ return GL_TRUE;
+}
+
+int main(int argc, char **argv)
+{
+ GLenum type;
+
+ glutInit(&argc, argv);
+
+ if (Args(argc, argv) == GL_FALSE) {
+ exit(1);
+ }
+
+ glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
+
+ type = GLUT_RGB | GLUT_ALPHA;
+ type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
+ glutInitDisplayMode(type);
+
+ if (glutCreateWindow("First Tri") == GL_FALSE) {
+ exit(1);
+ }
+
+ Init();
+
+ glutReshapeFunc(Reshape);
+ glutKeyboardFunc(Key);
+ glutDisplayFunc(Draw);
+ glutMainLoop();
+ return 0;
+}
diff --git a/progs/trivial/trifan.c b/progs/trivial/trifan.c
new file mode 100644
index 00000000000..ecb0424393e
--- /dev/null
+++ b/progs/trivial/trifan.c
@@ -0,0 +1,138 @@
+/*
+ * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and
+ * its documentation for any purpose is hereby granted without fee, provided
+ * that (i) the above copyright notices and this permission notice appear in
+ * all copies of the software and related documentation, and (ii) the name of
+ * Silicon Graphics may not be used in any advertising or
+ * publicity relating to the software without the specific, prior written
+ * permission of Silicon Graphics.
+ *
+ * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF
+ * ANY KIND,
+ * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
+ * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * IN NO EVENT SHALL SILICON GRAPHICS BE LIABLE FOR
+ * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
+ * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
+ * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+ * OF THIS SOFTWARE.
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <GL/glut.h>
+
+
+#define CI_OFFSET_1 16
+#define CI_OFFSET_2 32
+
+
+GLenum doubleBuffer;
+
+static void Init(void)
+{
+ fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
+ fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
+ fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
+
+ glClearColor(0.0, 0.0, 1.0, 0.0);
+}
+
+static void Reshape(int width, int height)
+{
+
+ glViewport(0, 0, (GLint)width, (GLint)height);
+
+ glMatrixMode(GL_PROJECTION);
+ glLoadIdentity();
+ glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
+ glMatrixMode(GL_MODELVIEW);
+}
+
+static void Key(unsigned char key, int x, int y)
+{
+
+ switch (key) {
+ case 27:
+ exit(1);
+ default:
+ return;
+ }
+
+ glutPostRedisplay();
+}
+
+static void Draw(void)
+{
+ glClear(GL_COLOR_BUFFER_BIT);
+
+ glBegin(GL_TRIANGLE_FAN);
+ glColor3f(1,0,0);
+ glVertex3f( 0.9, -0.9, -30.0);
+ glColor3f(1,1,0);
+ glVertex3f( 0.9, 0.9, -30.0);
+ glColor3f(1,0,1);
+ glVertex3f(-0.9, 0.9, -30.0);
+ glColor3f(0,1,1);
+ glVertex3f(-0.9, -0.9, -30.0);
+ glEnd();
+
+ glFlush();
+
+ if (doubleBuffer) {
+ glutSwapBuffers();
+ }
+}
+
+static GLenum Args(int argc, char **argv)
+{
+ GLint i;
+
+ doubleBuffer = GL_FALSE;
+
+ for (i = 1; i < argc; i++) {
+ if (strcmp(argv[i], "-sb") == 0) {
+ doubleBuffer = GL_FALSE;
+ } else if (strcmp(argv[i], "-db") == 0) {
+ doubleBuffer = GL_TRUE;
+ } else {
+ fprintf(stderr, "%s (Bad option).\n", argv[i]);
+ return GL_FALSE;
+ }
+ }
+ return GL_TRUE;
+}
+
+int main(int argc, char **argv)
+{
+ GLenum type;
+
+ glutInit(&argc, argv);
+
+ if (Args(argc, argv) == GL_FALSE) {
+ exit(1);
+ }
+
+ glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
+
+ type = GLUT_RGB | GLUT_ALPHA;
+ type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
+ glutInitDisplayMode(type);
+
+ if (glutCreateWindow("First Tri") == GL_FALSE) {
+ exit(1);
+ }
+
+ Init();
+
+ glutReshapeFunc(Reshape);
+ glutKeyboardFunc(Key);
+ glutDisplayFunc(Draw);
+ glutMainLoop();
+ return 0;
+}
diff --git a/progs/trivial/tristrip-flat.c b/progs/trivial/tristrip-flat.c
new file mode 100644
index 00000000000..e048233e67c
--- /dev/null
+++ b/progs/trivial/tristrip-flat.c
@@ -0,0 +1,148 @@
+/*
+ * Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and
+ * its documentation for any purpose is hereby granted without fee, provided
+ * that (i) the above copyright notices and this permission notice appear in
+ * all copies of the software and related documentation, and (ii) the name of
+ * Silicon Graphics may not be used in any advertising or
+ * publicity relating to the software without the specific, prior written
+ * permission of Silicon Graphics.
+ *
+ * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF
+ * ANY KIND,
+ * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
+ * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * IN NO EVENT SHALL SILICON GRAPHICS BE LIABLE FOR
+ * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
+ * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
+ * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+ * OF THIS SOFTWARE.
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <GL/glut.h>
+
+
+#define CI_OFFSET_1 16
+#define CI_OFFSET_2 32
+
+
+GLenum doubleBuffer;
+
+static void Init(void)
+{
+ fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
+ fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
+ fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
+
+ glClearColor(0.0, 0.0, 1.0, 0.0);
+}
+
+static void Reshape(int width, int height)
+{
+
+ glViewport(0, 0, (GLint)width, (GLint)height);
+
+ glMatrixMode(GL_PROJECTION);
+ glLoadIdentity();
+ glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
+ glMatrixMode(GL_MODELVIEW);
+}
+
+static void Key(unsigned char key, int x, int y)
+{
+
+ switch (key) {
+ case 27:
+ exit(1);
+ default:
+ return;
+ }
+
+ glutPostRedisplay();
+}
+
+static void Draw(void)
+{
+ glClear(GL_COLOR_BUFFER_BIT);
+ glShadeModel(GL_FLAT);
+
+ if (0) {
+ glBegin(GL_LINES);
+ glColor3f(1,0,0);
+ glVertex3f( 0.95, -0.9, -30.0);
+ glColor3f(1,1,0);
+ glVertex3f( 0.95, 0.9, -30.0);
+ glEnd();
+ }
+
+ glBegin(GL_TRIANGLE_STRIP);
+ glColor3f(1,0,0);
+ glVertex3f( 0.9, -0.9, -30.0);
+ glColor3f(0,1,0);
+ glVertex3f( 0.9, 0.9, -30.0);
+ glColor3f(0,0,.5);
+ glVertex3f(-0.9, -0.9, -30.0);
+ glColor3f(1,1,1);
+ glVertex3f(-0.9, 0.9, -30.0);
+ glEnd();
+
+ glFlush();
+
+ if (doubleBuffer) {
+ glutSwapBuffers();
+ }
+}
+
+static GLenum Args(int argc, char **argv)
+{
+ GLint i;
+
+ doubleBuffer = GL_FALSE;
+
+ for (i = 1; i < argc; i++) {
+ if (strcmp(argv[i], "-sb") == 0) {
+ doubleBuffer = GL_FALSE;
+ } else if (strcmp(argv[i], "-db") == 0) {
+ doubleBuffer = GL_TRUE;
+ } else {
+ fprintf(stderr, "%s (Bad option).\n", argv[i]);
+ return GL_FALSE;
+ }
+ }
+ return GL_TRUE;
+}
+
+int main(int argc, char **argv)
+{
+ GLenum type;
+
+ glutInit(&argc, argv);
+
+ if (Args(argc, argv) == GL_FALSE) {
+ exit(1);
+ }
+
+ glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
+
+ type = GLUT_RGB;
+ type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
+ glutInitDisplayMode(type);
+
+ if (glutCreateWindow("First Tri") == GL_FALSE) {
+ exit(1);
+ }
+
+ Init();
+
+ glutReshapeFunc(Reshape);
+ glutKeyboardFunc(Key);
+ glutDisplayFunc(Draw);
+ glutMainLoop();
+ return 0;
+}
diff --git a/progs/trivial/tristrip.c b/progs/trivial/tristrip.c
index fa82a737112..51ea4f23251 100644
--- a/progs/trivial/tristrip.c
+++ b/progs/trivial/tristrip.c
@@ -120,7 +120,7 @@ int main(int argc, char **argv)
glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
- type = GLUT_RGB;
+ type = GLUT_RGB | GLUT_ALPHA;
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
diff --git a/progs/trivial/vbo-drawarrays.c b/progs/trivial/vbo-drawarrays.c
index fb590098a32..c29954b9033 100644
--- a/progs/trivial/vbo-drawarrays.c
+++ b/progs/trivial/vbo-drawarrays.c
@@ -5,7 +5,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#define GL_GLEXT_PROTOTYPES
+#include <GL/glew.h>
#include <GL/glut.h>
@@ -124,6 +124,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( 250, 250 );
glutInitDisplayMode( GLUT_RGB | GLUT_SINGLE | GLUT_DEPTH );
glutCreateWindow(argv[0]);
+ glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );
diff --git a/progs/trivial/vbo-drawelements.c b/progs/trivial/vbo-drawelements.c
index dddb45695cb..b1b16d920b9 100644
--- a/progs/trivial/vbo-drawelements.c
+++ b/progs/trivial/vbo-drawelements.c
@@ -5,7 +5,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#define GL_GLEXT_PROTOTYPES
+#include <GL/glew.h>
#include <GL/glut.h>
struct {
@@ -128,6 +128,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( 250, 250 );
glutInitDisplayMode( GLUT_RGB | GLUT_SINGLE | GLUT_DEPTH );
glutCreateWindow(argv[0]);
+ glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );
diff --git a/progs/trivial/vbo-drawrange.c b/progs/trivial/vbo-drawrange.c
index 407b7541f07..fa87eaf8fe5 100644
--- a/progs/trivial/vbo-drawrange.c
+++ b/progs/trivial/vbo-drawrange.c
@@ -5,7 +5,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#define GL_GLEXT_PROTOTYPES
+#include <GL/glew.h>
#include <GL/glut.h>
#define ELTOBJ 0
@@ -136,6 +136,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( 250, 250 );
glutInitDisplayMode( GLUT_RGB | GLUT_SINGLE | GLUT_DEPTH );
glutCreateWindow(argv[0]);
+ glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );
diff --git a/progs/trivial/vp-array-int.c b/progs/trivial/vp-array-int.c
new file mode 100644
index 00000000000..2e1ac1374d7
--- /dev/null
+++ b/progs/trivial/vp-array-int.c
@@ -0,0 +1,118 @@
+/* Test glGenProgramsNV(), glIsProgramNV(), glLoadProgramNV() */
+
+#include <assert.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <GL/glew.h>
+#include <GL/glut.h>
+
+GLint verts[][4] = {
+ { 1, -1, 0, 1 },
+ { 1, 1, 0, 1 },
+ { -1, 1, 0, 1 },
+ { -1, -1, 0, 1 },
+};
+
+GLubyte color[][4] = {
+ { 0x00, 0x00, 0xff, 0x00 },
+ { 0x00, 0xff, 0x00, 0x00 },
+ { 0xff, 0x00, 0x00, 0x00 },
+ { 0xff, 0xff, 0xff, 0x00 },
+};
+
+GLuint indices[] = { 0, 1, 2, 3 };
+
+static void Init( void )
+{
+ GLint errno;
+ GLuint prognum;
+
+ static const char *prog1 =
+ "!!ARBvp1.0\n"
+ "MOV result.color, vertex.color;\n"
+ "MOV result.position, vertex.position;\n"
+ "END\n";
+
+ glGenProgramsARB(1, &prognum);
+ glBindProgramARB(GL_VERTEX_PROGRAM_ARB, prognum);
+ glProgramStringARB(GL_VERTEX_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB,
+ strlen(prog1), (const GLubyte *) prog1);
+
+ assert(glIsProgramARB(prognum));
+ errno = glGetError();
+ printf("glGetError = %d\n", errno);
+ if (errno != GL_NO_ERROR)
+ {
+ GLint errorpos;
+
+ glGetIntegerv(GL_PROGRAM_ERROR_POSITION_ARB, &errorpos);
+ printf("errorpos: %d\n", errorpos);
+ printf("%s\n", (char *)glGetString(GL_PROGRAM_ERROR_STRING_ARB));
+ }
+
+
+ glEnableClientState( GL_VERTEX_ARRAY );
+ glEnableClientState( GL_COLOR_ARRAY );
+ glVertexPointer( 3, GL_INT, sizeof(verts[0]), verts );
+ glColorPointer( 4, GL_UNSIGNED_BYTE, 0, color );
+
+}
+
+
+
+static void Display( void )
+{
+ glClearColor(0.3, 0.3, 0.3, 1);
+ glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
+
+ glEnable(GL_VERTEX_PROGRAM_NV);
+ glDrawElements( GL_TRIANGLES, 3, GL_UNSIGNED_INT, indices );
+
+ glFlush();
+}
+
+
+static void Reshape( int width, int height )
+{
+ glViewport( 0, 0, width, height );
+ glMatrixMode( GL_PROJECTION );
+ glLoadIdentity();
+ glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
+ glMatrixMode( GL_MODELVIEW );
+ glLoadIdentity();
+ /*glTranslatef( 0.0, 0.0, -15.0 );*/
+}
+
+
+static void Key( unsigned char key, int x, int y )
+{
+ (void) x;
+ (void) y;
+ switch (key) {
+ case 27:
+ exit(0);
+ break;
+ }
+ glutPostRedisplay();
+}
+
+
+
+
+int main( int argc, char *argv[] )
+{
+ glutInit( &argc, argv );
+ glutInitWindowPosition( 0, 0 );
+ glutInitWindowSize( 250, 250 );
+ glutInitDisplayMode( GLUT_RGB | GLUT_SINGLE | GLUT_DEPTH );
+ glutCreateWindow(argv[0]);
+ glewInit();
+ glutReshapeFunc( Reshape );
+ glutKeyboardFunc( Key );
+ glutDisplayFunc( Display );
+ Init();
+ glutMainLoop();
+ return 0;
+}
diff --git a/progs/trivial/vp-array.c b/progs/trivial/vp-array.c
index abe8f62bec3..852bf7d44d7 100644
--- a/progs/trivial/vp-array.c
+++ b/progs/trivial/vp-array.c
@@ -5,7 +5,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#define GL_GLEXT_PROTOTYPES
+#include <GL/glew.h>
#include <GL/glut.h>
GLfloat verts[][4] = {
@@ -108,6 +108,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( 250, 250 );
glutInitDisplayMode( GLUT_RGB | GLUT_SINGLE | GLUT_DEPTH );
glutCreateWindow(argv[0]);
+ glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );
diff --git a/progs/trivial/vp-clip.c b/progs/trivial/vp-clip.c
index 206ba0b8cb8..267b927b93f 100644
--- a/progs/trivial/vp-clip.c
+++ b/progs/trivial/vp-clip.c
@@ -5,7 +5,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#define GL_GLEXT_PROTOTYPES
+#include <GL/glew.h>
#include <GL/glut.h>
static void Init( void )
@@ -93,6 +93,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( 250, 250 );
glutInitDisplayMode( GLUT_RGB | GLUT_SINGLE | GLUT_DEPTH );
glutCreateWindow(argv[0]);
+ glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );
diff --git a/progs/trivial/vp-line-clip.c b/progs/trivial/vp-line-clip.c
index b2aaf17ca4f..d27e4aae079 100644
--- a/progs/trivial/vp-line-clip.c
+++ b/progs/trivial/vp-line-clip.c
@@ -5,7 +5,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#define GL_GLEXT_PROTOTYPES
+#include <GL/glew.h>
#include <GL/glut.h>
static void Init( void )
@@ -107,6 +107,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( 250, 250 );
glutInitDisplayMode( GLUT_RGB | GLUT_SINGLE | GLUT_DEPTH );
glutCreateWindow(argv[0]);
+ glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );
diff --git a/progs/trivial/vp-tri-cb-pos.c b/progs/trivial/vp-tri-cb-pos.c
new file mode 100644
index 00000000000..430a4d3964c
--- /dev/null
+++ b/progs/trivial/vp-tri-cb-pos.c
@@ -0,0 +1,158 @@
+/* Test glGenProgramsNV(), glIsProgramNV(), glLoadProgramNV() */
+
+#include <stdio.h>
+#include <assert.h>
+#include <string.h>
+#include <stdlib.h>
+#include <math.h>
+#include <GL/glew.h>
+#include <GL/glut.h>
+
+
+
+GLenum doubleBuffer;
+
+static void Init(void)
+{
+ GLint errno;
+ GLuint prognum;
+
+ static const char *prog1 =
+ "!!ARBvp1.0\n"
+ "PARAM Emission = state.material.emission; \n"
+ "PARAM Ambient = state.material.ambient; \n"
+ "PARAM Diffuse = state.material.diffuse; \n"
+ "PARAM Specular = state.material.specular; \n"
+ "DP4 result.position.x, Ambient, vertex.position;\n"
+ "DP4 result.position.y, Diffuse, vertex.position;\n"
+ "DP4 result.position.z, Specular, vertex.position;\n"
+ "DP4 result.position.w, Emission, vertex.position;\n"
+ "MOV result.color, vertex.color;\n"
+ "END\n";
+
+ const float Ambient[4] = { 0.0, 1.0, 0.0, 0.0 };
+ const float Diffuse[4] = { 1.0, 0.0, 0.0, 0.0 };
+ const float Specular[4] = { 0.0, 0.0, 1.0, 0.0 };
+ const float Emission[4] = { 0.0, 0.0, 0.0, 1.0 };
+ glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT, Ambient);
+ glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, Diffuse);
+ glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, Specular);
+ glMaterialfv(GL_FRONT_AND_BACK, GL_EMISSION, Emission);
+
+
+ glGenProgramsARB(1, &prognum);
+
+ glBindProgramARB(GL_VERTEX_PROGRAM_ARB, prognum);
+ glProgramStringARB(GL_VERTEX_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB,
+ strlen(prog1), (const GLubyte *) prog1);
+
+ assert(glIsProgramARB(prognum));
+ errno = glGetError();
+ printf("glGetError = %d\n", errno);
+ if (errno != GL_NO_ERROR)
+ {
+ GLint errorpos;
+
+ glGetIntegerv(GL_PROGRAM_ERROR_POSITION_ARB, &errorpos);
+ printf("errorpos: %d\n", errorpos);
+ printf("%s\n", (char *)glGetString(GL_PROGRAM_ERROR_STRING_ARB));
+ }
+
+ glEnable(GL_VERTEX_PROGRAM_NV);
+
+}
+
+
+static void Reshape(int width, int height)
+{
+
+ glViewport(0, 0, (GLint)width, (GLint)height);
+
+ glMatrixMode(GL_PROJECTION);
+ glLoadIdentity();
+/* glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0); */
+ glMatrixMode(GL_MODELVIEW);
+}
+
+static void Key(unsigned char key, int x, int y)
+{
+
+ switch (key) {
+ case 27:
+ exit(1);
+ default:
+ return;
+ }
+
+ glutPostRedisplay();
+}
+
+static void Draw(void)
+{
+ glClear(GL_COLOR_BUFFER_BIT);
+
+ glBegin(GL_TRIANGLES);
+ glColor3f(0,0,.7);
+ glVertex3f( 0.9, -0.9, -0.0);
+ glColor3f(.8,0,0);
+ glVertex3f( 0.9, 0.9, -0.0);
+ glColor3f(0,.9,0);
+ glVertex3f(-0.9, 0.0, -0.0);
+ glEnd();
+
+ glFlush();
+
+ if (doubleBuffer) {
+ glutSwapBuffers();
+ }
+}
+
+static GLenum Args(int argc, char **argv)
+{
+ GLint i;
+
+ doubleBuffer = GL_FALSE;
+
+ for (i = 1; i < argc; i++) {
+ if (strcmp(argv[i], "-sb") == 0) {
+ doubleBuffer = GL_FALSE;
+ } else if (strcmp(argv[i], "-db") == 0) {
+ doubleBuffer = GL_TRUE;
+ } else {
+ fprintf(stderr, "%s (Bad option).\n", argv[i]);
+ return GL_FALSE;
+ }
+ }
+ return GL_TRUE;
+}
+
+int main(int argc, char **argv)
+{
+ GLenum type;
+
+ glutInit(&argc, argv);
+
+ if (Args(argc, argv) == GL_FALSE) {
+ exit(1);
+ }
+
+ glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
+
+ type = GLUT_RGB | GLUT_ALPHA;
+ type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
+ glutInitDisplayMode(type);
+
+ if (glutCreateWindow("First Tri") == GL_FALSE) {
+ exit(1);
+ }
+
+ glewInit();
+
+ Init();
+
+ glutReshapeFunc(Reshape);
+ glutKeyboardFunc(Key);
+ glutDisplayFunc(Draw);
+ glutMainLoop();
+ return 0;
+}
diff --git a/progs/trivial/vp-tri-cb-tex.c b/progs/trivial/vp-tri-cb-tex.c
new file mode 100644
index 00000000000..57fd2cdbbd1
--- /dev/null
+++ b/progs/trivial/vp-tri-cb-tex.c
@@ -0,0 +1,191 @@
+/* Test glGenProgramsNV(), glIsProgramNV(), glLoadProgramNV() */
+
+#include <stdio.h>
+#include <assert.h>
+#include <string.h>
+#include <stdlib.h>
+#include <math.h>
+#include <GL/glew.h>
+#include <GL/glut.h>
+
+
+
+GLenum doubleBuffer;
+
+static void Init(void)
+{
+ GLint errno;
+ GLuint prognum;
+
+ static const char *prog1 =
+ "!!ARBvp1.0\n"
+ "PARAM Emission = state.material.emission; \n"
+ "PARAM Ambient = state.material.ambient; \n"
+ "PARAM Diffuse = state.material.diffuse; \n"
+ "PARAM Specular = state.material.specular; \n"
+ "DP4 result.position.x, Ambient, vertex.position;\n"
+ "DP4 result.position.y, Diffuse, vertex.position;\n"
+ "DP4 result.position.z, Specular, vertex.position;\n"
+ "DP4 result.position.w, Emission, vertex.position;\n"
+ "MOV result.texcoord[0], vertex.texcoord[0];\n"
+ "END\n";
+
+ const float Ambient[4] = { 0.0, 1.0, 0.0, 0.0 };
+ const float Diffuse[4] = { 1.0, 0.0, 0.0, 0.0 };
+ const float Specular[4] = { 0.0, 0.0, 1.0, 0.0 };
+ const float Emission[4] = { 0.0, 0.0, 0.0, 1.0 };
+ glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT, Ambient);
+ glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, Diffuse);
+ glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, Specular);
+ glMaterialfv(GL_FRONT_AND_BACK, GL_EMISSION, Emission);
+
+
+ glGenProgramsARB(1, &prognum);
+
+ glBindProgramARB(GL_VERTEX_PROGRAM_ARB, prognum);
+ glProgramStringARB(GL_VERTEX_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB,
+ strlen(prog1), (const GLubyte *) prog1);
+
+ assert(glIsProgramARB(prognum));
+ errno = glGetError();
+ printf("glGetError = %d\n", errno);
+ if (errno != GL_NO_ERROR)
+ {
+ GLint errorpos;
+
+ glGetIntegerv(GL_PROGRAM_ERROR_POSITION_ARB, &errorpos);
+ printf("errorpos: %d\n", errorpos);
+ printf("%s\n", (char *)glGetString(GL_PROGRAM_ERROR_STRING_ARB));
+ }
+
+ glEnable(GL_VERTEX_PROGRAM_NV);
+
+#define SIZE 32
+ {
+ GLubyte tex2d[SIZE][SIZE][3];
+ GLint s, t;
+
+ for (s = 0; s < SIZE; s++) {
+ for (t = 0; t < SIZE; t++) {
+#if 0
+ tex2d[t][s][0] = (s < SIZE/2) ? 0 : 255;
+ tex2d[t][s][1] = (t < SIZE/2) ? 0 : 255;
+ tex2d[t][s][2] = 0;
+#else
+ tex2d[t][s][0] = s*255/(SIZE-1);
+ tex2d[t][s][1] = t*255/(SIZE-1);
+ tex2d[t][s][2] = 0;
+#endif
+ }
+ }
+
+ glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
+
+ glTexImage2D(GL_TEXTURE_2D, 0, 3, SIZE, SIZE, 0,
+ GL_RGB, GL_UNSIGNED_BYTE, tex2d);
+
+ glEnable(GL_TEXTURE_2D);
+ glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
+ glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_R, GL_REPEAT);
+ glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
+ glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
+
+ glPixelStorei(GL_UNPACK_ALIGNMENT, 4);
+ }
+
+}
+
+
+static void Reshape(int width, int height)
+{
+
+ glViewport(0, 0, (GLint)width, (GLint)height);
+
+ glMatrixMode(GL_PROJECTION);
+ glLoadIdentity();
+/* glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0); */
+ glMatrixMode(GL_MODELVIEW);
+}
+
+static void Key(unsigned char key, int x, int y)
+{
+
+ switch (key) {
+ case 27:
+ exit(1);
+ default:
+ return;
+ }
+
+ glutPostRedisplay();
+}
+
+static void Draw(void)
+{
+ glClear(GL_COLOR_BUFFER_BIT);
+
+ glBegin(GL_TRIANGLES);
+ glTexCoord2f(1,-1);
+ glVertex3f( 0.9, -0.9, -0.0);
+ glTexCoord2f(1,1);
+ glVertex3f( 0.9, 0.9, -0.0);
+ glTexCoord2f(-1,0);
+ glVertex3f(-0.9, 0.0, -0.0);
+ glEnd();
+
+ glFlush();
+
+ if (doubleBuffer) {
+ glutSwapBuffers();
+ }
+}
+
+static GLenum Args(int argc, char **argv)
+{
+ GLint i;
+
+ doubleBuffer = GL_FALSE;
+
+ for (i = 1; i < argc; i++) {
+ if (strcmp(argv[i], "-sb") == 0) {
+ doubleBuffer = GL_FALSE;
+ } else if (strcmp(argv[i], "-db") == 0) {
+ doubleBuffer = GL_TRUE;
+ } else {
+ fprintf(stderr, "%s (Bad option).\n", argv[i]);
+ return GL_FALSE;
+ }
+ }
+ return GL_TRUE;
+}
+
+int main(int argc, char **argv)
+{
+ GLenum type;
+
+ glutInit(&argc, argv);
+
+ if (Args(argc, argv) == GL_FALSE) {
+ exit(1);
+ }
+
+ glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
+
+ type = GLUT_RGB | GLUT_ALPHA;
+ type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
+ glutInitDisplayMode(type);
+
+ if (glutCreateWindow("First Tri") == GL_FALSE) {
+ exit(1);
+ }
+
+ glewInit();
+
+ Init();
+
+ glutReshapeFunc(Reshape);
+ glutKeyboardFunc(Key);
+ glutDisplayFunc(Draw);
+ glutMainLoop();
+ return 0;
+}
diff --git a/progs/trivial/vp-tri-cb.c b/progs/trivial/vp-tri-cb.c
new file mode 100644
index 00000000000..1f12a2c297a
--- /dev/null
+++ b/progs/trivial/vp-tri-cb.c
@@ -0,0 +1,108 @@
+/* Test glGenProgramsNV(), glIsProgramNV(), glLoadProgramNV() */
+
+#include <assert.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <GL/glew.h>
+#include <GL/glut.h>
+
+static void Init( void )
+{
+ GLint errno;
+ GLuint prognum;
+
+ static const char *prog1 =
+ "!!ARBvp1.0\n"
+ "PARAM Diffuse = state.material.diffuse; \n"
+ "MOV result.color, Diffuse;\n"
+ "MOV result.position, vertex.position;\n"
+ "END\n";
+
+ const float Diffuse[4] = { 0.0, 1.0, 0.0, 1.0 };
+ glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, Diffuse);
+
+
+ glGenProgramsARB(1, &prognum);
+
+ glBindProgramARB(GL_VERTEX_PROGRAM_ARB, prognum);
+ glProgramStringARB(GL_VERTEX_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB,
+ strlen(prog1), (const GLubyte *) prog1);
+
+ assert(glIsProgramARB(prognum));
+ errno = glGetError();
+ printf("glGetError = %d\n", errno);
+ if (errno != GL_NO_ERROR)
+ {
+ GLint errorpos;
+
+ glGetIntegerv(GL_PROGRAM_ERROR_POSITION_ARB, &errorpos);
+ printf("errorpos: %d\n", errorpos);
+ printf("%s\n", (char *)glGetString(GL_PROGRAM_ERROR_STRING_ARB));
+ }
+}
+
+static void Display( void )
+{
+ glClearColor(0.3, 0.3, 0.3, 1);
+ glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
+
+ glEnable(GL_VERTEX_PROGRAM_NV);
+
+ glBegin(GL_TRIANGLES);
+ glColor3f(0,0,.7);
+ glVertex3f( 0.9, -0.9, -0.0);
+ glColor3f(.8,0,0);
+ glVertex3f( 0.9, 0.9, -0.0);
+ glColor3f(0,.9,0);
+ glVertex3f(-0.9, 0.0, -0.0);
+ glEnd();
+
+
+ glFlush();
+}
+
+
+static void Reshape( int width, int height )
+{
+ glViewport( 0, 0, width, height );
+ glMatrixMode( GL_PROJECTION );
+ glLoadIdentity();
+ glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
+ glMatrixMode( GL_MODELVIEW );
+ glLoadIdentity();
+ /*glTranslatef( 0.0, 0.0, -15.0 );*/
+}
+
+
+static void Key( unsigned char key, int x, int y )
+{
+ (void) x;
+ (void) y;
+ switch (key) {
+ case 27:
+ exit(0);
+ break;
+ }
+ glutPostRedisplay();
+}
+
+
+
+
+int main( int argc, char *argv[] )
+{
+ glutInit( &argc, argv );
+ glutInitWindowPosition( 0, 0 );
+ glutInitWindowSize( 250, 250 );
+ glutInitDisplayMode( GLUT_DEPTH | GLUT_RGB | GLUT_SINGLE );
+ glutCreateWindow(argv[0]);
+ glewInit();
+ glutReshapeFunc( Reshape );
+ glutKeyboardFunc( Key );
+ glutDisplayFunc( Display );
+ Init();
+ glutMainLoop();
+ return 0;
+}
diff --git a/progs/trivial/vp-tri-imm.c b/progs/trivial/vp-tri-imm.c
new file mode 100644
index 00000000000..f2549f3697f
--- /dev/null
+++ b/progs/trivial/vp-tri-imm.c
@@ -0,0 +1,102 @@
+/* Test glGenProgramsNV(), glIsProgramNV(), glLoadProgramNV() */
+
+#include <assert.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <GL/glew.h>
+#include <GL/glut.h>
+
+static void Init( void )
+{
+ GLint errno;
+ GLuint prognum;
+
+ static const char *prog1 =
+ "!!ARBvp1.0\n"
+ "ADD result.color, vertex.color, {.5}.x;\n"
+ "MOV result.position, vertex.position;\n"
+ "END\n";
+
+
+ glGenProgramsARB(1, &prognum);
+
+ glBindProgramARB(GL_VERTEX_PROGRAM_ARB, prognum);
+ glProgramStringARB(GL_VERTEX_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB,
+ strlen(prog1), (const GLubyte *) prog1);
+
+ assert(glIsProgramARB(prognum));
+ errno = glGetError();
+ printf("glGetError = %d\n", errno);
+ if (errno != GL_NO_ERROR)
+ {
+ GLint errorpos;
+
+ glGetIntegerv(GL_PROGRAM_ERROR_POSITION_ARB, &errorpos);
+ printf("errorpos: %d\n", errorpos);
+ printf("%s\n", (char *)glGetString(GL_PROGRAM_ERROR_STRING_ARB));
+ }
+}
+
+static void Display( void )
+{
+ glClearColor(0.3, 0.3, 0.3, 1);
+ glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
+
+ glEnable(GL_VERTEX_PROGRAM_NV);
+
+ glBegin(GL_TRIANGLES);
+ glColor3f(0,0,0);
+ glVertex3f( 0.9, -0.9, -0.0);
+ glVertex3f( 0.9, 0.9, -0.0);
+ glVertex3f(-0.9, 0.0, -0.0);
+ glEnd();
+
+
+ glFlush();
+}
+
+
+static void Reshape( int width, int height )
+{
+ glViewport( 0, 0, width, height );
+ glMatrixMode( GL_PROJECTION );
+ glLoadIdentity();
+ glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
+ glMatrixMode( GL_MODELVIEW );
+ glLoadIdentity();
+ /*glTranslatef( 0.0, 0.0, -15.0 );*/
+}
+
+
+static void Key( unsigned char key, int x, int y )
+{
+ (void) x;
+ (void) y;
+ switch (key) {
+ case 27:
+ exit(0);
+ break;
+ }
+ glutPostRedisplay();
+}
+
+
+
+
+int main( int argc, char *argv[] )
+{
+ glutInit( &argc, argv );
+ glutInitWindowPosition( 0, 0 );
+ glutInitWindowSize( 250, 250 );
+ glutInitDisplayMode( GLUT_DEPTH | GLUT_RGB | GLUT_SINGLE );
+ glutCreateWindow(argv[0]);
+ glewInit();
+ glutReshapeFunc( Reshape );
+ glutKeyboardFunc( Key );
+ glutDisplayFunc( Display );
+ Init();
+ glutMainLoop();
+ return 0;
+}
diff --git a/progs/trivial/vp-tri-swap.c b/progs/trivial/vp-tri-swap.c
new file mode 100644
index 00000000000..a3ab1206fdf
--- /dev/null
+++ b/progs/trivial/vp-tri-swap.c
@@ -0,0 +1,104 @@
+/* Test glGenProgramsNV(), glIsProgramNV(), glLoadProgramNV() */
+
+#include <assert.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <GL/glew.h>
+#include <GL/glut.h>
+
+static void Init( void )
+{
+ GLint errno;
+ GLuint prognum;
+
+ static const char *prog1 =
+ "!!ARBvp1.0\n"
+ "MOV result.position, vertex.color;\n"
+ "MOV result.color, vertex.position;\n"
+ "END\n";
+
+
+ glGenProgramsARB(1, &prognum);
+
+ glBindProgramARB(GL_VERTEX_PROGRAM_ARB, prognum);
+ glProgramStringARB(GL_VERTEX_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB,
+ strlen(prog1), (const GLubyte *) prog1);
+
+ assert(glIsProgramARB(prognum));
+ errno = glGetError();
+ printf("glGetError = %d\n", errno);
+ if (errno != GL_NO_ERROR)
+ {
+ GLint errorpos;
+
+ glGetIntegerv(GL_PROGRAM_ERROR_POSITION_ARB, &errorpos);
+ printf("errorpos: %d\n", errorpos);
+ printf("%s\n", (char *)glGetString(GL_PROGRAM_ERROR_STRING_ARB));
+ }
+}
+
+static void Display( void )
+{
+ glClearColor(0.3, 0.3, 0.3, 1);
+ glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
+
+ glEnable(GL_VERTEX_PROGRAM_NV);
+
+ glBegin(GL_TRIANGLES);
+ glColor3f(0,0,.7);
+ glVertex3f( 0.9, -0.9, -0.0);
+ glColor3f(.8,0,0);
+ glVertex3f( 0.9, 0.9, -0.0);
+ glColor3f(0,.9,0);
+ glVertex3f(-0.9, 0.0, -0.0);
+ glEnd();
+
+
+ glFlush();
+}
+
+
+static void Reshape( int width, int height )
+{
+ glViewport( 0, 0, width, height );
+ glMatrixMode( GL_PROJECTION );
+ glLoadIdentity();
+ glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
+ glMatrixMode( GL_MODELVIEW );
+ glLoadIdentity();
+ /*glTranslatef( 0.0, 0.0, -15.0 );*/
+}
+
+
+static void Key( unsigned char key, int x, int y )
+{
+ (void) x;
+ (void) y;
+ switch (key) {
+ case 27:
+ exit(0);
+ break;
+ }
+ glutPostRedisplay();
+}
+
+
+
+
+int main( int argc, char *argv[] )
+{
+ glutInit( &argc, argv );
+ glutInitWindowPosition( 0, 0 );
+ glutInitWindowSize( 250, 250 );
+ glutInitDisplayMode( GLUT_DEPTH | GLUT_RGB | GLUT_SINGLE );
+ glutCreateWindow(argv[0]);
+ glewInit();
+ glutReshapeFunc( Reshape );
+ glutKeyboardFunc( Key );
+ glutDisplayFunc( Display );
+ Init();
+ glutMainLoop();
+ return 0;
+}
diff --git a/progs/trivial/vp-tri-tex.c b/progs/trivial/vp-tri-tex.c
new file mode 100644
index 00000000000..bd2b5e59f9d
--- /dev/null
+++ b/progs/trivial/vp-tri-tex.c
@@ -0,0 +1,138 @@
+/* Test glGenProgramsNV(), glIsProgramNV(), glLoadProgramNV() */
+
+#include <assert.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <GL/glew.h>
+#include <GL/glut.h>
+
+static void Init( void )
+{
+ GLint errno;
+ GLuint prognum;
+
+ static const char *prog1 =
+ "!!ARBvp1.0\n"
+ "MOV result.texcoord[0], vertex.texcoord[0];\n"
+ "MOV result.position, vertex.position;\n"
+ "END\n";
+
+
+ glGenProgramsARB(1, &prognum);
+
+ glBindProgramARB(GL_VERTEX_PROGRAM_ARB, prognum);
+ glProgramStringARB(GL_VERTEX_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB,
+ strlen(prog1), (const GLubyte *) prog1);
+
+ assert(glIsProgramARB(prognum));
+ errno = glGetError();
+ printf("glGetError = %d\n", errno);
+ if (errno != GL_NO_ERROR)
+ {
+ GLint errorpos;
+
+ glGetIntegerv(GL_PROGRAM_ERROR_POSITION_ARB, &errorpos);
+ printf("errorpos: %d\n", errorpos);
+ printf("%s\n", (char *)glGetString(GL_PROGRAM_ERROR_STRING_ARB));
+ }
+
+#define SIZE 32
+ {
+ GLubyte tex2d[SIZE][SIZE][3];
+ GLint s, t;
+
+ for (s = 0; s < SIZE; s++) {
+ for (t = 0; t < SIZE; t++) {
+#if 0
+ tex2d[t][s][0] = (s < SIZE/2) ? 0 : 255;
+ tex2d[t][s][1] = (t < SIZE/2) ? 0 : 255;
+ tex2d[t][s][2] = 0;
+#else
+ tex2d[t][s][0] = s*255/(SIZE-1);
+ tex2d[t][s][1] = t*255/(SIZE-1);
+ tex2d[t][s][2] = 0;
+#endif
+ }
+ }
+
+ glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
+
+ glTexImage2D(GL_TEXTURE_2D, 0, 3, SIZE, SIZE, 0,
+ GL_RGB, GL_UNSIGNED_BYTE, tex2d);
+
+ glEnable(GL_TEXTURE_2D);
+ glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
+ glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_R, GL_REPEAT);
+ glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
+ glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
+
+ glPixelStorei(GL_UNPACK_ALIGNMENT, 4);
+ }
+
+}
+
+static void Display( void )
+{
+ glClearColor(0.3, 0.3, 0.3, 1);
+ glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
+
+ glEnable(GL_VERTEX_PROGRAM_NV);
+
+ glBegin(GL_TRIANGLES);
+ glTexCoord2f(1,-1);
+ glVertex3f( 0.9, -0.9, -0.0);
+ glTexCoord2f(1,1);
+ glVertex3f( 0.9, 0.9, -0.0);
+ glTexCoord2f(-1,0);
+ glVertex3f(-0.9, 0.0, -0.0);
+ glEnd();
+
+
+ glFlush();
+}
+
+
+static void Reshape( int width, int height )
+{
+ glViewport( 0, 0, width, height );
+ glMatrixMode( GL_PROJECTION );
+ glLoadIdentity();
+ glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
+ glMatrixMode( GL_MODELVIEW );
+ glLoadIdentity();
+ /*glTranslatef( 0.0, 0.0, -15.0 );*/
+}
+
+
+static void Key( unsigned char key, int x, int y )
+{
+ (void) x;
+ (void) y;
+ switch (key) {
+ case 27:
+ exit(0);
+ break;
+ }
+ glutPostRedisplay();
+}
+
+
+
+
+int main( int argc, char *argv[] )
+{
+ glutInit( &argc, argv );
+ glutInitWindowPosition( 0, 0 );
+ glutInitWindowSize( 250, 250 );
+ glutInitDisplayMode( GLUT_DEPTH | GLUT_RGB | GLUT_SINGLE );
+ glutCreateWindow(argv[0]);
+ glewInit();
+ glutReshapeFunc( Reshape );
+ glutKeyboardFunc( Key );
+ glutDisplayFunc( Display );
+ Init();
+ glutMainLoop();
+ return 0;
+}
diff --git a/progs/trivial/vp-tri.c b/progs/trivial/vp-tri.c
index f8e18654c60..29329773143 100644
--- a/progs/trivial/vp-tri.c
+++ b/progs/trivial/vp-tri.c
@@ -5,7 +5,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#define GL_GLEXT_PROTOTYPES
+#include <GL/glew.h>
#include <GL/glut.h>
static void Init( void )
@@ -43,17 +43,17 @@ static void Init( void )
static void Display( void )
{
glClearColor(0.3, 0.3, 0.3, 1);
- glClear( GL_COLOR_BUFFER_BIT );
+ glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
glEnable(GL_VERTEX_PROGRAM_NV);
glBegin(GL_TRIANGLES);
- glColor3f(0,0,1);
- glVertex3f( 0.9, -0.9, 0.0);
- glColor3f(0,1,0);
- glVertex3f( 0.9, 0.9, 0.0);
- glColor3f(1,0,0);
- glVertex3f(-0.9, 0.0, 0.0);
+ glColor3f(0,0,.7);
+ glVertex3f( 0.9, -0.9, -0.0);
+ glColor3f(.8,0,0);
+ glVertex3f( 0.9, 0.9, -0.0);
+ glColor3f(0,.9,0);
+ glVertex3f(-0.9, 0.0, -0.0);
glEnd();
@@ -93,8 +93,9 @@ int main( int argc, char *argv[] )
glutInit( &argc, argv );
glutInitWindowPosition( 0, 0 );
glutInitWindowSize( 250, 250 );
- glutInitDisplayMode( GLUT_RGB | GLUT_SINGLE );
+ glutInitDisplayMode( GLUT_DEPTH | GLUT_RGB | GLUT_SINGLE );
glutCreateWindow(argv[0]);
+ glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );
diff --git a/progs/trivial/vp-unfilled.c b/progs/trivial/vp-unfilled.c
index ac23181fff7..fe2de674ea3 100644
--- a/progs/trivial/vp-unfilled.c
+++ b/progs/trivial/vp-unfilled.c
@@ -5,7 +5,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#define GL_GLEXT_PROTOTYPES
+#include <GL/glew.h>
#include <GL/glut.h>
static void Init( void )
@@ -95,6 +95,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( 250, 250 );
glutInitDisplayMode( GLUT_RGB | GLUT_SINGLE | GLUT_DEPTH );
glutCreateWindow(argv[0]);
+ glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );
diff --git a/progs/util/SConscript b/progs/util/SConscript
new file mode 100644
index 00000000000..8ad2466291d
--- /dev/null
+++ b/progs/util/SConscript
@@ -0,0 +1,15 @@
+Import('env')
+
+env = env.Clone()
+
+util = env.StaticLibrary(
+ target = ['util'],
+ source = [
+ 'readtex.c',
+ 'trackball.c',
+ 'showbuffer.c',
+ 'shaderutil.c',
+ ],
+)
+
+Export('util')
diff --git a/progs/util/descrip.mms b/progs/util/descrip.mms
deleted file mode 100644
index 21dec4b9be4..00000000000
--- a/progs/util/descrip.mms
+++ /dev/null
@@ -1,42 +0,0 @@
-# Makefile for GLUT-based demo programs for VMS
-# contributed by Jouk Jansen joukj@crys.chem.uva.nl
-
-
-.first
- define gl [--.include.gl]
-
-.include [--]mms-config.
-
-##### MACROS #####
-
-INCDIR = ([--.include],[-.util])
-CFLAGS = /include=$(INCDIR)/prefix=all/name=(as_is,short)/float=ieee/ieee=denorm
-
-.ifdef SHARE
-GL_LIBS = $(XLIBS)
-LIB_DEP = [--.lib]$(GL_SHAR) [--.lib]$(GLU_SHAR) [--.lib]$(GLUT_SHAR)
-.else
-GL_LIBS = [--.lib]libGLUT/l,libMesaGLU/l,libMesaGL/l,$(XLIBS)
-LIB_DEP = [--.lib]$(GL_LIB) [--.lib]$(GLU_LIB) [--.lib]$(GLUT_LIB)
-.endif
-
-
-OBJS =readtex.obj,showbuffer.obj
-
-
-##### RULES #####
-.obj.exe :
- cxxlink $(MMS$TARGET_NAME),$(GL_LIBS)
-
-##### TARGETS #####
-default :
- $(MMS)$(MMSQUALIFIERS) $(OBJS)
-
-clean :
- delete *.obj;*
-
-realclean :
- delete *.obj;*
-
-readtex.obj : readtex.c
-showbuffer.obj : showbuffer.c
diff --git a/progs/vp/Makefile b/progs/vp/Makefile
index 28d63237a45..58a0dacb22e 100644
--- a/progs/vp/Makefile
+++ b/progs/vp/Makefile
@@ -8,7 +8,7 @@ TOP = ../..
include $(TOP)/configs/current
-LIBS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) $(APP_LIB_DEPS)
+LIBS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLEW_LIB) -l$(GLU_LIB) -l$(GL_LIB) $(APP_LIB_DEPS)
SOURCES = \
vp-tris.c
@@ -26,13 +26,13 @@ INCLUDES = -I. -I$(TOP)/include -I../samples
.SUFFIXES: .c
.c:
- $(CC) $(INCLUDES) $(CFLAGS) $(LDFLAGS) $< $(LIBS) -o $@
+ $(APP_CC) $(INCLUDES) $(CFLAGS) $(LDFLAGS) $< $(LIBS) -o $@
.c.o:
- $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
+ $(APP_CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
.S.o:
- $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
+ $(APP_CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
##### TARGETS #####
diff --git a/progs/vp/SConscript b/progs/vp/SConscript
new file mode 100644
index 00000000000..640c5dd8470
--- /dev/null
+++ b/progs/vp/SConscript
@@ -0,0 +1,13 @@
+Import('env')
+
+if not env['GLUT']:
+ Return()
+
+env = env.Clone()
+
+env.Prepend(LIBS = ['$GLUT_LIB'])
+
+env.Program(
+ target = 'vp-tris',
+ source = ['vp-tris.c'],
+ )
diff --git a/progs/vp/exp.txt b/progs/vp/exp.txt
new file mode 100644
index 00000000000..53ce71db965
--- /dev/null
+++ b/progs/vp/exp.txt
@@ -0,0 +1,6 @@
+!!ARBvp1.0
+TEMP R0;
+EXP R0, vertex.color.x;
+SUB result.color, R0.z, R0.w;
+MOV result.position, vertex.position;
+END
diff --git a/progs/vp/log.txt b/progs/vp/log.txt
new file mode 100644
index 00000000000..6b4e94ed0ed
--- /dev/null
+++ b/progs/vp/log.txt
@@ -0,0 +1,7 @@
+!!ARBvp1.0
+TEMP R0;
+ADD R0, vertex.color, vertex.color;
+ADD R0, R0, R0;
+LOG result.color, R0.x;
+MOV result.position, vertex.position;
+END
diff --git a/progs/vp/run.sh b/progs/vp/run.sh
new file mode 100755
index 00000000000..fdd43d4a52b
--- /dev/null
+++ b/progs/vp/run.sh
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+for i in *.txt ; do
+echo $i
+./vp-tris $i
+done
+
diff --git a/progs/vp/vp-tris.c b/progs/vp/vp-tris.c
index 5dbe5ac8359..87cb12b9846 100644
--- a/progs/vp/vp-tris.c
+++ b/progs/vp/vp-tris.c
@@ -5,7 +5,13 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#define GL_GLEXT_PROTOTYPES
+
+#ifndef WIN32
+#include <unistd.h>
+#include <signal.h>
+#endif
+
+#include <GL/glew.h>
#include <GL/glut.h>
static const char *filename = NULL;
@@ -18,8 +24,29 @@ static void usage( char *name )
fprintf( stderr, "options:\n" );
fprintf( stderr, " -f flat shaded\n" );
fprintf( stderr, " -nNr subdivision steps\n" );
+ fprintf( stderr, " -fps show frames per second\n" );
+}
+
+unsigned show_fps = 0;
+unsigned int frame_cnt = 0;
+
+#ifndef WIN32
+
+void alarmhandler(int);
+
+void alarmhandler (int sig)
+{
+ if (sig == SIGALRM) {
+ printf("%d frames in 5.0 seconds = %.3f FPS\n", frame_cnt,
+ frame_cnt / 5.0);
+
+ frame_cnt = 0;
+ }
+ signal(SIGALRM, alarmhandler);
+ alarm(5);
}
+#endif
static void args(int argc, char *argv[])
{
@@ -32,6 +59,9 @@ static void args(int argc, char *argv[])
else if (strcmp(argv[i], "-f") == 0) {
glShadeModel(GL_FLAT);
}
+ else if (strcmp(argv[i], "-fps") == 0) {
+ show_fps = 1;
+ }
else if (i == argc - 1) {
filename = argv[i];
}
@@ -62,19 +92,31 @@ static void Init( void )
exit(1);
}
- sz = fread(buf, 1, sizeof(buf), f);
+ sz = (GLuint) fread(buf, 1, sizeof(buf), f);
if (!feof(f)) {
fprintf(stderr, "file too long\n");
exit(1);
}
fprintf(stderr, "%.*s\n", sz, buf);
-
- glGenProgramsARB(1, &prognum);
- glBindProgramARB(GL_VERTEX_PROGRAM_ARB, prognum);
- glProgramStringARB(GL_VERTEX_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB,
- sz, (const GLubyte *) buf);
+ if (strncmp( buf, "!!VP", 4 ) == 0) {
+ glEnable( GL_VERTEX_PROGRAM_NV );
+ glGenProgramsNV( 1, &prognum );
+ glBindProgramNV( GL_VERTEX_PROGRAM_NV, prognum );
+ glLoadProgramNV( GL_VERTEX_PROGRAM_NV, prognum, sz, (const GLubyte *) buf );
+ assert( glIsProgramNV( prognum ) );
+ }
+ else {
+ glEnable(GL_VERTEX_PROGRAM_ARB);
+
+ glGenProgramsARB(1, &prognum);
+
+ glBindProgramARB(GL_VERTEX_PROGRAM_ARB, prognum);
+ glProgramStringARB(GL_VERTEX_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB,
+ sz, (const GLubyte *) buf);
+ assert(glIsProgramARB(prognum));
+ }
errno = glGetError();
printf("glGetError = %d\n", errno);
@@ -86,7 +128,17 @@ static void Init( void )
printf("errorpos: %d\n", errorpos);
printf("%s\n", (char *)glGetString(GL_PROGRAM_ERROR_STRING_ARB));
}
- assert(glIsProgramARB(prognum));
+
+ {
+ const float Ambient[4] = { 0.0, 1.0, 0.0, 0.0 };
+ const float Diffuse[4] = { 1.0, 0.0, 0.0, 0.0 };
+ const float Specular[4] = { 0.0, 0.0, 1.0, 0.0 };
+ const float Emission[4] = { 0.0, 0.0, 0.0, 1.0 };
+ glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT, Ambient);
+ glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, Diffuse);
+ glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, Specular);
+ glMaterialfv(GL_FRONT_AND_BACK, GL_EMISSION, Emission);
+ }
}
@@ -147,8 +199,6 @@ static void Display( void )
glClearColor(0.3, 0.3, 0.3, 1);
glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
- glEnable(GL_VERTEX_PROGRAM_NV);
-
glBegin(GL_TRIANGLES);
@@ -168,7 +218,11 @@ static void Display( void )
glEnd();
- glFlush();
+ glFlush();
+ if (show_fps) {
+ ++frame_cnt;
+ glutPostRedisplay();
+ }
}
@@ -205,12 +259,19 @@ int main( int argc, char *argv[] )
glutInitWindowPosition( 0, 0 );
glutInitWindowSize( 250, 250 );
glutInitDisplayMode( GLUT_RGB | GLUT_SINGLE | GLUT_DEPTH );
- glutCreateWindow(argv[0]);
+ glutCreateWindow(argv[argc-1]);
+ glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );
args( argc, argv );
Init();
+#ifndef WIN32
+ if (show_fps) {
+ signal(SIGALRM, alarmhandler);
+ alarm(5);
+ }
+#endif
glutMainLoop();
return 0;
}
diff --git a/progs/vp/windows/vp2003.sln b/progs/vp/windows/vp2003.sln
new file mode 100644
index 00000000000..76de5cfd7ff
--- /dev/null
+++ b/progs/vp/windows/vp2003.sln
@@ -0,0 +1,21 @@
+Microsoft Visual Studio Solution File, Format Version 8.00
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vp2003", "vp2003.vcproj", "{E1C70416-98E7-4282-B6B2-6C9CF90B12C0}"
+ ProjectSection(ProjectDependencies) = postProject
+ EndProjectSection
+EndProject
+Global
+ GlobalSection(SolutionConfiguration) = preSolution
+ Debug = Debug
+ Release = Release
+ EndGlobalSection
+ GlobalSection(ProjectConfiguration) = postSolution
+ {E1C70416-98E7-4282-B6B2-6C9CF90B12C0}.Debug.ActiveCfg = Debug|Win32
+ {E1C70416-98E7-4282-B6B2-6C9CF90B12C0}.Debug.Build.0 = Debug|Win32
+ {E1C70416-98E7-4282-B6B2-6C9CF90B12C0}.Release.ActiveCfg = Release|Win32
+ {E1C70416-98E7-4282-B6B2-6C9CF90B12C0}.Release.Build.0 = Release|Win32
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ EndGlobalSection
+ GlobalSection(ExtensibilityAddIns) = postSolution
+ EndGlobalSection
+EndGlobal
diff --git a/progs/vp/windows/vp2003.vcproj b/progs/vp/windows/vp2003.vcproj
new file mode 100644
index 00000000000..adca2c50731
--- /dev/null
+++ b/progs/vp/windows/vp2003.vcproj
@@ -0,0 +1,121 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="7.10"
+ Name="vp2003"
+ ProjectGUID="{E1C70416-98E7-4282-B6B2-6C9CF90B12C0}"
+ Keyword="Win32Proj">
+ <Platforms>
+ <Platform
+ Name="Win32"/>
+ </Platforms>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="Debug"
+ IntermediateDirectory="Debug"
+ ConfigurationType="1"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="TRUE"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="5"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="4"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="glut32.lib"
+ OutputFile="$(OutDir)/vp2003.exe"
+ LinkIncremental="2"
+ GenerateDebugInformation="TRUE"
+ ProgramDatabaseFile="$(OutDir)/vp2003.pdb"
+ SubSystem="1"
+ TargetMachine="1"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="Release"
+ IntermediateDirectory="Release"
+ ConfigurationType="1"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ RuntimeLibrary="4"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="3"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="glut32.lib"
+ OutputFile="$(OutDir)/vp2003.exe"
+ LinkIncremental="1"
+ GenerateDebugInformation="TRUE"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath="..\vp-tris.c">
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/progs/vp/xform.txt b/progs/vp/xform.txt
new file mode 100644
index 00000000000..d1548f1f10d
--- /dev/null
+++ b/progs/vp/xform.txt
@@ -0,0 +1,11 @@
+!!ARBvp1.0
+PARAM Emission = state.material.emission;
+PARAM Ambient = state.material.ambient;
+PARAM Diffuse = state.material.diffuse;
+PARAM Specular = state.material.specular;
+DP4 result.position.x, Ambient, vertex.position;
+DP4 result.position.y, Diffuse, vertex.position;
+DP4 result.position.z, Specular, vertex.position;
+DP4 result.position.w, Emission, vertex.position;
+MOV result.color, vertex.color;
+END
diff --git a/progs/vpglsl/.gitignore b/progs/vpglsl/.gitignore
new file mode 100644
index 00000000000..a5ff9935254
--- /dev/null
+++ b/progs/vpglsl/.gitignore
@@ -0,0 +1 @@
+vp-tris
diff --git a/progs/vpglsl/Makefile b/progs/vpglsl/Makefile
new file mode 100644
index 00000000000..313b4dfa227
--- /dev/null
+++ b/progs/vpglsl/Makefile
@@ -0,0 +1,52 @@
+# progs/tests/Makefile
+
+
+# These programs aren't intended to be included with the normal distro.
+# They're not too interesting but they're good for testing.
+
+TOP = ../..
+include $(TOP)/configs/current
+
+LIBS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) $(APP_LIB_DEPS)
+
+SOURCES = \
+ vp-tris.c
+
+
+
+PROGS = $(SOURCES:%.c=%)
+
+INCLUDES = -I. -I$(TOP)/include -I../samples
+
+
+##### RULES #####
+
+.SUFFIXES:
+.SUFFIXES: .c
+
+.c:
+ $(CC) $(INCLUDES) $(CFLAGS) $< $(LIBS) -o $@
+
+.c.o:
+ $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
+
+.S.o:
+ $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
+
+
+##### TARGETS #####
+
+default: $(PROGS)
+
+clean:
+ rm -f $(PROGS)
+ rm -f *.o
+ rm -f getproclist.h
+
+
+
+
+
+# Emacs tags
+tags:
+ etags `find . -name \*.[ch]` `find ../include`
diff --git a/progs/vpglsl/for.glsl b/progs/vpglsl/for.glsl
new file mode 100644
index 00000000000..45d6845dacc
--- /dev/null
+++ b/progs/vpglsl/for.glsl
@@ -0,0 +1,7 @@
+
+void main() {
+ gl_Position = gl_Vertex;
+ gl_FrontColor = vec4(0);
+ for (int i = 0; i < 4; ++i)
+ gl_FrontColor += gl_Color;
+}
diff --git a/progs/vpglsl/if.glsl b/progs/vpglsl/if.glsl
new file mode 100644
index 00000000000..174f69c19c9
--- /dev/null
+++ b/progs/vpglsl/if.glsl
@@ -0,0 +1,7 @@
+
+void main() {
+ gl_FrontColor = gl_Color;
+ gl_Position = gl_Vertex;
+ if (gl_Position.x < 0.5)
+ gl_FrontColor = vec4(1.0, 0.0, 0.0, 1.0);
+}
diff --git a/progs/vpglsl/ifelse.glsl b/progs/vpglsl/ifelse.glsl
new file mode 100644
index 00000000000..645b2117a17
--- /dev/null
+++ b/progs/vpglsl/ifelse.glsl
@@ -0,0 +1,8 @@
+
+void main() {
+ gl_Position = gl_Vertex;
+ if (gl_Position.x < 0.5)
+ gl_FrontColor = vec4(1.0, 0.0, 0.0, 1.0);
+ else
+ gl_FrontColor = gl_Color;
+}
diff --git a/progs/vpglsl/nestedifs.glsl b/progs/vpglsl/nestedifs.glsl
new file mode 100644
index 00000000000..abb235cd65b
--- /dev/null
+++ b/progs/vpglsl/nestedifs.glsl
@@ -0,0 +1,13 @@
+
+void main() {
+ gl_Position = gl_Vertex;
+ if (gl_Position.x < 0.5) {
+ if (gl_Position.y < 0.20) {
+ gl_FrontColor = vec4(1.0, 0.0, 0.0, 1.0);
+ } else {
+ gl_FrontColor = vec4(0.0, 1.0, 0.0, 1.0);
+ }
+ gl_FrontColor.y = 1.0;
+ } else
+ gl_FrontColor = gl_Color;
+}
diff --git a/progs/vpglsl/nestedswizzle.glsl b/progs/vpglsl/nestedswizzle.glsl
new file mode 100644
index 00000000000..a3adb3dfeb2
--- /dev/null
+++ b/progs/vpglsl/nestedswizzle.glsl
@@ -0,0 +1,9 @@
+
+void main() {
+ gl_Position = gl_Vertex;
+ gl_FrontColor = gl_Color;
+ if (gl_Position.x < 0.5) {
+ gl_FrontColor.y = 1.0;
+ }
+ gl_FrontColor.xzw = vec3(0, 0, 1);
+}
diff --git a/progs/vpglsl/off2f.glsl b/progs/vpglsl/off2f.glsl
new file mode 100644
index 00000000000..e06cb42a0ed
--- /dev/null
+++ b/progs/vpglsl/off2f.glsl
@@ -0,0 +1,18 @@
+const int KernelSize = 8;
+uniform vec2 Offset2f[KernelSize];
+uniform vec4 KernelValue4f[KernelSize];
+
+void main(void)
+{
+ int i;
+ vec4 sum = vec4(0.0);
+ vec4 tmp = gl_Color;
+ vec2 rg, ba;
+ gl_Position = gl_Vertex;
+
+ rg = Offset2f[4];
+ ba = Offset2f[5];
+
+
+ gl_FrontColor = KernelValue4f[0] * vec4(rg, ba);
+}
diff --git a/progs/vpglsl/varfor1f.glsl b/progs/vpglsl/varfor1f.glsl
new file mode 100644
index 00000000000..9c3e8f2a238
--- /dev/null
+++ b/progs/vpglsl/varfor1f.glsl
@@ -0,0 +1,22 @@
+const int KernelSize = 16;
+uniform float KernelValue1f[KernelSize];
+
+void main(void)
+{
+ int i;
+ vec4 sum = vec4(0.0);
+ vec4 tmp = gl_Color;
+ gl_Position = gl_Vertex;
+
+ for (i = 0; i < KernelSize; ++i) {
+ float x, y, z, w;
+
+ x = KernelValue1f[i]; ++i;
+ y = KernelValue1f[i]; ++i;
+ z = KernelValue1f[i]; ++i;
+ w = KernelValue1f[i];
+
+ sum += tmp * vec4(x, y, z, w);
+ }
+ gl_FrontColor = sum;
+}
diff --git a/progs/vpglsl/varfor2f.glsl b/progs/vpglsl/varfor2f.glsl
new file mode 100644
index 00000000000..d98a1100458
--- /dev/null
+++ b/progs/vpglsl/varfor2f.glsl
@@ -0,0 +1,24 @@
+const int KernelSize = 9;
+uniform vec2 KernelValue2f[KernelSize];
+
+void main(void)
+{
+ int i;
+ vec4 sum = vec4(0.0);
+ vec4 tmp = gl_Color;
+ gl_Position = gl_Vertex;
+
+ for (i = 0; i < KernelSize; ++i) {
+ vec2 rg, ba;
+
+ rg = KernelValue2f[i];
+ ++i;
+ if (i < KernelSize)
+ ba = KernelValue2f[i];
+ else
+ ba = vec2(0, 0);
+
+ sum += tmp * vec4(rg, ba);
+ }
+ gl_FrontColor = sum;
+}
diff --git a/progs/vpglsl/varfor4f.glsl b/progs/vpglsl/varfor4f.glsl
new file mode 100644
index 00000000000..c70ba0356fd
--- /dev/null
+++ b/progs/vpglsl/varfor4f.glsl
@@ -0,0 +1,19 @@
+const int KernelSize = 4;
+uniform vec4 KernelValue4f[KernelSize];
+
+void main(void)
+{
+ int i;
+ vec4 sum = vec4(0.0);
+ vec4 tmp = gl_Color;
+ gl_Position = gl_Vertex;
+
+ for (i = 0; i < KernelSize; ++i) {
+ vec4 rgba;
+
+ rgba = KernelValue4f[i];
+
+ sum += tmp * rgba;
+ }
+ gl_FrontColor = sum;
+}
diff --git a/progs/vpglsl/vp-tris.c b/progs/vpglsl/vp-tris.c
new file mode 100644
index 00000000000..9108d3f1978
--- /dev/null
+++ b/progs/vpglsl/vp-tris.c
@@ -0,0 +1,313 @@
+
+#include <assert.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#define GL_GLEXT_PROTOTYPES
+#include <GL/glut.h>
+
+static const char *filename = NULL;
+static GLuint nr_steps = 4;
+
+static GLuint fragShader;
+static GLuint vertShader;
+static GLuint program;
+
+static void usage( char *name )
+{
+ fprintf( stderr, "usage: %s [ options ] shader_filename\n", name );
+ fprintf( stderr, "\n" );
+ fprintf( stderr, "options:\n" );
+ fprintf( stderr, " -f flat shaded\n" );
+ fprintf( stderr, " -nNr subdivision steps\n" );
+}
+
+
+static void load_and_compile_shader(GLuint shader, const char *text)
+{
+ GLint stat;
+
+ glShaderSource(shader, 1, (const GLchar **) &text, NULL);
+
+ glCompileShader(shader);
+
+ glGetShaderiv(shader, GL_COMPILE_STATUS, &stat);
+ if (!stat) {
+ GLchar log[1000];
+ GLsizei len;
+ glGetShaderInfoLog(shader, 1000, &len, log);
+ fprintf(stderr, "vp-tris: problem compiling shader:\n%s\n", log);
+ exit(1);
+ }
+}
+
+static void read_shader(GLuint shader, const char *filename)
+{
+ const int max = 100*1000;
+ int n;
+ char *buffer = (char*) malloc(max);
+ FILE *f = fopen(filename, "r");
+ if (!f) {
+ fprintf(stderr, "vp-tris: Unable to open shader file %s\n", filename);
+ exit(1);
+ }
+
+ n = fread(buffer, 1, max, f);
+ printf("vp-tris: read %d bytes from shader file %s\n", n, filename);
+ if (n > 0) {
+ buffer[n] = 0;
+ load_and_compile_shader(shader, buffer);
+ }
+
+ fclose(f);
+ free(buffer);
+}
+
+static void check_link(GLuint prog)
+{
+ GLint stat;
+ glGetProgramiv(prog, GL_LINK_STATUS, &stat);
+ if (!stat) {
+ GLchar log[1000];
+ GLsizei len;
+ glGetProgramInfoLog(prog, 1000, &len, log);
+ fprintf(stderr, "Linker error:\n%s\n", log);
+ }
+}
+
+static void setup_uniforms()
+{
+ {
+ GLuint loc1f = glGetUniformLocationARB(program, "Offset1f");
+ GLuint loc2f = glGetUniformLocationARB(program, "Offset2f");
+ GLuint loc4f = glGetUniformLocationARB(program, "Offset4f");
+ GLfloat vecKer[] =
+ { 1.0, 0.0, 0.0, 1.0,
+ 0.0, 1.0, 0.0, 1.0,
+ 1.0, 0.0, 0.0, 1.0,
+ 0.0, 0.0, 0.0, 1.0
+ };
+ if (loc1f >= 0)
+ glUniform1fv(loc1f, 16, vecKer);
+
+ if (loc2f >= 0)
+ glUniform2fv(loc2f, 8, vecKer);
+
+ if (loc4f >= 0)
+ glUniform4fv(loc4f, 4, vecKer);
+
+ }
+
+ GLuint loc1f = glGetUniformLocationARB(program, "KernelValue1f");
+ GLuint loc2f = glGetUniformLocationARB(program, "KernelValue2f");
+ GLuint loc4f = glGetUniformLocationARB(program, "KernelValue4f");
+ GLfloat vecKer[] =
+ { 1.0, 0.0, 0.0, 0.25,
+ 0.0, 1.0, 0.0, 0.25,
+ 0.0, 0.0, 1.0, 0.25,
+ 0.0, 0.0, 0.0, 0.25,
+ 0.5, 0.0, 0.0, 0.35,
+ 0.0, 0.5, 0.0, 0.35,
+ 0.0, 0.0, 0.5, 0.35,
+ 0.0, 0.0, 0.0, 0.35
+ };
+ if (loc1f >= 0)
+ glUniform1fv(loc1f, 16, vecKer);
+
+ if (loc2f >= 0)
+ glUniform2fv(loc2f, 8, vecKer);
+
+ if (loc4f >= 0)
+ glUniform4fv(loc4f, 4, vecKer);
+}
+
+static void prepare_shaders()
+{
+ static const char *fragShaderText =
+ "void main() {\n"
+ " gl_FragColor = gl_Color;\n"
+ "}\n";
+ static const char *vertShaderText =
+ "void main() {\n"
+ " gl_FrontColor = gl_Color;\n"
+ " gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;\n"
+ "}\n";
+ fragShader = glCreateShader(GL_FRAGMENT_SHADER);
+ load_and_compile_shader(fragShader, fragShaderText);
+
+
+ vertShader = glCreateShader(GL_VERTEX_SHADER);
+ if (filename)
+ read_shader(vertShader, filename);
+ else
+ load_and_compile_shader(vertShader, vertShaderText);
+
+ program = glCreateProgram();
+ glAttachShader(program, fragShader);
+ glAttachShader(program, vertShader);
+ glLinkProgram(program);
+ check_link(program);
+ glUseProgram(program);
+
+ setup_uniforms();
+}
+
+static void args(int argc, char *argv[])
+{
+ GLint i;
+
+ for (i = 1; i < argc; i++) {
+ if (strncmp(argv[i], "-n", 2) == 0) {
+ nr_steps = atoi((argv[i]) + 2);
+ }
+ else if (strcmp(argv[i], "-f") == 0) {
+ glShadeModel(GL_FLAT);
+ }
+ else if (i == argc - 1) {
+ filename = argv[i];
+ }
+ else {
+ usage(argv[0]);
+ exit(1);
+ }
+ }
+
+ if (!filename) {
+ usage(argv[0]);
+ exit(1);
+ }
+}
+
+
+
+
+union vert {
+ struct {
+ GLfloat color[3];
+ GLfloat pos[3];
+ } v;
+ GLfloat f[6];
+};
+
+static void make_midpoint( union vert *out,
+ const union vert *v0,
+ const union vert *v1)
+{
+ int i;
+ for (i = 0; i < 6; i++)
+ out->f[i] = v0->f[i] + .5 * (v1->f[i] - v0->f[i]);
+}
+
+static void subdiv( union vert *v0,
+ union vert *v1,
+ union vert *v2,
+ GLuint depth )
+{
+ if (depth == 0) {
+ glColor3fv(v0->v.color);
+ glVertex3fv(v0->v.pos);
+ glColor3fv(v1->v.color);
+ glVertex3fv(v1->v.pos);
+ glColor3fv(v2->v.color);
+ glVertex3fv(v2->v.pos);
+ }
+ else {
+ union vert m[3];
+
+ make_midpoint(&m[0], v0, v1);
+ make_midpoint(&m[1], v1, v2);
+ make_midpoint(&m[2], v2, v0);
+
+ subdiv(&m[0], &m[2], v0, depth-1);
+ subdiv(&m[1], &m[0], v1, depth-1);
+ subdiv(&m[2], &m[1], v2, depth-1);
+ subdiv(&m[0], &m[1], &m[2], depth-1);
+ }
+}
+
+/** Assignment */
+#define ASSIGN_3V( V, V0, V1, V2 ) \
+do { \
+ V[0] = V0; \
+ V[1] = V1; \
+ V[2] = V2; \
+} while(0)
+
+static void Display( void )
+{
+ glClearColor(0.3, 0.3, 0.3, 1);
+ glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
+
+ glUseProgram(program);
+
+ glBegin(GL_TRIANGLES);
+
+
+ {
+ union vert v[3];
+
+ ASSIGN_3V(v[0].v.color, 0,0,1);
+ ASSIGN_3V(v[0].v.pos, 0.9, -0.9, 0.0);
+ ASSIGN_3V(v[1].v.color, 1,0,0);
+ ASSIGN_3V(v[1].v.pos, 0.9, 0.9, 0.0);
+ ASSIGN_3V(v[2].v.color, 0,1,0);
+ ASSIGN_3V(v[2].v.pos, -0.9, 0, 0.0);
+
+ subdiv(&v[0], &v[1], &v[2], nr_steps);
+ }
+
+ glEnd();
+
+
+ glFlush();
+}
+
+
+static void Reshape( int width, int height )
+{
+ glViewport( 0, 0, width, height );
+ glMatrixMode( GL_PROJECTION );
+ glLoadIdentity();
+ glOrtho(-1.0, 1.0, -1.0, 1.0, -0.5, 1000.0);
+ glMatrixMode( GL_MODELVIEW );
+ glLoadIdentity();
+ /*glTranslatef( 0.0, 0.0, -15.0 );*/
+}
+
+
+static void CleanUp(void)
+{
+ glDeleteShader(fragShader);
+ glDeleteShader(vertShader);
+ glDeleteProgram(program);
+}
+
+static void Key( unsigned char key, int x, int y )
+{
+ (void) x;
+ (void) y;
+ switch (key) {
+ case 27:
+ CleanUp();
+ exit(0);
+ break;
+ }
+ glutPostRedisplay();
+}
+
+int main( int argc, char *argv[] )
+{
+ glutInit( &argc, argv );
+ glutInitWindowPosition( 0, 0 );
+ glutInitWindowSize( 250, 250 );
+ glutInitDisplayMode( GLUT_RGB | GLUT_SINGLE | GLUT_DEPTH );
+ glutCreateWindow(argv[0]);
+ glutReshapeFunc( Reshape );
+ glutKeyboardFunc( Key );
+ glutDisplayFunc( Display );
+ args( argc, argv );
+ prepare_shaders();
+ glutMainLoop();
+ return 0;
+}
diff --git a/progs/xdemos/Makefile b/progs/xdemos/Makefile
index f8f2f15380d..8d248fb0a92 100644
--- a/progs/xdemos/Makefile
+++ b/progs/xdemos/Makefile
@@ -50,7 +50,7 @@ EXTRA_PROGS = \
.SUFFIXES: .c
.c: $(LIB_DEP)
- $(CC) -I$(INCDIR) $(X11_INCLUDES) $(CFLAGS) $(LDFLAGS) $< $(LIBS) -o $@
+ $(APP_CC) -I$(INCDIR) $(X11_INCLUDES) $(CFLAGS) $(LDFLAGS) $< $(LIBS) -o $@
##### TARGETS #####
@@ -68,44 +68,44 @@ clean:
# special cases
pbinfo: pbinfo.o pbutil.o
- $(CC) $(CFLAGS) $(LDFLAGS) pbinfo.o pbutil.o $(LIBS) -o $@
+ $(APP_CC) $(CFLAGS) $(LDFLAGS) pbinfo.o pbutil.o $(LIBS) -o $@
pbdemo: pbdemo.o pbutil.o
- $(CC) $(CFLAGS) $(LDFLAGS) pbdemo.o pbutil.o $(LIBS) -o $@
+ $(APP_CC) $(CFLAGS) $(LDFLAGS) pbdemo.o pbutil.o $(LIBS) -o $@
pbinfo.o: pbinfo.c pbutil.h
- $(CC) -c -I. -I$(INCDIR) $(X11_INCLUDES) $(CFLAGS) pbinfo.c
+ $(APP_CC) -c -I. -I$(INCDIR) $(X11_INCLUDES) $(CFLAGS) pbinfo.c
pbdemo.o: pbdemo.c pbutil.h
- $(CC) -c -I. -I$(INCDIR) $(X11_INCLUDES) $(CFLAGS) pbdemo.c
+ $(APP_CC) -c -I. -I$(INCDIR) $(X11_INCLUDES) $(CFLAGS) pbdemo.c
pbutil.o: pbutil.c pbutil.h
- $(CC) -c -I. -I$(INCDIR) $(X11_INCLUDES) $(CFLAGS) pbutil.c
+ $(APP_CC) -c -I. -I$(INCDIR) $(X11_INCLUDES) $(CFLAGS) pbutil.c
glxgears_fbconfig: glxgears_fbconfig.o pbutil.o
- $(CC) $(CFLAGS) $(LDFLAGS) glxgears_fbconfig.o pbutil.o $(LIBS) -o $@
+ $(APP_CC) $(CFLAGS) $(LDFLAGS) glxgears_fbconfig.o pbutil.o $(LIBS) -o $@
glxgears_fbconfig.o: glxgears_fbconfig.c pbutil.h
- $(CC) -I$(INCDIR) $(X11_INCLUDES) $(CFLAGS) -c -I. $(CFLAGS) glxgears_fbconfig.c
+ $(APP_CC) -I$(INCDIR) $(X11_INCLUDES) $(CFLAGS) -c -I. $(CFLAGS) glxgears_fbconfig.c
xrotfontdemo: xrotfontdemo.o xuserotfont.o
- $(CC) $(CFLAGS) $(LDFLAGS) xrotfontdemo.o xuserotfont.o $(LIBS) -o $@
+ $(APP_CC) $(CFLAGS) $(LDFLAGS) xrotfontdemo.o xuserotfont.o $(LIBS) -o $@
xuserotfont.o: xuserotfont.c xuserotfont.h
- $(CC) -c -I. -I$(INCDIR) $(X11_INCLUDES) $(CFLAGS) xuserotfont.c
+ $(APP_CC) -c -I. -I$(INCDIR) $(X11_INCLUDES) $(CFLAGS) xuserotfont.c
xrotfontdemo.o: xrotfontdemo.c xuserotfont.h
- $(CC) -c -I. -I$(INCDIR) $(X11_INCLUDES) $(CFLAGS) xrotfontdemo.c
+ $(APP_CC) -c -I. -I$(INCDIR) $(X11_INCLUDES) $(CFLAGS) xrotfontdemo.c
corender: corender.o ipc.o
- $(CC) $(CFLAGS) corender.o ipc.o $(LIBS) -o $@
+ $(APP_CC) $(CFLAGS) corender.o ipc.o $(LIBS) -o $@
corender.o: corender.c ipc.h
- $(CC) -c -I. -I$(INCDIR) $(X11_INCLUDES) $(CFLAGS) corender.c
+ $(APP_CC) -c -I. -I$(INCDIR) $(X11_INCLUDES) $(CFLAGS) corender.c
ipc.o: ipc.c ipc.h
- $(CC) -c -I. -I$(INCDIR) $(X11_INCLUDES) $(CFLAGS) ipc.c
+ $(APP_CC) -c -I. -I$(INCDIR) $(X11_INCLUDES) $(CFLAGS) ipc.c
yuvrect_client: yuvrect_client.c
- $(CC) -I$(INCDIR) $(X11_INCLUDES) $(CFLAGS) $< $(LDFLAGS) $(LIBS) -l$(GLU_LIB) -o $@
+ $(APP_CC) -I$(INCDIR) $(X11_INCLUDES) $(CFLAGS) $< $(LDFLAGS) $(LIBS) -l$(GLU_LIB) -o $@
diff --git a/progs/xdemos/descrip.mms b/progs/xdemos/descrip.mms
deleted file mode 100644
index aa74daff599..00000000000
--- a/progs/xdemos/descrip.mms
+++ /dev/null
@@ -1,83 +0,0 @@
-# Makefile for GLUT-based demo programs for VMS
-# contributed by Jouk Jansen joukj@hrem.stm.tudelft.nl
-
-
-.first
- define gl [--.include.gl]
-
-.include [--]mms-config.
-
-##### MACROS #####
-
-INCDIR = ([--.include],[-.util])
-CFLAGS = /include=$(INCDIR)/prefix=all/name=(as_is,short)/nowarn/float=ieee/ieee=denorm
-
-.ifdef SHARE
-GL_LIBS = $(XLIBS)
-.else
-GL_LIBS = [--.lib]libGLUT/l,libMesaGLU/l,libMesaGL/l,$(XLIBS)
-.endif
-
-LIB_DEP = [--.lib]$(GL_LIB) [--.lib]$(GLU_LIB) [--.lib]$(GLUT_LIB)
-
-PROGS =glthreads.exe,\
- glxdemo.exe,\
- glxgears.exe,\
- glxheads.exe,\
- glxinfo.exe,\
- glxpixmap.exe,\
- manywin.exe,\
- offset.exe,\
- pbinfo.exe,\
- pbdemo.exe,\
- wincopy.exe,\
- xdemo.exe,\
- xfont.exe
-
-##### RULES #####
-.obj.exe :
- cxxlink $(MMS$TARGET_NAME),$(GL_LIBS)
-
-##### TARGETS #####
-default :
- $(MMS)$(MMSQUALIFIERS) $(PROGS)
-
-clean :
- delete *.obj;*
-
-realclean :
- delete $(PROGS)
- delete *.obj;*
-
-
-glthreads.exe : glthreads.obj $(LIB_DEP)
-glxdemo.exe : glxdemo.obj $(LIB_DEP)
-glxgears.exe : glxgears.obj $(LIB_DEP)
-glxheads.exe : glxheads.obj $(LIB_DEP)
-glxinfo.exe : glxinfo.obj $(LIB_DEP)
-glxpixmap.exe : glxpixmap.obj $(LIB_DEP)
-manywin.exe : manywin.obj $(LIB_DEP)
-offset.exe : offset.obj $(LIB_DEP)
-pbinfo.exe : pbinfo.obj pbutil.obj $(LIB_DEP)
- cxxlink pbinfo.obj,pbutil.obj,$(GL_LIBS)
-pbdemo.exe : pbdemo.obj pbutil.obj $(LIB_DEP)
- cxxlink pbdemo.obj,pbutil.obj,$(GL_LIBS)
-wincopy.exe : wincopy.obj $(LIB_DEP)
-xdemo.exe : xdemo.obj $(LIB_DEP)
-xfont.exe :xfont.obj $(LIB_DEP)
-
-
-glthreads.obj : glthreads.c
-glxdemo.obj : glxdemo.c
-glxgears.obj : glxgears.c
-glxheads.obj : glxheads.c
-glxinfo.obj : glxinfo.c
-glxpixmap.obj : glxpixmap.c
-manywin.obj : manywin.c
-offset.obj : offset.c
-pbinfo.obj : pbinfo.c
-pbutil.obj : pbutil.c
-pbdemo.obj : pbdemo.c
-wincopy.obj : wincopy.c
-xdemo.obj : xdemo.c
-xfont.obj :xfont.c
diff --git a/progs/xdemos/glthreads.c b/progs/xdemos/glthreads.c
index 4f87ee75d40..b90e6b4f319 100644
--- a/progs/xdemos/glthreads.c
+++ b/progs/xdemos/glthreads.c
@@ -27,16 +27,30 @@
* -l Enable application-side locking
* -n <num threads> Number of threads to create (default is 2)
* -display <display name> Specify X display (default is :0.0)
+ * -t Use texture mapping
*
* Brian Paul 20 July 2000
*/
+/*
+ * Notes:
+ * - Each thread gets its own GLX context.
+ *
+ * - The GLX contexts share texture objects.
+ *
+ * - When 't' is pressed to update the texture image, the window/thread which
+ * has input focus is signalled to change the texture. The other threads
+ * should see the updated texture the next time they call glBindTexture.
+ */
+
+
#if defined(PTHREADS) /* defined by Mesa on Linux and other platforms */
#include <assert.h>
#include <GL/gl.h>
#include <GL/glx.h>
+#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -56,6 +70,8 @@ struct winthread {
float Angle;
int WinWidth, WinHeight;
GLboolean NewSize;
+ GLboolean Initialized;
+ GLboolean MakeNewTexture;
};
@@ -66,8 +82,13 @@ static volatile GLboolean ExitFlag = GL_FALSE;
static GLboolean MultiDisplays = 0;
static GLboolean Locking = 0;
+static GLboolean Texture = GL_FALSE;
+static GLuint TexObj = 12;
+static GLboolean Animate = GL_TRUE;
static pthread_mutex_t Mutex;
+static pthread_cond_t CondVar;
+static pthread_mutex_t CondMutex;
static void
@@ -78,6 +99,59 @@ Error(const char *msg)
}
+static void
+signal_redraw(void)
+{
+ pthread_mutex_lock(&CondMutex);
+ pthread_cond_broadcast(&CondVar);
+ pthread_mutex_unlock(&CondMutex);
+}
+
+
+static void
+MakeNewTexture(struct winthread *wt)
+{
+#define TEX_SIZE 128
+ static float step = 0.0;
+ GLfloat image[TEX_SIZE][TEX_SIZE][4];
+ GLint width;
+ int i, j;
+
+ for (j = 0; j < TEX_SIZE; j++) {
+ for (i = 0; i < TEX_SIZE; i++) {
+ float dt = 5.0 * (j - 0.5 * TEX_SIZE) / TEX_SIZE;
+ float ds = 5.0 * (i - 0.5 * TEX_SIZE) / TEX_SIZE;
+ float r = dt * dt + ds * ds + step;
+ image[j][i][0] =
+ image[j][i][1] =
+ image[j][i][2] = 0.75 + 0.25 * cos(r);
+ image[j][i][3] = 1.0;
+ }
+ }
+
+ step += 0.5;
+
+ glBindTexture(GL_TEXTURE_2D, TexObj);
+
+ glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_WIDTH, &width);
+ if (width) {
+ assert(width == TEX_SIZE);
+ /* sub-tex replace */
+ glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, TEX_SIZE, TEX_SIZE,
+ GL_RGBA, GL_FLOAT, image);
+ }
+ else {
+ /* create new */
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
+
+ glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, TEX_SIZE, TEX_SIZE, 0,
+ GL_RGBA, GL_FLOAT, image);
+ }
+}
+
+
+
/* draw a colored cube */
static void
draw_object(void)
@@ -86,52 +160,61 @@ draw_object(void)
glScalef(0.75, 0.75, 0.75);
glColor3f(1, 0, 0);
- glBegin(GL_POLYGON);
- glVertex3f(1, -1, -1);
- glVertex3f(1, 1, -1);
- glVertex3f(1, 1, 1);
- glVertex3f(1, -1, 1);
- glEnd();
+ if (Texture) {
+ glBindTexture(GL_TEXTURE_2D, TexObj);
+ glEnable(GL_TEXTURE_2D);
+ }
+ else {
+ glDisable(GL_TEXTURE_2D);
+ }
+
+ glBegin(GL_QUADS);
+
+ /* -X */
glColor3f(0, 1, 1);
- glBegin(GL_POLYGON);
- glVertex3f(-1, -1, -1);
- glVertex3f(-1, 1, -1);
- glVertex3f(-1, 1, 1);
- glVertex3f(-1, -1, 1);
- glEnd();
+ glTexCoord2f(0, 0); glVertex3f(-1, -1, -1);
+ glTexCoord2f(1, 0); glVertex3f(-1, 1, -1);
+ glTexCoord2f(1, 1); glVertex3f(-1, 1, 1);
+ glTexCoord2f(0, 1); glVertex3f(-1, -1, 1);
- glColor3f(0, 1, 0);
- glBegin(GL_POLYGON);
- glVertex3f(-1, 1, -1);
- glVertex3f( 1, 1, -1);
- glVertex3f( 1, 1, 1);
- glVertex3f(-1, 1, 1);
- glEnd();
+ /* +X */
+ glColor3f(1, 0, 0);
+ glTexCoord2f(0, 0); glVertex3f(1, -1, -1);
+ glTexCoord2f(1, 0); glVertex3f(1, 1, -1);
+ glTexCoord2f(1, 1); glVertex3f(1, 1, 1);
+ glTexCoord2f(0, 1); glVertex3f(1, -1, 1);
+ /* -Y */
glColor3f(1, 0, 1);
- glBegin(GL_POLYGON);
- glVertex3f(-1, -1, -1);
- glVertex3f( 1, -1, -1);
- glVertex3f( 1, -1, 1);
- glVertex3f(-1, -1, 1);
- glEnd();
+ glTexCoord2f(0, 0); glVertex3f(-1, -1, -1);
+ glTexCoord2f(1, 0); glVertex3f( 1, -1, -1);
+ glTexCoord2f(1, 1); glVertex3f( 1, -1, 1);
+ glTexCoord2f(0, 1); glVertex3f(-1, -1, 1);
- glColor3f(0, 0, 1);
- glBegin(GL_POLYGON);
- glVertex3f(-1, -1, 1);
- glVertex3f( 1, -1, 1);
- glVertex3f( 1, 1, 1);
- glVertex3f(-1, 1, 1);
- glEnd();
+ /* +Y */
+ glColor3f(0, 1, 0);
+ glTexCoord2f(0, 0); glVertex3f(-1, 1, -1);
+ glTexCoord2f(1, 0); glVertex3f( 1, 1, -1);
+ glTexCoord2f(1, 1); glVertex3f( 1, 1, 1);
+ glTexCoord2f(0, 1); glVertex3f(-1, 1, 1);
+ /* -Z */
glColor3f(1, 1, 0);
- glBegin(GL_POLYGON);
- glVertex3f(-1, -1, -1);
- glVertex3f( 1, -1, -1);
- glVertex3f( 1, 1, -1);
- glVertex3f(-1, 1, -1);
+ glTexCoord2f(0, 0); glVertex3f(-1, -1, -1);
+ glTexCoord2f(1, 0); glVertex3f( 1, -1, -1);
+ glTexCoord2f(1, 1); glVertex3f( 1, 1, -1);
+ glTexCoord2f(0, 1); glVertex3f(-1, 1, -1);
+
+ /* +Y */
+ glColor3f(0, 0, 1);
+ glTexCoord2f(0, 0); glVertex3f(-1, -1, 1);
+ glTexCoord2f(1, 0); glVertex3f( 1, -1, 1);
+ glTexCoord2f(1, 1); glVertex3f( 1, 1, 1);
+ glTexCoord2f(0, 1); glVertex3f(-1, 1, 1);
+
glEnd();
+
glPopMatrix();
}
@@ -143,6 +226,8 @@ resize(struct winthread *wt, int w, int h)
wt->NewSize = GL_TRUE;
wt->WinWidth = w;
wt->WinHeight = h;
+ if (!Animate)
+ signal_redraw();
}
@@ -152,18 +237,19 @@ resize(struct winthread *wt, int w, int h)
static void
draw_loop(struct winthread *wt)
{
- GLboolean firstIter = GL_TRUE;
-
while (!ExitFlag) {
if (Locking)
pthread_mutex_lock(&Mutex);
glXMakeCurrent(wt->Dpy, wt->Win, wt->Context);
- if (firstIter) {
+ if (!wt->Initialized) {
printf("glthreads: %d: GL_RENDERER = %s\n", wt->Index,
(char *) glGetString(GL_RENDERER));
- firstIter = GL_FALSE;
+ if (Texture /*&& wt->Index == 0*/) {
+ MakeNewTexture(wt);
+ }
+ wt->Initialized = GL_TRUE;
}
if (Locking)
@@ -183,10 +269,15 @@ draw_loop(struct winthread *wt)
wt->NewSize = GL_FALSE;
}
+ if (wt->MakeNewTexture) {
+ MakeNewTexture(wt);
+ wt->MakeNewTexture = GL_FALSE;
+ }
+
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glPushMatrix();
- glRotatef(wt->Angle, 0, 0, 1);
+ glRotatef(wt->Angle, 0, 1, 0);
glRotatef(wt->Angle, 1, 0, 0);
glScalef(0.7, 0.7, 0.7);
draw_object();
@@ -200,12 +291,63 @@ draw_loop(struct winthread *wt)
if (Locking)
pthread_mutex_unlock(&Mutex);
- usleep(5000);
+ if (Animate) {
+ usleep(5000);
+ }
+ else {
+ /* wait for signal to draw */
+ pthread_mutex_lock(&CondMutex);
+ pthread_cond_wait(&CondVar, &CondMutex);
+ pthread_mutex_unlock(&CondMutex);
+ }
wt->Angle += 1.0;
}
}
+static void
+keypress(XEvent *event, struct winthread *wt)
+{
+ char buf[100];
+ KeySym keySym;
+ XComposeStatus stat;
+
+ XLookupString(&event->xkey, buf, sizeof(buf), &keySym, &stat);
+
+ switch (keySym) {
+ case XK_Escape:
+ /* tell all threads to exit */
+ if (!Animate) {
+ signal_redraw();
+ }
+ ExitFlag = GL_TRUE;
+ /*printf("exit draw_loop %d\n", wt->Index);*/
+ return;
+ case XK_t:
+ case XK_T:
+ if (Texture) {
+ wt->MakeNewTexture = GL_TRUE;
+ if (!Animate)
+ signal_redraw();
+ }
+ break;
+ case XK_a:
+ case XK_A:
+ Animate = !Animate;
+ if (Animate) /* yes, prev Animate state! */
+ signal_redraw();
+ break;
+ case XK_s:
+ case XK_S:
+ if (!Animate)
+ signal_redraw();
+ break;
+ default:
+ ; /* nop */
+ }
+}
+
+
/*
* The main process thread runs this loop.
* Single display connection for all threads.
@@ -251,10 +393,14 @@ event_loop(Display *dpy)
}
break;
case KeyPress:
- /* tell all threads to exit */
- ExitFlag = GL_TRUE;
- /*printf("exit draw_loop %d\n", wt->Index);*/
- return;
+ for (i = 0; i < NumWinThreads; i++) {
+ struct winthread *wt = &WinThreads[i];
+ if (event.xkey.window == wt->Win) {
+ keypress(&event, wt);
+ break;
+ }
+ }
+ break;
default:
/*no-op*/ ;
}
@@ -282,12 +428,10 @@ event_loop_multi(void)
resize(wt, event.xconfigure.width, event.xconfigure.height);
break;
case KeyPress:
- /* tell all threads to exit */
- ExitFlag = GL_TRUE;
- /*printf("exit draw_loop %d\n", wt->Index);*/
- return;
+ keypress(&event, wt);
+ break;
default:
- /*no-op*/ ;
+ ; /* nop */
}
}
w = (w + 1) % NumWinThreads;
@@ -301,7 +445,7 @@ event_loop_multi(void)
* we'll call this once for each thread, before the threads are created.
*/
static void
-create_window(struct winthread *wt)
+create_window(struct winthread *wt, GLXContext shareCtx)
{
Window win;
GLXContext ctx;
@@ -317,9 +461,9 @@ create_window(struct winthread *wt)
unsigned long mask;
Window root;
XVisualInfo *visinfo;
- int width = 80, height = 80;
- int xpos = (wt->Index % 10) * 90;
- int ypos = (wt->Index / 10) * 100;
+ int width = 160, height = 160;
+ int xpos = (wt->Index % 8) * (width + 10);
+ int ypos = (wt->Index / 8) * (width + 20);
scrnum = DefaultScreen(wt->Dpy);
root = RootWindow(wt->Dpy, scrnum);
@@ -356,7 +500,7 @@ create_window(struct winthread *wt)
}
- ctx = glXCreateContext(wt->Dpy, visinfo, NULL, True);
+ ctx = glXCreateContext(wt->Dpy, visinfo, shareCtx, True);
if (!ctx) {
Error("Couldn't create GLX context");
}
@@ -417,6 +561,12 @@ usage(void)
printf(" -n NUMTHREADS Number of threads to create\n");
printf(" -p Use a separate display connection for each thread\n");
printf(" -l Use application-side locking\n");
+ printf(" -t Enable texturing\n");
+ printf("Keyboard:\n");
+ printf(" Esc Exit\n");
+ printf(" t Change texture image (requires -t option)\n");
+ printf(" a Toggle animation\n");
+ printf(" s Step rotation (when not animating)\n");
}
@@ -445,6 +595,9 @@ main(int argc, char *argv[])
else if (strcmp(argv[i], "-l") == 0) {
Locking = 1;
}
+ else if (strcmp(argv[i], "-t") == 0) {
+ Texture = 1;
+ }
else if (strcmp(argv[i], "-n") == 0 && i + 1 < argc) {
numThreads = atoi(argv[i + 1]);
if (numThreads < 1)
@@ -491,9 +644,9 @@ main(int argc, char *argv[])
}
}
- if (Locking) {
- pthread_mutex_init(&Mutex, NULL);
- }
+ pthread_mutex_init(&Mutex, NULL);
+ pthread_mutex_init(&CondMutex, NULL);
+ pthread_cond_init(&CondVar, NULL);
printf("glthreads: creating windows\n");
@@ -501,6 +654,8 @@ main(int argc, char *argv[])
/* Create the GLX windows and contexts */
for (i = 0; i < numThreads; i++) {
+ GLXContext share;
+
if (MultiDisplays) {
WinThreads[i].Dpy = XOpenDisplay(displayName);
assert(WinThreads[i].Dpy);
@@ -509,7 +664,11 @@ main(int argc, char *argv[])
WinThreads[i].Dpy = dpy;
}
WinThreads[i].Index = i;
- create_window(&WinThreads[i]);
+ WinThreads[i].Initialized = GL_FALSE;
+
+ share = (Texture && i > 0) ? WinThreads[0].Context : 0;
+
+ create_window(&WinThreads[i], share);
}
printf("glthreads: creating threads\n");