summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile50
-rw-r--r--SConstruct4
-rwxr-xr-xbin/config.guess71
-rwxr-xr-xbin/config.sub95
-rw-r--r--configs/autoconf.in8
-rw-r--r--configs/darwin14
-rw-r--r--configs/default8
-rw-r--r--configs/linux3
-rw-r--r--configs/linux-cell2
-rw-r--r--configs/linux-llvm6
-rw-r--r--configure.ac123
-rw-r--r--docs/MESA_shader_debug.spec2
-rw-r--r--docs/relnotes-7.5.html1
-rw-r--r--include/EGL/eglplatform.h2
-rw-r--r--include/GL/gl.h2
-rw-r--r--include/GL/gl_mangle.h298
-rw-r--r--include/GL/glext.h72
-rw-r--r--include/GL/glut.h22
-rw-r--r--include/GL/internal/dri_interface.h11
-rw-r--r--include/GL/wglext.h813
-rw-r--r--progs/SConscript4
-rw-r--r--progs/demos/arbfplight.c1
-rw-r--r--progs/demos/arbfslight.c1
-rw-r--r--progs/demos/cubemap.c95
-rw-r--r--progs/demos/engine.c27
-rw-r--r--progs/demos/fslight.c1
-rw-r--r--progs/demos/gearbox.c1
-rw-r--r--progs/demos/gears.c1
-rw-r--r--progs/demos/geartrain.c1
-rw-r--r--progs/demos/gloss.c1
-rw-r--r--progs/demos/glslnoise.c1
-rw-r--r--progs/demos/isosurf.c14
-rw-r--r--progs/demos/reflect.c1
-rw-r--r--progs/demos/streaming_rect.c4
-rw-r--r--progs/demos/texcyl.c1
-rwxr-xr-xprogs/fp/Makefile2
-rw-r--r--progs/fp/SConscript17
-rw-r--r--progs/fp/fp-tri.c87
-rw-r--r--progs/fp/kill-pos.txt9
-rw-r--r--progs/fp/position.txt3
-rw-r--r--progs/fp/tex-pos-kil-1.txt7
-rw-r--r--progs/fp/tex-pos-kil.txt8
-rw-r--r--progs/fp/tex-pos.txt6
-rw-r--r--progs/fp/tex.txt3
-rw-r--r--progs/glsl/.gitignore1
-rw-r--r--progs/glsl/Makefile1
-rw-r--r--progs/glsl/shadow_sampler.c341
-rw-r--r--progs/tests/.gitignore4
-rw-r--r--progs/tests/Makefile17
-rw-r--r--progs/tests/SConscript134
-rw-r--r--progs/tests/afsmultiarb.c3
-rw-r--r--progs/tests/antialias.c16
-rw-r--r--progs/tests/api_speed.c5
-rw-r--r--progs/tests/arbfpspec.c3
-rw-r--r--progs/tests/arbfptest1.c3
-rw-r--r--progs/tests/arbfptexture.c3
-rw-r--r--progs/tests/arbfptrig.c3
-rw-r--r--progs/tests/arbnpot-mipmap.c2
-rw-r--r--progs/tests/arbnpot.c2
-rw-r--r--progs/tests/arbvptest1.c3
-rw-r--r--progs/tests/arbvptest3.c3
-rw-r--r--progs/tests/arbvptorus.c3
-rw-r--r--progs/tests/arbvpwarpmesh.c3
-rw-r--r--progs/tests/arraytexture.c2
-rw-r--r--progs/tests/blendminmax.c2
-rw-r--r--progs/tests/blendsquare.c2
-rw-r--r--progs/tests/blendxor.c3
-rw-r--r--progs/tests/bufferobj.c92
-rw-r--r--progs/tests/bug_3050.c2
-rw-r--r--progs/tests/bug_3101.c2
-rw-r--r--progs/tests/bug_3195.c2
-rw-r--r--progs/tests/bug_texstore_i8.c2
-rw-r--r--progs/tests/bumpmap.c208
-rw-r--r--progs/tests/calibrate_rast.c2
-rw-r--r--progs/tests/copypixrate.c3
-rw-r--r--progs/tests/crossbar.c2
-rw-r--r--progs/tests/cva.c2
-rw-r--r--progs/tests/debugger.c6
-rw-r--r--progs/tests/dinoshade.c2
-rw-r--r--progs/tests/drawbuffers.c3
-rw-r--r--progs/tests/exactrast.c20
-rw-r--r--progs/tests/ext422square.c3
-rw-r--r--progs/tests/fbotest1.c3
-rw-r--r--progs/tests/fbotest2.c3
-rw-r--r--progs/tests/fbotexture.c36
-rw-r--r--progs/tests/fillrate.c3
-rw-r--r--progs/tests/floattex.c2
-rw-r--r--progs/tests/fog.c3
-rw-r--r--progs/tests/fogcoord.c3
-rw-r--r--progs/tests/fptest1.c3
-rw-r--r--progs/tests/fptexture.c3
-rw-r--r--progs/tests/interleave.c2
-rw-r--r--progs/tests/invert.c2
-rw-r--r--progs/tests/lineclip.c2
-rw-r--r--progs/tests/manytex.c2
-rw-r--r--progs/tests/mapbufrange.c205
-rw-r--r--progs/tests/mapvbo.c139
-rw-r--r--progs/tests/minmag.c2
-rw-r--r--progs/tests/mipgen.c207
-rw-r--r--progs/tests/mipmap_limits.c199
-rw-r--r--progs/tests/mipmap_view.c2
-rw-r--r--progs/tests/multipal.c2
-rw-r--r--progs/tests/multitexarray.c2
-rw-r--r--progs/tests/multiwindow.c3
-rw-r--r--progs/tests/no_s3tc.c2
-rw-r--r--progs/tests/packedpixels.c2
-rw-r--r--progs/tests/pbo.c3
-rw-r--r--progs/tests/prog_parameter.c2
-rw-r--r--progs/tests/projtex.c2
-rw-r--r--progs/tests/quads.c9
-rw-r--r--progs/tests/random.c3
-rw-r--r--progs/tests/readrate.c3
-rw-r--r--progs/tests/rubberband.c3
-rw-r--r--progs/tests/seccolor.c3
-rw-r--r--progs/tests/shader_api.c3
-rw-r--r--progs/tests/stencil_twoside.c2
-rw-r--r--progs/tests/stencil_wrap.c2
-rw-r--r--progs/tests/stencilwrap.c2
-rw-r--r--progs/tests/subtex.c2
-rw-r--r--progs/tests/subtexrate.c3
-rw-r--r--progs/tests/tex1d.c2
-rw-r--r--progs/tests/texcmp.c3
-rw-r--r--progs/tests/texcompress2.c3
-rw-r--r--progs/tests/texfilt.c14
-rw-r--r--progs/tests/texgenmix.c2
-rw-r--r--progs/tests/texline.c2
-rw-r--r--progs/tests/texrect.c3
-rw-r--r--progs/tests/texwrap.c3
-rw-r--r--progs/tests/unfilledclip.c2
-rw-r--r--progs/tests/vao-01.c2
-rw-r--r--progs/tests/vao-02.c2
-rw-r--r--progs/tests/vparray.c3
-rw-r--r--progs/tests/vpeval.c3
-rw-r--r--progs/tests/vptest1.c3
-rw-r--r--progs/tests/vptest2.c3
-rw-r--r--progs/tests/vptest3.c3
-rw-r--r--progs/tests/vptorus.c3
-rw-r--r--progs/tests/vpwarpmesh.c3
-rw-r--r--progs/tests/yuvrect.c3
-rw-r--r--progs/tests/yuvsquare.c3
-rw-r--r--progs/tests/zcomp.c3
-rw-r--r--progs/tests/zdrawpix.c3
-rw-r--r--progs/tests/zreaddraw.c3
-rw-r--r--progs/trivial/.gitignore8
-rw-r--r--progs/trivial/Makefile8
-rw-r--r--progs/trivial/SConscript9
-rw-r--r--progs/trivial/clear-random.c2
-rw-r--r--progs/trivial/clear-repeat.c22
-rw-r--r--progs/trivial/clear.c2
-rw-r--r--progs/trivial/createwin.c2
-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/draw2arrays.c117
-rw-r--r--progs/trivial/line-clip.c2
-rw-r--r--progs/trivial/line-cull.c2
-rw-r--r--progs/trivial/line-stipple-wide.c2
-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.c2
-rw-r--r--progs/trivial/line.c2
-rw-r--r--progs/trivial/lineloop-clip.c2
-rw-r--r--progs/trivial/lineloop.c2
-rw-r--r--progs/trivial/linestrip-clip.c2
-rw-r--r--progs/trivial/linestrip-flat-stipple.c2
-rw-r--r--progs/trivial/linestrip-stipple-wide.c2
-rw-r--r--progs/trivial/linestrip-stipple.c2
-rw-r--r--progs/trivial/linestrip.c2
-rw-r--r--progs/trivial/long-fixed-func.c2
-rw-r--r--progs/trivial/point-clip.c2
-rw-r--r--progs/trivial/point-sprite.c2
-rw-r--r--progs/trivial/point-wide-smooth.c2
-rw-r--r--progs/trivial/point-wide.c2
-rw-r--r--progs/trivial/point.c2
-rw-r--r--progs/trivial/poly-flat-clip.c2
-rw-r--r--progs/trivial/poly-flat-unfilled-clip.c2
-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/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.c2
-rw-r--r--progs/trivial/quad-offset-unfilled.c2
-rw-r--r--progs/trivial/quad-offset-units.c2
-rw-r--r--progs/trivial/quad-tex-2d.c2
-rw-r--r--progs/trivial/quad-tex-3d.c2
-rw-r--r--progs/trivial/quad-tex-alpha.c2
-rw-r--r--progs/trivial/quad-tex-pbo.c2
-rw-r--r--progs/trivial/quad-tex-sub.c203
-rw-r--r--progs/trivial/quad-unfilled-clip.c2
-rw-r--r--progs/trivial/quad-unfilled-stipple.c2
-rw-r--r--progs/trivial/quad-unfilled.c2
-rw-r--r--progs/trivial/quad.c2
-rw-r--r--progs/trivial/quads.c2
-rw-r--r--progs/trivial/quadstrip-clip.c137
-rw-r--r--progs/trivial/quadstrip-cont.c2
-rw-r--r--progs/trivial/quadstrip-flat.c2
-rw-r--r--progs/trivial/quadstrip.c2
-rw-r--r--progs/trivial/tri-alpha-tex.c2
-rw-r--r--progs/trivial/tri-alpha.c2
-rw-r--r--progs/trivial/tri-blend-color.c2
-rw-r--r--progs/trivial/tri-clear.c2
-rw-r--r--progs/trivial/tri-clip.c2
-rw-r--r--progs/trivial/tri-cull-both.c2
-rw-r--r--progs/trivial/tri-cull.c2
-rw-r--r--progs/trivial/tri-dlist.c2
-rw-r--r--progs/trivial/tri-edgeflag.c2
-rw-r--r--progs/trivial/tri-fbo-tex-mip.c261
-rw-r--r--progs/trivial/tri-fbo-tex.c10
-rw-r--r--progs/trivial/tri-flat-clip.c2
-rw-r--r--progs/trivial/tri-flat.c2
-rw-r--r--progs/trivial/tri-fog.c27
-rw-r--r--progs/trivial/tri-fp-const-imm.c2
-rw-r--r--progs/trivial/tri-fp.c2
-rw-r--r--progs/trivial/tri-lit.c2
-rw-r--r--progs/trivial/tri-logicop-none.c178
-rw-r--r--progs/trivial/tri-logicop-xor.c186
-rw-r--r--progs/trivial/tri-mask-tri.c2
-rw-r--r--progs/trivial/tri-orig.c2
-rw-r--r--progs/trivial/tri-query.c2
-rw-r--r--progs/trivial/tri-repeat.c2
-rw-r--r--progs/trivial/tri-scissor-tri.c2
-rw-r--r--progs/trivial/tri-square.c2
-rw-r--r--progs/trivial/tri-stencil.c2
-rw-r--r--progs/trivial/tri-stipple.c2
-rw-r--r--progs/trivial/tri-tex-3d.c2
-rw-r--r--progs/trivial/tri-tex.c2
-rw-r--r--progs/trivial/tri-tri.c2
-rw-r--r--progs/trivial/tri-unfilled-clip.c2
-rw-r--r--progs/trivial/tri-unfilled-edgeflag.c2
-rw-r--r--progs/trivial/tri-unfilled-fog.c152
-rw-r--r--progs/trivial/tri-unfilled-point.c2
-rw-r--r--progs/trivial/tri-unfilled-smooth.c2
-rw-r--r--progs/trivial/tri-unfilled-tri-lit.c2
-rw-r--r--progs/trivial/tri-unfilled-tri.c2
-rw-r--r--progs/trivial/tri-unfilled-userclip-stip.c2
-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-viewport.c129
-rw-r--r--progs/trivial/tri-z-9.c2
-rw-r--r--progs/trivial/tri-z-eq.c2
-rw-r--r--progs/trivial/tri.c86
-rw-r--r--progs/trivial/trifan-flat-clip.c2
-rw-r--r--progs/trivial/trifan-flat-unfilled-clip.c2
-rw-r--r--progs/trivial/trifan-flat.c2
-rw-r--r--progs/trivial/trifan-unfilled.c2
-rw-r--r--progs/trivial/trifan.c2
-rw-r--r--progs/trivial/tristrip-clip.c2
-rw-r--r--progs/trivial/tristrip-flat.c2
-rw-r--r--progs/trivial/tristrip.c2
-rw-r--r--progs/trivial/vp-tri-cb-pos.c2
-rw-r--r--progs/trivial/vp-tri-cb-tex.c2
-rw-r--r--progs/util/readtex.c12
-rw-r--r--progs/vp/addimm.txt5
-rw-r--r--progs/vp/arl-static.txt7
-rw-r--r--progs/vp/arl-unused.txt7
-rw-r--r--progs/vp/exp-no-w.txt6
-rw-r--r--progs/vp/msk.txt7
-rw-r--r--progs/vp/psiz-mul.txt6
-rw-r--r--progs/vp/vp-tris.c55
-rw-r--r--progs/vpglsl/Makefile2
-rw-r--r--progs/vpglsl/mov.glsl5
-rw-r--r--progs/vpglsl/vp-tris.c48
-rw-r--r--progs/wgl/SConscript23
-rw-r--r--progs/wgl/sharedtex_mt/sharedtex_mt.c540
-rw-r--r--progs/wgl/wglthreads/wglthreads.c614
-rw-r--r--progs/xdemos/.gitignore1
-rw-r--r--progs/xdemos/Makefile1
-rw-r--r--progs/xdemos/glsync.c2
-rw-r--r--progs/xdemos/glxpixmap.c1
-rw-r--r--progs/xdemos/manywin.c2
-rw-r--r--progs/xdemos/sharedtex_mt.c486
-rw-r--r--scons/gallium.py15
-rw-r--r--scons/generic.py20
-rw-r--r--src/egl/drivers/glx/egl_glx.c44
-rw-r--r--src/egl/main/Makefile5
-rw-r--r--src/egl/main/eglconfig.c3
-rw-r--r--src/gallium/Makefile20
-rw-r--r--src/gallium/Makefile.template74
-rw-r--r--src/gallium/auxiliary/Makefile14
-rw-r--r--src/gallium/auxiliary/cso_cache/Makefile3
-rw-r--r--src/gallium/auxiliary/cso_cache/cso_cache.c2
-rw-r--r--src/gallium/auxiliary/cso_cache/cso_context.c1
-rw-r--r--src/gallium/auxiliary/cso_cache/cso_hash.c2
-rw-r--r--src/gallium/auxiliary/draw/Makefile4
-rw-r--r--src/gallium/auxiliary/draw/draw_context.c7
-rw-r--r--src/gallium/auxiliary/draw/draw_pipe_aaline.c17
-rw-r--r--src/gallium/auxiliary/draw/draw_pipe_aapoint.c1
-rw-r--r--src/gallium/auxiliary/draw/draw_pipe_pstipple.c20
-rw-r--r--src/gallium/auxiliary/draw/draw_pipe_vbuf.c95
-rw-r--r--src/gallium/auxiliary/draw/draw_pt.c2
-rw-r--r--src/gallium/auxiliary/draw/draw_pt.h4
-rw-r--r--src/gallium/auxiliary/draw/draw_pt_emit.c67
-rw-r--r--src/gallium/auxiliary/draw/draw_pt_fetch_emit.c69
-rw-r--r--src/gallium/auxiliary/draw/draw_pt_fetch_shade_emit.c107
-rw-r--r--src/gallium/auxiliary/draw/draw_pt_fetch_shade_pipeline.c23
-rw-r--r--src/gallium/auxiliary/draw/draw_pt_post_vs.c4
-rw-r--r--src/gallium/auxiliary/draw/draw_vbuf.h16
-rw-r--r--src/gallium/auxiliary/draw/draw_vs_aos.c55
-rw-r--r--src/gallium/auxiliary/draw/draw_vs_aos.h2
-rw-r--r--src/gallium/auxiliary/draw/draw_vs_aos_io.c4
-rw-r--r--src/gallium/auxiliary/gallivm/storagesoa.cpp2
-rw-r--r--src/gallium/auxiliary/indices/Makefile8
-rw-r--r--src/gallium/auxiliary/indices/SConscript9
-rw-r--r--src/gallium/auxiliary/indices/u_indices.h23
-rw-r--r--src/gallium/auxiliary/indices/u_indices_gen.c2
-rw-r--r--src/gallium/auxiliary/indices/u_indices_gen.py2
-rw-r--r--src/gallium/auxiliary/indices/u_unfilled_gen.c1152
-rw-r--r--src/gallium/auxiliary/indices/u_unfilled_gen.py247
-rw-r--r--src/gallium/auxiliary/indices/u_unfilled_indices.c186
-rw-r--r--src/gallium/auxiliary/pipebuffer/Makefile3
-rw-r--r--src/gallium/auxiliary/pipebuffer/pb_buffer.h28
-rw-r--r--src/gallium/auxiliary/pipebuffer/pb_buffer_fenced.c143
-rw-r--r--src/gallium/auxiliary/pipebuffer/pb_buffer_fenced.h9
-rw-r--r--src/gallium/auxiliary/pipebuffer/pb_buffer_malloc.c4
-rw-r--r--src/gallium/auxiliary/pipebuffer/pb_bufmgr.h5
-rw-r--r--src/gallium/auxiliary/pipebuffer/pb_bufmgr_alt.c2
-rw-r--r--src/gallium/auxiliary/pipebuffer/pb_bufmgr_cache.c13
-rw-r--r--src/gallium/auxiliary/pipebuffer/pb_bufmgr_debug.c26
-rw-r--r--src/gallium/auxiliary/pipebuffer/pb_bufmgr_fenced.c6
-rw-r--r--src/gallium/auxiliary/pipebuffer/pb_bufmgr_mm.c18
-rw-r--r--src/gallium/auxiliary/pipebuffer/pb_bufmgr_ondemand.c4
-rw-r--r--src/gallium/auxiliary/pipebuffer/pb_bufmgr_pool.c10
-rw-r--r--src/gallium/auxiliary/pipebuffer/pb_bufmgr_slab.c8
-rw-r--r--src/gallium/auxiliary/pipebuffer/pb_validate.c2
-rw-r--r--src/gallium/auxiliary/rtasm/Makefile3
-rw-r--r--src/gallium/auxiliary/rtasm/rtasm_cpu.c2
-rw-r--r--src/gallium/auxiliary/rtasm/rtasm_execmem.c12
-rw-r--r--src/gallium/auxiliary/rtasm/rtasm_ppc.c2
-rw-r--r--src/gallium/auxiliary/rtasm/rtasm_x86sse.c2
-rw-r--r--src/gallium/auxiliary/sct/Makefile3
-rw-r--r--src/gallium/auxiliary/sct/sct.c3
-rw-r--r--src/gallium/auxiliary/tgsi/Makefile3
-rw-r--r--src/gallium/auxiliary/tgsi/tgsi-instruction-set.txt1036
-rw-r--r--src/gallium/auxiliary/tgsi/tgsi_build.c2
-rw-r--r--src/gallium/auxiliary/tgsi/tgsi_dump.c10
-rw-r--r--src/gallium/auxiliary/tgsi/tgsi_dump_c.c2
-rw-r--r--src/gallium/auxiliary/tgsi/tgsi_exec.c326
-rw-r--r--src/gallium/auxiliary/tgsi/tgsi_info.c2
-rw-r--r--src/gallium/auxiliary/tgsi/tgsi_iterate.c2
-rw-r--r--src/gallium/auxiliary/tgsi/tgsi_parse.c17
-rw-r--r--src/gallium/auxiliary/tgsi/tgsi_ppc.c2
-rw-r--r--src/gallium/auxiliary/tgsi/tgsi_sanity.c32
-rw-r--r--src/gallium/auxiliary/tgsi/tgsi_scan.c9
-rw-r--r--src/gallium/auxiliary/tgsi/tgsi_sse2.c3
-rw-r--r--src/gallium/auxiliary/tgsi/tgsi_text.c2
-rw-r--r--src/gallium/auxiliary/tgsi/tgsi_transform.c2
-rw-r--r--src/gallium/auxiliary/tgsi/tgsi_util.c2
-rw-r--r--src/gallium/auxiliary/translate/Makefile3
-rw-r--r--src/gallium/auxiliary/util/Makefile5
-rw-r--r--src/gallium/auxiliary/util/SConscript8
-rw-r--r--src/gallium/auxiliary/util/u_bitmask.c320
-rw-r--r--src/gallium/auxiliary/util/u_bitmask.h114
-rw-r--r--src/gallium/auxiliary/util/u_blit.c75
-rw-r--r--src/gallium/auxiliary/util/u_cache.c2
-rw-r--r--src/gallium/auxiliary/util/u_debug.c (renamed from src/gallium/auxiliary/util/p_debug.c)68
-rw-r--r--src/gallium/auxiliary/util/u_debug.h (renamed from src/gallium/include/pipe/p_debug.h)10
-rw-r--r--src/gallium/auxiliary/util/u_debug_memory.c (renamed from src/gallium/auxiliary/util/p_debug_mem.c)15
-rw-r--r--src/gallium/auxiliary/util/u_debug_profile.c (renamed from src/gallium/auxiliary/util/p_debug_prof.c)2
-rw-r--r--src/gallium/auxiliary/util/u_debug_stack.c97
-rw-r--r--src/gallium/auxiliary/util/u_debug_stack.h (renamed from src/gallium/state_trackers/wgl/stw.c)64
-rw-r--r--src/gallium/auxiliary/util/u_draw_quad.c4
-rw-r--r--src/gallium/auxiliary/util/u_gen_mipmap.c290
-rw-r--r--src/gallium/auxiliary/util/u_handle_table.c2
-rw-r--r--src/gallium/auxiliary/util/u_hash_table.c2
-rw-r--r--src/gallium/auxiliary/util/u_keymap.c2
-rw-r--r--src/gallium/auxiliary/util/u_linear.c2
-rw-r--r--src/gallium/auxiliary/util/u_math.h2
-rw-r--r--src/gallium/auxiliary/util/u_memory.h14
-rw-r--r--src/gallium/auxiliary/util/u_mm.c2
-rw-r--r--src/gallium/auxiliary/util/u_rect.c112
-rw-r--r--src/gallium/auxiliary/util/u_simple_screen.c28
-rw-r--r--src/gallium/auxiliary/util/u_simple_shaders.c74
-rw-r--r--src/gallium/auxiliary/util/u_simple_shaders.h9
-rw-r--r--src/gallium/auxiliary/util/u_stream_stdc.c2
-rw-r--r--src/gallium/auxiliary/util/u_tile.c153
-rw-r--r--src/gallium/auxiliary/util/u_tile.h30
-rw-r--r--src/gallium/auxiliary/util/u_time.c12
-rw-r--r--src/gallium/auxiliary/util/u_time.h6
-rw-r--r--src/gallium/auxiliary/util/u_timed_winsys.c7
-rw-r--r--src/gallium/drivers/Makefile16
-rw-r--r--src/gallium/drivers/cell/ppu/cell_clear.c6
-rw-r--r--src/gallium/drivers/cell/ppu/cell_context.h3
-rw-r--r--src/gallium/drivers/cell/ppu/cell_fence.c18
-rw-r--r--src/gallium/drivers/cell/ppu/cell_pipe_state.c95
-rw-r--r--src/gallium/drivers/cell/ppu/cell_state_emit.c18
-rw-r--r--src/gallium/drivers/cell/ppu/cell_state_shader.c4
-rw-r--r--src/gallium/drivers/cell/ppu/cell_surface.c14
-rw-r--r--src/gallium/drivers/cell/ppu/cell_texture.c377
-rw-r--r--src/gallium/drivers/cell/ppu/cell_texture.h28
-rw-r--r--src/gallium/drivers/cell/ppu/cell_vbuf.c33
-rw-r--r--src/gallium/drivers/cell/spu/Makefile5
-rw-r--r--src/gallium/drivers/cell/spu/spu_tri.c179
-rw-r--r--src/gallium/drivers/cell/spu/spu_util.c2
-rw-r--r--src/gallium/drivers/failover/Makefile3
-rw-r--r--src/gallium/drivers/failover/fo_context.c2
-rw-r--r--src/gallium/drivers/failover/fo_state.c2
-rw-r--r--src/gallium/drivers/i915simple/Makefile3
-rw-r--r--src/gallium/drivers/i915simple/i915_debug.c2
-rw-r--r--src/gallium/drivers/i915simple/i915_fpc_translate.c11
-rw-r--r--src/gallium/drivers/i915simple/i915_prim_vbuf.c59
-rw-r--r--src/gallium/drivers/i915simple/i915_screen.c83
-rw-r--r--src/gallium/drivers/i915simple/i915_screen.h21
-rw-r--r--src/gallium/drivers/i915simple/i915_state_emit.c8
-rw-r--r--src/gallium/drivers/i915simple/i915_state_sampler.c2
-rw-r--r--src/gallium/drivers/i915simple/i915_surface.c80
-rw-r--r--src/gallium/drivers/i915simple/i915_texture.c92
-rw-r--r--src/gallium/drivers/i915simple/i915_winsys.h42
-rw-r--r--src/gallium/drivers/i965simple/Makefile2
-rw-r--r--src/gallium/drivers/i965simple/brw_eu_debug.c2
-rw-r--r--src/gallium/drivers/i965simple/brw_surface.c13
-rw-r--r--src/gallium/drivers/i965simple/brw_tex_layout.c38
-rw-r--r--src/gallium/drivers/i965simple/brw_wm_surface_state.c2
-rw-r--r--src/gallium/drivers/nouveau/nouveau_stateobj.h14
-rw-r--r--src/gallium/drivers/nouveau/nouveau_winsys.h7
-rw-r--r--src/gallium/drivers/nv04/Makefile12
-rw-r--r--src/gallium/drivers/nv04/nv04_miptree.c78
-rw-r--r--src/gallium/drivers/nv04/nv04_prim_vbuf.c24
-rw-r--r--src/gallium/drivers/nv04/nv04_screen.c26
-rw-r--r--src/gallium/drivers/nv04/nv04_screen.h3
-rw-r--r--src/gallium/drivers/nv04/nv04_state.h3
-rw-r--r--src/gallium/drivers/nv04/nv04_state_emit.c17
-rw-r--r--src/gallium/drivers/nv04/nv04_surface.c11
-rw-r--r--src/gallium/drivers/nv04/nv04_surface_2d.c61
-rw-r--r--src/gallium/drivers/nv04/nv04_surface_2d.h5
-rw-r--r--src/gallium/drivers/nv04/nv04_transfer.c196
-rw-r--r--src/gallium/drivers/nv10/Makefile12
-rw-r--r--src/gallium/drivers/nv10/nv10_miptree.c74
-rw-r--r--src/gallium/drivers/nv10/nv10_prim_vbuf.c44
-rw-r--r--src/gallium/drivers/nv10/nv10_screen.c28
-rw-r--r--src/gallium/drivers/nv10/nv10_screen.h4
-rw-r--r--src/gallium/drivers/nv10/nv10_state_emit.c14
-rw-r--r--src/gallium/drivers/nv10/nv10_surface.c11
-rw-r--r--src/gallium/drivers/nv10/nv10_transfer.c196
-rw-r--r--src/gallium/drivers/nv20/Makefile12
-rw-r--r--src/gallium/drivers/nv20/nv20_miptree.c113
-rw-r--r--src/gallium/drivers/nv20/nv20_prim_vbuf.c66
-rw-r--r--src/gallium/drivers/nv20/nv20_screen.c28
-rw-r--r--src/gallium/drivers/nv20/nv20_screen.h4
-rw-r--r--src/gallium/drivers/nv20/nv20_state_emit.c14
-rw-r--r--src/gallium/drivers/nv20/nv20_surface.c11
-rw-r--r--src/gallium/drivers/nv20/nv20_transfer.c196
-rw-r--r--src/gallium/drivers/nv30/Makefile12
-rw-r--r--src/gallium/drivers/nv30/nv30_fragprog.c4
-rw-r--r--src/gallium/drivers/nv30/nv30_fragtex.c2
-rw-r--r--src/gallium/drivers/nv30/nv30_miptree.c89
-rw-r--r--src/gallium/drivers/nv30/nv30_screen.c80
-rw-r--r--src/gallium/drivers/nv30/nv30_screen.h3
-rw-r--r--src/gallium/drivers/nv30/nv30_state.c3
-rw-r--r--src/gallium/drivers/nv30/nv30_state.h3
-rw-r--r--src/gallium/drivers/nv30/nv30_state_blend.c1
-rw-r--r--src/gallium/drivers/nv30/nv30_state_fb.c29
-rw-r--r--src/gallium/drivers/nv30/nv30_state_scissor.c1
-rw-r--r--src/gallium/drivers/nv30/nv30_state_stipple.c1
-rw-r--r--src/gallium/drivers/nv30/nv30_state_viewport.c4
-rw-r--r--src/gallium/drivers/nv30/nv30_surface.c11
-rw-r--r--src/gallium/drivers/nv30/nv30_transfer.c196
-rw-r--r--src/gallium/drivers/nv30/nv30_vbo.c3
-rw-r--r--src/gallium/drivers/nv30/nv30_vertprog.c1
-rw-r--r--src/gallium/drivers/nv40/Makefile12
-rw-r--r--src/gallium/drivers/nv40/nv40_fragprog.c4
-rw-r--r--src/gallium/drivers/nv40/nv40_fragtex.c1
-rw-r--r--src/gallium/drivers/nv40/nv40_miptree.c78
-rw-r--r--src/gallium/drivers/nv40/nv40_screen.c83
-rw-r--r--src/gallium/drivers/nv40/nv40_screen.h3
-rw-r--r--src/gallium/drivers/nv40/nv40_state.c3
-rw-r--r--src/gallium/drivers/nv40/nv40_state.h3
-rw-r--r--src/gallium/drivers/nv40/nv40_state_blend.c1
-rw-r--r--src/gallium/drivers/nv40/nv40_state_fb.c41
-rw-r--r--src/gallium/drivers/nv40/nv40_state_scissor.c1
-rw-r--r--src/gallium/drivers/nv40/nv40_state_viewport.c4
-rw-r--r--src/gallium/drivers/nv40/nv40_surface.c11
-rw-r--r--src/gallium/drivers/nv40/nv40_transfer.c196
-rw-r--r--src/gallium/drivers/nv40/nv40_vbo.c3
-rw-r--r--src/gallium/drivers/nv40/nv40_vertprog.c1
-rw-r--r--src/gallium/drivers/nv50/Makefile12
-rw-r--r--src/gallium/drivers/nv50/nv50_context.h8
-rw-r--r--src/gallium/drivers/nv50/nv50_miptree.c160
-rw-r--r--src/gallium/drivers/nv50/nv50_program.c8
-rw-r--r--src/gallium/drivers/nv50/nv50_query.c11
-rw-r--r--src/gallium/drivers/nv50/nv50_screen.c87
-rw-r--r--src/gallium/drivers/nv50/nv50_screen.h3
-rw-r--r--src/gallium/drivers/nv50/nv50_state.c3
-rw-r--r--src/gallium/drivers/nv50/nv50_state_validate.c8
-rw-r--r--src/gallium/drivers/nv50/nv50_surface.c38
-rw-r--r--src/gallium/drivers/nv50/nv50_tex.c10
-rw-r--r--src/gallium/drivers/nv50/nv50_transfer.c211
-rw-r--r--src/gallium/drivers/nv50/nv50_vbo.c4
-rw-r--r--src/gallium/drivers/r300/Makefile6
-rw-r--r--src/gallium/drivers/r300/r300_chipset.c15
-rw-r--r--src/gallium/drivers/r300/r300_chipset.h1
-rw-r--r--src/gallium/drivers/r300/r300_context.c88
-rw-r--r--src/gallium/drivers/r300/r300_context.h137
-rw-r--r--src/gallium/drivers/r300/r300_cs.h30
-rw-r--r--src/gallium/drivers/r300/r300_cs_inlines.h19
-rw-r--r--src/gallium/drivers/r300/r300_debug.c218
-rw-r--r--src/gallium/drivers/r300/r300_debug.h31
-rw-r--r--src/gallium/drivers/r300/r300_emit.c346
-rw-r--r--src/gallium/drivers/r300/r300_emit.h27
-rw-r--r--src/gallium/drivers/r300/r300_flush.c1
-rw-r--r--src/gallium/drivers/r300/r300_query.c111
-rw-r--r--src/gallium/drivers/r300/r300_query.h44
-rw-r--r--src/gallium/drivers/r300/r300_reg.h248
-rw-r--r--src/gallium/drivers/r300/r300_screen.c138
-rw-r--r--src/gallium/drivers/r300/r300_screen.h18
-rw-r--r--src/gallium/drivers/r300/r300_state.c414
-rw-r--r--src/gallium/drivers/r300/r300_state_derived.c299
-rw-r--r--src/gallium/drivers/r300/r300_state_derived.h34
-rw-r--r--src/gallium/drivers/r300/r300_state_inlines.h384
-rw-r--r--src/gallium/drivers/r300/r300_state_invariant.c203
-rw-r--r--src/gallium/drivers/r300/r300_state_invariant.h33
-rw-r--r--src/gallium/drivers/r300/r300_state_shader.c553
-rw-r--r--src/gallium/drivers/r300/r300_state_shader.h133
-rw-r--r--src/gallium/drivers/r300/r300_surface.c433
-rw-r--r--src/gallium/drivers/r300/r300_surface.h36
-rw-r--r--src/gallium/drivers/r300/r300_swtcl_emit.c324
-rw-r--r--src/gallium/drivers/r300/r300_texture.c115
-rw-r--r--src/gallium/drivers/r300/r300_texture.h9
-rw-r--r--src/gallium/drivers/r300/r300_winsys.h15
-rw-r--r--src/gallium/drivers/softpipe/Makefile5
-rw-r--r--src/gallium/drivers/softpipe/SConscript2
-rw-r--r--src/gallium/drivers/softpipe/sp_context.c16
-rw-r--r--src/gallium/drivers/softpipe/sp_context.h31
-rw-r--r--src/gallium/drivers/softpipe/sp_draw_arrays.c2
-rw-r--r--src/gallium/drivers/softpipe/sp_flush.c2
-rw-r--r--src/gallium/drivers/softpipe/sp_fs_exec.c3
-rw-r--r--src/gallium/drivers/softpipe/sp_fs_llvm.c1
-rw-r--r--src/gallium/drivers/softpipe/sp_fs_sse.c5
-rw-r--r--src/gallium/drivers/softpipe/sp_headers.h95
-rw-r--r--src/gallium/drivers/softpipe/sp_prim_vbuf.c78
-rw-r--r--src/gallium/drivers/softpipe/sp_quad.h81
-rw-r--r--src/gallium/drivers/softpipe/sp_quad_alpha_test.c2
-rw-r--r--src/gallium/drivers/softpipe/sp_quad_blend.c4
-rw-r--r--src/gallium/drivers/softpipe/sp_quad_bufloop.c4
-rw-r--r--src/gallium/drivers/softpipe/sp_quad_colormask.c4
-rw-r--r--src/gallium/drivers/softpipe/sp_quad_coverage.c9
-rw-r--r--src/gallium/drivers/softpipe/sp_quad_depth_test.c4
-rw-r--r--src/gallium/drivers/softpipe/sp_quad_earlyz.c2
-rw-r--r--src/gallium/drivers/softpipe/sp_quad_fs.c2
-rw-r--r--src/gallium/drivers/softpipe/sp_quad_occlusion.c4
-rw-r--r--src/gallium/drivers/softpipe/sp_quad_output.c4
-rw-r--r--src/gallium/drivers/softpipe/sp_quad_pipe.c (renamed from src/gallium/drivers/softpipe/sp_quad.c)0
-rw-r--r--src/gallium/drivers/softpipe/sp_quad_pipe.h74
-rw-r--r--src/gallium/drivers/softpipe/sp_quad_stencil.c4
-rw-r--r--src/gallium/drivers/softpipe/sp_quad_stipple.c27
-rw-r--r--src/gallium/drivers/softpipe/sp_query.c1
-rw-r--r--src/gallium/drivers/softpipe/sp_setup.c38
-rw-r--r--src/gallium/drivers/softpipe/sp_state.h6
-rw-r--r--src/gallium/drivers/softpipe/sp_state_fs.c31
-rw-r--r--src/gallium/drivers/softpipe/sp_state_sampler.c1
-rw-r--r--src/gallium/drivers/softpipe/sp_state_surface.c1
-rw-r--r--src/gallium/drivers/softpipe/sp_surface.c13
-rw-r--r--src/gallium/drivers/softpipe/sp_tex_sample.c2
-rw-r--r--src/gallium/drivers/softpipe/sp_texture.c174
-rw-r--r--src/gallium/drivers/softpipe/sp_texture.h15
-rw-r--r--src/gallium/drivers/softpipe/sp_tile_cache.c183
-rw-r--r--src/gallium/drivers/softpipe/sp_tile_cache.h4
-rw-r--r--src/gallium/drivers/trace/Makefile8
-rw-r--r--src/gallium/drivers/trace/SConscript4
-rw-r--r--src/gallium/drivers/trace/tr_buffer.c70
-rw-r--r--src/gallium/drivers/trace/tr_buffer.h (renamed from src/gallium/winsys/drm/intel/dri/intel_reg.h)51
-rw-r--r--src/gallium/drivers/trace/tr_context.c210
-rw-r--r--src/gallium/drivers/trace/tr_context.h6
-rw-r--r--src/gallium/drivers/trace/tr_dump.c117
-rw-r--r--src/gallium/drivers/trace/tr_dump.h13
-rw-r--r--src/gallium/drivers/trace/tr_screen.c777
-rw-r--r--src/gallium/drivers/trace/tr_screen.h17
-rw-r--r--src/gallium/drivers/trace/tr_state.c76
-rw-r--r--src/gallium/drivers/trace/tr_state.h2
-rw-r--r--src/gallium/drivers/trace/tr_texture.c80
-rw-r--r--src/gallium/drivers/trace/tr_texture.h42
-rw-r--r--src/gallium/drivers/trace/tr_winsys.c450
-rw-r--r--src/gallium/include/pipe/internal/p_winsys_screen.h8
-rw-r--r--src/gallium/include/pipe/p_atomic.h382
-rw-r--r--src/gallium/include/pipe/p_config.h8
-rw-r--r--src/gallium/include/pipe/p_context.h1
-rw-r--r--src/gallium/include/pipe/p_defines.h12
-rw-r--r--src/gallium/include/pipe/p_format.h3
-rw-r--r--src/gallium/include/pipe/p_inlines.h175
-rw-r--r--src/gallium/include/pipe/p_refcnt.h (renamed from src/gallium/drivers/trace/tr_winsys.h)84
-rw-r--r--src/gallium/include/pipe/p_screen.h60
-rw-r--r--src/gallium/include/pipe/p_shader_tokens.h6
-rw-r--r--src/gallium/include/pipe/p_state.h85
-rw-r--r--src/gallium/include/pipe/p_thread.h32
-rw-r--r--src/gallium/include/state_tracker/drm_api.h24
-rw-r--r--src/gallium/state_trackers/dri2/Makefile28
-rw-r--r--src/gallium/state_trackers/dri2/dri_context.c (renamed from src/gallium/state_trackers/glx/dri/dri_context.c)64
-rw-r--r--src/gallium/state_trackers/dri2/dri_context.h (renamed from src/gallium/state_trackers/glx/dri/dri_context.h)41
-rw-r--r--src/gallium/state_trackers/dri2/dri_drawable.c325
-rw-r--r--src/gallium/state_trackers/dri2/dri_drawable.h (renamed from src/gallium/state_trackers/glx/dri/dri_drawable.h)36
-rw-r--r--src/gallium/state_trackers/dri2/dri_extensions.c (renamed from src/gallium/state_trackers/glx/dri/dri_extensions.c)27
-rw-r--r--src/gallium/state_trackers/dri2/dri_screen.c (renamed from src/gallium/state_trackers/glx/dri/dri_screen.c)231
-rw-r--r--src/gallium/state_trackers/dri2/dri_screen.h (renamed from src/gallium/state_trackers/glx/dri/dri_screen.h)53
-rw-r--r--src/gallium/state_trackers/egl/Makefile6
-rw-r--r--src/gallium/state_trackers/egl/egl_context.c2
-rw-r--r--src/gallium/state_trackers/egl/egl_surface.c14
-rw-r--r--src/gallium/state_trackers/egl/egl_tracker.c4
-rw-r--r--src/gallium/state_trackers/egl/egl_tracker.h2
-rw-r--r--src/gallium/state_trackers/g3dvl/Makefile2
-rw-r--r--src/gallium/state_trackers/g3dvl/vl_basic_csc.c10
-rw-r--r--src/gallium/state_trackers/g3dvl/vl_context.c4
-rw-r--r--src/gallium/state_trackers/g3dvl/vl_r16snorm_mc_buf.c24
-rw-r--r--src/gallium/state_trackers/glx/dri/dri_drawable.c363
-rw-r--r--src/gallium/state_trackers/glx/dri/dri_lock.c90
-rw-r--r--src/gallium/state_trackers/glx/xlib/Makefile18
-rw-r--r--src/gallium/state_trackers/glx/xlib/SConscript5
-rw-r--r--src/gallium/state_trackers/glx/xlib/glxapi.c10
-rw-r--r--src/gallium/state_trackers/glx/xlib/xm_api.c35
-rw-r--r--src/gallium/state_trackers/glx/xlib/xm_api.h1
-rw-r--r--src/gallium/state_trackers/python/gallium.i16
-rw-r--r--src/gallium/state_trackers/python/p_context.i10
-rw-r--r--src/gallium/state_trackers/python/p_state.i1
-rw-r--r--src/gallium/state_trackers/python/p_texture.i50
-rwxr-xr-xsrc/gallium/state_trackers/python/retrace/interpreter.py84
-rw-r--r--src/gallium/state_trackers/python/samples/tri.py14
-rw-r--r--src/gallium/state_trackers/python/st_device.c56
-rw-r--r--src/gallium/state_trackers/python/st_device.h6
-rw-r--r--src/gallium/state_trackers/python/st_sample.c49
-rw-r--r--src/gallium/state_trackers/python/st_softpipe_winsys.c4
-rw-r--r--src/gallium/state_trackers/wgl/SConscript5
-rw-r--r--src/gallium/state_trackers/wgl/icd/stw_icd.c253
-rw-r--r--src/gallium/state_trackers/wgl/opengl32.mingw.def387
-rw-r--r--src/gallium/state_trackers/wgl/shared/stw_context.c213
-rw-r--r--src/gallium/state_trackers/wgl/shared/stw_context.h11
-rw-r--r--src/gallium/state_trackers/wgl/shared/stw_device.c69
-rw-r--r--src/gallium/state_trackers/wgl/shared/stw_device.h25
-rw-r--r--src/gallium/state_trackers/wgl/shared/stw_framebuffer.c49
-rw-r--r--src/gallium/state_trackers/wgl/shared/stw_pixelformat.c14
-rw-r--r--src/gallium/state_trackers/wgl/shared/stw_public.h27
-rw-r--r--src/gallium/state_trackers/wgl/shared/stw_quirks.c3
-rw-r--r--src/gallium/state_trackers/wgl/wgl/stw_wgl.c32
-rw-r--r--src/gallium/state_trackers/wgl/wgl/stw_wgl.h2
-rw-r--r--src/gallium/state_trackers/xorg/Makefile29
-rw-r--r--src/gallium/state_trackers/xorg/xorg_crtc.c314
-rw-r--r--src/gallium/state_trackers/xorg/xorg_dri2.c212
-rw-r--r--src/gallium/state_trackers/xorg/xorg_driver.c695
-rw-r--r--src/gallium/state_trackers/xorg/xorg_exa.c528
-rw-r--r--src/gallium/state_trackers/xorg/xorg_output.c296
-rw-r--r--src/gallium/state_trackers/xorg/xorg_tracker.h130
-rw-r--r--src/gallium/state_trackers/xorg/xorg_winsys.h (renamed from src/gallium/state_trackers/wgl/stw.h)44
-rw-r--r--src/gallium/winsys/Makefile18
-rw-r--r--src/gallium/winsys/drm/Makefile32
-rw-r--r--src/gallium/winsys/drm/Makefile.template19
-rw-r--r--src/gallium/winsys/drm/intel/Makefile21
-rw-r--r--src/gallium/winsys/drm/intel/common/Makefile23
-rw-r--r--src/gallium/winsys/drm/intel/common/Makefile.template64
-rw-r--r--src/gallium/winsys/drm/intel/common/intel_be_batchbuffer.c429
-rw-r--r--src/gallium/winsys/drm/intel/common/intel_be_batchbuffer.h69
-rw-r--r--src/gallium/winsys/drm/intel/common/intel_be_context.c107
-rw-r--r--src/gallium/winsys/drm/intel/common/intel_be_context.h40
-rw-r--r--src/gallium/winsys/drm/intel/common/intel_be_device.c296
-rw-r--r--src/gallium/winsys/drm/intel/common/intel_be_device.h72
-rw-r--r--src/gallium/winsys/drm/intel/common/ws_dri_bufmgr.c949
-rw-r--r--src/gallium/winsys/drm/intel/common/ws_dri_bufmgr.h138
-rw-r--r--src/gallium/winsys/drm/intel/common/ws_dri_bufpool.h102
-rw-r--r--src/gallium/winsys/drm/intel/common/ws_dri_drmpool.c268
-rw-r--r--src/gallium/winsys/drm/intel/common/ws_dri_fencemgr.c377
-rw-r--r--src/gallium/winsys/drm/intel/common/ws_dri_fencemgr.h115
-rw-r--r--src/gallium/winsys/drm/intel/common/ws_dri_mallocpool.c161
-rw-r--r--src/gallium/winsys/drm/intel/common/ws_dri_slabpool.c968
-rw-r--r--src/gallium/winsys/drm/intel/dri/Makefile33
-rw-r--r--src/gallium/winsys/drm/intel/dri/SConscript41
-rw-r--r--src/gallium/winsys/drm/intel/dri/intel_batchbuffer.h24
-rw-r--r--src/gallium/winsys/drm/intel/dri/intel_context.c337
-rw-r--r--src/gallium/winsys/drm/intel/dri/intel_context.h164
-rw-r--r--src/gallium/winsys/drm/intel/dri/intel_lock.c102
-rw-r--r--src/gallium/winsys/drm/intel/dri/intel_screen.c703
-rw-r--r--src/gallium/winsys/drm/intel/dri/intel_screen.h122
-rw-r--r--src/gallium/winsys/drm/intel/dri/intel_swapbuffers.c260
-rw-r--r--src/gallium/winsys/drm/intel/dri/intel_winsys_softpipe.c82
-rw-r--r--src/gallium/winsys/drm/intel/dri/server/i830_common.h255
-rw-r--r--src/gallium/winsys/drm/intel/dri/server/i830_dri.h62
-rw-r--r--src/gallium/winsys/drm/intel/dri2/Makefile22
-rw-r--r--src/gallium/winsys/drm/intel/egl/Makefile13
-rw-r--r--src/gallium/winsys/drm/intel/egl/intel_api.c10
-rw-r--r--src/gallium/winsys/drm/intel/egl/intel_api.h14
-rw-r--r--src/gallium/winsys/drm/intel/egl/intel_context.c83
-rw-r--r--src/gallium/winsys/drm/intel/egl/intel_device.c48
-rw-r--r--src/gallium/winsys/drm/intel/gem/Makefile12
-rw-r--r--src/gallium/winsys/drm/intel/gem/Makefile.template64
-rw-r--r--src/gallium/winsys/drm/intel/gem/intel_be_api.c15
-rw-r--r--src/gallium/winsys/drm/intel/gem/intel_be_api.h14
-rw-r--r--src/gallium/winsys/drm/intel/gem/intel_be_batchbuffer.c7
-rw-r--r--src/gallium/winsys/drm/intel/gem/intel_be_context.c44
-rw-r--r--src/gallium/winsys/drm/intel/gem/intel_be_context.h17
-rw-r--r--src/gallium/winsys/drm/intel/gem/intel_be_device.c111
-rw-r--r--src/gallium/winsys/drm/intel/gem/intel_be_device.h32
-rw-r--r--src/gallium/winsys/drm/intel/gem/intel_be_fence.h18
-rw-r--r--src/gallium/winsys/drm/intel/xorg/Makefile43
-rw-r--r--src/gallium/winsys/drm/intel/xorg/intel_xorg.c156
-rw-r--r--src/gallium/winsys/drm/nouveau/Makefile21
-rw-r--r--src/gallium/winsys/drm/nouveau/common/Makefile22
-rw-r--r--src/gallium/winsys/drm/nouveau/common/Makefile.template59
-rw-r--r--src/gallium/winsys/drm/nouveau/common/nouveau_context.c206
-rw-r--r--src/gallium/winsys/drm/nouveau/common/nouveau_context.h59
-rw-r--r--src/gallium/winsys/drm/nouveau/common/nouveau_local.h19
-rw-r--r--src/gallium/winsys/drm/nouveau/common/nouveau_screen.c31
-rw-r--r--src/gallium/winsys/drm/nouveau/common/nouveau_screen.h27
-rw-r--r--src/gallium/winsys/drm/nouveau/common/nouveau_winsys_pipe.c242
-rw-r--r--src/gallium/winsys/drm/nouveau/common/nouveau_winsys_pipe.h44
-rw-r--r--src/gallium/winsys/drm/nouveau/common/nouveau_winsys_softpipe.c101
-rw-r--r--src/gallium/winsys/drm/nouveau/dri/Makefile10
-rw-r--r--src/gallium/winsys/drm/nouveau/dri/nouveau_context.c (renamed from src/gallium/winsys/drm/nouveau/dri/nouveau_context_dri.c)62
-rw-r--r--src/gallium/winsys/drm/nouveau/dri/nouveau_context.h (renamed from src/gallium/winsys/drm/nouveau/dri/nouveau_context_dri.h)14
-rw-r--r--src/gallium/winsys/drm/nouveau/dri/nouveau_dri.h (renamed from src/gallium/winsys/drm/nouveau/common/nouveau_dri.h)0
-rw-r--r--src/gallium/winsys/drm/nouveau/dri/nouveau_lock.c (renamed from src/gallium/winsys/drm/nouveau/common/nouveau_lock.c)5
-rw-r--r--src/gallium/winsys/drm/nouveau/dri/nouveau_screen.c (renamed from src/gallium/winsys/drm/nouveau/dri/nouveau_screen_dri.c)94
-rw-r--r--src/gallium/winsys/drm/nouveau/dri/nouveau_screen.h (renamed from src/gallium/winsys/drm/nouveau/dri/nouveau_screen_dri.h)9
-rw-r--r--src/gallium/winsys/drm/nouveau/dri/nouveau_swapbuffers.c32
-rw-r--r--src/gallium/winsys/drm/nouveau/dri/nouveau_swapbuffers.h11
-rw-r--r--src/gallium/winsys/drm/nouveau/dri2/Makefile26
-rw-r--r--src/gallium/winsys/drm/nouveau/drm/Makefile13
-rw-r--r--src/gallium/winsys/drm/nouveau/drm/nouveau_drm_api.c194
-rw-r--r--src/gallium/winsys/drm/nouveau/drm/nouveau_drm_api.h5
-rw-r--r--src/gallium/winsys/drm/nouveau/drm/nouveau_winsys.c (renamed from src/gallium/winsys/drm/nouveau/common/nouveau_winsys.c)73
-rw-r--r--src/gallium/winsys/drm/nouveau/drm/nouveau_winsys_pipe.c204
-rw-r--r--src/gallium/winsys/drm/nouveau/drm/nouveau_winsys_pipe.h52
-rw-r--r--src/gallium/winsys/drm/radeon/Makefile36
-rw-r--r--src/gallium/winsys/drm/radeon/core/Makefile18
-rw-r--r--src/gallium/winsys/drm/radeon/core/radeon_buffer.c (renamed from src/gallium/winsys/drm/radeon/radeon_buffer.c)106
-rw-r--r--src/gallium/winsys/drm/radeon/core/radeon_buffer.h (renamed from src/gallium/winsys/drm/radeon/radeon_buffer.h)25
-rw-r--r--src/gallium/winsys/drm/radeon/core/radeon_drm.c122
-rw-r--r--src/gallium/winsys/drm/radeon/core/radeon_drm.h (renamed from src/gallium/winsys/drm/radeon/radeon_context.h)63
-rw-r--r--src/gallium/winsys/drm/radeon/core/radeon_r300.c (renamed from src/gallium/winsys/drm/radeon/radeon_r300.c)7
-rw-r--r--src/gallium/winsys/drm/radeon/core/radeon_r300.h (renamed from src/gallium/winsys/drm/radeon/radeon_r300.h)3
-rw-r--r--src/gallium/winsys/drm/radeon/core/radeon_winsys_softpipe.c (renamed from src/gallium/winsys/drm/radeon/radeon_winsys_softpipe.c)26
-rw-r--r--src/gallium/winsys/drm/radeon/core/radeon_winsys_softpipe.h (renamed from src/gallium/winsys/drm/radeon/radeon_winsys_softpipe.h)11
-rw-r--r--src/gallium/winsys/drm/radeon/dri2/Makefile25
-rw-r--r--src/gallium/winsys/drm/radeon/egl/Makefile25
-rw-r--r--src/gallium/winsys/drm/radeon/radeon_context.c306
-rw-r--r--src/gallium/winsys/drm/radeon/radeon_screen.c288
-rw-r--r--src/gallium/winsys/drm/radeon/radeon_screen.h41
-rw-r--r--src/gallium/winsys/drm/radeon/xorg/Makefile42
-rw-r--r--src/gallium/winsys/drm/radeon/xorg/radeon_xorg.c157
-rw-r--r--src/gallium/winsys/egl_xlib/egl_xlib.c7
-rw-r--r--src/gallium/winsys/egl_xlib/sw_winsys.c6
-rw-r--r--src/gallium/winsys/g3dvl/nouveau/nouveau_swapbuffers.c2
-rw-r--r--src/gallium/winsys/g3dvl/xsp_winsys.c25
-rw-r--r--src/gallium/winsys/gdi/SConscript12
-rw-r--r--src/gallium/winsys/gdi/gdi_softpipe_winsys.c14
-rw-r--r--src/gallium/winsys/xlib/xlib_brw_aub.c14
-rw-r--r--src/gallium/winsys/xlib/xlib_brw_screen.c8
-rw-r--r--src/gallium/winsys/xlib/xlib_cell.c22
-rw-r--r--src/gallium/winsys/xlib/xlib_softpipe.c58
-rw-r--r--src/glew/Makefile3
-rw-r--r--src/glx/x11/dri2_glx.c75
-rw-r--r--src/glx/x11/dri_common.c7
-rw-r--r--src/glx/x11/dri_glx.c2
-rw-r--r--src/glx/x11/glxclient.h6
-rw-r--r--src/glx/x11/glxcmds.c24
-rw-r--r--src/glx/x11/glxext.c86
-rw-r--r--src/glx/x11/indirect.c40
-rw-r--r--src/glx/x11/indirect.h2
-rw-r--r--src/glx/x11/indirect_init.c2
-rw-r--r--src/glx/x11/indirect_size.c1
-rw-r--r--src/mesa/Makefile2
-rw-r--r--src/mesa/SConscript9
-rw-r--r--src/mesa/drivers/common/driverfuncs.c5
-rw-r--r--src/mesa/drivers/dri/common/extension_helper.h38
-rw-r--r--src/mesa/drivers/dri/common/texmem.c10
-rw-r--r--src/mesa/drivers/dri/common/utils.c74
-rw-r--r--src/mesa/drivers/dri/common/xmlpool/options.h20
-rw-r--r--src/mesa/drivers/dri/common/xmlpool/t_options.h10
-rw-r--r--src/mesa/drivers/dri/fb/fb_dri.c2
-rw-r--r--src/mesa/drivers/dri/ffb/ffb_state.c4
-rw-r--r--src/mesa/drivers/dri/ffb/ffb_xmesa.c2
-rw-r--r--src/mesa/drivers/dri/gamma/gamma_tex.c8
-rw-r--r--src/mesa/drivers/dri/gamma/gamma_xmesa.c2
-rw-r--r--src/mesa/drivers/dri/i810/i810screen.c2
-rw-r--r--src/mesa/drivers/dri/i915/i830_context.c2
-rw-r--r--src/mesa/drivers/dri/i915/i830_vtbl.c4
-rw-r--r--src/mesa/drivers/dri/i915/i915_context.c2
-rw-r--r--src/mesa/drivers/dri/i915/i915_fragprog.c4
-rw-r--r--src/mesa/drivers/dri/i915/intel_tris.c8
-rw-r--r--src/mesa/drivers/dri/i965/brw_cc.c2
-rw-r--r--src/mesa/drivers/dri/i965/brw_clip_line.c66
-rw-r--r--src/mesa/drivers/dri/i965/brw_clip_tri.c76
-rw-r--r--src/mesa/drivers/dri/i965/brw_context.c3
-rw-r--r--src/mesa/drivers/dri/i965/brw_context.h49
-rw-r--r--src/mesa/drivers/dri/i965/brw_curbe.c56
-rw-r--r--src/mesa/drivers/dri/i965/brw_defines.h2
-rw-r--r--src/mesa/drivers/dri/i965/brw_draw.c77
-rw-r--r--src/mesa/drivers/dri/i965/brw_eu.c123
-rw-r--r--src/mesa/drivers/dri/i965/brw_eu.h27
-rw-r--r--src/mesa/drivers/dri/i965/brw_eu_emit.c61
-rw-r--r--src/mesa/drivers/dri/i965/brw_fallback.c4
-rw-r--r--src/mesa/drivers/dri/i965/brw_misc_state.c37
-rw-r--r--src/mesa/drivers/dri/i965/brw_program.c31
-rw-r--r--src/mesa/drivers/dri/i965/brw_sf.c10
-rw-r--r--src/mesa/drivers/dri/i965/brw_sf_state.c3
-rw-r--r--src/mesa/drivers/dri/i965/brw_state.h1
-rw-r--r--src/mesa/drivers/dri/i965/brw_state_batch.c2
-rw-r--r--src/mesa/drivers/dri/i965/brw_state_dump.c8
-rw-r--r--src/mesa/drivers/dri/i965/brw_structs.h2
-rw-r--r--src/mesa/drivers/dri/i965/brw_vs_constval.c4
-rw-r--r--src/mesa/drivers/dri/i965/brw_vs_emit.c80
-rw-r--r--src/mesa/drivers/dri/i965/brw_vtbl.c43
-rw-r--r--src/mesa/drivers/dri/i965/brw_wm.c115
-rw-r--r--src/mesa/drivers/dri/i965/brw_wm.h9
-rw-r--r--src/mesa/drivers/dri/i965/brw_wm_emit.c8
-rw-r--r--src/mesa/drivers/dri/i965/brw_wm_fp.c195
-rw-r--r--src/mesa/drivers/dri/i965/brw_wm_glsl.c365
-rw-r--r--src/mesa/drivers/dri/i965/brw_wm_pass0.c12
-rw-r--r--src/mesa/drivers/dri/i965/brw_wm_pass1.c4
-rw-r--r--src/mesa/drivers/dri/i965/brw_wm_sampler_state.c22
-rw-r--r--src/mesa/drivers/dri/i965/brw_wm_state.c8
-rw-r--r--src/mesa/drivers/dri/i965/brw_wm_surface_state.c26
-rw-r--r--src/mesa/drivers/dri/intel/intel_batchbuffer.c2
-rw-r--r--src/mesa/drivers/dri/intel/intel_blit.c3
-rw-r--r--src/mesa/drivers/dri/intel/intel_buffer_objects.c16
-rw-r--r--src/mesa/drivers/dri/intel/intel_buffers.c9
-rw-r--r--src/mesa/drivers/dri/intel/intel_chipset.h11
-rw-r--r--src/mesa/drivers/dri/intel/intel_clear.c40
-rw-r--r--src/mesa/drivers/dri/intel/intel_context.c26
-rw-r--r--src/mesa/drivers/dri/intel/intel_context.h10
-rw-r--r--src/mesa/drivers/dri/intel/intel_decode.c2
-rw-r--r--src/mesa/drivers/dri/intel/intel_depthtmp.h54
-rw-r--r--src/mesa/drivers/dri/intel/intel_extensions.c6
-rw-r--r--src/mesa/drivers/dri/intel/intel_fbo.c65
-rw-r--r--src/mesa/drivers/dri/intel/intel_mipmap_tree.c6
-rw-r--r--src/mesa/drivers/dri/intel/intel_mipmap_tree.h3
-rw-r--r--src/mesa/drivers/dri/intel/intel_pixel.c3
-rw-r--r--src/mesa/drivers/dri/intel/intel_pixel_copy.c2
-rw-r--r--src/mesa/drivers/dri/intel/intel_pixel_draw.c2
-rw-r--r--src/mesa/drivers/dri/intel/intel_regions.c15
-rw-r--r--src/mesa/drivers/dri/intel/intel_regions.h3
-rw-r--r--src/mesa/drivers/dri/intel/intel_screen.c39
-rw-r--r--src/mesa/drivers/dri/intel/intel_span.c255
-rw-r--r--src/mesa/drivers/dri/intel/intel_spantmp.h61
-rw-r--r--src/mesa/drivers/dri/intel/intel_tex_format.c19
-rw-r--r--src/mesa/drivers/dri/intel/intel_tex_image.c19
-rw-r--r--src/mesa/drivers/dri/intel/intel_tex_validate.c3
-rw-r--r--src/mesa/drivers/dri/mach64/mach64_screen.c2
-rw-r--r--src/mesa/drivers/dri/mga/mga_texstate.c8
-rw-r--r--src/mesa/drivers/dri/mga/mga_xmesa.c2
-rw-r--r--src/mesa/drivers/dri/mga/mgapixel.c2
-rw-r--r--src/mesa/drivers/dri/r128/r128_screen.c2
-rw-r--r--src/mesa/drivers/dri/r200/r200_pixel.c2
-rw-r--r--src/mesa/drivers/dri/r200/r200_texstate.c42
-rw-r--r--src/mesa/drivers/dri/r200/r200_vertprog.c2
-rw-r--r--src/mesa/drivers/dri/r300/r300_context.c4
-rw-r--r--src/mesa/drivers/dri/r300/r300_emit.c11
-rw-r--r--src/mesa/drivers/dri/r300/r300_fragprog.c4
-rw-r--r--src/mesa/drivers/dri/r300/r300_reg.h6
-rw-r--r--src/mesa/drivers/dri/r300/r300_state.c581
-rw-r--r--src/mesa/drivers/dri/r300/r300_swtcl.c75
-rw-r--r--src/mesa/drivers/dri/r300/r300_vertprog.c14
-rw-r--r--src/mesa/drivers/dri/r300/r500_fragprog.c4
-rw-r--r--src/mesa/drivers/dri/r300/radeon_nqssadce.c2
-rw-r--r--src/mesa/drivers/dri/r300/radeon_program_pair.c32
-rw-r--r--src/mesa/drivers/dri/radeon/radeon_common.c2
-rw-r--r--src/mesa/drivers/dri/radeon/radeon_screen.c4
-rw-r--r--src/mesa/drivers/dri/radeon/radeon_texstate.c24
-rw-r--r--src/mesa/drivers/dri/radeon/server/radeon_reg.h2
-rw-r--r--src/mesa/drivers/dri/s3v/s3v_tex.c8
-rw-r--r--src/mesa/drivers/dri/s3v/s3v_xmesa.c5
-rw-r--r--src/mesa/drivers/dri/savage/savage_xmesa.c2
-rw-r--r--src/mesa/drivers/dri/savage/savagestate.c4
-rw-r--r--src/mesa/drivers/dri/sis/sis_screen.c2
-rw-r--r--src/mesa/drivers/dri/swrast/swrast.c2
-rw-r--r--src/mesa/drivers/dri/tdfx/tdfx_context.c4
-rw-r--r--src/mesa/drivers/dri/tdfx/tdfx_pixels.c2
-rw-r--r--src/mesa/drivers/dri/tdfx/tdfx_render.c2
-rw-r--r--src/mesa/drivers/dri/tdfx/tdfx_screen.c2
-rw-r--r--src/mesa/drivers/dri/tdfx/tdfx_state.c2
-rw-r--r--src/mesa/drivers/dri/trident/trident_context.c3
-rw-r--r--src/mesa/drivers/dri/unichrome/via_screen.c2
-rw-r--r--src/mesa/drivers/dri/unichrome/via_state.c2
-rw-r--r--src/mesa/drivers/ggi/default/stubs.c2
-rw-r--r--src/mesa/drivers/glide/fxdd.c3
-rw-r--r--src/mesa/drivers/glslcompiler/glslcompiler.c51
-rw-r--r--src/mesa/drivers/windows/gdi/mesa.def2
-rw-r--r--src/mesa/drivers/windows/gdi/wmesa.c2
-rw-r--r--src/mesa/drivers/x11/Makefile3
-rw-r--r--src/mesa/drivers/x11/glxapi.c6
-rw-r--r--src/mesa/drivers/x11/xm_api.c17
-rw-r--r--src/mesa/drivers/x11/xm_buffer.c1
-rw-r--r--src/mesa/drivers/x11/xm_span.c18
-rw-r--r--src/mesa/glapi/dispatch.h136
-rw-r--r--src/mesa/glapi/glX_proto_recv.py2
-rw-r--r--src/mesa/glapi/gl_API.xml50
-rw-r--r--src/mesa/glapi/gl_SPARC_asm.py228
-rw-r--r--src/mesa/glapi/gl_enums.py3
-rw-r--r--src/mesa/glapi/glapi.c133
-rw-r--r--src/mesa/glapi/glapi_getproc.c89
-rw-r--r--src/mesa/glapi/glapioffsets.h116
-rw-r--r--src/mesa/glapi/glapitable.h110
-rw-r--r--src/mesa/glapi/glapitemp.h98
-rw-r--r--src/mesa/glapi/glprocs.h750
-rw-r--r--src/mesa/glapi/glthread.c2
-rw-r--r--src/mesa/glapi/glthread.h18
-rw-r--r--src/mesa/main/api_exec.c9
-rw-r--r--src/mesa/main/api_validate.c15
-rw-r--r--src/mesa/main/attrib.c169
-rw-r--r--src/mesa/main/bufferobj.c60
-rw-r--r--src/mesa/main/buffers.c19
-rw-r--r--src/mesa/main/clip.c1
-rw-r--r--src/mesa/main/compiler.h479
-rw-r--r--src/mesa/main/config.h20
-rw-r--r--src/mesa/main/context.c475
-rw-r--r--src/mesa/main/context.h4
-rw-r--r--src/mesa/main/cpuinfo.c109
-rw-r--r--src/mesa/main/cpuinfo.h (renamed from src/mesa/math/mathmod.h)32
-rw-r--r--src/mesa/main/dd.h35
-rw-r--r--src/mesa/main/debug.c22
-rw-r--r--src/mesa/main/dispatch.c1
-rw-r--r--src/mesa/main/dlist.c50
-rw-r--r--src/mesa/main/dlopen.c6
-rw-r--r--src/mesa/main/drawpix.c8
-rw-r--r--src/mesa/main/enable.c28
-rw-r--r--src/mesa/main/enums.c5879
-rw-r--r--src/mesa/main/execmem.c4
-rw-r--r--src/mesa/main/extensions.c10
-rw-r--r--src/mesa/main/fbobject.c46
-rw-r--r--src/mesa/main/fbobject.h2
-rw-r--r--src/mesa/main/feedback.c105
-rw-r--r--src/mesa/main/feedback.h41
-rw-r--r--src/mesa/main/ffvertex_prog.c9
-rw-r--r--src/mesa/main/framebuffer.c17
-rw-r--r--src/mesa/main/framebuffer.h3
-rw-r--r--src/mesa/main/get.c90
-rw-r--r--src/mesa/main/get_gen.py24
-rw-r--r--src/mesa/main/getstring.c32
-rw-r--r--src/mesa/main/glheader.h265
-rw-r--r--src/mesa/main/hash.c2
-rw-r--r--src/mesa/main/image.c370
-rw-r--r--src/mesa/main/image.h7
-rw-r--r--src/mesa/main/imports.c2
-rw-r--r--src/mesa/main/imports.h184
-rw-r--r--src/mesa/main/macros.h7
-rw-r--r--src/mesa/main/matrix.c157
-rw-r--r--src/mesa/main/matrix.h25
-rw-r--r--src/mesa/main/mfeatures.h1
-rw-r--r--src/mesa/main/mipmap.c16
-rw-r--r--src/mesa/main/mtypes.h693
-rw-r--r--src/mesa/main/shaders.c51
-rw-r--r--src/mesa/main/shared.c356
-rw-r--r--src/mesa/main/shared.h (renamed from src/mesa/x86/x86.h)20
-rw-r--r--src/mesa/main/state.c41
-rw-r--r--src/mesa/main/stencil.c26
-rw-r--r--src/mesa/main/texenv.c175
-rw-r--r--src/mesa/main/texenv.h11
-rw-r--r--src/mesa/main/texenvprogram.c124
-rw-r--r--src/mesa/main/texformat.c42
-rw-r--r--src/mesa/main/texformat.h14
-rw-r--r--src/mesa/main/texformat_tmp.h24
-rw-r--r--src/mesa/main/texgen.c590
-rw-r--r--src/mesa/main/teximage.c118
-rw-r--r--src/mesa/main/texobj.c133
-rw-r--r--src/mesa/main/texparam.c14
-rw-r--r--src/mesa/main/texstate.c398
-rw-r--r--src/mesa/main/texstore.c91
-rw-r--r--src/mesa/main/texstore.h2
-rw-r--r--src/mesa/main/version.h4
-rw-r--r--src/mesa/main/viewport.c176
-rw-r--r--src/mesa/main/viewport.h52
-rw-r--r--src/mesa/main/vtxfmt.c9
-rw-r--r--src/mesa/math/m_debug_util.h4
-rw-r--r--src/mesa/math/m_matrix.c21
-rw-r--r--src/mesa/math/m_matrix.h3
-rw-r--r--src/mesa/math/m_xform.c94
-rw-r--r--src/mesa/math/m_xform.h19
-rw-r--r--src/mesa/shader/arbprogparse.c39
-rw-r--r--src/mesa/shader/arbprogram.c9
-rw-r--r--src/mesa/shader/nvfragparse.c44
-rw-r--r--src/mesa/shader/nvfragparse.h5
-rw-r--r--src/mesa/shader/nvprogram.c9
-rw-r--r--src/mesa/shader/nvvertparse.c7
-rw-r--r--src/mesa/shader/prog_debug.c259
-rw-r--r--src/mesa/shader/prog_execute.c41
-rw-r--r--src/mesa/shader/prog_execute.h2
-rw-r--r--src/mesa/shader/prog_instruction.c2
-rw-r--r--src/mesa/shader/prog_instruction.h68
-rw-r--r--src/mesa/shader/prog_optimize.c427
-rw-r--r--src/mesa/shader/prog_optimize.h (renamed from src/mesa/shader/prog_debug.h)27
-rw-r--r--src/mesa/shader/prog_parameter.c8
-rw-r--r--src/mesa/shader/prog_parameter.h8
-rw-r--r--src/mesa/shader/prog_print.c82
-rw-r--r--src/mesa/shader/prog_statevars.c44
-rw-r--r--src/mesa/shader/prog_statevars.h2
-rw-r--r--src/mesa/shader/program.c15
-rw-r--r--src/mesa/shader/programopt.c8
-rw-r--r--src/mesa/shader/programopt.h2
-rw-r--r--src/mesa/shader/shader_api.c90
-rw-r--r--src/mesa/shader/slang/library/slang_common_builtin.gc34
-rw-r--r--src/mesa/shader/slang/library/slang_common_builtin_gc.h234
-rw-r--r--src/mesa/shader/slang/library/slang_fragment_builtin.gc30
-rw-r--r--src/mesa/shader/slang/library/slang_fragment_builtin_gc.h177
-rw-r--r--src/mesa/shader/slang/library/slang_vertex_builtin.gc28
-rw-r--r--src/mesa/shader/slang/library/slang_vertex_builtin_gc.h131
-rw-r--r--src/mesa/shader/slang/slang_builtin.c2
-rw-r--r--src/mesa/shader/slang/slang_codegen.c187
-rw-r--r--src/mesa/shader/slang/slang_codegen.h1
-rw-r--r--src/mesa/shader/slang/slang_compile.c14
-rw-r--r--src/mesa/shader/slang/slang_emit.c101
-rw-r--r--src/mesa/shader/slang/slang_ir.c13
-rw-r--r--src/mesa/shader/slang/slang_ir.h19
-rw-r--r--src/mesa/shader/slang/slang_link.c30
-rw-r--r--src/mesa/shader/slang/slang_preprocess.c23
-rw-r--r--src/mesa/sources.mak35
-rw-r--r--src/mesa/sparc/clip.S29
-rw-r--r--src/mesa/sparc/glapi_sparc.S1649
-rw-r--r--src/mesa/sparc/norm.S25
-rw-r--r--src/mesa/sparc/sparc.c37
-rw-r--r--src/mesa/sparc/sparc.h1
-rw-r--r--src/mesa/state_tracker/st_atom.c4
-rw-r--r--src/mesa/state_tracker/st_atom_constbuf.c12
-rw-r--r--src/mesa/state_tracker/st_atom_depth.c54
-rw-r--r--src/mesa/state_tracker/st_atom_framebuffer.c19
-rw-r--r--src/mesa/state_tracker/st_atom_pixeltransfer.c18
-rw-r--r--src/mesa/state_tracker/st_atom_shader.c11
-rw-r--r--src/mesa/state_tracker/st_atom_texture.c1
-rw-r--r--src/mesa/state_tracker/st_cb_accum.c164
-rw-r--r--src/mesa/state_tracker/st_cb_bitmap.c103
-rw-r--r--src/mesa/state_tracker/st_cb_bufferobjects.c90
-rw-r--r--src/mesa/state_tracker/st_cb_clear.c58
-rw-r--r--src/mesa/state_tracker/st_cb_drawpixels.c264
-rw-r--r--src/mesa/state_tracker/st_cb_fbo.c36
-rw-r--r--src/mesa/state_tracker/st_cb_feedback.c14
-rw-r--r--src/mesa/state_tracker/st_cb_flush.c32
-rw-r--r--src/mesa/state_tracker/st_cb_program.c12
-rw-r--r--src/mesa/state_tracker/st_cb_queryobj.c4
-rw-r--r--src/mesa/state_tracker/st_cb_rasterpos.c4
-rw-r--r--src/mesa/state_tracker/st_cb_readpixels.c104
-rw-r--r--src/mesa/state_tracker/st_cb_texture.c151
-rw-r--r--src/mesa/state_tracker/st_cb_viewport.c (renamed from src/gallium/winsys/drm/intel/dri/intel_swapbuffers.h)48
-rw-r--r--src/mesa/state_tracker/st_cb_viewport.h (renamed from src/gallium/winsys/drm/intel/dri/intel_winsys_softpipe.h)26
-rw-r--r--src/mesa/state_tracker/st_context.c17
-rw-r--r--src/mesa/state_tracker/st_context.h7
-rw-r--r--src/mesa/state_tracker/st_draw.c20
-rw-r--r--src/mesa/state_tracker/st_draw.h15
-rw-r--r--src/mesa/state_tracker/st_draw_feedback.c6
-rw-r--r--src/mesa/state_tracker/st_extensions.c1
-rw-r--r--src/mesa/state_tracker/st_framebuffer.c6
-rw-r--r--src/mesa/state_tracker/st_gen_mipmap.c34
-rw-r--r--src/mesa/state_tracker/st_mesa_to_tgsi.c52
-rw-r--r--src/mesa/state_tracker/st_program.c16
-rw-r--r--src/mesa/state_tracker/st_texture.c58
-rw-r--r--src/mesa/state_tracker/st_texture.h6
-rw-r--r--src/mesa/swrast/s_atifragshader.c4
-rw-r--r--src/mesa/swrast/s_clear.c (renamed from src/mesa/swrast/s_buffers.c)7
-rw-r--r--src/mesa/swrast/s_context.c4
-rw-r--r--src/mesa/swrast/s_context.h28
-rw-r--r--src/mesa/swrast/s_drawpix.c11
-rw-r--r--src/mesa/swrast/s_feedback.c8
-rw-r--r--src/mesa/swrast/s_fragprog.c16
-rw-r--r--src/mesa/swrast/s_span.c24
-rw-r--r--src/mesa/swrast/s_texcombine.c95
-rw-r--r--src/mesa/swrast/s_texfilter.c4
-rw-r--r--src/mesa/swrast/s_triangle.c29
-rw-r--r--src/mesa/swrast/swrast.h12
-rw-r--r--src/mesa/swrast_setup/ss_triangle.c119
-rw-r--r--src/mesa/swrast_setup/ss_tritmp.h4
-rw-r--r--src/mesa/tnl/t_context.c11
-rw-r--r--src/mesa/tnl/t_context.h1
-rw-r--r--src/mesa/tnl/t_rasterpos.c24
-rw-r--r--src/mesa/tnl/t_vb_points.c2
-rw-r--r--src/mesa/tnl/t_vb_texgen.c24
-rw-r--r--src/mesa/tnl/t_vertex.c45
-rw-r--r--src/mesa/tnl/t_vp_build.c1
-rw-r--r--src/mesa/tnl_dd/t_dd_vb.c3
-rw-r--r--src/mesa/vbo/vbo_exec.c1
-rw-r--r--src/mesa/vbo/vbo_exec.h15
-rw-r--r--src/mesa/vbo/vbo_exec_api.c90
-rw-r--r--src/mesa/vbo/vbo_exec_array.c67
-rw-r--r--src/mesa/vbo/vbo_exec_draw.c133
-rw-r--r--src/mesa/vbo/vbo_save.h2
-rw-r--r--src/mesa/vbo/vbo_save_api.c16
-rw-r--r--src/mesa/vbo/vbo_save_draw.c6
-rw-r--r--src/mesa/x86-64/glapi_x86-64.S706
-rw-r--r--src/mesa/x86-64/x86-64.c2
-rw-r--r--src/mesa/x86/3dnow.c2
-rw-r--r--src/mesa/x86/common_x86.c83
-rw-r--r--src/mesa/x86/common_x86_asm.h14
-rw-r--r--src/mesa/x86/gen_matypes.c4
-rw-r--r--src/mesa/x86/glapi_x86.S54
-rw-r--r--src/mesa/x86/sse.c2
-rw-r--r--src/mesa/x86/x86_xform.c (renamed from src/mesa/x86/x86.c)68
-rw-r--r--src/mesa/x86/x86_xform.h (renamed from src/mesa/x86/common_x86_macros.h)4
-rw-r--r--windows/VC7/progs/progs.sln29
-rw-r--r--windows/VC7/progs/wgl/sharedtex_mt.vcproj132
-rw-r--r--windows/VC7/progs/wgl/wglthreads.vcproj132
-rw-r--r--windows/VC8/mesa/mesa/mesa.vcproj18
1089 files changed, 38820 insertions, 26670 deletions
diff --git a/Makefile b/Makefile
index c79fb1cb28b..59f0a07a480 100644
--- a/Makefile
+++ b/Makefile
@@ -190,8 +190,6 @@ MAIN_FILES = \
$(DIRECTORY)/configure.ac \
$(DIRECTORY)/acinclude.m4 \
$(DIRECTORY)/aclocal.m4 \
- $(DIRECTORY)/descrip.mms \
- $(DIRECTORY)/mms-config. \
$(DIRECTORY)/bin/config.guess \
$(DIRECTORY)/bin/config.sub \
$(DIRECTORY)/bin/install-sh \
@@ -221,11 +219,11 @@ MAIN_FILES = \
$(DIRECTORY)/include/GL/osmesa.h \
$(DIRECTORY)/include/GL/svgamesa.h \
$(DIRECTORY)/include/GL/vms_x_fix.h \
+ $(DIRECTORY)/include/GL/wglext.h \
$(DIRECTORY)/include/GL/wmesa.h \
$(DIRECTORY)/src/Makefile \
- $(DIRECTORY)/src/descrip.mms \
$(DIRECTORY)/src/mesa/Makefile* \
- $(DIRECTORY)/src/mesa/sources \
+ $(DIRECTORY)/src/mesa/sources.mak \
$(DIRECTORY)/src/mesa/descrip.mms \
$(DIRECTORY)/src/mesa/gl.pc.in \
$(DIRECTORY)/src/mesa/osmesa.pc.in \
@@ -233,13 +231,11 @@ MAIN_FILES = \
$(DIRECTORY)/src/mesa/main/*.[chS] \
$(DIRECTORY)/src/mesa/main/descrip.mms \
$(DIRECTORY)/src/mesa/glapi/*.[chS] \
- $(DIRECTORY)/src/mesa/glapi/descrip.mms \
$(DIRECTORY)/src/mesa/math/*.[ch] \
$(DIRECTORY)/src/mesa/math/descrip.mms \
$(DIRECTORY)/src/mesa/shader/*.[ch] \
$(DIRECTORY)/src/mesa/shader/descrip.mms \
$(DIRECTORY)/src/mesa/shader/grammar/*.[ch] \
- $(DIRECTORY)/src/mesa/shader/grammar/descrip.mms \
$(DIRECTORY)/src/mesa/shader/slang/*.[ch] \
$(DIRECTORY)/src/mesa/shader/slang/descrip.mms \
$(DIRECTORY)/src/mesa/shader/slang/library/*.[ch] \
@@ -300,11 +296,36 @@ MAIN_FILES = \
$(DIRECTORY)/progs/util/README \
$(DIRECTORY)/progs/util/*.[ch] \
$(DIRECTORY)/progs/util/sampleMakefile \
- $(DIRECTORY)/vms/analyze_map.com \
- $(DIRECTORY)/vms/xlib.opt \
- $(DIRECTORY)/vms/xlib_share.opt \
$(DIRECTORY)/windows/VC8/
+EGL_FILES = \
+ $(DIRECTORY)/include/EGL/*.h \
+ $(DIRECTORY)/include/GLES/*.h \
+ $(DIRECTORY)/include/GLES2/*.h \
+ $(DIRECTORY)/src/egl/Makefile \
+ $(DIRECTORY)/src/egl/*/Makefile \
+ $(DIRECTORY)/src/egl/*/*.[ch] \
+ $(DIRECTORY)/src/egl/*/*/Makefile \
+ $(DIRECTORY)/src/egl/*/*/*.[ch] \
+
+GALLIUM_FILES = \
+ $(DIRECTORY)/src/mesa/state_tracker/*[ch] \
+ $(DIRECTORY)/src/gallium/Makefile \
+ $(DIRECTORY)/src/gallium/Makefile.template \
+ $(DIRECTORY)/src/gallium/SConscript \
+ $(DIRECTORY)/src/gallium/*/Makefile \
+ $(DIRECTORY)/src/gallium/*/SConscript \
+ $(DIRECTORY)/src/gallium/*/*/Makefile \
+ $(DIRECTORY)/src/gallium/*/*/Makefile.template \
+ $(DIRECTORY)/src/gallium/*/*/SConscript \
+ $(DIRECTORY)/src/gallium/*/*/*.[ch] \
+ $(DIRECTORY)/src/gallium/*/*/*.py \
+ $(DIRECTORY)/src/gallium/*/*/*/Makefile \
+ $(DIRECTORY)/src/gallium/*/*/*/SConscript \
+ $(DIRECTORY)/src/gallium/*/*/*/*.[ch] \
+ $(DIRECTORY)/src/gallium/*/*/*/*.py \
+ $(DIRECTORY)/src/gallium/*/*/*/*/*.[ch] \
+
DRI_FILES = \
$(DIRECTORY)/include/GL/internal/dri_interface.h \
@@ -325,15 +346,12 @@ DRI_FILES = \
SGI_GLU_FILES = \
$(DIRECTORY)/src/glu/Makefile \
- $(DIRECTORY)/src/glu/descrip.mms \
$(DIRECTORY)/src/glu/glu.pc.in \
$(DIRECTORY)/src/glu/sgi/Makefile \
$(DIRECTORY)/src/glu/sgi/Makefile.mgw \
$(DIRECTORY)/src/glu/sgi/Makefile.win \
- $(DIRECTORY)/src/glu/sgi/Makefile.DJ \
$(DIRECTORY)/src/glu/sgi/glu.def \
$(DIRECTORY)/src/glu/sgi/dummy.cc \
- $(DIRECTORY)/src/glu/sgi/descrip.mms \
$(DIRECTORY)/src/glu/sgi/glu.exports \
$(DIRECTORY)/src/glu/sgi/glu.exports.darwin \
$(DIRECTORY)/src/glu/sgi/mesaglu.opt \
@@ -438,7 +456,13 @@ DEPEND_FILES = \
$(TOP)/src/glu/sgi/depend
-LIB_FILES = $(MAIN_FILES) $(DRI_FILES) $(SGI_GLU_FILES) $(GLW_FILES)
+LIB_FILES = \
+ $(MAIN_FILES) \
+ $(EGL_FILES) \
+ $(GALLIUM_FILES) \
+ $(DRI_FILES) \
+ $(SGI_GLU_FILES) \
+ $(GLW_FILES)
# Everything for new a Mesa release:
diff --git a/SConstruct b/SConstruct
index a22b9483da0..7e7f51516e8 100644
--- a/SConstruct
+++ b/SConstruct
@@ -32,7 +32,7 @@ import common
default_statetrackers = 'mesa'
if common.default_platform in ('linux', 'freebsd', 'darwin'):
- default_drivers = 'softpipe,failover,i915simple,i965simple,trace'
+ default_drivers = 'softpipe,failover,i915simple,trace'
default_winsys = 'xlib'
elif common.default_platform in ('winddk',):
default_drivers = 'softpipe,i915simple,trace'
@@ -133,7 +133,7 @@ if dri:
# LLVM
if llvm:
# See also http://www.scons.org/wiki/UsingPkgConfig
- env.ParseConfig('llvm-config --cflags --ldflags --libs backend bitreader engine ipo')
+ env.ParseConfig('llvm-config --cflags --ldflags --libs backend bitreader engine instrumentation interpreter ipo')
env.Append(CPPDEFINES = ['MESA_LLVM'])
# Force C++ linkage
env['LINK'] = env['CXX']
diff --git a/bin/config.guess b/bin/config.guess
index 278f9e9e07c..e5716eea733 100755
--- a/bin/config.guess
+++ b/bin/config.guess
@@ -1,10 +1,10 @@
#! /bin/sh
# Attempt to guess a canonical system name.
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-# 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation,
-# Inc.
+# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
+# Free Software Foundation, Inc.
-timestamp='2007-07-22'
+timestamp='2009-02-03'
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
@@ -56,8 +56,8 @@ version="\
GNU config.guess ($timestamp)
Originally written by Per Bothner.
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
-Free Software Foundation, Inc.
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
+2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -331,7 +331,20 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit ;;
i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
- echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ eval $set_cc_for_build
+ SUN_ARCH="i386"
+ # If there is a compiler, see if it is configured for 64-bit objects.
+ # Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
+ # This test works for both compilers.
+ if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
+ if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
+ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
+ grep IS_64BIT_ARCH >/dev/null
+ then
+ SUN_ARCH="x86_64"
+ fi
+ fi
+ echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit ;;
sun4*:SunOS:6*:*)
# According to config.sub, this is the proper way to canonicalize
@@ -532,7 +545,7 @@ EOF
echo rs6000-ibm-aix3.2
fi
exit ;;
- *:AIX:*:[45])
+ *:AIX:*:[456])
IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
IBM_ARCH=rs6000
@@ -796,9 +809,12 @@ EOF
x86)
echo i586-pc-interix${UNAME_RELEASE}
exit ;;
- EM64T | authenticamd)
+ EM64T | authenticamd | genuineintel)
echo x86_64-unknown-interix${UNAME_RELEASE}
exit ;;
+ IA64)
+ echo ia64-unknown-interix${UNAME_RELEASE}
+ exit ;;
esac ;;
[345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
echo i${UNAME_MACHINE}-pc-mks
@@ -833,7 +849,14 @@ EOF
echo ${UNAME_MACHINE}-pc-minix
exit ;;
arm*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
+ eval $set_cc_for_build
+ if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
+ | grep -q __ARM_EABI__
+ then
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ else
+ echo ${UNAME_MACHINE}-unknown-linux-gnueabi
+ fi
exit ;;
avr32*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
@@ -925,6 +948,9 @@ EOF
if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
exit ;;
+ padre:Linux:*:*)
+ echo sparc-unknown-linux-gnu
+ exit ;;
parisc:Linux:*:* | hppa:Linux:*:*)
# Look for CPU level
case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
@@ -954,8 +980,8 @@ EOF
x86_64:Linux:*:*)
echo x86_64-unknown-linux-gnu
exit ;;
- xtensa:Linux:*:*)
- echo xtensa-unknown-linux-gnu
+ xtensa*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
i*86:Linux:*:*)
# The BFD linker knows what the default object file format is, so
@@ -975,9 +1001,6 @@ EOF
a.out-i386-linux)
echo "${UNAME_MACHINE}-pc-linux-gnuaout"
exit ;;
- coff-i386)
- echo "${UNAME_MACHINE}-pc-linux-gnucoff"
- exit ;;
"")
# Either a pre-BFD a.out linker (linux-gnuoldld) or
# one that does not give us useful --help.
@@ -1131,6 +1154,16 @@ EOF
3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
&& { echo i486-ncr-sysv4; exit; } ;;
+ NCR*:*:4.2:* | MPRAS*:*:4.2:*)
+ OS_REL='.3'
+ test -r /etc/.relid \
+ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
+ /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+ && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
+ /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
+ && { echo i586-ncr-sysv4.3${OS_REL}; exit; }
+ /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
+ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
echo m68k-unknown-lynxos${UNAME_RELEASE}
exit ;;
@@ -1206,6 +1239,9 @@ EOF
BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
echo i586-pc-beos
exit ;;
+ BePC:Haiku:*:*) # Haiku running on Intel PC compatible.
+ echo i586-pc-haiku
+ exit ;;
SX-4:SUPER-UX:*:*)
echo sx4-nec-superux${UNAME_RELEASE}
exit ;;
@@ -1314,6 +1350,9 @@ EOF
i*86:rdos:*:*)
echo ${UNAME_MACHINE}-pc-rdos
exit ;;
+ i*86:AROS:*:*)
+ echo ${UNAME_MACHINE}-pc-aros
+ exit ;;
esac
#echo '(No uname command or uname output not recognized.)' 1>&2
@@ -1474,9 +1513,9 @@ This script, last modified $timestamp, has failed to recognize
the operating system you are using. It is advised that you
download the most up to date version of the config scripts from
- http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.guess
+ http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
and
- http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.sub
+ http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
If the version you run ($0) is already up to date, please
send the following data and any information you think might be
diff --git a/bin/config.sub b/bin/config.sub
index 1761d8bdf63..d546a94b951 100755
--- a/bin/config.sub
+++ b/bin/config.sub
@@ -1,10 +1,10 @@
#! /bin/sh
# Configuration validation subroutine script.
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-# 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation,
-# Inc.
+# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
+# Free Software Foundation, Inc.
-timestamp='2007-06-28'
+timestamp='2009-02-03'
# This file is (in principle) common to ALL GNU software.
# The presence of a machine in this file suggests that SOME GNU software
@@ -72,8 +72,8 @@ Report bugs and patches to <config-patches@gnu.org>."
version="\
GNU config.sub ($timestamp)
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
-Free Software Foundation, Inc.
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
+2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -122,6 +122,7 @@ maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
case $maybe_os in
nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
+ kopensolaris*-gnu* | \
storm-chaos* | os2-emx* | rtmk-nova*)
os=-$maybe_os
basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
@@ -249,13 +250,16 @@ case $basic_machine in
| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
| i370 | i860 | i960 | ia64 \
| ip2k | iq2000 \
+ | lm32 \
| m32c | m32r | m32rle | m68000 | m68k | m88k \
- | maxq | mb | microblaze | mcore | mep \
+ | maxq | mb | microblaze | mcore | mep | metag \
| mips | mipsbe | mipseb | mipsel | mipsle \
| mips16 \
| mips64 | mips64el \
- | mips64vr | mips64vrel \
+ | mips64octeon | mips64octeonel \
| mips64orion | mips64orionel \
+ | mips64r5900 | mips64r5900el \
+ | mips64vr | mips64vrel \
| mips64vr4100 | mips64vr4100el \
| mips64vr4300 | mips64vr4300el \
| mips64vr5000 | mips64vr5000el \
@@ -277,7 +281,7 @@ case $basic_machine in
| powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
| pyramid \
| score \
- | sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
+ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
| sh64 | sh64le \
| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
| sparcv8 | sparcv9 | sparcv9b | sparcv9v \
@@ -286,7 +290,7 @@ case $basic_machine in
| v850 | v850e \
| we32k \
| x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \
- | z8k)
+ | z8k | z80)
basic_machine=$basic_machine-unknown
;;
m6811 | m68hc11 | m6812 | m68hc12)
@@ -329,14 +333,17 @@ case $basic_machine in
| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
| i*86-* | i860-* | i960-* | ia64-* \
| ip2k-* | iq2000-* \
+ | lm32-* \
| m32c-* | m32r-* | m32rle-* \
| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
- | m88110-* | m88k-* | maxq-* | mcore-* \
+ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
| mips16-* \
| mips64-* | mips64el-* \
- | mips64vr-* | mips64vrel-* \
+ | mips64octeon-* | mips64octeonel-* \
| mips64orion-* | mips64orionel-* \
+ | mips64r5900-* | mips64r5900el-* \
+ | mips64vr-* | mips64vrel-* \
| mips64vr4100-* | mips64vr4100el-* \
| mips64vr4300-* | mips64vr4300el-* \
| mips64vr5000-* | mips64vr5000el-* \
@@ -358,20 +365,24 @@ case $basic_machine in
| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
| pyramid-* \
| romp-* | rs6000-* \
- | sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
+ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
| sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
| sparclite-* \
| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
| tahoe-* | thumb-* \
- | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
+ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* | tile-* \
| tron-* \
| v850-* | v850e-* | vax-* \
| we32k-* \
| x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
- | xstormy16-* | xtensa-* \
+ | xstormy16-* | xtensa*-* \
| ymp-* \
- | z8k-*)
+ | z8k-* | z80-*)
+ ;;
+ # Recognize the basic CPU types without company name, with glob match.
+ xtensa*)
+ basic_machine=$basic_machine-unknown
;;
# Recognize the various machine names and aliases which stand
# for a CPU type and a company and sometimes even an OS.
@@ -435,6 +446,10 @@ case $basic_machine in
basic_machine=m68k-apollo
os=-bsd
;;
+ aros)
+ basic_machine=i386-pc
+ os=-aros
+ ;;
aux)
basic_machine=m68k-apple
os=-aux
@@ -443,10 +458,22 @@ case $basic_machine in
basic_machine=ns32k-sequent
os=-dynix
;;
+ blackfin)
+ basic_machine=bfin-unknown
+ os=-linux
+ ;;
+ blackfin-*)
+ basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
+ os=-linux
+ ;;
c90)
basic_machine=c90-cray
os=-unicos
;;
+ cegcc)
+ basic_machine=arm-unknown
+ os=-cegcc
+ ;;
convex-c1)
basic_machine=c1-convex
os=-bsd
@@ -514,6 +541,10 @@ case $basic_machine in
basic_machine=m88k-motorola
os=-sysv3
;;
+ dicos)
+ basic_machine=i686-pc
+ os=-dicos
+ ;;
djgpp)
basic_machine=i586-pc
os=-msdosdjgpp
@@ -668,6 +699,14 @@ case $basic_machine in
basic_machine=m68k-isi
os=-sysv
;;
+ m68knommu)
+ basic_machine=m68k-unknown
+ os=-linux
+ ;;
+ m68knommu-*)
+ basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
+ os=-linux
+ ;;
m88k-omron*)
basic_machine=m88k-omron
;;
@@ -813,6 +852,14 @@ case $basic_machine in
basic_machine=i860-intel
os=-osf
;;
+ parisc)
+ basic_machine=hppa-unknown
+ os=-linux
+ ;;
+ parisc-*)
+ basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
+ os=-linux
+ ;;
pbd)
basic_machine=sparc-tti
;;
@@ -1021,6 +1068,10 @@ case $basic_machine in
basic_machine=tic6x-unknown
os=-coff
;;
+ tile*)
+ basic_machine=tile-unknown
+ os=-linux-gnu
+ ;;
tx39)
basic_machine=mipstx39-unknown
;;
@@ -1096,6 +1147,10 @@ case $basic_machine in
basic_machine=z8k-unknown
os=-sim
;;
+ z80-*-coff)
+ basic_machine=z80-unknown
+ os=-sim
+ ;;
none)
basic_machine=none-none
os=-none
@@ -1134,7 +1189,7 @@ case $basic_machine in
we32k)
basic_machine=we32k-att
;;
- sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele)
+ sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
basic_machine=sh-unknown
;;
sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
@@ -1206,8 +1261,9 @@ case $os in
-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
| -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
| -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
+ | -kopensolaris* \
| -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
- | -aos* \
+ | -aos* | -aros* \
| -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
| -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
| -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
@@ -1216,7 +1272,7 @@ case $os in
| -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
| -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
| -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
- | -chorusos* | -chorusrdb* \
+ | -chorusos* | -chorusrdb* | -cegcc* \
| -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
| -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \
| -uxpv* | -beos* | -mpeix* | -udk* \
@@ -1356,6 +1412,9 @@ case $os in
-zvmoe)
os=-zvmoe
;;
+ -dicos*)
+ os=-dicos
+ ;;
-none)
;;
*)
diff --git a/configs/autoconf.in b/configs/autoconf.in
index d7860294eae..0f9306d8226 100644
--- a/configs/autoconf.in
+++ b/configs/autoconf.in
@@ -66,12 +66,12 @@ GLU_DIRS = @GLU_DIRS@
DRIVER_DIRS = @DRIVER_DIRS@
GALLIUM_DIRS = @GALLIUM_DIRS@
GALLIUM_AUXILIARY_DIRS = @GALLIUM_AUXILIARY_DIRS@
-GALLIUM_DRIVER_DIRS = @GALLIUM_DRIVER_DIRS@
+GALLIUM_DRIVERS_DIRS = @GALLIUM_DRIVERS_DIRS@
GALLIUM_WINSYS_DIRS = @GALLIUM_WINSYS_DIRS@
GALLIUM_WINSYS_DRM_DIRS = @GALLIUM_WINSYS_DRM_DIRS@
GALLIUM_STATE_TRACKERS_DIRS = @GALLIUM_STATE_TRACKERS_DIRS@
GALLIUM_AUXILIARIES = $(foreach DIR,$(GALLIUM_AUXILIARY_DIRS),$(TOP)/src/gallium/auxiliary/$(DIR)/lib$(DIR).a)
-GALLIUM_DRIVERS = $(foreach DIR,$(GALLIUM_DRIVER_DIRS),$(TOP)/src/gallium/drivers/$(DIR)/lib$(DIR).a)
+GALLIUM_DRIVERS = $(foreach DIR,$(GALLIUM_DRIVERS_DIRS),$(TOP)/src/gallium/drivers/$(DIR)/lib$(DIR).a)
# Which subdirs under $(TOP)/progs/ to enter:
PROGRAM_DIRS = @PROGRAM_DIRS@
@@ -92,6 +92,7 @@ MOTIF_CFLAGS = @MOTIF_CFLAGS@
GL_LIB_DEPS = $(EXTRA_LIB_PATH) @GL_LIB_DEPS@
OSMESA_LIB_DEPS = -L$(TOP)/$(LIB_DIR) @OSMESA_MESA_DEPS@ \
$(EXTRA_LIB_PATH) @OSMESA_LIB_DEPS@
+EGL_LIB_DEPS = $(EXTRA_LIB_PATH) @EGL_LIB_DEPS@
GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) @GLU_MESA_DEPS@ \
$(EXTRA_LIB_PATH) @GLU_LIB_DEPS@
GLUT_LIB_DEPS = -L$(TOP)/$(LIB_DIR) @GLUT_MESA_DEPS@ \
@@ -124,6 +125,9 @@ DRI_DRIVER_INSTALL_DIR = @DRI_DRIVER_INSTALL_DIR@
# Where libGL will look for DRI hardware drivers
DRI_DRIVER_SEARCH_DIR = $(DRI_DRIVER_INSTALL_DIR)
+# Xorg driver install directory (for xorg state-tracker)
+XORG_DRIVER_INSTALL_DIR = @XORG_DRIVER_INSTALL_DIR@
+
# pkg-config substitutions
GL_PC_REQ_PRIV = @GL_PC_REQ_PRIV@
GL_PC_LIB_PRIV = @GL_PC_LIB_PRIV@
diff --git a/configs/darwin b/configs/darwin
index c50ea9c44d5..29fa0f13ff4 100644
--- a/configs/darwin
+++ b/configs/darwin
@@ -6,6 +6,8 @@ CONFIG_NAME = darwin
INSTALL_DIR = /usr/X11
+X11_DIR = $(INSTALL_DIR)
+
# Compiler and flags
CC = gcc
CXX = gcc
@@ -21,9 +23,9 @@ DEFINES = -D_DARWIN_C_SOURCE -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L \
ARCH_FLAGS += $(RC_CFLAGS)
CFLAGS = -ggdb3 -Os -Wall -Wmissing-prototypes -std=c99 -ffast-math -fno-strict-aliasing \
- -I$(INSTALL_DIR)/include $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(ASM_FLAGS) $(DEFINES)
+ -I$(INSTALL_DIR)/include -I$(X11_DIR)/include $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(ASM_FLAGS) $(DEFINES)
CXXFLAGS = -ggdb3 -Os -Wall -fno-strict-aliasing \
- -I$(INSTALL_DIR)/include $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(ASM_FLAGS) $(DEFINES)
+ -I$(INSTALL_DIR)/include -I$(X11_DIR)/include $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(ASM_FLAGS) $(DEFINES)
# Library names (actual file names)
GL_LIB_NAME = libGL.dylib
@@ -39,12 +41,12 @@ GLUT_LIB_GLOB = libglut.*dylib
GLW_LIB_GLOB = libGLw.*dylib
OSMESA_LIB_GLOB = libOSMesa.*dylib
-GL_LIB_DEPS = -L$(INSTALL_DIR)/$(LIB_DIR) -lX11 -lXext -lm -lpthread
+GL_LIB_DEPS = -L$(INSTALL_DIR)/$(LIB_DIR) -L$(X11_DIR)/$(LIB_DIR) -lX11 -lXext -lm -lpthread
OSMESA_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB)
GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB)
-GLUT_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -L$(INSTALL_DIR)/$(LIB_DIR) -lX11 -lXmu -lXi -lXext
-GLW_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -L$(INSTALL_DIR)/$(LIB_DIR) -lX11 -lXt
-APP_LIB_DEPS = -L$(TOP)/lib -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -L$(INSTALL_DIR)/$(LIB_DIR) -lX11 -lXmu -lXt -lXi -lm
+GLUT_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -L$(INSTALL_DIR)/$(LIB_DIR) -L$(X11_DIR)/$(LIB_DIR) -lX11 -lXmu -lXi -lXext
+GLW_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -L$(INSTALL_DIR)/$(LIB_DIR) -L$(X11_DIR)/$(LIB_DIR) -lX11 -lXt
+APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -L$(INSTALL_DIR)/$(LIB_DIR) -L$(X11_DIR)/$(LIB_DIR) -lX11 -lXmu -lXt -lXi -lm
# omit glw lib for now:
SRC_DIRS = glx/x11 mesa glu glut/glx glew
diff --git a/configs/default b/configs/default
index a90d46f18e1..eab36a36775 100644
--- a/configs/default
+++ b/configs/default
@@ -92,8 +92,8 @@ EGL_DRIVERS_DIRS = demo
GALLIUM_DIRS = auxiliary drivers state_trackers
GALLIUM_AUXILIARY_DIRS = draw translate cso_cache pipebuffer tgsi sct rtasm util indices
GALLIUM_AUXILIARIES = $(foreach DIR,$(GALLIUM_AUXILIARY_DIRS),$(TOP)/src/gallium/auxiliary/$(DIR)/lib$(DIR).a)
-GALLIUM_DRIVER_DIRS = softpipe i915simple i965simple failover trace
-GALLIUM_DRIVERS = $(foreach DIR,$(GALLIUM_DRIVER_DIRS),$(TOP)/src/gallium/drivers/$(DIR)/lib$(DIR).a)
+GALLIUM_DRIVERS_DIRS = softpipe i915simple failover trace
+GALLIUM_DRIVERS = $(foreach DIR,$(GALLIUM_DRIVERS_DIRS),$(TOP)/src/gallium/drivers/$(DIR)/lib$(DIR).a)
GALLIUM_WINSYS_DIRS = xlib egl_xlib
GALLIUM_WINSYS_DRM_DIRS =
GALLIUM_STATE_TRACKERS_DIRS = glx
@@ -102,6 +102,7 @@ GALLIUM_STATE_TRACKERS_DIRS = glx
# Library dependencies
#EXTRA_LIB_PATH ?=
GL_LIB_DEPS = $(EXTRA_LIB_PATH) -lX11 -lXext -lm -lpthread
+EGL_LIB_DEPS = $(EXTRA_LIB_PATH) -lX11 -ldl
OSMESA_LIB_DEPS = $(EXTRA_LIB_PATH) -L$(TOP)/$(LIB_DIR) -l$(GL_LIB)
GLU_LIB_DEPS = $(EXTRA_LIB_PATH) -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -lm
GLUT_LIB_DEPS = $(EXTRA_LIB_PATH) -L$(TOP)/$(LIB_DIR) -l$(GLU_LIB) -l$(GL_LIB) -lX11 -lXmu -lXi -lm
@@ -121,6 +122,9 @@ DRI_DRIVER_INSTALL_DIR = $(INSTALL_LIB_DIR)/dri
# Where libGL will look for DRI hardware drivers
DRI_DRIVER_SEARCH_DIR = $(DRI_DRIVER_INSTALL_DIR)
+# Xorg driver install directory (for xorg state-tracker)
+XORG_DRIVER_INSTALL_DIR = $(INSTALL_LIB_DIR)/xorg/modules/drivers
+
# pkg-config substitutions
GL_PC_REQ_PRIV =
GL_PC_LIB_PRIV =
diff --git a/configs/linux b/configs/linux
index 15700a1a3bf..73a6b61b2f6 100644
--- a/configs/linux
+++ b/configs/linux
@@ -22,7 +22,8 @@ DEFINES = -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE \
X11_INCLUDES = -I/usr/X11R6/include
-CFLAGS = -Wall -Wmissing-prototypes $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) \
+CFLAGS = -Wall -Wmissing-prototypes -Wdeclaration-after-statement \
+ $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) \
$(DEFINES) $(ASM_FLAGS) $(X11_INCLUDES) -std=c99 -ffast-math
CXXFLAGS = -Wall $(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(DEFINES) \
diff --git a/configs/linux-cell b/configs/linux-cell
index d58a7a6ec72..19d435fecce 100644
--- a/configs/linux-cell
+++ b/configs/linux-cell
@@ -6,7 +6,7 @@ CONFIG_NAME = linux-cell
# Omiting other gallium drivers:
-GALLIUM_DRIVER_DIRS = cell softpipe trace
+GALLIUM_DRIVERS_DIRS = cell softpipe trace
# Compiler and flags
diff --git a/configs/linux-llvm b/configs/linux-llvm
index a9d740574cf..e7ecd826d53 100644
--- a/configs/linux-llvm
+++ b/configs/linux-llvm
@@ -22,9 +22,9 @@ endif
ifeq ($(MESA_LLVM),1)
# LLVM_CFLAGS=`llvm-config --cflags`
- LLVM_CXXFLAGS=`llvm-config --cxxflags backend bitreader engine ipo` -Wno-long-long
- LLVM_LDFLAGS=`llvm-config --ldflags backend bitreader engine ipo`
- LLVM_LIBS=`llvm-config --libs backend bitreader engine ipo`
+ LLVM_CXXFLAGS=`llvm-config --cxxflags backend bitreader engine ipo interpreter instrumentation` -Wno-long-long
+ LLVM_LDFLAGS=`llvm-config --ldflags backend bitreader engine ipo interpreter instrumentation`
+ LLVM_LIBS=`llvm-config --libs backend bitreader engine ipo interpreter instrumentation`
MKLIB_OPTIONS=-cplusplus
else
LLVM_CFLAGS=
diff --git a/configure.ac b/configure.ac
index ea2992d38b0..4164d377ce8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -87,7 +87,7 @@ dnl Compiler macros
DEFINES=""
AC_SUBST([DEFINES])
case "$host_os" in
-*-gnu*)
+linux*|*-gnu*)
DEFINES="$DEFINES -D_GNU_SOURCE -DPTHREADS"
;;
solaris*)
@@ -307,6 +307,13 @@ if test "x$enable_asm" = xyes; then
;;
esac
;;
+ sparc*)
+ case "$host_os" in
+ linux*)
+ asm_arch=sparc
+ ;;
+ esac
+ ;;
esac
case "$asm_arch" in
@@ -327,6 +334,12 @@ if test "x$enable_asm" = xyes; then
MESA_ASM_SOURCES='$(PPC_SOURCES)'
AC_MSG_RESULT([yes, ppc])
;;
+ sparc)
+ ASM_FLAGS="-DUSE_SPARC_ASM"
+ MESA_ASM_SOURCES='$(SPARC_SOURCES)'
+ GLAPI_ASM_SOURCES='$(SPARC_API)'
+ AC_MSG_RESULT([yes, sparc])
+ ;;
*)
AC_MSG_RESULT([no, platform not supported])
;;
@@ -382,7 +395,7 @@ default_driver="xlib"
case "$host_os" in
linux*)
case "$host_cpu" in
- i*86|x86_64|powerpc*) default_driver="dri";;
+ i*86|x86_64|powerpc*|sparc*) default_driver="dri";;
esac
;;
*freebsd* | dragonfly*)
@@ -409,14 +422,14 @@ esac
dnl
dnl Driver specific build directories
dnl
-SRC_DIRS="mesa egl"
+SRC_DIRS="mesa egl glew"
GLU_DIRS="sgi"
WINDOW_SYSTEM=""
GALLIUM_DIRS="auxiliary drivers state_trackers"
GALLIUM_WINSYS_DIRS=""
GALLIUM_WINSYS_DRM_DIRS=""
GALLIUM_AUXILIARY_DIRS="draw translate cso_cache pipebuffer tgsi sct rtasm util"
-GALLIUM_DRIVER_DIRS="softpipe failover trace"
+GALLIUM_DRIVERS_DIRS="softpipe failover trace"
GALLIUM_STATE_TRACKERS_DIRS=""
case "$mesa_driver" in
@@ -428,9 +441,6 @@ dri)
DRIVER_DIRS="dri"
WINDOW_SYSTEM="dri"
GALLIUM_WINSYS_DIRS="drm $GALLIUM_WINSYS_DIRS"
- GALLIUM_WINSYS_DRM_DIRS="intel"
- GALLIUM_DRIVER_DIRS="$GALLIUM_DRIVER_DIRS i915simple i965simple"
- GALLIUM_STATE_TRACKERS_DIRS="egl"
;;
osmesa)
DRIVER_DIRS="osmesa"
@@ -443,7 +453,7 @@ AC_SUBST([WINDOW_SYSTEM])
AC_SUBST([GALLIUM_DIRS])
AC_SUBST([GALLIUM_WINSYS_DIRS])
AC_SUBST([GALLIUM_WINSYS_DRM_DIRS])
-AC_SUBST([GALLIUM_DRIVER_DIRS])
+AC_SUBST([GALLIUM_DRIVERS_DIRS])
AC_SUBST([GALLIUM_AUXILIARY_DIRS])
AC_SUBST([GALLIUM_STATE_TRACKERS_DIRS])
AC_SUBST([RADEON_CFLAGS])
@@ -868,6 +878,19 @@ AC_SUBST([OSMESA_PC_REQ])
AC_SUBST([OSMESA_PC_LIB_PRIV])
dnl
+dnl EGL configuration
+dnl
+if test "$x11_pkgconfig" = yes; then
+ PKG_CHECK_MODULES([EGL],[x11])
+ EGL_LIB_DEPS="$EGL_LIBS"
+else
+ # should check these...
+ EGL_LIB_DEPS="$X_LIBS -lX11"
+fi
+EGL_LIB_DEPS="$EGL_LIB_DEPS $DLOPEN_LIBS $OS_LIBS"
+AC_SUBST([EGL_LIB_DEPS])
+
+dnl
dnl GLU configuration
dnl
AC_ARG_ENABLE([glu],
@@ -1087,6 +1110,86 @@ if test "x$enable_gallium" = xyes; then
SRC_DIRS="$SRC_DIRS gallium gallium/winsys"
fi
+dnl
+dnl Gallium state trackers configuration
+dnl
+AC_ARG_WITH([state-trackers],
+ [AS_HELP_STRING([--with-state-trackers@<:@=DIRS...@:>@],
+ [comma delimited state_trackers list, e.g.
+ "egl,glx" @<:@default=auto@:>@])],
+ [with_state_trackers="$withval"],
+ [with_state_trackers=yes])
+
+case "$with_state_trackers" in
+no)
+ GALLIUM_STATE_TRACKERS_DIRS=""
+ ;;
+yes)
+ # look at what else is built
+ case "$mesa_driver" in
+ dri)
+ GALLIUM_STATE_TRACKERS_DIRS=egl
+ ;;
+ esac
+ ;;
+*)
+ # verify the requested state tracker exist
+ state_trackers=`IFS=', '; echo $with_state_trackers`
+ for tracker in $state_trackers; do
+ test -d "$srcdir/src/gallium/state_trackers/$tracker" || \
+ AC_MSG_ERROR([state tracker '$tracker' doesn't exist])
+ done
+ GALLIUM_STATE_TRACKERS_DIRS="$state_trackers"
+ ;;
+esac
+
+AC_ARG_WITH([xorg-driver-dir],
+ [AS_HELP_STRING([--with-xorg-driver-dir=DIR],
+ [Default xorg driver directory[[default=${libdir}/xorg/modules/drivers]]])],
+ [XORG_DRIVER_INSTALL_DIR="$withval"],
+ [XORG_DRIVER_INSTALL_DIR="${libdir}/xorg/modules/drivers"])
+AC_SUBST([XORG_DRIVER_INSTALL_DIR])
+
+dnl
+dnl Gallium Intel configuration
+dnl
+AC_ARG_ENABLE([gallium-intel],
+ [AS_HELP_STRING([--disable-gallium-intel],
+ [build gallium intel @<:@default=enabled@:>@])],
+ [enable_gallium_intel="$enableval"],
+ [enable_gallium_intel=yes])
+if test "x$enable_gallium_intel" = xyes; then
+ GALLIUM_WINSYS_DRM_DIRS="$GALLIUM_WINSYS_DRM_DIRS intel"
+ GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS i915simple"
+fi
+
+dnl
+dnl Gallium Radeon configuration
+dnl
+AC_ARG_ENABLE([gallium-radeon],
+ [AS_HELP_STRING([--enable-gallium-radeon],
+ [build gallium radeon @<:@default=disabled@:>@])],
+ [enable_gallium_radeon="$enableval"],
+ [enable_gallium_radeon=no])
+if test "x$enable_gallium_radeon" = xyes; then
+ GALLIUM_WINSYS_DRM_DIRS="$GALLIUM_WINSYS_DRM_DIRS radeon"
+ GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS r300"
+fi
+
+dnl
+dnl Gallium Radeon configuration
+dnl
+AC_ARG_ENABLE([gallium-nouveau],
+ [AS_HELP_STRING([--enable-gallium-nouveau],
+ [build gallium nouveau @<:@default=disabled@:>@])],
+ [enable_gallium_nouveau="$enableval"],
+ [enable_gallium_nouveau=no])
+if test "x$enable_gallium_nouveau" = xyes; then
+ GALLIUM_WINSYS_DRM_DIRS="$GALLIUM_WINSYS_DRM_DIRS nouveau"
+ GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS nv04 nv10 nv20 nv30 nv40 nv50"
+fi
+
+
dnl Restore LDFLAGS and CPPFLAGS
LDFLAGS="$_SAVE_LDFLAGS"
CPPFLAGS="$_SAVE_CPPFLAGS"
@@ -1138,9 +1241,9 @@ if echo "$SRC_DIRS" | grep 'gallium' >/dev/null 2>&1; then
echo " Gallium: yes"
echo " Gallium dirs: $GALLIUM_DIRS"
echo " Winsys dirs: $GALLIUM_WINSYS_DIRS"
- echo " Winsys drm dirs: $GALLIUM_WINSYS_DRM_DIRS"
+ echo " Winsys drm dirs:$GALLIUM_WINSYS_DRM_DIRS"
echo " Auxiliary dirs: $GALLIUM_AUXILIARY_DIRS"
- echo " Driver dirs: $GALLIUM_DRIVER_DIRS"
+ echo " Driver dirs: $GALLIUM_DRIVERS_DIRS"
echo " Trackers dirs: $GALLIUM_STATE_TRACKERS_DIRS"
else
echo " Gallium: no"
diff --git a/docs/MESA_shader_debug.spec b/docs/MESA_shader_debug.spec
index 1f7d42ac914..fab92abc762 100644
--- a/docs/MESA_shader_debug.spec
+++ b/docs/MESA_shader_debug.spec
@@ -13,7 +13,7 @@ Contact
Status
- XXX - Not complete yet!!!
+ Obsolete.
Version
diff --git a/docs/relnotes-7.5.html b/docs/relnotes-7.5.html
index 621bd4afacf..f29553b0fb2 100644
--- a/docs/relnotes-7.5.html
+++ b/docs/relnotes-7.5.html
@@ -39,6 +39,7 @@ including GL_ATI_separate_stencil, GL_EXT_stencil_two_side and OpenGL 2.0
<li>GL_EXT_vertex_array_bgra extension (software drivers, i965 driver)
<li>GL_NV_texture_env_combine4 extension (software drivers, i965/i915 drivers)
<li>GL_EXT_texture_swizzle extension (software drivers, i965 driver)
+<li>Updated SPARC assembly optimizations (David S. Miller)
</ul>
diff --git a/include/EGL/eglplatform.h b/include/EGL/eglplatform.h
index 02c3b94bd8a..d873428d756 100644
--- a/include/EGL/eglplatform.h
+++ b/include/EGL/eglplatform.h
@@ -68,7 +68,7 @@ typedef HWND NativeWindowType;
typedef HBITMAP NativePixmapType;
/** END Added for Windows **/
-#elif defined(__gnu_linux__)
+#elif defined(__gnu_linux__) || defined(__FreeBSD__)
/** BEGIN Added for X (Mesa) **/
#ifndef EGLAPI
diff --git a/include/GL/gl.h b/include/GL/gl.h
index c9ef6136fab..aad51214fbe 100644
--- a/include/GL/gl.h
+++ b/include/GL/gl.h
@@ -1,6 +1,6 @@
/*
* Mesa 3-D graphics library
- * Version: 6.5.1
+ * Version: 7.5
*
* Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
*
diff --git a/include/GL/gl_mangle.h b/include/GL/gl_mangle.h
index 1dcd4a895b8..639d7bb7a40 100644
--- a/include/GL/gl_mangle.h
+++ b/include/GL/gl_mangle.h
@@ -48,34 +48,49 @@
#define glAsyncMarkerSGIX MANGLE(AsyncMarkerSGIX)
#define glAttachObjectARB MANGLE(AttachObjectARB)
#define glAttachShader MANGLE(AttachShader)
+#define glBeginConditionalRender MANGLE(BeginConditionalRender)
+#define glBeginConditionalRenderNV MANGLE(BeginConditionalRenderNV)
#define glBeginFragmentShaderATI MANGLE(BeginFragmentShaderATI)
#define glBegin MANGLE(Begin)
#define glBeginOcclusionQueryNV MANGLE(BeginOcclusionQueryNV)
#define glBeginQueryARB MANGLE(BeginQueryARB)
#define glBeginQuery MANGLE(BeginQuery)
+#define glBeginTransformFeedbackEXT MANGLE(BeginTransformFeedbackEXT)
+#define glBeginTransformFeedback MANGLE(BeginTransformFeedback)
#define glBeginTransformFeedbackNV MANGLE(BeginTransformFeedbackNV)
#define glBeginVertexShaderEXT MANGLE(BeginVertexShaderEXT)
#define glBindAttribLocationARB MANGLE(BindAttribLocationARB)
#define glBindAttribLocation MANGLE(BindAttribLocation)
#define glBindBufferARB MANGLE(BindBufferARB)
+#define glBindBufferBaseEXT MANGLE(BindBufferBaseEXT)
+#define glBindBufferBase MANGLE(BindBufferBase)
#define glBindBufferBaseNV MANGLE(BindBufferBaseNV)
#define glBindBuffer MANGLE(BindBuffer)
+#define glBindBufferOffsetEXT MANGLE(BindBufferOffsetEXT)
#define glBindBufferOffsetNV MANGLE(BindBufferOffsetNV)
+#define glBindBufferRangeEXT MANGLE(BindBufferRangeEXT)
+#define glBindBufferRange MANGLE(BindBufferRange)
#define glBindBufferRangeNV MANGLE(BindBufferRangeNV)
#define glBindFragDataLocationEXT MANGLE(BindFragDataLocationEXT)
+#define glBindFragDataLocation MANGLE(BindFragDataLocation)
#define glBindFragmentShaderATI MANGLE(BindFragmentShaderATI)
#define glBindFramebufferEXT MANGLE(BindFramebufferEXT)
+#define glBindFramebuffer MANGLE(BindFramebuffer)
#define glBindLightParameterEXT MANGLE(BindLightParameterEXT)
#define glBindMaterialParameterEXT MANGLE(BindMaterialParameterEXT)
+#define glBindMultiTextureEXT MANGLE(BindMultiTextureEXT)
#define glBindParameterEXT MANGLE(BindParameterEXT)
#define glBindProgramARB MANGLE(BindProgramARB)
#define glBindProgramNV MANGLE(BindProgramNV)
#define glBindRenderbufferEXT MANGLE(BindRenderbufferEXT)
+#define glBindRenderbuffer MANGLE(BindRenderbuffer)
#define glBindTexGenParameterEXT MANGLE(BindTexGenParameterEXT)
#define glBindTextureEXT MANGLE(BindTextureEXT)
#define glBindTexture MANGLE(BindTexture)
#define glBindTextureUnitParameterEXT MANGLE(BindTextureUnitParameterEXT)
+#define glBindTransformFeedbackNV MANGLE(BindTransformFeedbackNV)
#define glBindVertexArrayAPPLE MANGLE(BindVertexArrayAPPLE)
+#define glBindVertexArray MANGLE(BindVertexArray)
#define glBindVertexShaderEXT MANGLE(BindVertexShaderEXT)
#define glBinormal3bEXT MANGLE(Binormal3bEXT)
#define glBinormal3bvEXT MANGLE(Binormal3bvEXT)
@@ -101,6 +116,7 @@
#define glBlendFuncSeparateINGR MANGLE(BlendFuncSeparateINGR)
#define glBlendFuncSeparate MANGLE(BlendFuncSeparate)
#define glBlitFramebufferEXT MANGLE(BlitFramebufferEXT)
+#define glBlitFramebuffer MANGLE(BlitFramebuffer)
#define glBufferDataARB MANGLE(BufferDataARB)
#define glBufferData MANGLE(BufferData)
#define glBufferParameteriAPPLE MANGLE(BufferParameteriAPPLE)
@@ -109,8 +125,15 @@
#define glCallList MANGLE(CallList)
#define glCallLists MANGLE(CallLists)
#define glCheckFramebufferStatusEXT MANGLE(CheckFramebufferStatusEXT)
+#define glCheckFramebufferStatus MANGLE(CheckFramebufferStatus)
+#define glCheckNamedFramebufferStatusEXT MANGLE(CheckNamedFramebufferStatusEXT)
#define glClampColorARB MANGLE(ClampColorARB)
+#define glClampColor MANGLE(ClampColor)
#define glClearAccum MANGLE(ClearAccum)
+#define glClearBufferfi MANGLE(ClearBufferfi)
+#define glClearBufferfv MANGLE(ClearBufferfv)
+#define glClearBufferiv MANGLE(ClearBufferiv)
+#define glClearBufferuiv MANGLE(ClearBufferuiv)
#define glClearColorIiEXT MANGLE(ClearColorIiEXT)
#define glClearColorIuiEXT MANGLE(ClearColorIuiEXT)
#define glClearColor MANGLE(ClearColor)
@@ -123,6 +146,7 @@
#define glClientActiveTextureARB MANGLE(ClientActiveTextureARB)
#define glClientActiveTexture MANGLE(ClientActiveTexture)
#define glClientActiveVertexStreamATI MANGLE(ClientActiveVertexStreamATI)
+#define glClientAttribDefaultEXT MANGLE(ClientAttribDefaultEXT)
#define glClipPlane MANGLE(ClipPlane)
#define glColor3b MANGLE(Color3b)
#define glColor3bv MANGLE(Color3bv)
@@ -171,6 +195,7 @@
#define glColorFragmentOp1ATI MANGLE(ColorFragmentOp1ATI)
#define glColorFragmentOp2ATI MANGLE(ColorFragmentOp2ATI)
#define glColorFragmentOp3ATI MANGLE(ColorFragmentOp3ATI)
+#define glColorMaski MANGLE(ColorMaski)
#define glColorMaskIndexedEXT MANGLE(ColorMaskIndexedEXT)
#define glColorMask MANGLE(ColorMask)
#define glColorMaterial MANGLE(ColorMaterial)
@@ -196,6 +221,12 @@
#define glCombinerStageParameterfvNV MANGLE(CombinerStageParameterfvNV)
#define glCompileShaderARB MANGLE(CompileShaderARB)
#define glCompileShader MANGLE(CompileShader)
+#define glCompressedMultiTexImage1DEXT MANGLE(CompressedMultiTexImage1DEXT)
+#define glCompressedMultiTexImage2DEXT MANGLE(CompressedMultiTexImage2DEXT)
+#define glCompressedMultiTexImage3DEXT MANGLE(CompressedMultiTexImage3DEXT)
+#define glCompressedMultiTexSubImage1DEXT MANGLE(CompressedMultiTexSubImage1DEXT)
+#define glCompressedMultiTexSubImage2DEXT MANGLE(CompressedMultiTexSubImage2DEXT)
+#define glCompressedMultiTexSubImage3DEXT MANGLE(CompressedMultiTexSubImage3DEXT)
#define glCompressedTexImage1DARB MANGLE(CompressedTexImage1DARB)
#define glCompressedTexImage1D MANGLE(CompressedTexImage1D)
#define glCompressedTexImage2DARB MANGLE(CompressedTexImage2DARB)
@@ -208,6 +239,12 @@
#define glCompressedTexSubImage2D MANGLE(CompressedTexSubImage2D)
#define glCompressedTexSubImage3DARB MANGLE(CompressedTexSubImage3DARB)
#define glCompressedTexSubImage3D MANGLE(CompressedTexSubImage3D)
+#define glCompressedTextureImage1DEXT MANGLE(CompressedTextureImage1DEXT)
+#define glCompressedTextureImage2DEXT MANGLE(CompressedTextureImage2DEXT)
+#define glCompressedTextureImage3DEXT MANGLE(CompressedTextureImage3DEXT)
+#define glCompressedTextureSubImage1DEXT MANGLE(CompressedTextureSubImage1DEXT)
+#define glCompressedTextureSubImage2DEXT MANGLE(CompressedTextureSubImage2DEXT)
+#define glCompressedTextureSubImage3DEXT MANGLE(CompressedTextureSubImage3DEXT)
#define glConvolutionFilter1DEXT MANGLE(ConvolutionFilter1DEXT)
#define glConvolutionFilter1D MANGLE(ConvolutionFilter1D)
#define glConvolutionFilter2DEXT MANGLE(ConvolutionFilter2DEXT)
@@ -228,6 +265,11 @@
#define glCopyConvolutionFilter1D MANGLE(CopyConvolutionFilter1D)
#define glCopyConvolutionFilter2DEXT MANGLE(CopyConvolutionFilter2DEXT)
#define glCopyConvolutionFilter2D MANGLE(CopyConvolutionFilter2D)
+#define glCopyMultiTexImage1DEXT MANGLE(CopyMultiTexImage1DEXT)
+#define glCopyMultiTexImage2DEXT MANGLE(CopyMultiTexImage2DEXT)
+#define glCopyMultiTexSubImage1DEXT MANGLE(CopyMultiTexSubImage1DEXT)
+#define glCopyMultiTexSubImage2DEXT MANGLE(CopyMultiTexSubImage2DEXT)
+#define glCopyMultiTexSubImage3DEXT MANGLE(CopyMultiTexSubImage3DEXT)
#define glCopyPixels MANGLE(CopyPixels)
#define glCopyTexImage1DEXT MANGLE(CopyTexImage1DEXT)
#define glCopyTexImage1D MANGLE(CopyTexImage1D)
@@ -239,6 +281,11 @@
#define glCopyTexSubImage2D MANGLE(CopyTexSubImage2D)
#define glCopyTexSubImage3DEXT MANGLE(CopyTexSubImage3DEXT)
#define glCopyTexSubImage3D MANGLE(CopyTexSubImage3D)
+#define glCopyTextureImage1DEXT MANGLE(CopyTextureImage1DEXT)
+#define glCopyTextureImage2DEXT MANGLE(CopyTextureImage2DEXT)
+#define glCopyTextureSubImage1DEXT MANGLE(CopyTextureSubImage1DEXT)
+#define glCopyTextureSubImage2DEXT MANGLE(CopyTextureSubImage2DEXT)
+#define glCopyTextureSubImage3DEXT MANGLE(CopyTextureSubImage3DEXT)
#define glCreateDebugObjectMESA MANGLE(CreateDebugObjectMESA)
#define glCreateProgram MANGLE(CreateProgram)
#define glCreateProgramObjectARB MANGLE(CreateProgramObjectARB)
@@ -258,6 +305,7 @@
#define glDeleteFencesNV MANGLE(DeleteFencesNV)
#define glDeleteFragmentShaderATI MANGLE(DeleteFragmentShaderATI)
#define glDeleteFramebuffersEXT MANGLE(DeleteFramebuffersEXT)
+#define glDeleteFramebuffers MANGLE(DeleteFramebuffers)
#define glDeleteLists MANGLE(DeleteLists)
#define glDeleteObjectARB MANGLE(DeleteObjectARB)
#define glDeleteOcclusionQueriesNV MANGLE(DeleteOcclusionQueriesNV)
@@ -267,10 +315,13 @@
#define glDeleteQueriesARB MANGLE(DeleteQueriesARB)
#define glDeleteQueries MANGLE(DeleteQueries)
#define glDeleteRenderbuffersEXT MANGLE(DeleteRenderbuffersEXT)
+#define glDeleteRenderbuffers MANGLE(DeleteRenderbuffers)
#define glDeleteShader MANGLE(DeleteShader)
#define glDeleteTexturesEXT MANGLE(DeleteTexturesEXT)
#define glDeleteTextures MANGLE(DeleteTextures)
+#define glDeleteTransformFeedbacksNV MANGLE(DeleteTransformFeedbacksNV)
#define glDeleteVertexArraysAPPLE MANGLE(DeleteVertexArraysAPPLE)
+#define glDeleteVertexArrays MANGLE(DeleteVertexArrays)
#define glDeleteVertexShaderEXT MANGLE(DeleteVertexShaderEXT)
#define glDepthBoundsdNV MANGLE(DepthBoundsdNV)
#define glDepthBoundsEXT MANGLE(DepthBoundsEXT)
@@ -281,13 +332,16 @@
#define glDetachObjectARB MANGLE(DetachObjectARB)
#define glDetachShader MANGLE(DetachShader)
#define glDetailTexFuncSGIS MANGLE(DetailTexFuncSGIS)
+#define glDisableClientStateIndexedEXT MANGLE(DisableClientStateIndexedEXT)
#define glDisableClientState MANGLE(DisableClientState)
+#define glDisablei MANGLE(Disablei)
#define glDisableIndexedEXT MANGLE(DisableIndexedEXT)
#define glDisable MANGLE(Disable)
#define glDisableVariantClientStateEXT MANGLE(DisableVariantClientStateEXT)
#define glDisableVertexAttribArrayARB MANGLE(DisableVertexAttribArrayARB)
#define glDisableVertexAttribArray MANGLE(DisableVertexAttribArray)
#define glDrawArraysEXT MANGLE(DrawArraysEXT)
+#define glDrawArraysInstancedARB MANGLE(DrawArraysInstancedARB)
#define glDrawArraysInstancedEXT MANGLE(DrawArraysInstancedEXT)
#define glDrawArrays MANGLE(DrawArrays)
#define glDrawBuffer MANGLE(DrawBuffer)
@@ -296,6 +350,7 @@
#define glDrawBuffers MANGLE(DrawBuffers)
#define glDrawElementArrayAPPLE MANGLE(DrawElementArrayAPPLE)
#define glDrawElementArrayATI MANGLE(DrawElementArrayATI)
+#define glDrawElementsInstancedARB MANGLE(DrawElementsInstancedARB)
#define glDrawElementsInstancedEXT MANGLE(DrawElementsInstancedEXT)
#define glDrawElements MANGLE(DrawElements)
#define glDrawMeshArraysSUN MANGLE(DrawMeshArraysSUN)
@@ -304,6 +359,7 @@
#define glDrawRangeElementArrayATI MANGLE(DrawRangeElementArrayATI)
#define glDrawRangeElementsEXT MANGLE(DrawRangeElementsEXT)
#define glDrawRangeElements MANGLE(DrawRangeElements)
+#define glDrawTransformFeedbackNV MANGLE(DrawTransformFeedbackNV)
#define glEdgeFlag MANGLE(EdgeFlag)
#define glEdgeFlagPointerEXT MANGLE(EdgeFlagPointerEXT)
#define glEdgeFlagPointerListIBM MANGLE(EdgeFlagPointerListIBM)
@@ -311,18 +367,24 @@
#define glEdgeFlagv MANGLE(EdgeFlagv)
#define glElementPointerAPPLE MANGLE(ElementPointerAPPLE)
#define glElementPointerATI MANGLE(ElementPointerATI)
+#define glEnableClientStateIndexedEXT MANGLE(EnableClientStateIndexedEXT)
#define glEnableClientState MANGLE(EnableClientState)
+#define glEnablei MANGLE(Enablei)
#define glEnableIndexedEXT MANGLE(EnableIndexedEXT)
#define glEnable MANGLE(Enable)
#define glEnableVariantClientStateEXT MANGLE(EnableVariantClientStateEXT)
#define glEnableVertexAttribArrayARB MANGLE(EnableVertexAttribArrayARB)
#define glEnableVertexAttribArray MANGLE(EnableVertexAttribArray)
+#define glEndConditionalRender MANGLE(EndConditionalRender)
+#define glEndConditionalRenderNV MANGLE(EndConditionalRenderNV)
#define glEndFragmentShaderATI MANGLE(EndFragmentShaderATI)
#define glEndList MANGLE(EndList)
#define glEnd MANGLE(End)
#define glEndOcclusionQueryNV MANGLE(EndOcclusionQueryNV)
#define glEndQueryARB MANGLE(EndQueryARB)
#define glEndQuery MANGLE(EndQuery)
+#define glEndTransformFeedbackEXT MANGLE(EndTransformFeedbackEXT)
+#define glEndTransformFeedback MANGLE(EndTransformFeedback)
#define glEndTransformFeedbackNV MANGLE(EndTransformFeedbackNV)
#define glEndVertexShaderEXT MANGLE(EndVertexShaderEXT)
#define glEvalCoord1d MANGLE(EvalCoord1d)
@@ -350,6 +412,7 @@
#define glFinishTextureSUNX MANGLE(FinishTextureSUNX)
#define glFlush MANGLE(Flush)
#define glFlushMappedBufferRangeAPPLE MANGLE(FlushMappedBufferRangeAPPLE)
+#define glFlushMappedBufferRange MANGLE(FlushMappedBufferRange)
#define glFlushPixelDataRangeNV MANGLE(FlushPixelDataRangeNV)
#define glFlushRasterSGIX MANGLE(FlushRasterSGIX)
#define glFlushVertexArrayRangeAPPLE MANGLE(FlushVertexArrayRangeAPPLE)
@@ -385,13 +448,25 @@
#define glFragmentMaterialfvSGIX MANGLE(FragmentMaterialfvSGIX)
#define glFragmentMaterialiSGIX MANGLE(FragmentMaterialiSGIX)
#define glFragmentMaterialivSGIX MANGLE(FragmentMaterialivSGIX)
+#define glFramebufferDrawBufferEXT MANGLE(FramebufferDrawBufferEXT)
+#define glFramebufferDrawBuffersEXT MANGLE(FramebufferDrawBuffersEXT)
+#define glFramebufferReadBufferEXT MANGLE(FramebufferReadBufferEXT)
#define glFramebufferRenderbufferEXT MANGLE(FramebufferRenderbufferEXT)
+#define glFramebufferRenderbuffer MANGLE(FramebufferRenderbuffer)
#define glFramebufferTexture1DEXT MANGLE(FramebufferTexture1DEXT)
+#define glFramebufferTexture1D MANGLE(FramebufferTexture1D)
#define glFramebufferTexture2DEXT MANGLE(FramebufferTexture2DEXT)
+#define glFramebufferTexture2D MANGLE(FramebufferTexture2D)
#define glFramebufferTexture3DEXT MANGLE(FramebufferTexture3DEXT)
+#define glFramebufferTexture3D MANGLE(FramebufferTexture3D)
+#define glFramebufferTextureARB MANGLE(FramebufferTextureARB)
#define glFramebufferTextureEXT MANGLE(FramebufferTextureEXT)
+#define glFramebufferTextureFaceARB MANGLE(FramebufferTextureFaceARB)
#define glFramebufferTextureFaceEXT MANGLE(FramebufferTextureFaceEXT)
+#define glFramebufferTextureLayerARB MANGLE(FramebufferTextureLayerARB)
#define glFramebufferTextureLayerEXT MANGLE(FramebufferTextureLayerEXT)
+#define glFramebufferTextureLayer MANGLE(FramebufferTextureLayer)
+#define glFrameTerminatorGREMEDY MANGLE(FrameTerminatorGREMEDY)
#define glFrameZoomSGIX MANGLE(FrameZoomSGIX)
#define glFreeObjectBufferATI MANGLE(FreeObjectBufferATI)
#define glFrontFace MANGLE(FrontFace)
@@ -400,10 +475,14 @@
#define glGenBuffersARB MANGLE(GenBuffersARB)
#define glGenBuffers MANGLE(GenBuffers)
#define glGenerateMipmapEXT MANGLE(GenerateMipmapEXT)
+#define glGenerateMipmap MANGLE(GenerateMipmap)
+#define glGenerateMultiTexMipmapEXT MANGLE(GenerateMultiTexMipmapEXT)
+#define glGenerateTextureMipmapEXT MANGLE(GenerateTextureMipmapEXT)
#define glGenFencesAPPLE MANGLE(GenFencesAPPLE)
#define glGenFencesNV MANGLE(GenFencesNV)
#define glGenFragmentShadersATI MANGLE(GenFragmentShadersATI)
#define glGenFramebuffersEXT MANGLE(GenFramebuffersEXT)
+#define glGenFramebuffers MANGLE(GenFramebuffers)
#define glGenLists MANGLE(GenLists)
#define glGenOcclusionQueriesNV MANGLE(GenOcclusionQueriesNV)
#define glGenProgramsARB MANGLE(GenProgramsARB)
@@ -411,10 +490,13 @@
#define glGenQueriesARB MANGLE(GenQueriesARB)
#define glGenQueries MANGLE(GenQueries)
#define glGenRenderbuffersEXT MANGLE(GenRenderbuffersEXT)
+#define glGenRenderbuffers MANGLE(GenRenderbuffers)
#define glGenSymbolsEXT MANGLE(GenSymbolsEXT)
#define glGenTexturesEXT MANGLE(GenTexturesEXT)
#define glGenTextures MANGLE(GenTextures)
+#define glGenTransformFeedbacksNV MANGLE(GenTransformFeedbacksNV)
#define glGenVertexArraysAPPLE MANGLE(GenVertexArraysAPPLE)
+#define glGenVertexArrays MANGLE(GenVertexArrays)
#define glGenVertexShadersEXT MANGLE(GenVertexShadersEXT)
#define glGetActiveAttribARB MANGLE(GetActiveAttribARB)
#define glGetActiveAttrib MANGLE(GetActiveAttrib)
@@ -428,6 +510,7 @@
#define glGetAttribLocationARB MANGLE(GetAttribLocationARB)
#define glGetAttribLocation MANGLE(GetAttribLocation)
#define glGetBooleanIndexedvEXT MANGLE(GetBooleanIndexedvEXT)
+#define glGetBooleani_v MANGLE(GetBooleani_v)
#define glGetBooleanv MANGLE(GetBooleanv)
#define glGetBufferParameterivARB MANGLE(GetBufferParameterivARB)
#define glGetBufferParameteriv MANGLE(GetBufferParameteriv)
@@ -450,8 +533,10 @@
#define glGetCombinerOutputParameterfvNV MANGLE(GetCombinerOutputParameterfvNV)
#define glGetCombinerOutputParameterivNV MANGLE(GetCombinerOutputParameterivNV)
#define glGetCombinerStageParameterfvNV MANGLE(GetCombinerStageParameterfvNV)
+#define glGetCompressedMultiTexImageEXT MANGLE(GetCompressedMultiTexImageEXT)
#define glGetCompressedTexImageARB MANGLE(GetCompressedTexImageARB)
#define glGetCompressedTexImage MANGLE(GetCompressedTexImage)
+#define glGetCompressedTextureImageEXT MANGLE(GetCompressedTextureImageEXT)
#define glGetConvolutionFilterEXT MANGLE(GetConvolutionFilterEXT)
#define glGetConvolutionFilter MANGLE(GetConvolutionFilter)
#define glGetConvolutionParameterfvEXT MANGLE(GetConvolutionParameterfvEXT)
@@ -461,19 +546,24 @@
#define glGetDebugLogLengthMESA MANGLE(GetDebugLogLengthMESA)
#define glGetDebugLogMESA MANGLE(GetDebugLogMESA)
#define glGetDetailTexFuncSGIS MANGLE(GetDetailTexFuncSGIS)
+#define glGetDoubleIndexedvEXT MANGLE(GetDoubleIndexedvEXT)
#define glGetDoublev MANGLE(GetDoublev)
#define glGetError MANGLE(GetError)
#define glGetFenceivNV MANGLE(GetFenceivNV)
#define glGetFinalCombinerInputParameterfvNV MANGLE(GetFinalCombinerInputParameterfvNV)
#define glGetFinalCombinerInputParameterivNV MANGLE(GetFinalCombinerInputParameterivNV)
+#define glGetFloatIndexedvEXT MANGLE(GetFloatIndexedvEXT)
#define glGetFloatv MANGLE(GetFloatv)
#define glGetFogFuncSGIS MANGLE(GetFogFuncSGIS)
#define glGetFragDataLocationEXT MANGLE(GetFragDataLocationEXT)
+#define glGetFragDataLocation MANGLE(GetFragDataLocation)
#define glGetFragmentLightfvSGIX MANGLE(GetFragmentLightfvSGIX)
#define glGetFragmentLightivSGIX MANGLE(GetFragmentLightivSGIX)
#define glGetFragmentMaterialfvSGIX MANGLE(GetFragmentMaterialfvSGIX)
#define glGetFragmentMaterialivSGIX MANGLE(GetFragmentMaterialivSGIX)
#define glGetFramebufferAttachmentParameterivEXT MANGLE(GetFramebufferAttachmentParameterivEXT)
+#define glGetFramebufferAttachmentParameteriv MANGLE(GetFramebufferAttachmentParameteriv)
+#define glGetFramebufferParameterivEXT MANGLE(GetFramebufferParameterivEXT)
#define glGetHandleARB MANGLE(GetHandleARB)
#define glGetHistogramEXT MANGLE(GetHistogramEXT)
#define glGetHistogram MANGLE(GetHistogram)
@@ -486,6 +576,7 @@
#define glGetInfoLogARB MANGLE(GetInfoLogARB)
#define glGetInstrumentsSGIX MANGLE(GetInstrumentsSGIX)
#define glGetIntegerIndexedvEXT MANGLE(GetIntegerIndexedvEXT)
+#define glGetIntegeri_v MANGLE(GetIntegeri_v)
#define glGetIntegerv MANGLE(GetIntegerv)
#define glGetInvariantBooleanvEXT MANGLE(GetInvariantBooleanvEXT)
#define glGetInvariantFloatvEXT MANGLE(GetInvariantFloatvEXT)
@@ -513,6 +604,30 @@
#define glGetMinmaxParameterfv MANGLE(GetMinmaxParameterfv)
#define glGetMinmaxParameterivEXT MANGLE(GetMinmaxParameterivEXT)
#define glGetMinmaxParameteriv MANGLE(GetMinmaxParameteriv)
+#define glGetMultisamplefvNV MANGLE(GetMultisamplefvNV)
+#define glGetMultiTexEnvfvEXT MANGLE(GetMultiTexEnvfvEXT)
+#define glGetMultiTexEnvivEXT MANGLE(GetMultiTexEnvivEXT)
+#define glGetMultiTexGendvEXT MANGLE(GetMultiTexGendvEXT)
+#define glGetMultiTexGenfvEXT MANGLE(GetMultiTexGenfvEXT)
+#define glGetMultiTexGenivEXT MANGLE(GetMultiTexGenivEXT)
+#define glGetMultiTexImageEXT MANGLE(GetMultiTexImageEXT)
+#define glGetMultiTexLevelParameterfvEXT MANGLE(GetMultiTexLevelParameterfvEXT)
+#define glGetMultiTexLevelParameterivEXT MANGLE(GetMultiTexLevelParameterivEXT)
+#define glGetMultiTexParameterfvEXT MANGLE(GetMultiTexParameterfvEXT)
+#define glGetMultiTexParameterIivEXT MANGLE(GetMultiTexParameterIivEXT)
+#define glGetMultiTexParameterIuivEXT MANGLE(GetMultiTexParameterIuivEXT)
+#define glGetMultiTexParameterivEXT MANGLE(GetMultiTexParameterivEXT)
+#define glGetNamedBufferParameterivEXT MANGLE(GetNamedBufferParameterivEXT)
+#define glGetNamedBufferPointervEXT MANGLE(GetNamedBufferPointervEXT)
+#define glGetNamedBufferSubDataEXT MANGLE(GetNamedBufferSubDataEXT)
+#define glGetNamedFramebufferAttachmentParameterivEXT MANGLE(GetNamedFramebufferAttachmentParameterivEXT)
+#define glGetNamedProgramivEXT MANGLE(GetNamedProgramivEXT)
+#define glGetNamedProgramLocalParameterdvEXT MANGLE(GetNamedProgramLocalParameterdvEXT)
+#define glGetNamedProgramLocalParameterfvEXT MANGLE(GetNamedProgramLocalParameterfvEXT)
+#define glGetNamedProgramLocalParameterIivEXT MANGLE(GetNamedProgramLocalParameterIivEXT)
+#define glGetNamedProgramLocalParameterIuivEXT MANGLE(GetNamedProgramLocalParameterIuivEXT)
+#define glGetNamedProgramStringEXT MANGLE(GetNamedProgramStringEXT)
+#define glGetNamedRenderbufferParameterivEXT MANGLE(GetNamedRenderbufferParameterivEXT)
#define glGetObjectBufferfvATI MANGLE(GetObjectBufferfvATI)
#define glGetObjectBufferivATI MANGLE(GetObjectBufferivATI)
#define glGetObjectParameterfvARB MANGLE(GetObjectParameterfvARB)
@@ -524,6 +639,7 @@
#define glGetPixelMapusv MANGLE(GetPixelMapusv)
#define glGetPixelTexGenParameterfvSGIS MANGLE(GetPixelTexGenParameterfvSGIS)
#define glGetPixelTexGenParameterivSGIS MANGLE(GetPixelTexGenParameterivSGIS)
+#define glGetPointerIndexedvEXT MANGLE(GetPointerIndexedvEXT)
#define glGetPointervEXT MANGLE(GetPointervEXT)
#define glGetPointerv MANGLE(GetPointerv)
#define glGetPolygonStipple MANGLE(GetPolygonStipple)
@@ -555,6 +671,7 @@
#define glGetQueryObjectuivARB MANGLE(GetQueryObjectuivARB)
#define glGetQueryObjectuiv MANGLE(GetQueryObjectuiv)
#define glGetRenderbufferParameterivEXT MANGLE(GetRenderbufferParameterivEXT)
+#define glGetRenderbufferParameteriv MANGLE(GetRenderbufferParameteriv)
#define glGetSeparableFilterEXT MANGLE(GetSeparableFilterEXT)
#define glGetSeparableFilter MANGLE(GetSeparableFilter)
#define glGetShaderInfoLog MANGLE(GetShaderInfoLog)
@@ -562,6 +679,7 @@
#define glGetShaderSourceARB MANGLE(GetShaderSourceARB)
#define glGetShaderSource MANGLE(GetShaderSource)
#define glGetSharpenTexFuncSGIS MANGLE(GetSharpenTexFuncSGIS)
+#define glGetStringi MANGLE(GetStringi)
#define glGetString MANGLE(GetString)
#define glGetTexBumpParameterfvATI MANGLE(GetTexBumpParameterfvATI)
#define glGetTexBumpParameterivATI MANGLE(GetTexBumpParameterivATI)
@@ -576,9 +694,20 @@
#define glGetTexLevelParameteriv MANGLE(GetTexLevelParameteriv)
#define glGetTexParameterfv MANGLE(GetTexParameterfv)
#define glGetTexParameterIivEXT MANGLE(GetTexParameterIivEXT)
+#define glGetTexParameterIiv MANGLE(GetTexParameterIiv)
#define glGetTexParameterIuivEXT MANGLE(GetTexParameterIuivEXT)
+#define glGetTexParameterIuiv MANGLE(GetTexParameterIuiv)
#define glGetTexParameteriv MANGLE(GetTexParameteriv)
+#define glGetTextureImageEXT MANGLE(GetTextureImageEXT)
+#define glGetTextureLevelParameterfvEXT MANGLE(GetTextureLevelParameterfvEXT)
+#define glGetTextureLevelParameterivEXT MANGLE(GetTextureLevelParameterivEXT)
+#define glGetTextureParameterfvEXT MANGLE(GetTextureParameterfvEXT)
+#define glGetTextureParameterIivEXT MANGLE(GetTextureParameterIivEXT)
+#define glGetTextureParameterIuivEXT MANGLE(GetTextureParameterIuivEXT)
+#define glGetTextureParameterivEXT MANGLE(GetTextureParameterivEXT)
#define glGetTrackMatrixivNV MANGLE(GetTrackMatrixivNV)
+#define glGetTransformFeedbackVaryingEXT MANGLE(GetTransformFeedbackVaryingEXT)
+#define glGetTransformFeedbackVarying MANGLE(GetTransformFeedbackVarying)
#define glGetTransformFeedbackVaryingNV MANGLE(GetTransformFeedbackVaryingNV)
#define glGetUniformBufferSizeEXT MANGLE(GetUniformBufferSizeEXT)
#define glGetUniformfvARB MANGLE(GetUniformfvARB)
@@ -589,6 +718,7 @@
#define glGetUniformLocation MANGLE(GetUniformLocation)
#define glGetUniformOffsetEXT MANGLE(GetUniformOffsetEXT)
#define glGetUniformuivEXT MANGLE(GetUniformuivEXT)
+#define glGetUniformuiv MANGLE(GetUniformuiv)
#define glGetVariantArrayObjectfvATI MANGLE(GetVariantArrayObjectfvATI)
#define glGetVariantArrayObjectivATI MANGLE(GetVariantArrayObjectivATI)
#define glGetVariantBooleanvEXT MANGLE(GetVariantBooleanvEXT)
@@ -605,7 +735,9 @@
#define glGetVertexAttribfv MANGLE(GetVertexAttribfv)
#define glGetVertexAttribfvNV MANGLE(GetVertexAttribfvNV)
#define glGetVertexAttribIivEXT MANGLE(GetVertexAttribIivEXT)
+#define glGetVertexAttribIiv MANGLE(GetVertexAttribIiv)
#define glGetVertexAttribIuivEXT MANGLE(GetVertexAttribIuivEXT)
+#define glGetVertexAttribIuiv MANGLE(GetVertexAttribIuiv)
#define glGetVertexAttribivARB MANGLE(GetVertexAttribivARB)
#define glGetVertexAttribiv MANGLE(GetVertexAttribiv)
#define glGetVertexAttribivNV MANGLE(GetVertexAttribivNV)
@@ -652,11 +784,13 @@
#define glIsAsyncMarkerSGIX MANGLE(IsAsyncMarkerSGIX)
#define glIsBufferARB MANGLE(IsBufferARB)
#define glIsBuffer MANGLE(IsBuffer)
+#define glIsEnabledi MANGLE(IsEnabledi)
#define glIsEnabledIndexedEXT MANGLE(IsEnabledIndexedEXT)
#define glIsEnabled MANGLE(IsEnabled)
#define glIsFenceAPPLE MANGLE(IsFenceAPPLE)
#define glIsFenceNV MANGLE(IsFenceNV)
#define glIsFramebufferEXT MANGLE(IsFramebufferEXT)
+#define glIsFramebuffer MANGLE(IsFramebuffer)
#define glIsList MANGLE(IsList)
#define glIsObjectBufferATI MANGLE(IsObjectBufferATI)
#define glIsOcclusionQueryNV MANGLE(IsOcclusionQueryNV)
@@ -666,11 +800,14 @@
#define glIsQueryARB MANGLE(IsQueryARB)
#define glIsQuery MANGLE(IsQuery)
#define glIsRenderbufferEXT MANGLE(IsRenderbufferEXT)
+#define glIsRenderbuffer MANGLE(IsRenderbuffer)
#define glIsShader MANGLE(IsShader)
#define glIsTextureEXT MANGLE(IsTextureEXT)
#define glIsTexture MANGLE(IsTexture)
+#define glIsTransformFeedbackNV MANGLE(IsTransformFeedbackNV)
#define glIsVariantEnabledEXT MANGLE(IsVariantEnabledEXT)
#define glIsVertexArrayAPPLE MANGLE(IsVertexArrayAPPLE)
+#define glIsVertexArray MANGLE(IsVertexArray)
#define glLightEnviSGIX MANGLE(LightEnviSGIX)
#define glLightf MANGLE(Lightf)
#define glLightfv MANGLE(Lightfv)
@@ -707,11 +844,13 @@
#define glMap2f MANGLE(Map2f)
#define glMapBufferARB MANGLE(MapBufferARB)
#define glMapBuffer MANGLE(MapBuffer)
+#define glMapBufferRange MANGLE(MapBufferRange)
#define glMapControlPointsNV MANGLE(MapControlPointsNV)
#define glMapGrid1d MANGLE(MapGrid1d)
#define glMapGrid1f MANGLE(MapGrid1f)
#define glMapGrid2d MANGLE(MapGrid2d)
#define glMapGrid2f MANGLE(MapGrid2f)
+#define glMapNamedBufferEXT MANGLE(MapNamedBufferEXT)
#define glMapObjectBufferATI MANGLE(MapObjectBufferATI)
#define glMapParameterfvNV MANGLE(MapParameterfvNV)
#define glMapParameterivNV MANGLE(MapParameterivNV)
@@ -719,11 +858,30 @@
#define glMaterialfv MANGLE(Materialfv)
#define glMateriali MANGLE(Materiali)
#define glMaterialiv MANGLE(Materialiv)
+#define glMatrixFrustumEXT MANGLE(MatrixFrustumEXT)
#define glMatrixIndexPointerARB MANGLE(MatrixIndexPointerARB)
#define glMatrixIndexubvARB MANGLE(MatrixIndexubvARB)
#define glMatrixIndexuivARB MANGLE(MatrixIndexuivARB)
#define glMatrixIndexusvARB MANGLE(MatrixIndexusvARB)
+#define glMatrixLoaddEXT MANGLE(MatrixLoaddEXT)
+#define glMatrixLoadfEXT MANGLE(MatrixLoadfEXT)
+#define glMatrixLoadIdentityEXT MANGLE(MatrixLoadIdentityEXT)
+#define glMatrixLoadTransposedEXT MANGLE(MatrixLoadTransposedEXT)
+#define glMatrixLoadTransposefEXT MANGLE(MatrixLoadTransposefEXT)
#define glMatrixMode MANGLE(MatrixMode)
+#define glMatrixMultdEXT MANGLE(MatrixMultdEXT)
+#define glMatrixMultfEXT MANGLE(MatrixMultfEXT)
+#define glMatrixMultTransposedEXT MANGLE(MatrixMultTransposedEXT)
+#define glMatrixMultTransposefEXT MANGLE(MatrixMultTransposefEXT)
+#define glMatrixOrthoEXT MANGLE(MatrixOrthoEXT)
+#define glMatrixPopEXT MANGLE(MatrixPopEXT)
+#define glMatrixPushEXT MANGLE(MatrixPushEXT)
+#define glMatrixRotatedEXT MANGLE(MatrixRotatedEXT)
+#define glMatrixRotatefEXT MANGLE(MatrixRotatefEXT)
+#define glMatrixScaledEXT MANGLE(MatrixScaledEXT)
+#define glMatrixScalefEXT MANGLE(MatrixScalefEXT)
+#define glMatrixTranslatedEXT MANGLE(MatrixTranslatedEXT)
+#define glMatrixTranslatefEXT MANGLE(MatrixTranslatefEXT)
#define glMinmaxEXT MANGLE(MinmaxEXT)
#define glMinmax MANGLE(Minmax)
#define glMultiDrawArraysEXT MANGLE(MultiDrawArraysEXT)
@@ -734,6 +892,7 @@
#define glMultiDrawRangeElementArrayAPPLE MANGLE(MultiDrawRangeElementArrayAPPLE)
#define glMultiModeDrawArraysIBM MANGLE(MultiModeDrawArraysIBM)
#define glMultiModeDrawElementsIBM MANGLE(MultiModeDrawElementsIBM)
+#define glMultiTexBufferEXT MANGLE(MultiTexBufferEXT)
#define glMultiTexCoord1dARB MANGLE(MultiTexCoord1dARB)
#define glMultiTexCoord1d MANGLE(MultiTexCoord1d)
#define glMultiTexCoord1dvARB MANGLE(MultiTexCoord1dvARB)
@@ -806,12 +965,60 @@
#define glMultiTexCoord4s MANGLE(MultiTexCoord4s)
#define glMultiTexCoord4svARB MANGLE(MultiTexCoord4svARB)
#define glMultiTexCoord4sv MANGLE(MultiTexCoord4sv)
+#define glMultiTexCoordPointerEXT MANGLE(MultiTexCoordPointerEXT)
+#define glMultiTexEnvfEXT MANGLE(MultiTexEnvfEXT)
+#define glMultiTexEnvfvEXT MANGLE(MultiTexEnvfvEXT)
+#define glMultiTexEnviEXT MANGLE(MultiTexEnviEXT)
+#define glMultiTexEnvivEXT MANGLE(MultiTexEnvivEXT)
+#define glMultiTexGendEXT MANGLE(MultiTexGendEXT)
+#define glMultiTexGendvEXT MANGLE(MultiTexGendvEXT)
+#define glMultiTexGenfEXT MANGLE(MultiTexGenfEXT)
+#define glMultiTexGenfvEXT MANGLE(MultiTexGenfvEXT)
+#define glMultiTexGeniEXT MANGLE(MultiTexGeniEXT)
+#define glMultiTexGenivEXT MANGLE(MultiTexGenivEXT)
+#define glMultiTexImage1DEXT MANGLE(MultiTexImage1DEXT)
+#define glMultiTexImage2DEXT MANGLE(MultiTexImage2DEXT)
+#define glMultiTexImage3DEXT MANGLE(MultiTexImage3DEXT)
+#define glMultiTexParameterfEXT MANGLE(MultiTexParameterfEXT)
+#define glMultiTexParameterfvEXT MANGLE(MultiTexParameterfvEXT)
+#define glMultiTexParameteriEXT MANGLE(MultiTexParameteriEXT)
+#define glMultiTexParameterIivEXT MANGLE(MultiTexParameterIivEXT)
+#define glMultiTexParameterIuivEXT MANGLE(MultiTexParameterIuivEXT)
+#define glMultiTexParameterivEXT MANGLE(MultiTexParameterivEXT)
+#define glMultiTexRenderbufferEXT MANGLE(MultiTexRenderbufferEXT)
+#define glMultiTexSubImage1DEXT MANGLE(MultiTexSubImage1DEXT)
+#define glMultiTexSubImage2DEXT MANGLE(MultiTexSubImage2DEXT)
+#define glMultiTexSubImage3DEXT MANGLE(MultiTexSubImage3DEXT)
#define glMultMatrixd MANGLE(MultMatrixd)
#define glMultMatrixf MANGLE(MultMatrixf)
#define glMultTransposeMatrixdARB MANGLE(MultTransposeMatrixdARB)
#define glMultTransposeMatrixd MANGLE(MultTransposeMatrixd)
#define glMultTransposeMatrixfARB MANGLE(MultTransposeMatrixfARB)
#define glMultTransposeMatrixf MANGLE(MultTransposeMatrixf)
+#define glNamedBufferDataEXT MANGLE(NamedBufferDataEXT)
+#define glNamedBufferSubDataEXT MANGLE(NamedBufferSubDataEXT)
+#define glNamedFramebufferRenderbufferEXT MANGLE(NamedFramebufferRenderbufferEXT)
+#define glNamedFramebufferTexture1DEXT MANGLE(NamedFramebufferTexture1DEXT)
+#define glNamedFramebufferTexture2DEXT MANGLE(NamedFramebufferTexture2DEXT)
+#define glNamedFramebufferTexture3DEXT MANGLE(NamedFramebufferTexture3DEXT)
+#define glNamedFramebufferTextureEXT MANGLE(NamedFramebufferTextureEXT)
+#define glNamedFramebufferTextureFaceEXT MANGLE(NamedFramebufferTextureFaceEXT)
+#define glNamedFramebufferTextureLayerEXT MANGLE(NamedFramebufferTextureLayerEXT)
+#define glNamedProgramLocalParameter4dEXT MANGLE(NamedProgramLocalParameter4dEXT)
+#define glNamedProgramLocalParameter4dvEXT MANGLE(NamedProgramLocalParameter4dvEXT)
+#define glNamedProgramLocalParameter4fEXT MANGLE(NamedProgramLocalParameter4fEXT)
+#define glNamedProgramLocalParameter4fvEXT MANGLE(NamedProgramLocalParameter4fvEXT)
+#define glNamedProgramLocalParameterI4iEXT MANGLE(NamedProgramLocalParameterI4iEXT)
+#define glNamedProgramLocalParameterI4ivEXT MANGLE(NamedProgramLocalParameterI4ivEXT)
+#define glNamedProgramLocalParameterI4uiEXT MANGLE(NamedProgramLocalParameterI4uiEXT)
+#define glNamedProgramLocalParameterI4uivEXT MANGLE(NamedProgramLocalParameterI4uivEXT)
+#define glNamedProgramLocalParameters4fvEXT MANGLE(NamedProgramLocalParameters4fvEXT)
+#define glNamedProgramLocalParametersI4ivEXT MANGLE(NamedProgramLocalParametersI4ivEXT)
+#define glNamedProgramLocalParametersI4uivEXT MANGLE(NamedProgramLocalParametersI4uivEXT)
+#define glNamedProgramStringEXT MANGLE(NamedProgramStringEXT)
+#define glNamedRenderbufferStorageEXT MANGLE(NamedRenderbufferStorageEXT)
+#define glNamedRenderbufferStorageMultisampleCoverageEXT MANGLE(NamedRenderbufferStorageMultisampleCoverageEXT)
+#define glNamedRenderbufferStorageMultisampleEXT MANGLE(NamedRenderbufferStorageMultisampleEXT)
#define glNewList MANGLE(NewList)
#define glNewObjectBufferATI MANGLE(NewObjectBufferATI)
#define glNormal3b MANGLE(Normal3b)
@@ -845,6 +1052,7 @@
#define glOrtho MANGLE(Ortho)
#define glPassTexCoordATI MANGLE(PassTexCoordATI)
#define glPassThrough MANGLE(PassThrough)
+#define glPauseTransformFeedbackNV MANGLE(PauseTransformFeedbackNV)
#define glPixelDataRangeNV MANGLE(PixelDataRangeNV)
#define glPixelMapfv MANGLE(PixelMapfv)
#define glPixelMapuiv MANGLE(PixelMapuiv)
@@ -926,12 +1134,47 @@
#define glProgramParameter4dvNV MANGLE(ProgramParameter4dvNV)
#define glProgramParameter4fNV MANGLE(ProgramParameter4fNV)
#define glProgramParameter4fvNV MANGLE(ProgramParameter4fvNV)
+#define glProgramParameteriARB MANGLE(ProgramParameteriARB)
#define glProgramParameteriEXT MANGLE(ProgramParameteriEXT)
#define glProgramParameters4dvNV MANGLE(ProgramParameters4dvNV)
#define glProgramParameters4fvNV MANGLE(ProgramParameters4fvNV)
#define glProgramStringARB MANGLE(ProgramStringARB)
+#define glProgramUniform1fEXT MANGLE(ProgramUniform1fEXT)
+#define glProgramUniform1fvEXT MANGLE(ProgramUniform1fvEXT)
+#define glProgramUniform1iEXT MANGLE(ProgramUniform1iEXT)
+#define glProgramUniform1ivEXT MANGLE(ProgramUniform1ivEXT)
+#define glProgramUniform1uiEXT MANGLE(ProgramUniform1uiEXT)
+#define glProgramUniform1uivEXT MANGLE(ProgramUniform1uivEXT)
+#define glProgramUniform2fEXT MANGLE(ProgramUniform2fEXT)
+#define glProgramUniform2fvEXT MANGLE(ProgramUniform2fvEXT)
+#define glProgramUniform2iEXT MANGLE(ProgramUniform2iEXT)
+#define glProgramUniform2ivEXT MANGLE(ProgramUniform2ivEXT)
+#define glProgramUniform2uiEXT MANGLE(ProgramUniform2uiEXT)
+#define glProgramUniform2uivEXT MANGLE(ProgramUniform2uivEXT)
+#define glProgramUniform3fEXT MANGLE(ProgramUniform3fEXT)
+#define glProgramUniform3fvEXT MANGLE(ProgramUniform3fvEXT)
+#define glProgramUniform3iEXT MANGLE(ProgramUniform3iEXT)
+#define glProgramUniform3ivEXT MANGLE(ProgramUniform3ivEXT)
+#define glProgramUniform3uiEXT MANGLE(ProgramUniform3uiEXT)
+#define glProgramUniform3uivEXT MANGLE(ProgramUniform3uivEXT)
+#define glProgramUniform4fEXT MANGLE(ProgramUniform4fEXT)
+#define glProgramUniform4fvEXT MANGLE(ProgramUniform4fvEXT)
+#define glProgramUniform4iEXT MANGLE(ProgramUniform4iEXT)
+#define glProgramUniform4ivEXT MANGLE(ProgramUniform4ivEXT)
+#define glProgramUniform4uiEXT MANGLE(ProgramUniform4uiEXT)
+#define glProgramUniform4uivEXT MANGLE(ProgramUniform4uivEXT)
+#define glProgramUniformMatrix2fvEXT MANGLE(ProgramUniformMatrix2fvEXT)
+#define glProgramUniformMatrix2x3fvEXT MANGLE(ProgramUniformMatrix2x3fvEXT)
+#define glProgramUniformMatrix2x4fvEXT MANGLE(ProgramUniformMatrix2x4fvEXT)
+#define glProgramUniformMatrix3fvEXT MANGLE(ProgramUniformMatrix3fvEXT)
+#define glProgramUniformMatrix3x2fvEXT MANGLE(ProgramUniformMatrix3x2fvEXT)
+#define glProgramUniformMatrix3x4fvEXT MANGLE(ProgramUniformMatrix3x4fvEXT)
+#define glProgramUniformMatrix4fvEXT MANGLE(ProgramUniformMatrix4fvEXT)
+#define glProgramUniformMatrix4x2fvEXT MANGLE(ProgramUniformMatrix4x2fvEXT)
+#define glProgramUniformMatrix4x3fvEXT MANGLE(ProgramUniformMatrix4x3fvEXT)
#define glProgramVertexLimitNV MANGLE(ProgramVertexLimitNV)
#define glPushAttrib MANGLE(PushAttrib)
+#define glPushClientAttribDefaultEXT MANGLE(PushClientAttribDefaultEXT)
#define glPushClientAttrib MANGLE(PushClientAttrib)
#define glPushMatrix MANGLE(PushMatrix)
#define glPushName MANGLE(PushName)
@@ -972,8 +1215,10 @@
#define glRectsv MANGLE(Rectsv)
#define glReferencePlaneSGIX MANGLE(ReferencePlaneSGIX)
#define glRenderbufferStorageEXT MANGLE(RenderbufferStorageEXT)
+#define glRenderbufferStorage MANGLE(RenderbufferStorage)
#define glRenderbufferStorageMultisampleCoverageNV MANGLE(RenderbufferStorageMultisampleCoverageNV)
#define glRenderbufferStorageMultisampleEXT MANGLE(RenderbufferStorageMultisampleEXT)
+#define glRenderbufferStorageMultisample MANGLE(RenderbufferStorageMultisample)
#define glRenderMode MANGLE(RenderMode)
#define glReplacementCodePointerSUN MANGLE(ReplacementCodePointerSUN)
#define glReplacementCodeubSUN MANGLE(ReplacementCodeubSUN)
@@ -1004,12 +1249,14 @@
#define glResetMinmaxEXT MANGLE(ResetMinmaxEXT)
#define glResetMinmax MANGLE(ResetMinmax)
#define glResizeBuffersMESA MANGLE(ResizeBuffersMESA)
+#define glResumeTransformFeedbackNV MANGLE(ResumeTransformFeedbackNV)
#define glRotated MANGLE(Rotated)
#define glRotatef MANGLE(Rotatef)
#define glSampleCoverageARB MANGLE(SampleCoverageARB)
#define glSampleCoverage MANGLE(SampleCoverage)
#define glSampleMapATI MANGLE(SampleMapATI)
#define glSampleMaskEXT MANGLE(SampleMaskEXT)
+#define glSampleMaskIndexedNV MANGLE(SampleMaskIndexedNV)
#define glSampleMaskSGIS MANGLE(SampleMaskSGIS)
#define glSamplePatternEXT MANGLE(SamplePatternEXT)
#define glSamplePatternSGIS MANGLE(SamplePatternSGIS)
@@ -1101,6 +1348,7 @@
#define glTestFenceAPPLE MANGLE(TestFenceAPPLE)
#define glTestFenceNV MANGLE(TestFenceNV)
#define glTestObjectAPPLE MANGLE(TestObjectAPPLE)
+#define glTexBufferARB MANGLE(TexBufferARB)
#define glTexBufferEXT MANGLE(TexBufferEXT)
#define glTexBumpParameterfvATI MANGLE(TexBumpParameterfvATI)
#define glTexBumpParameterivATI MANGLE(TexBumpParameterivATI)
@@ -1181,9 +1429,12 @@
#define glTexParameterf MANGLE(TexParameterf)
#define glTexParameterfv MANGLE(TexParameterfv)
#define glTexParameterIivEXT MANGLE(TexParameterIivEXT)
+#define glTexParameterIiv MANGLE(TexParameterIiv)
#define glTexParameteri MANGLE(TexParameteri)
#define glTexParameterIuivEXT MANGLE(TexParameterIuivEXT)
+#define glTexParameterIuiv MANGLE(TexParameterIuiv)
#define glTexParameteriv MANGLE(TexParameteriv)
+#define glTexRenderbufferNV MANGLE(TexRenderbufferNV)
#define glTexSubImage1DEXT MANGLE(TexSubImage1DEXT)
#define glTexSubImage1D MANGLE(TexSubImage1D)
#define glTexSubImage2DEXT MANGLE(TexSubImage2DEXT)
@@ -1191,12 +1442,28 @@
#define glTexSubImage3DEXT MANGLE(TexSubImage3DEXT)
#define glTexSubImage3D MANGLE(TexSubImage3D)
#define glTexSubImage4DSGIS MANGLE(TexSubImage4DSGIS)
+#define glTextureBufferEXT MANGLE(TextureBufferEXT)
#define glTextureColorMaskSGIS MANGLE(TextureColorMaskSGIS)
+#define glTextureImage1DEXT MANGLE(TextureImage1DEXT)
+#define glTextureImage2DEXT MANGLE(TextureImage2DEXT)
+#define glTextureImage3DEXT MANGLE(TextureImage3DEXT)
#define glTextureLightEXT MANGLE(TextureLightEXT)
#define glTextureMaterialEXT MANGLE(TextureMaterialEXT)
#define glTextureNormalEXT MANGLE(TextureNormalEXT)
+#define glTextureParameterfEXT MANGLE(TextureParameterfEXT)
+#define glTextureParameterfvEXT MANGLE(TextureParameterfvEXT)
+#define glTextureParameteriEXT MANGLE(TextureParameteriEXT)
+#define glTextureParameterIivEXT MANGLE(TextureParameterIivEXT)
+#define glTextureParameterIuivEXT MANGLE(TextureParameterIuivEXT)
+#define glTextureParameterivEXT MANGLE(TextureParameterivEXT)
+#define glTextureRenderbufferEXT MANGLE(TextureRenderbufferEXT)
+#define glTextureSubImage1DEXT MANGLE(TextureSubImage1DEXT)
+#define glTextureSubImage2DEXT MANGLE(TextureSubImage2DEXT)
+#define glTextureSubImage3DEXT MANGLE(TextureSubImage3DEXT)
#define glTrackMatrixNV MANGLE(TrackMatrixNV)
#define glTransformFeedbackAttribsNV MANGLE(TransformFeedbackAttribsNV)
+#define glTransformFeedbackVaryingsEXT MANGLE(TransformFeedbackVaryingsEXT)
+#define glTransformFeedbackVaryings MANGLE(TransformFeedbackVaryings)
#define glTransformFeedbackVaryingsNV MANGLE(TransformFeedbackVaryingsNV)
#define glTranslated MANGLE(Translated)
#define glTranslatef MANGLE(Translatef)
@@ -1209,7 +1476,9 @@
#define glUniform1ivARB MANGLE(Uniform1ivARB)
#define glUniform1iv MANGLE(Uniform1iv)
#define glUniform1uiEXT MANGLE(Uniform1uiEXT)
+#define glUniform1ui MANGLE(Uniform1ui)
#define glUniform1uivEXT MANGLE(Uniform1uivEXT)
+#define glUniform1uiv MANGLE(Uniform1uiv)
#define glUniform2fARB MANGLE(Uniform2fARB)
#define glUniform2f MANGLE(Uniform2f)
#define glUniform2fvARB MANGLE(Uniform2fvARB)
@@ -1219,7 +1488,9 @@
#define glUniform2ivARB MANGLE(Uniform2ivARB)
#define glUniform2iv MANGLE(Uniform2iv)
#define glUniform2uiEXT MANGLE(Uniform2uiEXT)
+#define glUniform2ui MANGLE(Uniform2ui)
#define glUniform2uivEXT MANGLE(Uniform2uivEXT)
+#define glUniform2uiv MANGLE(Uniform2uiv)
#define glUniform3fARB MANGLE(Uniform3fARB)
#define glUniform3f MANGLE(Uniform3f)
#define glUniform3fvARB MANGLE(Uniform3fvARB)
@@ -1229,7 +1500,9 @@
#define glUniform3ivARB MANGLE(Uniform3ivARB)
#define glUniform3iv MANGLE(Uniform3iv)
#define glUniform3uiEXT MANGLE(Uniform3uiEXT)
+#define glUniform3ui MANGLE(Uniform3ui)
#define glUniform3uivEXT MANGLE(Uniform3uivEXT)
+#define glUniform3uiv MANGLE(Uniform3uiv)
#define glUniform4fARB MANGLE(Uniform4fARB)
#define glUniform4f MANGLE(Uniform4f)
#define glUniform4fvARB MANGLE(Uniform4fvARB)
@@ -1239,7 +1512,9 @@
#define glUniform4ivARB MANGLE(Uniform4ivARB)
#define glUniform4iv MANGLE(Uniform4iv)
#define glUniform4uiEXT MANGLE(Uniform4uiEXT)
+#define glUniform4ui MANGLE(Uniform4ui)
#define glUniform4uivEXT MANGLE(Uniform4uivEXT)
+#define glUniform4uiv MANGLE(Uniform4uiv)
#define glUniformBufferEXT MANGLE(UniformBufferEXT)
#define glUniformMatrix2fvARB MANGLE(UniformMatrix2fvARB)
#define glUniformMatrix2fv MANGLE(UniformMatrix2fv)
@@ -1256,6 +1531,7 @@
#define glUnlockArraysEXT MANGLE(UnlockArraysEXT)
#define glUnmapBufferARB MANGLE(UnmapBufferARB)
#define glUnmapBuffer MANGLE(UnmapBuffer)
+#define glUnmapNamedBufferEXT MANGLE(UnmapNamedBufferEXT)
#define glUnmapObjectBufferATI MANGLE(UnmapObjectBufferATI)
#define glUpdateObjectBufferATI MANGLE(UpdateObjectBufferATI)
#define glUseProgram MANGLE(UseProgram)
@@ -1412,27 +1688,49 @@
#define glVertexAttrib4usvARB MANGLE(VertexAttrib4usvARB)
#define glVertexAttrib4usv MANGLE(VertexAttrib4usv)
#define glVertexAttribArrayObjectATI MANGLE(VertexAttribArrayObjectATI)
+#define glVertexAttribDivisor MANGLE(VertexAttribDivisor)
#define glVertexAttribI1iEXT MANGLE(VertexAttribI1iEXT)
+#define glVertexAttribI1i MANGLE(VertexAttribI1i)
#define glVertexAttribI1ivEXT MANGLE(VertexAttribI1ivEXT)
+#define glVertexAttribI1iv MANGLE(VertexAttribI1iv)
#define glVertexAttribI1uiEXT MANGLE(VertexAttribI1uiEXT)
+#define glVertexAttribI1ui MANGLE(VertexAttribI1ui)
#define glVertexAttribI1uivEXT MANGLE(VertexAttribI1uivEXT)
+#define glVertexAttribI1uiv MANGLE(VertexAttribI1uiv)
#define glVertexAttribI2iEXT MANGLE(VertexAttribI2iEXT)
+#define glVertexAttribI2i MANGLE(VertexAttribI2i)
#define glVertexAttribI2ivEXT MANGLE(VertexAttribI2ivEXT)
+#define glVertexAttribI2iv MANGLE(VertexAttribI2iv)
#define glVertexAttribI2uiEXT MANGLE(VertexAttribI2uiEXT)
+#define glVertexAttribI2ui MANGLE(VertexAttribI2ui)
#define glVertexAttribI2uivEXT MANGLE(VertexAttribI2uivEXT)
+#define glVertexAttribI2uiv MANGLE(VertexAttribI2uiv)
#define glVertexAttribI3iEXT MANGLE(VertexAttribI3iEXT)
+#define glVertexAttribI3i MANGLE(VertexAttribI3i)
#define glVertexAttribI3ivEXT MANGLE(VertexAttribI3ivEXT)
+#define glVertexAttribI3iv MANGLE(VertexAttribI3iv)
#define glVertexAttribI3uiEXT MANGLE(VertexAttribI3uiEXT)
+#define glVertexAttribI3ui MANGLE(VertexAttribI3ui)
#define glVertexAttribI3uivEXT MANGLE(VertexAttribI3uivEXT)
+#define glVertexAttribI3uiv MANGLE(VertexAttribI3uiv)
#define glVertexAttribI4bvEXT MANGLE(VertexAttribI4bvEXT)
+#define glVertexAttribI4bv MANGLE(VertexAttribI4bv)
#define glVertexAttribI4iEXT MANGLE(VertexAttribI4iEXT)
+#define glVertexAttribI4i MANGLE(VertexAttribI4i)
#define glVertexAttribI4ivEXT MANGLE(VertexAttribI4ivEXT)
+#define glVertexAttribI4iv MANGLE(VertexAttribI4iv)
#define glVertexAttribI4svEXT MANGLE(VertexAttribI4svEXT)
+#define glVertexAttribI4sv MANGLE(VertexAttribI4sv)
#define glVertexAttribI4ubvEXT MANGLE(VertexAttribI4ubvEXT)
+#define glVertexAttribI4ubv MANGLE(VertexAttribI4ubv)
#define glVertexAttribI4uiEXT MANGLE(VertexAttribI4uiEXT)
+#define glVertexAttribI4ui MANGLE(VertexAttribI4ui)
#define glVertexAttribI4uivEXT MANGLE(VertexAttribI4uivEXT)
+#define glVertexAttribI4uiv MANGLE(VertexAttribI4uiv)
#define glVertexAttribI4usvEXT MANGLE(VertexAttribI4usvEXT)
+#define glVertexAttribI4usv MANGLE(VertexAttribI4usv)
#define glVertexAttribIPointerEXT MANGLE(VertexAttribIPointerEXT)
+#define glVertexAttribIPointer MANGLE(VertexAttribIPointer)
#define glVertexAttribPointerARB MANGLE(VertexAttribPointerARB)
#define glVertexAttribPointer MANGLE(VertexAttribPointer)
#define glVertexAttribPointerNV MANGLE(VertexAttribPointerNV)
diff --git a/include/GL/glext.h b/include/GL/glext.h
index c0941aa8044..d3f01a2b6c4 100644
--- a/include/GL/glext.h
+++ b/include/GL/glext.h
@@ -46,9 +46,9 @@ extern "C" {
/*************************************************************/
/* Header file version number, required by OpenGL ABI for Linux */
-/* glext.h last updated 2008/11/14 */
+/* glext.h last updated 2009/03/04 */
/* Current version at http://www.opengl.org/registry/ */
-#define GL_GLEXT_VERSION 44
+#define GL_GLEXT_VERSION 46
#ifndef GL_VERSION_1_2
#define GL_UNSIGNED_BYTE_3_3_2 0x8032
@@ -3862,6 +3862,22 @@ extern "C" {
#define GL_TRANSFORM_FEEDBACK_BINDING_NV 0x8E25
#endif
+#ifndef GL_ATI_meminfo
+#define GL_VBO_FREE_MEMORY_ATI 0x87FB
+#define GL_TEXTURE_FREE_MEMORY_ATI 0x87FC
+#define GL_RENDERBUFFER_FREE_MEMORY_ATI 0x87FD
+#endif
+
+#ifndef GL_AMD_performance_monitor
+#define GL_COUNTER_TYPE_AMD 0x8BC0
+#define GL_COUNTER_RANGE_AMD 0x8BC1
+#define GL_UNSIGNED_INT64_AMD 0x8BC2
+#define GL_PERCENTAGE_AMD 0x8BC3
+#define GL_PERFMON_RESULT_AVAILABLE_AMD 0x8BC4
+#define GL_PERFMON_RESULT_SIZE_AMD 0x8BC5
+#define GL_PERFMON_RESULT_AMD 0x8BC6
+#endif
+
/*************************************************************/
@@ -5268,10 +5284,10 @@ typedef void (APIENTRYP PFNGLVERTEXATTRIBDIVISORPROC) (GLuint index, GLuint divi
#ifndef GL_ARB_map_buffer_range
#define GL_ARB_map_buffer_range 1
#ifdef GL_GLEXT_PROTOTYPES
-GLAPI void APIENTRY glMapBufferRange (GLenum, GLintptr, GLsizeiptr, GLbitfield);
+GLAPI GLvoid* APIENTRY glMapBufferRange (GLenum, GLintptr, GLsizeiptr, GLbitfield);
GLAPI void APIENTRY glFlushMappedBufferRange (GLenum, GLintptr, GLsizeiptr);
#endif /* GL_GLEXT_PROTOTYPES */
-typedef void (APIENTRYP PFNGLMAPBUFFERRANGEPROC) (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access);
+typedef GLvoid* (APIENTRYP PFNGLMAPBUFFERRANGEPROC) (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access);
typedef void (APIENTRYP PFNGLFLUSHMAPPEDBUFFERRANGEPROC) (GLenum target, GLintptr offset, GLsizeiptr length);
#endif
@@ -8011,6 +8027,22 @@ typedef void (APIENTRYP PFNGLENDCONDITIONALRENDERNVPROC) (void);
#ifndef GL_NV_present_video
#define GL_NV_present_video 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glPresentFrameKeyedNV (GLuint, GLuint64EXT, GLuint, GLuint, GLenum, GLenum, GLuint, GLuint, GLenum, GLuint, GLuint);
+GLAPI void APIENTRY glPresentFrameDualFillNV (GLuint, GLuint64EXT, GLuint, GLuint, GLenum, GLenum, GLuint, GLenum, GLuint, GLenum, GLuint, GLenum, GLuint);
+GLAPI void APIENTRY glGetVideoivNV (GLuint, GLenum, GLint *);
+GLAPI void APIENTRY glGetVideouivNV (GLuint, GLenum, GLuint *);
+GLAPI void APIENTRY glGetVideoi64vNV (GLuint, GLenum, GLint64EXT *);
+GLAPI void APIENTRY glGetVideoui64vNV (GLuint, GLenum, GLuint64EXT *);
+GLAPI void APIENTRY glVideoParameterivNV (GLuint, GLenum, const GLint *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLPRESENTFRAMEKEYEDNVPROC) (GLuint video_slot, GLuint64EXT minPresentTime, GLuint beginPresentTimeId, GLuint presentDurationId, GLenum type, GLenum target0, GLuint fill0, GLuint key0, GLenum target1, GLuint fill1, GLuint key1);
+typedef void (APIENTRYP PFNGLPRESENTFRAMEDUALFILLNVPROC) (GLuint video_slot, GLuint64EXT minPresentTime, GLuint beginPresentTimeId, GLuint presentDurationId, GLenum type, GLenum target0, GLuint fill0, GLenum target1, GLuint fill1, GLenum target2, GLuint fill2, GLenum target3, GLuint fill3);
+typedef void (APIENTRYP PFNGLGETVIDEOIVNVPROC) (GLuint video_slot, GLenum pname, GLint *params);
+typedef void (APIENTRYP PFNGLGETVIDEOUIVNVPROC) (GLuint video_slot, GLenum pname, GLuint *params);
+typedef void (APIENTRYP PFNGLGETVIDEOI64VNVPROC) (GLuint video_slot, GLenum pname, GLint64EXT *params);
+typedef void (APIENTRYP PFNGLGETVIDEOUI64VNVPROC) (GLuint video_slot, GLenum pname, GLuint64EXT *params);
+typedef void (APIENTRYP PFNGLVIDEOPARAMETERIVNVPROC) (GLuint video_slot, GLenum pname, const GLint *params);
#endif
#ifndef GL_EXT_transform_feedback
@@ -8451,6 +8483,38 @@ typedef void (APIENTRYP PFNGLRESUMETRANSFORMFEEDBACKNVPROC) (void);
typedef void (APIENTRYP PFNGLDRAWTRANSFORMFEEDBACKNVPROC) (GLenum mode, GLuint id);
#endif
+#ifndef GL_ATI_meminfo
+#define GL_ATI_meminfo 1
+#endif
+
+#ifndef GL_AMD_performance_monitor
+#define GL_AMD_performance_monitor 1
+#ifdef GL_GLEXT_PROTOTYPES
+GLAPI void APIENTRY glGetPerfMonitorGroupsAMD (GLint *, GLsizei, GLuint *);
+GLAPI void APIENTRY glGetPerfMonitorCountersAMD (GLuint, GLint *, GLint *, GLsizei, GLuint *);
+GLAPI void APIENTRY glGetPerfMonitorGroupStringAMD (GLuint, GLsizei, GLsizei *, GLchar *);
+GLAPI void APIENTRY glGetPerfMonitorCounterStringAMD (GLuint, GLuint, GLsizei, GLsizei *, GLchar *);
+GLAPI void APIENTRY glGetPerfMonitorCounterInfoAMD (GLuint, GLuint, GLenum, void *);
+GLAPI void APIENTRY glGenPerfMonitorsAMD (GLsizei, GLuint *);
+GLAPI void APIENTRY glDeletePerfMonitorsAMD (GLsizei, GLuint *);
+GLAPI void APIENTRY glSelectPerfMonitorCountersAMD (GLuint, GLboolean, GLuint, GLint, GLuint *);
+GLAPI void APIENTRY glBeginPerfMonitorAMD (GLuint);
+GLAPI void APIENTRY glEndPerfMonitorAMD (GLuint);
+GLAPI void APIENTRY glGetPerfMonitorCounterDataAMD (GLuint, GLenum, GLsizei, GLuint *, GLint *);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (APIENTRYP PFNGLGETPERFMONITORGROUPSAMDPROC) (GLint *numGroups, GLsizei groupsSize, GLuint *groups);
+typedef void (APIENTRYP PFNGLGETPERFMONITORCOUNTERSAMDPROC) (GLuint group, GLint *numCounters, GLint *maxActiveCounters, GLsizei counterSize, GLuint *counters);
+typedef void (APIENTRYP PFNGLGETPERFMONITORGROUPSTRINGAMDPROC) (GLuint group, GLsizei bufSize, GLsizei *length, GLchar *groupString);
+typedef void (APIENTRYP PFNGLGETPERFMONITORCOUNTERSTRINGAMDPROC) (GLuint group, GLuint counter, GLsizei bufSize, GLsizei *length, GLchar *counterString);
+typedef void (APIENTRYP PFNGLGETPERFMONITORCOUNTERINFOAMDPROC) (GLuint group, GLuint counter, GLenum pname, void *data);
+typedef void (APIENTRYP PFNGLGENPERFMONITORSAMDPROC) (GLsizei n, GLuint *monitors);
+typedef void (APIENTRYP PFNGLDELETEPERFMONITORSAMDPROC) (GLsizei n, GLuint *monitors);
+typedef void (APIENTRYP PFNGLSELECTPERFMONITORCOUNTERSAMDPROC) (GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint *counterList);
+typedef void (APIENTRYP PFNGLBEGINPERFMONITORAMDPROC) (GLuint monitor);
+typedef void (APIENTRYP PFNGLENDPERFMONITORAMDPROC) (GLuint monitor);
+typedef void (APIENTRYP PFNGLGETPERFMONITORCOUNTERDATAAMDPROC) (GLuint monitor, GLenum pname, GLsizei dataSize, GLuint *data, GLint *bytesWritten);
+#endif
+
#ifdef __cplusplus
}
diff --git a/include/GL/glut.h b/include/GL/glut.h
index 022378fb9d7..9fdb9cfdfa9 100644
--- a/include/GL/glut.h
+++ b/include/GL/glut.h
@@ -74,23 +74,9 @@ extern "C" {
# define __cdecl
# define GLUT_DEFINED___CDECL
# endif
-# ifndef _CRTIMP
-# ifdef _NTSDK
- /* Definition compatible with NT SDK */
-# define _CRTIMP
-# else
- /* Current definition */
-# ifdef _DLL
-# define _CRTIMP __declspec(dllimport)
-# else
-# define _CRTIMP
-# endif
-# endif
-# define GLUT_DEFINED__CRTIMP
-# endif
-# ifndef GLUT_BUILDING_LIB
-extern _CRTIMP void __cdecl exit(int);
-# endif
+#if defined(_WIN32) && !defined(GLUT_DISABLE_ATEXIT_HACK)
+#include <stdlib.h>
+#endif
/* GLUT callback calling convention for Win32. */
# define GLUTCALLBACK __cdecl
@@ -122,7 +108,7 @@ extern _CRTIMP void __cdecl exit(int);
# define GLUTAPIENTRY
# define GLUTAPIENTRYV
# define GLUTCALLBACK
-# define GLUTAPI __attribute__((visibility("default")))
+# define GLUTAPI extern __attribute__((visibility("default")))
#else
diff --git a/include/GL/internal/dri_interface.h b/include/GL/internal/dri_interface.h
index 27cc1be7ff3..a726b932340 100644
--- a/include/GL/internal/dri_interface.h
+++ b/include/GL/internal/dri_interface.h
@@ -78,6 +78,7 @@ typedef struct __DRIswrastExtensionRec __DRIswrastExtension;
typedef struct __DRIbufferRec __DRIbuffer;
typedef struct __DRIdri2ExtensionRec __DRIdri2Extension;
typedef struct __DRIdri2LoaderExtensionRec __DRIdri2LoaderExtension;
+typedef struct __DRI2flushExtensionRec __DRI2flushExtension;
/*@}*/
@@ -245,6 +246,16 @@ struct __DRItexBufferExtensionRec {
__DRIdrawable *pDraw);
};
+/**
+ * Used by drivers that implement DRI2
+ */
+#define __DRI2_FLUSH "DRI2_Flush"
+#define __DRI2_FLUSH_VERSION 1
+struct __DRI2flushExtensionRec {
+ __DRIextension base;
+ void (*flush)(__DRIdrawable *drawable);
+};
+
/**
* XML document describing the configuration options supported by the
diff --git a/include/GL/wglext.h b/include/GL/wglext.h
new file mode 100644
index 00000000000..d54e0a4d509
--- /dev/null
+++ b/include/GL/wglext.h
@@ -0,0 +1,813 @@
+#ifndef __wglext_h_
+#define __wglext_h_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+** Copyright (c) 2007 The Khronos Group Inc.
+**
+** Permission is hereby granted, free of charge, to any person obtaining a
+** copy of this software and/or associated documentation files (the
+** "Materials"), to deal in the Materials without restriction, including
+** without limitation the rights to use, copy, modify, merge, publish,
+** distribute, sublicense, and/or sell copies of the Materials, and to
+** permit persons to whom the Materials are 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 Materials.
+**
+** THE MATERIALS ARE 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 THE AUTHORS OR COPYRIGHT HOLDERS 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
+** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
+*/
+
+#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__)
+#define WIN32_LEAN_AND_MEAN 1
+#include <windows.h>
+#endif
+
+#ifndef APIENTRY
+#define APIENTRY
+#endif
+#ifndef APIENTRYP
+#define APIENTRYP APIENTRY *
+#endif
+#ifndef GLAPI
+#define GLAPI extern
+#endif
+
+/*************************************************************/
+
+/* Header file version number */
+/* wglext.h last updated 2009/03/03 */
+/* Current version at http://www.opengl.org/registry/ */
+#define WGL_WGLEXT_VERSION 12
+
+#ifndef WGL_ARB_buffer_region
+#define WGL_FRONT_COLOR_BUFFER_BIT_ARB 0x00000001
+#define WGL_BACK_COLOR_BUFFER_BIT_ARB 0x00000002
+#define WGL_DEPTH_BUFFER_BIT_ARB 0x00000004
+#define WGL_STENCIL_BUFFER_BIT_ARB 0x00000008
+#endif
+
+#ifndef WGL_ARB_multisample
+#define WGL_SAMPLE_BUFFERS_ARB 0x2041
+#define WGL_SAMPLES_ARB 0x2042
+#endif
+
+#ifndef WGL_ARB_extensions_string
+#endif
+
+#ifndef WGL_ARB_pixel_format
+#define WGL_NUMBER_PIXEL_FORMATS_ARB 0x2000
+#define WGL_DRAW_TO_WINDOW_ARB 0x2001
+#define WGL_DRAW_TO_BITMAP_ARB 0x2002
+#define WGL_ACCELERATION_ARB 0x2003
+#define WGL_NEED_PALETTE_ARB 0x2004
+#define WGL_NEED_SYSTEM_PALETTE_ARB 0x2005
+#define WGL_SWAP_LAYER_BUFFERS_ARB 0x2006
+#define WGL_SWAP_METHOD_ARB 0x2007
+#define WGL_NUMBER_OVERLAYS_ARB 0x2008
+#define WGL_NUMBER_UNDERLAYS_ARB 0x2009
+#define WGL_TRANSPARENT_ARB 0x200A
+#define WGL_TRANSPARENT_RED_VALUE_ARB 0x2037
+#define WGL_TRANSPARENT_GREEN_VALUE_ARB 0x2038
+#define WGL_TRANSPARENT_BLUE_VALUE_ARB 0x2039
+#define WGL_TRANSPARENT_ALPHA_VALUE_ARB 0x203A
+#define WGL_TRANSPARENT_INDEX_VALUE_ARB 0x203B
+#define WGL_SHARE_DEPTH_ARB 0x200C
+#define WGL_SHARE_STENCIL_ARB 0x200D
+#define WGL_SHARE_ACCUM_ARB 0x200E
+#define WGL_SUPPORT_GDI_ARB 0x200F
+#define WGL_SUPPORT_OPENGL_ARB 0x2010
+#define WGL_DOUBLE_BUFFER_ARB 0x2011
+#define WGL_STEREO_ARB 0x2012
+#define WGL_PIXEL_TYPE_ARB 0x2013
+#define WGL_COLOR_BITS_ARB 0x2014
+#define WGL_RED_BITS_ARB 0x2015
+#define WGL_RED_SHIFT_ARB 0x2016
+#define WGL_GREEN_BITS_ARB 0x2017
+#define WGL_GREEN_SHIFT_ARB 0x2018
+#define WGL_BLUE_BITS_ARB 0x2019
+#define WGL_BLUE_SHIFT_ARB 0x201A
+#define WGL_ALPHA_BITS_ARB 0x201B
+#define WGL_ALPHA_SHIFT_ARB 0x201C
+#define WGL_ACCUM_BITS_ARB 0x201D
+#define WGL_ACCUM_RED_BITS_ARB 0x201E
+#define WGL_ACCUM_GREEN_BITS_ARB 0x201F
+#define WGL_ACCUM_BLUE_BITS_ARB 0x2020
+#define WGL_ACCUM_ALPHA_BITS_ARB 0x2021
+#define WGL_DEPTH_BITS_ARB 0x2022
+#define WGL_STENCIL_BITS_ARB 0x2023
+#define WGL_AUX_BUFFERS_ARB 0x2024
+#define WGL_NO_ACCELERATION_ARB 0x2025
+#define WGL_GENERIC_ACCELERATION_ARB 0x2026
+#define WGL_FULL_ACCELERATION_ARB 0x2027
+#define WGL_SWAP_EXCHANGE_ARB 0x2028
+#define WGL_SWAP_COPY_ARB 0x2029
+#define WGL_SWAP_UNDEFINED_ARB 0x202A
+#define WGL_TYPE_RGBA_ARB 0x202B
+#define WGL_TYPE_COLORINDEX_ARB 0x202C
+#endif
+
+#ifndef WGL_ARB_make_current_read
+#define ERROR_INVALID_PIXEL_TYPE_ARB 0x2043
+#define ERROR_INCOMPATIBLE_DEVICE_CONTEXTS_ARB 0x2054
+#endif
+
+#ifndef WGL_ARB_pbuffer
+#define WGL_DRAW_TO_PBUFFER_ARB 0x202D
+#define WGL_MAX_PBUFFER_PIXELS_ARB 0x202E
+#define WGL_MAX_PBUFFER_WIDTH_ARB 0x202F
+#define WGL_MAX_PBUFFER_HEIGHT_ARB 0x2030
+#define WGL_PBUFFER_LARGEST_ARB 0x2033
+#define WGL_PBUFFER_WIDTH_ARB 0x2034
+#define WGL_PBUFFER_HEIGHT_ARB 0x2035
+#define WGL_PBUFFER_LOST_ARB 0x2036
+#endif
+
+#ifndef WGL_ARB_render_texture
+#define WGL_BIND_TO_TEXTURE_RGB_ARB 0x2070
+#define WGL_BIND_TO_TEXTURE_RGBA_ARB 0x2071
+#define WGL_TEXTURE_FORMAT_ARB 0x2072
+#define WGL_TEXTURE_TARGET_ARB 0x2073
+#define WGL_MIPMAP_TEXTURE_ARB 0x2074
+#define WGL_TEXTURE_RGB_ARB 0x2075
+#define WGL_TEXTURE_RGBA_ARB 0x2076
+#define WGL_NO_TEXTURE_ARB 0x2077
+#define WGL_TEXTURE_CUBE_MAP_ARB 0x2078
+#define WGL_TEXTURE_1D_ARB 0x2079
+#define WGL_TEXTURE_2D_ARB 0x207A
+#define WGL_MIPMAP_LEVEL_ARB 0x207B
+#define WGL_CUBE_MAP_FACE_ARB 0x207C
+#define WGL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB 0x207D
+#define WGL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB 0x207E
+#define WGL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB 0x207F
+#define WGL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB 0x2080
+#define WGL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB 0x2081
+#define WGL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB 0x2082
+#define WGL_FRONT_LEFT_ARB 0x2083
+#define WGL_FRONT_RIGHT_ARB 0x2084
+#define WGL_BACK_LEFT_ARB 0x2085
+#define WGL_BACK_RIGHT_ARB 0x2086
+#define WGL_AUX0_ARB 0x2087
+#define WGL_AUX1_ARB 0x2088
+#define WGL_AUX2_ARB 0x2089
+#define WGL_AUX3_ARB 0x208A
+#define WGL_AUX4_ARB 0x208B
+#define WGL_AUX5_ARB 0x208C
+#define WGL_AUX6_ARB 0x208D
+#define WGL_AUX7_ARB 0x208E
+#define WGL_AUX8_ARB 0x208F
+#define WGL_AUX9_ARB 0x2090
+#endif
+
+#ifndef WGL_ARB_pixel_format_float
+#define WGL_TYPE_RGBA_FLOAT_ARB 0x21A0
+#endif
+
+#ifndef WGL_ARB_create_context
+#define WGL_CONTEXT_DEBUG_BIT_ARB 0x0001
+#define WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB 0x0002
+#define WGL_CONTEXT_MAJOR_VERSION_ARB 0x2091
+#define WGL_CONTEXT_MINOR_VERSION_ARB 0x2092
+#define WGL_CONTEXT_LAYER_PLANE_ARB 0x2093
+#define WGL_CONTEXT_FLAGS_ARB 0x2094
+#define ERROR_INVALID_VERSION_ARB 0x2095
+#endif
+
+#ifndef WGL_EXT_make_current_read
+#define ERROR_INVALID_PIXEL_TYPE_EXT 0x2043
+#endif
+
+#ifndef WGL_EXT_pixel_format
+#define WGL_NUMBER_PIXEL_FORMATS_EXT 0x2000
+#define WGL_DRAW_TO_WINDOW_EXT 0x2001
+#define WGL_DRAW_TO_BITMAP_EXT 0x2002
+#define WGL_ACCELERATION_EXT 0x2003
+#define WGL_NEED_PALETTE_EXT 0x2004
+#define WGL_NEED_SYSTEM_PALETTE_EXT 0x2005
+#define WGL_SWAP_LAYER_BUFFERS_EXT 0x2006
+#define WGL_SWAP_METHOD_EXT 0x2007
+#define WGL_NUMBER_OVERLAYS_EXT 0x2008
+#define WGL_NUMBER_UNDERLAYS_EXT 0x2009
+#define WGL_TRANSPARENT_EXT 0x200A
+#define WGL_TRANSPARENT_VALUE_EXT 0x200B
+#define WGL_SHARE_DEPTH_EXT 0x200C
+#define WGL_SHARE_STENCIL_EXT 0x200D
+#define WGL_SHARE_ACCUM_EXT 0x200E
+#define WGL_SUPPORT_GDI_EXT 0x200F
+#define WGL_SUPPORT_OPENGL_EXT 0x2010
+#define WGL_DOUBLE_BUFFER_EXT 0x2011
+#define WGL_STEREO_EXT 0x2012
+#define WGL_PIXEL_TYPE_EXT 0x2013
+#define WGL_COLOR_BITS_EXT 0x2014
+#define WGL_RED_BITS_EXT 0x2015
+#define WGL_RED_SHIFT_EXT 0x2016
+#define WGL_GREEN_BITS_EXT 0x2017
+#define WGL_GREEN_SHIFT_EXT 0x2018
+#define WGL_BLUE_BITS_EXT 0x2019
+#define WGL_BLUE_SHIFT_EXT 0x201A
+#define WGL_ALPHA_BITS_EXT 0x201B
+#define WGL_ALPHA_SHIFT_EXT 0x201C
+#define WGL_ACCUM_BITS_EXT 0x201D
+#define WGL_ACCUM_RED_BITS_EXT 0x201E
+#define WGL_ACCUM_GREEN_BITS_EXT 0x201F
+#define WGL_ACCUM_BLUE_BITS_EXT 0x2020
+#define WGL_ACCUM_ALPHA_BITS_EXT 0x2021
+#define WGL_DEPTH_BITS_EXT 0x2022
+#define WGL_STENCIL_BITS_EXT 0x2023
+#define WGL_AUX_BUFFERS_EXT 0x2024
+#define WGL_NO_ACCELERATION_EXT 0x2025
+#define WGL_GENERIC_ACCELERATION_EXT 0x2026
+#define WGL_FULL_ACCELERATION_EXT 0x2027
+#define WGL_SWAP_EXCHANGE_EXT 0x2028
+#define WGL_SWAP_COPY_EXT 0x2029
+#define WGL_SWAP_UNDEFINED_EXT 0x202A
+#define WGL_TYPE_RGBA_EXT 0x202B
+#define WGL_TYPE_COLORINDEX_EXT 0x202C
+#endif
+
+#ifndef WGL_EXT_pbuffer
+#define WGL_DRAW_TO_PBUFFER_EXT 0x202D
+#define WGL_MAX_PBUFFER_PIXELS_EXT 0x202E
+#define WGL_MAX_PBUFFER_WIDTH_EXT 0x202F
+#define WGL_MAX_PBUFFER_HEIGHT_EXT 0x2030
+#define WGL_OPTIMAL_PBUFFER_WIDTH_EXT 0x2031
+#define WGL_OPTIMAL_PBUFFER_HEIGHT_EXT 0x2032
+#define WGL_PBUFFER_LARGEST_EXT 0x2033
+#define WGL_PBUFFER_WIDTH_EXT 0x2034
+#define WGL_PBUFFER_HEIGHT_EXT 0x2035
+#endif
+
+#ifndef WGL_EXT_depth_float
+#define WGL_DEPTH_FLOAT_EXT 0x2040
+#endif
+
+#ifndef WGL_3DFX_multisample
+#define WGL_SAMPLE_BUFFERS_3DFX 0x2060
+#define WGL_SAMPLES_3DFX 0x2061
+#endif
+
+#ifndef WGL_EXT_multisample
+#define WGL_SAMPLE_BUFFERS_EXT 0x2041
+#define WGL_SAMPLES_EXT 0x2042
+#endif
+
+#ifndef WGL_I3D_digital_video_control
+#define WGL_DIGITAL_VIDEO_CURSOR_ALPHA_FRAMEBUFFER_I3D 0x2050
+#define WGL_DIGITAL_VIDEO_CURSOR_ALPHA_VALUE_I3D 0x2051
+#define WGL_DIGITAL_VIDEO_CURSOR_INCLUDED_I3D 0x2052
+#define WGL_DIGITAL_VIDEO_GAMMA_CORRECTED_I3D 0x2053
+#endif
+
+#ifndef WGL_I3D_gamma
+#define WGL_GAMMA_TABLE_SIZE_I3D 0x204E
+#define WGL_GAMMA_EXCLUDE_DESKTOP_I3D 0x204F
+#endif
+
+#ifndef WGL_I3D_genlock
+#define WGL_GENLOCK_SOURCE_MULTIVIEW_I3D 0x2044
+#define WGL_GENLOCK_SOURCE_EXTENAL_SYNC_I3D 0x2045
+#define WGL_GENLOCK_SOURCE_EXTENAL_FIELD_I3D 0x2046
+#define WGL_GENLOCK_SOURCE_EXTENAL_TTL_I3D 0x2047
+#define WGL_GENLOCK_SOURCE_DIGITAL_SYNC_I3D 0x2048
+#define WGL_GENLOCK_SOURCE_DIGITAL_FIELD_I3D 0x2049
+#define WGL_GENLOCK_SOURCE_EDGE_FALLING_I3D 0x204A
+#define WGL_GENLOCK_SOURCE_EDGE_RISING_I3D 0x204B
+#define WGL_GENLOCK_SOURCE_EDGE_BOTH_I3D 0x204C
+#endif
+
+#ifndef WGL_I3D_image_buffer
+#define WGL_IMAGE_BUFFER_MIN_ACCESS_I3D 0x00000001
+#define WGL_IMAGE_BUFFER_LOCK_I3D 0x00000002
+#endif
+
+#ifndef WGL_I3D_swap_frame_lock
+#endif
+
+#ifndef WGL_NV_render_depth_texture
+#define WGL_BIND_TO_TEXTURE_DEPTH_NV 0x20A3
+#define WGL_BIND_TO_TEXTURE_RECTANGLE_DEPTH_NV 0x20A4
+#define WGL_DEPTH_TEXTURE_FORMAT_NV 0x20A5
+#define WGL_TEXTURE_DEPTH_COMPONENT_NV 0x20A6
+#define WGL_DEPTH_COMPONENT_NV 0x20A7
+#endif
+
+#ifndef WGL_NV_render_texture_rectangle
+#define WGL_BIND_TO_TEXTURE_RECTANGLE_RGB_NV 0x20A0
+#define WGL_BIND_TO_TEXTURE_RECTANGLE_RGBA_NV 0x20A1
+#define WGL_TEXTURE_RECTANGLE_NV 0x20A2
+#endif
+
+#ifndef WGL_ATI_pixel_format_float
+#define WGL_TYPE_RGBA_FLOAT_ATI 0x21A0
+#endif
+
+#ifndef WGL_NV_float_buffer
+#define WGL_FLOAT_COMPONENTS_NV 0x20B0
+#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_R_NV 0x20B1
+#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RG_NV 0x20B2
+#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RGB_NV 0x20B3
+#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RGBA_NV 0x20B4
+#define WGL_TEXTURE_FLOAT_R_NV 0x20B5
+#define WGL_TEXTURE_FLOAT_RG_NV 0x20B6
+#define WGL_TEXTURE_FLOAT_RGB_NV 0x20B7
+#define WGL_TEXTURE_FLOAT_RGBA_NV 0x20B8
+#endif
+
+#ifndef WGL_3DL_stereo_control
+#define WGL_STEREO_EMITTER_ENABLE_3DL 0x2055
+#define WGL_STEREO_EMITTER_DISABLE_3DL 0x2056
+#define WGL_STEREO_POLARITY_NORMAL_3DL 0x2057
+#define WGL_STEREO_POLARITY_INVERT_3DL 0x2058
+#endif
+
+#ifndef WGL_EXT_pixel_format_packed_float
+#define WGL_TYPE_RGBA_UNSIGNED_FLOAT_EXT 0x20A8
+#endif
+
+#ifndef WGL_EXT_framebuffer_sRGB
+#define WGL_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x20A9
+#endif
+
+#ifndef WGL_NV_present_video
+#define WGL_NUM_VIDEO_SLOTS_NV 0x20F0
+#endif
+
+#ifndef WGL_NV_video_out
+#define WGL_BIND_TO_VIDEO_RGB_NV 0x20C0
+#define WGL_BIND_TO_VIDEO_RGBA_NV 0x20C1
+#define WGL_BIND_TO_VIDEO_RGB_AND_DEPTH_NV 0x20C2
+#define WGL_VIDEO_OUT_COLOR_NV 0x20C3
+#define WGL_VIDEO_OUT_ALPHA_NV 0x20C4
+#define WGL_VIDEO_OUT_DEPTH_NV 0x20C5
+#define WGL_VIDEO_OUT_COLOR_AND_ALPHA_NV 0x20C6
+#define WGL_VIDEO_OUT_COLOR_AND_DEPTH_NV 0x20C7
+#define WGL_VIDEO_OUT_FRAME 0x20C8
+#define WGL_VIDEO_OUT_FIELD_1 0x20C9
+#define WGL_VIDEO_OUT_FIELD_2 0x20CA
+#define WGL_VIDEO_OUT_STACKED_FIELDS_1_2 0x20CB
+#define WGL_VIDEO_OUT_STACKED_FIELDS_2_1 0x20CC
+#endif
+
+#ifndef WGL_NV_swap_group
+#endif
+
+#ifndef WGL_NV_gpu_affinity
+#define WGL_ERROR_INCOMPATIBLE_AFFINITY_MASKS_NV 0x20D0
+#define WGL_ERROR_MISSING_AFFINITY_MASK_NV 0x20D1
+#endif
+
+#ifndef WGL_AMD_gpu_association
+#define WGL_GPU_VENDOR_AMD 0x1F00
+#define WGL_GPU_RENDERER_STRING_AMD 0x1F01
+#define WGL_GPU_OPENGL_VERSION_STRING_AMD 0x1F02
+#define WGL_GPU_FASTEST_TARGET_GPUS_AMD 0x21A2
+#define WGL_GPU_RAM_AMD 0x21A3
+#define WGL_GPU_CLOCK_AMD 0x21A4
+#define WGL_GPU_NUM_PIPES_AMD 0x21A5
+#define WGL_GPU_NUM_SIMD_AMD 0x21A6
+#define WGL_GPU_NUM_RB_AMD 0x21A7
+#define WGL_GPU_NUM_SPI_AMD 0x21A8
+#endif
+
+
+/*************************************************************/
+
+#ifndef WGL_ARB_pbuffer
+DECLARE_HANDLE(HPBUFFERARB);
+#endif
+#ifndef WGL_EXT_pbuffer
+DECLARE_HANDLE(HPBUFFEREXT);
+#endif
+#ifndef WGL_NV_present_video
+DECLARE_HANDLE(HVIDEOOUTPUTDEVICENV);
+#endif
+#ifndef WGL_NV_video_out
+DECLARE_HANDLE(HPVIDEODEV);
+#endif
+#ifndef WGL_NV_gpu_affinity
+DECLARE_HANDLE(HPGPUNV);
+DECLARE_HANDLE(HGPUNV);
+
+typedef struct _GPU_DEVICE {
+ DWORD cb;
+ CHAR DeviceName[32];
+ CHAR DeviceString[128];
+ DWORD Flags;
+ RECT rcVirtualScreen;
+} GPU_DEVICE, *PGPU_DEVICE;
+#endif
+
+#ifndef WGL_ARB_buffer_region
+#define WGL_ARB_buffer_region 1
+#ifdef WGL_WGLEXT_PROTOTYPES
+extern HANDLE WINAPI wglCreateBufferRegionARB (HDC, int, UINT);
+extern VOID WINAPI wglDeleteBufferRegionARB (HANDLE);
+extern BOOL WINAPI wglSaveBufferRegionARB (HANDLE, int, int, int, int);
+extern BOOL WINAPI wglRestoreBufferRegionARB (HANDLE, int, int, int, int, int, int);
+#endif /* WGL_WGLEXT_PROTOTYPES */
+typedef HANDLE (WINAPI * PFNWGLCREATEBUFFERREGIONARBPROC) (HDC hDC, int iLayerPlane, UINT uType);
+typedef VOID (WINAPI * PFNWGLDELETEBUFFERREGIONARBPROC) (HANDLE hRegion);
+typedef BOOL (WINAPI * PFNWGLSAVEBUFFERREGIONARBPROC) (HANDLE hRegion, int x, int y, int width, int height);
+typedef BOOL (WINAPI * PFNWGLRESTOREBUFFERREGIONARBPROC) (HANDLE hRegion, int x, int y, int width, int height, int xSrc, int ySrc);
+#endif
+
+#ifndef WGL_ARB_multisample
+#define WGL_ARB_multisample 1
+#endif
+
+#ifndef WGL_ARB_extensions_string
+#define WGL_ARB_extensions_string 1
+#ifdef WGL_WGLEXT_PROTOTYPES
+extern const char * WINAPI wglGetExtensionsStringARB (HDC);
+#endif /* WGL_WGLEXT_PROTOTYPES */
+typedef const char * (WINAPI * PFNWGLGETEXTENSIONSSTRINGARBPROC) (HDC hdc);
+#endif
+
+#ifndef WGL_ARB_pixel_format
+#define WGL_ARB_pixel_format 1
+#ifdef WGL_WGLEXT_PROTOTYPES
+extern BOOL WINAPI wglGetPixelFormatAttribivARB (HDC, int, int, UINT, const int *, int *);
+extern BOOL WINAPI wglGetPixelFormatAttribfvARB (HDC, int, int, UINT, const int *, FLOAT *);
+extern BOOL WINAPI wglChoosePixelFormatARB (HDC, const int *, const FLOAT *, UINT, int *, UINT *);
+#endif /* WGL_WGLEXT_PROTOTYPES */
+typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBIVARBPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int *piAttributes, int *piValues);
+typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBFVARBPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int *piAttributes, FLOAT *pfValues);
+typedef BOOL (WINAPI * PFNWGLCHOOSEPIXELFORMATARBPROC) (HDC hdc, const int *piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats);
+#endif
+
+#ifndef WGL_ARB_make_current_read
+#define WGL_ARB_make_current_read 1
+#ifdef WGL_WGLEXT_PROTOTYPES
+extern BOOL WINAPI wglMakeContextCurrentARB (HDC, HDC, HGLRC);
+extern HDC WINAPI wglGetCurrentReadDCARB (void);
+#endif /* WGL_WGLEXT_PROTOTYPES */
+typedef BOOL (WINAPI * PFNWGLMAKECONTEXTCURRENTARBPROC) (HDC hDrawDC, HDC hReadDC, HGLRC hglrc);
+typedef HDC (WINAPI * PFNWGLGETCURRENTREADDCARBPROC) (void);
+#endif
+
+#ifndef WGL_ARB_pbuffer
+#define WGL_ARB_pbuffer 1
+#ifdef WGL_WGLEXT_PROTOTYPES
+extern HPBUFFERARB WINAPI wglCreatePbufferARB (HDC, int, int, int, const int *);
+extern HDC WINAPI wglGetPbufferDCARB (HPBUFFERARB);
+extern int WINAPI wglReleasePbufferDCARB (HPBUFFERARB, HDC);
+extern BOOL WINAPI wglDestroyPbufferARB (HPBUFFERARB);
+extern BOOL WINAPI wglQueryPbufferARB (HPBUFFERARB, int, int *);
+#endif /* WGL_WGLEXT_PROTOTYPES */
+typedef HPBUFFERARB (WINAPI * PFNWGLCREATEPBUFFERARBPROC) (HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int *piAttribList);
+typedef HDC (WINAPI * PFNWGLGETPBUFFERDCARBPROC) (HPBUFFERARB hPbuffer);
+typedef int (WINAPI * PFNWGLRELEASEPBUFFERDCARBPROC) (HPBUFFERARB hPbuffer, HDC hDC);
+typedef BOOL (WINAPI * PFNWGLDESTROYPBUFFERARBPROC) (HPBUFFERARB hPbuffer);
+typedef BOOL (WINAPI * PFNWGLQUERYPBUFFERARBPROC) (HPBUFFERARB hPbuffer, int iAttribute, int *piValue);
+#endif
+
+#ifndef WGL_ARB_render_texture
+#define WGL_ARB_render_texture 1
+#ifdef WGL_WGLEXT_PROTOTYPES
+extern BOOL WINAPI wglBindTexImageARB (HPBUFFERARB, int);
+extern BOOL WINAPI wglReleaseTexImageARB (HPBUFFERARB, int);
+extern BOOL WINAPI wglSetPbufferAttribARB (HPBUFFERARB, const int *);
+#endif /* WGL_WGLEXT_PROTOTYPES */
+typedef BOOL (WINAPI * PFNWGLBINDTEXIMAGEARBPROC) (HPBUFFERARB hPbuffer, int iBuffer);
+typedef BOOL (WINAPI * PFNWGLRELEASETEXIMAGEARBPROC) (HPBUFFERARB hPbuffer, int iBuffer);
+typedef BOOL (WINAPI * PFNWGLSETPBUFFERATTRIBARBPROC) (HPBUFFERARB hPbuffer, const int *piAttribList);
+#endif
+
+#ifndef WGL_ARB_pixel_format_float
+#define WGL_ARB_pixel_format_float 1
+#endif
+
+#ifndef WGL_ARB_create_context
+#define WGL_ARB_create_context 1
+#ifdef WGL_WGLEXT_PROTOTYPES
+extern HGLRC WINAPI wglCreateContextAttribsARB (HDC, HGLRC, const int *);
+#endif /* WGL_WGLEXT_PROTOTYPES */
+typedef HGLRC (WINAPI * PFNWGLCREATECONTEXTATTRIBSARBPROC) (HDC hDC, HGLRC hShareContext, const int *attribList);
+#endif
+
+#ifndef WGL_EXT_display_color_table
+#define WGL_EXT_display_color_table 1
+#ifdef WGL_WGLEXT_PROTOTYPES
+extern GLboolean WINAPI wglCreateDisplayColorTableEXT (GLushort);
+extern GLboolean WINAPI wglLoadDisplayColorTableEXT (const GLushort *, GLuint);
+extern GLboolean WINAPI wglBindDisplayColorTableEXT (GLushort);
+extern VOID WINAPI wglDestroyDisplayColorTableEXT (GLushort);
+#endif /* WGL_WGLEXT_PROTOTYPES */
+typedef GLboolean (WINAPI * PFNWGLCREATEDISPLAYCOLORTABLEEXTPROC) (GLushort id);
+typedef GLboolean (WINAPI * PFNWGLLOADDISPLAYCOLORTABLEEXTPROC) (const GLushort *table, GLuint length);
+typedef GLboolean (WINAPI * PFNWGLBINDDISPLAYCOLORTABLEEXTPROC) (GLushort id);
+typedef VOID (WINAPI * PFNWGLDESTROYDISPLAYCOLORTABLEEXTPROC) (GLushort id);
+#endif
+
+#ifndef WGL_EXT_extensions_string
+#define WGL_EXT_extensions_string 1
+#ifdef WGL_WGLEXT_PROTOTYPES
+extern const char * WINAPI wglGetExtensionsStringEXT (void);
+#endif /* WGL_WGLEXT_PROTOTYPES */
+typedef const char * (WINAPI * PFNWGLGETEXTENSIONSSTRINGEXTPROC) (void);
+#endif
+
+#ifndef WGL_EXT_make_current_read
+#define WGL_EXT_make_current_read 1
+#ifdef WGL_WGLEXT_PROTOTYPES
+extern BOOL WINAPI wglMakeContextCurrentEXT (HDC, HDC, HGLRC);
+extern HDC WINAPI wglGetCurrentReadDCEXT (void);
+#endif /* WGL_WGLEXT_PROTOTYPES */
+typedef BOOL (WINAPI * PFNWGLMAKECONTEXTCURRENTEXTPROC) (HDC hDrawDC, HDC hReadDC, HGLRC hglrc);
+typedef HDC (WINAPI * PFNWGLGETCURRENTREADDCEXTPROC) (void);
+#endif
+
+#ifndef WGL_EXT_pbuffer
+#define WGL_EXT_pbuffer 1
+#ifdef WGL_WGLEXT_PROTOTYPES
+extern HPBUFFEREXT WINAPI wglCreatePbufferEXT (HDC, int, int, int, const int *);
+extern HDC WINAPI wglGetPbufferDCEXT (HPBUFFEREXT);
+extern int WINAPI wglReleasePbufferDCEXT (HPBUFFEREXT, HDC);
+extern BOOL WINAPI wglDestroyPbufferEXT (HPBUFFEREXT);
+extern BOOL WINAPI wglQueryPbufferEXT (HPBUFFEREXT, int, int *);
+#endif /* WGL_WGLEXT_PROTOTYPES */
+typedef HPBUFFEREXT (WINAPI * PFNWGLCREATEPBUFFEREXTPROC) (HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int *piAttribList);
+typedef HDC (WINAPI * PFNWGLGETPBUFFERDCEXTPROC) (HPBUFFEREXT hPbuffer);
+typedef int (WINAPI * PFNWGLRELEASEPBUFFERDCEXTPROC) (HPBUFFEREXT hPbuffer, HDC hDC);
+typedef BOOL (WINAPI * PFNWGLDESTROYPBUFFEREXTPROC) (HPBUFFEREXT hPbuffer);
+typedef BOOL (WINAPI * PFNWGLQUERYPBUFFEREXTPROC) (HPBUFFEREXT hPbuffer, int iAttribute, int *piValue);
+#endif
+
+#ifndef WGL_EXT_pixel_format
+#define WGL_EXT_pixel_format 1
+#ifdef WGL_WGLEXT_PROTOTYPES
+extern BOOL WINAPI wglGetPixelFormatAttribivEXT (HDC, int, int, UINT, int *, int *);
+extern BOOL WINAPI wglGetPixelFormatAttribfvEXT (HDC, int, int, UINT, int *, FLOAT *);
+extern BOOL WINAPI wglChoosePixelFormatEXT (HDC, const int *, const FLOAT *, UINT, int *, UINT *);
+#endif /* WGL_WGLEXT_PROTOTYPES */
+typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBIVEXTPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int *piAttributes, int *piValues);
+typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBFVEXTPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int *piAttributes, FLOAT *pfValues);
+typedef BOOL (WINAPI * PFNWGLCHOOSEPIXELFORMATEXTPROC) (HDC hdc, const int *piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats);
+#endif
+
+#ifndef WGL_EXT_swap_control
+#define WGL_EXT_swap_control 1
+#ifdef WGL_WGLEXT_PROTOTYPES
+extern BOOL WINAPI wglSwapIntervalEXT (int);
+extern int WINAPI wglGetSwapIntervalEXT (void);
+#endif /* WGL_WGLEXT_PROTOTYPES */
+typedef BOOL (WINAPI * PFNWGLSWAPINTERVALEXTPROC) (int interval);
+typedef int (WINAPI * PFNWGLGETSWAPINTERVALEXTPROC) (void);
+#endif
+
+#ifndef WGL_EXT_depth_float
+#define WGL_EXT_depth_float 1
+#endif
+
+#ifndef WGL_NV_vertex_array_range
+#define WGL_NV_vertex_array_range 1
+#ifdef WGL_WGLEXT_PROTOTYPES
+extern void* WINAPI wglAllocateMemoryNV (GLsizei, GLfloat, GLfloat, GLfloat);
+extern void WINAPI wglFreeMemoryNV (void *);
+#endif /* WGL_WGLEXT_PROTOTYPES */
+typedef void* (WINAPI * PFNWGLALLOCATEMEMORYNVPROC) (GLsizei size, GLfloat readfreq, GLfloat writefreq, GLfloat priority);
+typedef void (WINAPI * PFNWGLFREEMEMORYNVPROC) (void *pointer);
+#endif
+
+#ifndef WGL_3DFX_multisample
+#define WGL_3DFX_multisample 1
+#endif
+
+#ifndef WGL_EXT_multisample
+#define WGL_EXT_multisample 1
+#endif
+
+#ifndef WGL_OML_sync_control
+#define WGL_OML_sync_control 1
+#ifdef WGL_WGLEXT_PROTOTYPES
+extern BOOL WINAPI wglGetSyncValuesOML (HDC, INT64 *, INT64 *, INT64 *);
+extern BOOL WINAPI wglGetMscRateOML (HDC, INT32 *, INT32 *);
+extern INT64 WINAPI wglSwapBuffersMscOML (HDC, INT64, INT64, INT64);
+extern INT64 WINAPI wglSwapLayerBuffersMscOML (HDC, int, INT64, INT64, INT64);
+extern BOOL WINAPI wglWaitForMscOML (HDC, INT64, INT64, INT64, INT64 *, INT64 *, INT64 *);
+extern BOOL WINAPI wglWaitForSbcOML (HDC, INT64, INT64 *, INT64 *, INT64 *);
+#endif /* WGL_WGLEXT_PROTOTYPES */
+typedef BOOL (WINAPI * PFNWGLGETSYNCVALUESOMLPROC) (HDC hdc, INT64 *ust, INT64 *msc, INT64 *sbc);
+typedef BOOL (WINAPI * PFNWGLGETMSCRATEOMLPROC) (HDC hdc, INT32 *numerator, INT32 *denominator);
+typedef INT64 (WINAPI * PFNWGLSWAPBUFFERSMSCOMLPROC) (HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder);
+typedef INT64 (WINAPI * PFNWGLSWAPLAYERBUFFERSMSCOMLPROC) (HDC hdc, int fuPlanes, INT64 target_msc, INT64 divisor, INT64 remainder);
+typedef BOOL (WINAPI * PFNWGLWAITFORMSCOMLPROC) (HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder, INT64 *ust, INT64 *msc, INT64 *sbc);
+typedef BOOL (WINAPI * PFNWGLWAITFORSBCOMLPROC) (HDC hdc, INT64 target_sbc, INT64 *ust, INT64 *msc, INT64 *sbc);
+#endif
+
+#ifndef WGL_I3D_digital_video_control
+#define WGL_I3D_digital_video_control 1
+#ifdef WGL_WGLEXT_PROTOTYPES
+extern BOOL WINAPI wglGetDigitalVideoParametersI3D (HDC, int, int *);
+extern BOOL WINAPI wglSetDigitalVideoParametersI3D (HDC, int, const int *);
+#endif /* WGL_WGLEXT_PROTOTYPES */
+typedef BOOL (WINAPI * PFNWGLGETDIGITALVIDEOPARAMETERSI3DPROC) (HDC hDC, int iAttribute, int *piValue);
+typedef BOOL (WINAPI * PFNWGLSETDIGITALVIDEOPARAMETERSI3DPROC) (HDC hDC, int iAttribute, const int *piValue);
+#endif
+
+#ifndef WGL_I3D_gamma
+#define WGL_I3D_gamma 1
+#ifdef WGL_WGLEXT_PROTOTYPES
+extern BOOL WINAPI wglGetGammaTableParametersI3D (HDC, int, int *);
+extern BOOL WINAPI wglSetGammaTableParametersI3D (HDC, int, const int *);
+extern BOOL WINAPI wglGetGammaTableI3D (HDC, int, USHORT *, USHORT *, USHORT *);
+extern BOOL WINAPI wglSetGammaTableI3D (HDC, int, const USHORT *, const USHORT *, const USHORT *);
+#endif /* WGL_WGLEXT_PROTOTYPES */
+typedef BOOL (WINAPI * PFNWGLGETGAMMATABLEPARAMETERSI3DPROC) (HDC hDC, int iAttribute, int *piValue);
+typedef BOOL (WINAPI * PFNWGLSETGAMMATABLEPARAMETERSI3DPROC) (HDC hDC, int iAttribute, const int *piValue);
+typedef BOOL (WINAPI * PFNWGLGETGAMMATABLEI3DPROC) (HDC hDC, int iEntries, USHORT *puRed, USHORT *puGreen, USHORT *puBlue);
+typedef BOOL (WINAPI * PFNWGLSETGAMMATABLEI3DPROC) (HDC hDC, int iEntries, const USHORT *puRed, const USHORT *puGreen, const USHORT *puBlue);
+#endif
+
+#ifndef WGL_I3D_genlock
+#define WGL_I3D_genlock 1
+#ifdef WGL_WGLEXT_PROTOTYPES
+extern BOOL WINAPI wglEnableGenlockI3D (HDC);
+extern BOOL WINAPI wglDisableGenlockI3D (HDC);
+extern BOOL WINAPI wglIsEnabledGenlockI3D (HDC, BOOL *);
+extern BOOL WINAPI wglGenlockSourceI3D (HDC, UINT);
+extern BOOL WINAPI wglGetGenlockSourceI3D (HDC, UINT *);
+extern BOOL WINAPI wglGenlockSourceEdgeI3D (HDC, UINT);
+extern BOOL WINAPI wglGetGenlockSourceEdgeI3D (HDC, UINT *);
+extern BOOL WINAPI wglGenlockSampleRateI3D (HDC, UINT);
+extern BOOL WINAPI wglGetGenlockSampleRateI3D (HDC, UINT *);
+extern BOOL WINAPI wglGenlockSourceDelayI3D (HDC, UINT);
+extern BOOL WINAPI wglGetGenlockSourceDelayI3D (HDC, UINT *);
+extern BOOL WINAPI wglQueryGenlockMaxSourceDelayI3D (HDC, UINT *, UINT *);
+#endif /* WGL_WGLEXT_PROTOTYPES */
+typedef BOOL (WINAPI * PFNWGLENABLEGENLOCKI3DPROC) (HDC hDC);
+typedef BOOL (WINAPI * PFNWGLDISABLEGENLOCKI3DPROC) (HDC hDC);
+typedef BOOL (WINAPI * PFNWGLISENABLEDGENLOCKI3DPROC) (HDC hDC, BOOL *pFlag);
+typedef BOOL (WINAPI * PFNWGLGENLOCKSOURCEI3DPROC) (HDC hDC, UINT uSource);
+typedef BOOL (WINAPI * PFNWGLGETGENLOCKSOURCEI3DPROC) (HDC hDC, UINT *uSource);
+typedef BOOL (WINAPI * PFNWGLGENLOCKSOURCEEDGEI3DPROC) (HDC hDC, UINT uEdge);
+typedef BOOL (WINAPI * PFNWGLGETGENLOCKSOURCEEDGEI3DPROC) (HDC hDC, UINT *uEdge);
+typedef BOOL (WINAPI * PFNWGLGENLOCKSAMPLERATEI3DPROC) (HDC hDC, UINT uRate);
+typedef BOOL (WINAPI * PFNWGLGETGENLOCKSAMPLERATEI3DPROC) (HDC hDC, UINT *uRate);
+typedef BOOL (WINAPI * PFNWGLGENLOCKSOURCEDELAYI3DPROC) (HDC hDC, UINT uDelay);
+typedef BOOL (WINAPI * PFNWGLGETGENLOCKSOURCEDELAYI3DPROC) (HDC hDC, UINT *uDelay);
+typedef BOOL (WINAPI * PFNWGLQUERYGENLOCKMAXSOURCEDELAYI3DPROC) (HDC hDC, UINT *uMaxLineDelay, UINT *uMaxPixelDelay);
+#endif
+
+#ifndef WGL_I3D_image_buffer
+#define WGL_I3D_image_buffer 1
+#ifdef WGL_WGLEXT_PROTOTYPES
+extern LPVOID WINAPI wglCreateImageBufferI3D (HDC, DWORD, UINT);
+extern BOOL WINAPI wglDestroyImageBufferI3D (HDC, LPVOID);
+extern BOOL WINAPI wglAssociateImageBufferEventsI3D (HDC, const HANDLE *, const LPVOID *, const DWORD *, UINT);
+extern BOOL WINAPI wglReleaseImageBufferEventsI3D (HDC, const LPVOID *, UINT);
+#endif /* WGL_WGLEXT_PROTOTYPES */
+typedef LPVOID (WINAPI * PFNWGLCREATEIMAGEBUFFERI3DPROC) (HDC hDC, DWORD dwSize, UINT uFlags);
+typedef BOOL (WINAPI * PFNWGLDESTROYIMAGEBUFFERI3DPROC) (HDC hDC, LPVOID pAddress);
+typedef BOOL (WINAPI * PFNWGLASSOCIATEIMAGEBUFFEREVENTSI3DPROC) (HDC hDC, const HANDLE *pEvent, const LPVOID *pAddress, const DWORD *pSize, UINT count);
+typedef BOOL (WINAPI * PFNWGLRELEASEIMAGEBUFFEREVENTSI3DPROC) (HDC hDC, const LPVOID *pAddress, UINT count);
+#endif
+
+#ifndef WGL_I3D_swap_frame_lock
+#define WGL_I3D_swap_frame_lock 1
+#ifdef WGL_WGLEXT_PROTOTYPES
+extern BOOL WINAPI wglEnableFrameLockI3D (void);
+extern BOOL WINAPI wglDisableFrameLockI3D (void);
+extern BOOL WINAPI wglIsEnabledFrameLockI3D (BOOL *);
+extern BOOL WINAPI wglQueryFrameLockMasterI3D (BOOL *);
+#endif /* WGL_WGLEXT_PROTOTYPES */
+typedef BOOL (WINAPI * PFNWGLENABLEFRAMELOCKI3DPROC) (void);
+typedef BOOL (WINAPI * PFNWGLDISABLEFRAMELOCKI3DPROC) (void);
+typedef BOOL (WINAPI * PFNWGLISENABLEDFRAMELOCKI3DPROC) (BOOL *pFlag);
+typedef BOOL (WINAPI * PFNWGLQUERYFRAMELOCKMASTERI3DPROC) (BOOL *pFlag);
+#endif
+
+#ifndef WGL_I3D_swap_frame_usage
+#define WGL_I3D_swap_frame_usage 1
+#ifdef WGL_WGLEXT_PROTOTYPES
+extern BOOL WINAPI wglGetFrameUsageI3D (float *);
+extern BOOL WINAPI wglBeginFrameTrackingI3D (void);
+extern BOOL WINAPI wglEndFrameTrackingI3D (void);
+extern BOOL WINAPI wglQueryFrameTrackingI3D (DWORD *, DWORD *, float *);
+#endif /* WGL_WGLEXT_PROTOTYPES */
+typedef BOOL (WINAPI * PFNWGLGETFRAMEUSAGEI3DPROC) (float *pUsage);
+typedef BOOL (WINAPI * PFNWGLBEGINFRAMETRACKINGI3DPROC) (void);
+typedef BOOL (WINAPI * PFNWGLENDFRAMETRACKINGI3DPROC) (void);
+typedef BOOL (WINAPI * PFNWGLQUERYFRAMETRACKINGI3DPROC) (DWORD *pFrameCount, DWORD *pMissedFrames, float *pLastMissedUsage);
+#endif
+
+#ifndef WGL_ATI_pixel_format_float
+#define WGL_ATI_pixel_format_float 1
+#endif
+
+#ifndef WGL_NV_float_buffer
+#define WGL_NV_float_buffer 1
+#endif
+
+#ifndef WGL_EXT_pixel_format_packed_float
+#define WGL_EXT_pixel_format_packed_float 1
+#endif
+
+#ifndef WGL_EXT_framebuffer_sRGB
+#define WGL_EXT_framebuffer_sRGB 1
+#endif
+
+#ifndef WGL_NV_present_video
+#define WGL_NV_present_video 1
+#ifdef WGL_WGLEXT_PROTOTYPES
+extern int WINAPI wglEnumerateVideoDevicesNV (HDC, HVIDEOOUTPUTDEVICENV *);
+extern BOOL WINAPI wglBindVideoDeviceNV (HDC, unsigned int, HVIDEOOUTPUTDEVICENV, const int *);
+extern BOOL WINAPI wglQueryCurrentContextNV (int, int *);
+#endif /* WGL_WGLEXT_PROTOTYPES */
+typedef int (WINAPI * PFNWGLENUMERATEVIDEODEVICESNVPROC) (HDC hDC, HVIDEOOUTPUTDEVICENV *phDeviceList);
+typedef BOOL (WINAPI * PFNWGLBINDVIDEODEVICENVPROC) (HDC hDC, unsigned int uVideoSlot, HVIDEOOUTPUTDEVICENV hVideoDevice, const int *piAttribList);
+typedef BOOL (WINAPI * PFNWGLQUERYCURRENTCONTEXTNVPROC) (int iAttribute, int *piValue);
+#endif
+
+#ifndef WGL_NV_video_out
+#define WGL_NV_video_out 1
+#ifdef WGL_WGLEXT_PROTOTYPES
+extern BOOL WINAPI wglGetVideoDeviceNV (HDC, int, HPVIDEODEV *);
+extern BOOL WINAPI wglReleaseVideoDeviceNV (HPVIDEODEV);
+extern BOOL WINAPI wglBindVideoImageNV (HPVIDEODEV, HPBUFFERARB, int);
+extern BOOL WINAPI wglReleaseVideoImageNV (HPBUFFERARB, int);
+extern BOOL WINAPI wglSendPbufferToVideoNV (HPBUFFERARB, int, unsigned long *, BOOL);
+extern BOOL WINAPI wglGetVideoInfoNV (HPVIDEODEV, unsigned long *, unsigned long *);
+#endif /* WGL_WGLEXT_PROTOTYPES */
+typedef BOOL (WINAPI * PFNWGLGETVIDEODEVICENVPROC) (HDC hDC, int numDevices, HPVIDEODEV *hVideoDevice);
+typedef BOOL (WINAPI * PFNWGLRELEASEVIDEODEVICENVPROC) (HPVIDEODEV hVideoDevice);
+typedef BOOL (WINAPI * PFNWGLBINDVIDEOIMAGENVPROC) (HPVIDEODEV hVideoDevice, HPBUFFERARB hPbuffer, int iVideoBuffer);
+typedef BOOL (WINAPI * PFNWGLRELEASEVIDEOIMAGENVPROC) (HPBUFFERARB hPbuffer, int iVideoBuffer);
+typedef BOOL (WINAPI * PFNWGLSENDPBUFFERTOVIDEONVPROC) (HPBUFFERARB hPbuffer, int iBufferType, unsigned long *pulCounterPbuffer, BOOL bBlock);
+typedef BOOL (WINAPI * PFNWGLGETVIDEOINFONVPROC) (HPVIDEODEV hpVideoDevice, unsigned long *pulCounterOutputPbuffer, unsigned long *pulCounterOutputVideo);
+#endif
+
+#ifndef WGL_NV_swap_group
+#define WGL_NV_swap_group 1
+#ifdef WGL_WGLEXT_PROTOTYPES
+extern BOOL WINAPI wglJoinSwapGroupNV (HDC, GLuint);
+extern BOOL WINAPI wglBindSwapBarrierNV (GLuint, GLuint);
+extern BOOL WINAPI wglQuerySwapGroupNV (HDC, GLuint *, GLuint *);
+extern BOOL WINAPI wglQueryMaxSwapGroupsNV (HDC, GLuint *, GLuint *);
+extern BOOL WINAPI wglQueryFrameCountNV (HDC, GLuint *);
+extern BOOL WINAPI wglResetFrameCountNV (HDC);
+#endif /* WGL_WGLEXT_PROTOTYPES */
+typedef BOOL (WINAPI * PFNWGLJOINSWAPGROUPNVPROC) (HDC hDC, GLuint group);
+typedef BOOL (WINAPI * PFNWGLBINDSWAPBARRIERNVPROC) (GLuint group, GLuint barrier);
+typedef BOOL (WINAPI * PFNWGLQUERYSWAPGROUPNVPROC) (HDC hDC, GLuint *group, GLuint *barrier);
+typedef BOOL (WINAPI * PFNWGLQUERYMAXSWAPGROUPSNVPROC) (HDC hDC, GLuint *maxGroups, GLuint *maxBarriers);
+typedef BOOL (WINAPI * PFNWGLQUERYFRAMECOUNTNVPROC) (HDC hDC, GLuint *count);
+typedef BOOL (WINAPI * PFNWGLRESETFRAMECOUNTNVPROC) (HDC hDC);
+#endif
+
+#ifndef WGL_NV_gpu_affinity
+#define WGL_NV_gpu_affinity 1
+#ifdef WGL_WGLEXT_PROTOTYPES
+extern BOOL WINAPI wglEnumGpusNV (UINT, HGPUNV *);
+extern BOOL WINAPI wglEnumGpuDevicesNV (HGPUNV, UINT, PGPU_DEVICE);
+extern HDC WINAPI wglCreateAffinityDCNV (const HGPUNV *);
+extern BOOL WINAPI wglEnumGpusFromAffinityDCNV (HDC, UINT, HGPUNV *);
+extern BOOL WINAPI wglDeleteDCNV (HDC);
+#endif /* WGL_WGLEXT_PROTOTYPES */
+typedef BOOL (WINAPI * PFNWGLENUMGPUSNVPROC) (UINT iGpuIndex, HGPUNV *phGpu);
+typedef BOOL (WINAPI * PFNWGLENUMGPUDEVICESNVPROC) (HGPUNV hGpu, UINT iDeviceIndex, PGPU_DEVICE lpGpuDevice);
+typedef HDC (WINAPI * PFNWGLCREATEAFFINITYDCNVPROC) (const HGPUNV *phGpuList);
+typedef BOOL (WINAPI * PFNWGLENUMGPUSFROMAFFINITYDCNVPROC) (HDC hAffinityDC, UINT iGpuIndex, HGPUNV *hGpu);
+typedef BOOL (WINAPI * PFNWGLDELETEDCNVPROC) (HDC hdc);
+#endif
+
+#ifndef WGL_AMD_gpu_association
+#define WGL_AMD_gpu_association 1
+#ifdef WGL_WGLEXT_PROTOTYPES
+extern UINT WINAPI wglGetGPUIDsAMD (UINT, UINT *);
+extern INT WINAPI wglGetGPUInfoAMD (UINT, int, GLenum, UINT, void *);
+extern UINT WINAPI wglGetContextGPUIDAMD (HGLRC);
+extern HGLRC WINAPI wglCreateAssociatedContextAMD (UINT);
+extern HGLRC WINAPI wglCreateAssociatedContextAttribsAMD (UINT, HGLRC, const int *);
+extern BOOL WINAPI wglDeleteAssociatedContextAMD (HGLRC);
+extern BOOL WINAPI wglMakeAssociatedContextCurrentAMD (HGLRC);
+extern HGLRC WINAPI wglGetCurrentAssociatedContextAMD (void);
+extern VOID WINAPI wglBlitContextFramebufferAMD (HGLRC, GLint, GLint, GLint, GLint, GLint, GLint, GLint, GLint, GLbitfield, GLenum);
+#endif /* WGL_WGLEXT_PROTOTYPES */
+typedef UINT (WINAPI * PFNWGLGETGPUIDSAMDPROC) (UINT maxCount, UINT *ids);
+typedef INT (WINAPI * PFNWGLGETGPUINFOAMDPROC) (UINT id, int property, GLenum dataType, UINT size, void *data);
+typedef UINT (WINAPI * PFNWGLGETCONTEXTGPUIDAMDPROC) (HGLRC hglrc);
+typedef HGLRC (WINAPI * PFNWGLCREATEASSOCIATEDCONTEXTAMDPROC) (UINT id);
+typedef HGLRC (WINAPI * PFNWGLCREATEASSOCIATEDCONTEXTATTRIBSAMDPROC) (UINT id, HGLRC hShareContext, const int *attribList);
+typedef BOOL (WINAPI * PFNWGLDELETEASSOCIATEDCONTEXTAMDPROC) (HGLRC hglrc);
+typedef BOOL (WINAPI * PFNWGLMAKEASSOCIATEDCONTEXTCURRENTAMDPROC) (HGLRC hglrc);
+typedef HGLRC (WINAPI * PFNWGLGETCURRENTASSOCIATEDCONTEXTAMDPROC) (void);
+typedef VOID (WINAPI * PFNWGLBLITCONTEXTFRAMEBUFFERAMDPROC) (HGLRC dstCtx, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
+#endif
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/progs/SConscript b/progs/SConscript
index 6484c761fc5..71ebe5e0f37 100644
--- a/progs/SConscript
+++ b/progs/SConscript
@@ -3,6 +3,10 @@ SConscript([
'demos/SConscript',
'redbook/SConscript',
'samples/SConscript',
+ 'tests/SConscript',
'trivial/SConscript',
'vp/SConscript',
+ 'vpglsl/SConscript',
+ 'fp/SConscript',
+ 'wgl/SConscript',
])
diff --git a/progs/demos/arbfplight.c b/progs/demos/arbfplight.c
index 401bfb49684..7b7a12bf88d 100644
--- a/progs/demos/arbfplight.c
+++ b/progs/demos/arbfplight.c
@@ -92,6 +92,7 @@ static void Redisplay( void )
GLfloat seconds = (t - T0) / 1000.0;
GLfloat fps = Frames / seconds;
printf("%d frames in %6.3f seconds = %6.3f FPS\n", Frames, seconds, fps);
+ fflush(stdout);
T0 = t;
Frames = 0;
}
diff --git a/progs/demos/arbfslight.c b/progs/demos/arbfslight.c
index a84491d34fe..275c85105ed 100644
--- a/progs/demos/arbfslight.c
+++ b/progs/demos/arbfslight.c
@@ -105,6 +105,7 @@ static void Redisplay (void)
GLfloat seconds = (GLfloat) (t - t0) / 1000.0f;
GLfloat fps = frames / seconds;
printf ("%d frames in %6.3f seconds = %6.3f FPS\n", frames, seconds, fps);
+ fflush(stdout);
t0 = t;
frames = 0;
}
diff --git a/progs/demos/cubemap.c b/progs/demos/cubemap.c
index b3bdd64f68d..26db42aed5e 100644
--- a/progs/demos/cubemap.c
+++ b/progs/demos/cubemap.c
@@ -39,6 +39,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <GL/glew.h>
#include "GL/glut.h"
#include "readtex.h"
@@ -49,6 +50,45 @@ static GLboolean use_vertex_arrays = GL_FALSE;
static GLboolean anim = GL_TRUE;
static GLboolean NoClear = GL_FALSE;
static GLint FrameParity = 0;
+static GLenum FilterIndex = 0;
+static GLint ClampIndex = 0;
+
+
+static struct {
+ GLenum mode;
+ const char *name;
+} ClampModes[] = {
+ { GL_CLAMP_TO_EDGE, "GL_CLAMP_TO_EDGE" },
+ { GL_CLAMP_TO_BORDER, "GL_CLAMP_TO_BORDER" },
+ { GL_CLAMP, "GL_CLAMP" },
+ { GL_REPEAT, "GL_REPEAT" }
+};
+
+#define NUM_CLAMP_MODES (sizeof(ClampModes) / sizeof(ClampModes[0]))
+
+
+static struct {
+ GLenum mag_mode, min_mode;
+ const char *name;
+} FilterModes[] = {
+ { GL_NEAREST, GL_NEAREST, "GL_NEAREST, GL_NEAREST" },
+ { GL_NEAREST, GL_LINEAR, "GL_NEAREST, GL_LINEAR" },
+ { GL_NEAREST, GL_NEAREST_MIPMAP_NEAREST, "GL_NEAREST, GL_NEAREST_MIPMAP_NEAREST" },
+ { GL_NEAREST, GL_NEAREST_MIPMAP_LINEAR, "GL_NEAREST, GL_NEAREST_MIPMAP_LINEAR" },
+ { GL_NEAREST, GL_LINEAR_MIPMAP_NEAREST, "GL_NEAREST, GL_LINEAR_MIPMAP_NEAREST" },
+ { GL_NEAREST, GL_LINEAR_MIPMAP_LINEAR, "GL_NEAREST, GL_LINEAR_MIPMAP_LINEAR" },
+
+ { GL_LINEAR, GL_NEAREST, "GL_LINEAR, GL_NEAREST" },
+ { GL_LINEAR, GL_LINEAR, "GL_LINEAR, GL_LINEAR" },
+ { GL_LINEAR, GL_NEAREST_MIPMAP_NEAREST, "GL_LINEAR, GL_NEAREST_MIPMAP_NEAREST" },
+ { GL_LINEAR, GL_NEAREST_MIPMAP_LINEAR, "GL_LINEAR, GL_NEAREST_MIPMAP_LINEAR" },
+ { GL_LINEAR, GL_LINEAR_MIPMAP_NEAREST, "GL_LINEAR, GL_LINEAR_MIPMAP_NEAREST" },
+ { GL_LINEAR, GL_LINEAR_MIPMAP_LINEAR, "GL_LINEAR, GL_LINEAR_MIPMAP_LINEAR" }
+};
+
+#define NUM_FILTER_MODES (sizeof(FilterModes) / sizeof(FilterModes[0]))
+
+
#define eps1 0.99
#define br 20.0 /* box radius */
@@ -158,6 +198,8 @@ static void draw_skybox( void )
static void draw( void )
{
+ GLenum wrap;
+
if (NoClear) {
/* This demonstrates how we can avoid calling glClear.
* This method only works if every pixel in the window is painted for
@@ -183,6 +225,16 @@ static void draw( void )
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
}
+ glTexParameteri(GL_TEXTURE_CUBE_MAP_ARB, GL_TEXTURE_MIN_FILTER,
+ FilterModes[FilterIndex].min_mode);
+ glTexParameteri(GL_TEXTURE_CUBE_MAP_ARB, GL_TEXTURE_MAG_FILTER,
+ FilterModes[FilterIndex].mag_mode);
+
+ wrap = ClampModes[ClampIndex].mode;
+ glTexParameteri(GL_TEXTURE_CUBE_MAP_ARB, GL_TEXTURE_WRAP_S, wrap);
+ glTexParameteri(GL_TEXTURE_CUBE_MAP_ARB, GL_TEXTURE_WRAP_T, wrap);
+ glTexParameteri(GL_TEXTURE_CUBE_MAP_ARB, GL_TEXTURE_WRAP_R, wrap);
+
glPushMatrix(); /*MODELVIEW*/
glTranslatef( 0.0, 0.0, -EyeDist );
@@ -256,6 +308,14 @@ static void key(unsigned char k, int x, int y)
else
glutIdleFunc(NULL);
break;
+ case 'f':
+ FilterIndex = (FilterIndex + 1) % NUM_FILTER_MODES;
+ printf("Tex filter: %s\n", FilterModes[FilterIndex].name);
+ break;
+ case 'c':
+ ClampIndex = (ClampIndex + 1) % NUM_CLAMP_MODES;
+ printf("Tex wrap mode: %s\n", ClampModes[ClampIndex].name);
+ break;
case 'm':
mode = !mode;
set_mode(mode);
@@ -321,7 +381,7 @@ static void reshape(int width, int height)
static void init_checkers( void )
{
#define CUBE_TEX_SIZE 64
- GLubyte image[CUBE_TEX_SIZE][CUBE_TEX_SIZE][3];
+ GLubyte image[CUBE_TEX_SIZE][CUBE_TEX_SIZE][4];
static const GLubyte colors[6][3] = {
{ 255, 0, 0 }, /* face 0 - red */
{ 0, 255, 255 }, /* face 1 - cyan */
@@ -348,21 +408,25 @@ static void init_checkers( void )
for (i = 0; i < CUBE_TEX_SIZE; i++) {
for (j = 0; j < CUBE_TEX_SIZE; j++) {
if ((i/4 + j/4) & 1) {
- image[i][j][0] = colors[f][0];
+ image[i][j][0] = colors[f][2];
image[i][j][1] = colors[f][1];
- image[i][j][2] = colors[f][2];
+ image[i][j][2] = colors[f][0];
+ image[i][j][3] = 255;
}
else {
image[i][j][0] = 255;
image[i][j][1] = 255;
image[i][j][2] = 255;
+ image[i][j][3] = 255;
}
}
}
- glTexImage2D(targets[f], 0, GL_RGB, CUBE_TEX_SIZE, CUBE_TEX_SIZE, 0,
- GL_RGB, GL_UNSIGNED_BYTE, image);
+ glTexImage2D(targets[f], 0, GL_RGBA8, CUBE_TEX_SIZE, CUBE_TEX_SIZE, 0,
+ GL_BGRA, GL_UNSIGNED_BYTE, image);
}
+
+ glGenerateMipmapEXT(GL_TEXTURE_CUBE_MAP_ARB);
}
@@ -431,32 +495,30 @@ static void load_envmaps(void)
static void init( GLboolean useImageFiles )
{
- GLenum filter;
-
- /* check for extension */
+ /* check for extensions */
{
char *exten = (char *) glGetString(GL_EXTENSIONS);
if (!strstr(exten, "GL_ARB_texture_cube_map")) {
printf("Sorry, this demo requires GL_ARB_texture_cube_map\n");
exit(0);
}
+
+ /* Needed for glGenerateMipmapEXT
+ */
+ if (!strstr(exten, "GL_EXT_framebuffer_object")) {
+ printf("Sorry, this demo requires GL_EXT_framebuffer_object\n");
+ exit(0);
+ }
}
printf("GL_RENDERER: %s\n", (char *) glGetString(GL_RENDERER));
if (useImageFiles) {
load_envmaps();
- filter = GL_LINEAR;
}
else {
init_checkers();
- filter = GL_NEAREST;
}
- glTexParameteri(GL_TEXTURE_CUBE_MAP_ARB, GL_TEXTURE_MIN_FILTER, filter);
- glTexParameteri(GL_TEXTURE_CUBE_MAP_ARB, GL_TEXTURE_MAG_FILTER, filter);
- glTexParameteri(GL_TEXTURE_CUBE_MAP_ARB, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
- glTexParameteri(GL_TEXTURE_CUBE_MAP_ARB, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
-
glEnable(GL_TEXTURE_CUBE_MAP_ARB);
glEnable(GL_DEPTH_TEST);
@@ -472,6 +534,8 @@ static void usage(void)
printf("keys:\n");
printf(" SPACE - toggle animation\n");
printf(" CURSOR KEYS - rotation\n");
+ printf(" c - toggle texture clamp/wrap mode\n");
+ printf(" f - toggle texture filter mode\n");
printf(" m - toggle texgen reflection mode\n");
printf(" z/Z - change viewing distance\n");
}
@@ -502,6 +566,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize(600, 500);
glutInitDisplayMode( GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE );
glutCreateWindow("Texture Cube Mapping");
+ glewInit();
glutReshapeFunc( reshape );
glutKeyboardFunc( key );
glutSpecialFunc( specialkey );
diff --git a/progs/demos/engine.c b/progs/demos/engine.c
index 14fd1e68629..3cf311e7782 100644
--- a/progs/demos/engine.c
+++ b/progs/demos/engine.c
@@ -386,7 +386,10 @@ DrawPositionedPiston(const Engine *eng, float crankAngle)
glPushMatrix();
glRotatef(-90, 1, 0, 0);
glTranslatef(0, 0, pos);
- DrawPiston(eng);
+ if (eng->PistonList)
+ glCallList(eng->PistonList);
+ else
+ DrawPiston(eng);
glPopMatrix();
}
@@ -961,6 +964,28 @@ Draw(void)
glEnable(GL_TEXTURE_2D);
}
+ /* also print out a periodic fps to stdout. useful for trying to
+ * figure out the performance impact of rendering the string above
+ * with glBitmap.
+ */
+ {
+ static GLint T0 = 0;
+ static GLint Frames = 0;
+ 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);
+ fflush(stdout);
+ T0 = t;
+ Frames = 0;
+ }
+ }
+
+
glutSwapBuffers();
}
diff --git a/progs/demos/fslight.c b/progs/demos/fslight.c
index e79b5cc1970..41a13cc9f46 100644
--- a/progs/demos/fslight.c
+++ b/progs/demos/fslight.c
@@ -105,6 +105,7 @@ Redisplay(void)
GLfloat fps = frames / seconds;
printf("%d frames in %6.3f seconds = %6.3f FPS\n",
frames, seconds, fps);
+ fflush(stdout);
t0 = t;
frames = 0;
}
diff --git a/progs/demos/gearbox.c b/progs/demos/gearbox.c
index 35bde04417b..2dcf32f92ff 100644
--- a/progs/demos/gearbox.c
+++ b/progs/demos/gearbox.c
@@ -314,6 +314,7 @@ draw(void)
GLfloat seconds = (t - T0) / 1000.0;
GLfloat fps = Frames / seconds;
printf("%d frames in %6.3f seconds = %6.3f FPS\n", Frames, seconds, fps);
+ fflush(stdout);
T0 = t;
Frames = 0;
}
diff --git a/progs/demos/gears.c b/progs/demos/gears.c
index 2a9fefefb53..6016162d6f7 100644
--- a/progs/demos/gears.c
+++ b/progs/demos/gears.c
@@ -219,6 +219,7 @@ draw(void)
GLfloat seconds = (t - T0) / 1000.0;
GLfloat fps = Frames / seconds;
printf("%d frames in %6.3f seconds = %6.3f FPS\n", Frames, seconds, fps);
+ fflush(stdout);
T0 = t;
Frames = 0;
if ((t >= 999.0 * autoexit) && (autoexit)) {
diff --git a/progs/demos/geartrain.c b/progs/demos/geartrain.c
index 8363f2abc6d..8fe405e8076 100644
--- a/progs/demos/geartrain.c
+++ b/progs/demos/geartrain.c
@@ -905,6 +905,7 @@ draw (void)
GLfloat seconds = (t - T0) / 1000.0;
GLfloat fps = Frames / seconds;
printf("%d frames in %g seconds = %g FPS\n", Frames, seconds, fps);
+ fflush(stdout);
T0 = t;
Frames = 0;
}
diff --git a/progs/demos/gloss.c b/progs/demos/gloss.c
index b2126e32678..69694b23a09 100644
--- a/progs/demos/gloss.c
+++ b/progs/demos/gloss.c
@@ -132,6 +132,7 @@ static void Display( void )
GLfloat seconds = (t - T0) / 1000.0;
GLfloat fps = Frames / seconds;
printf("%d frames in %g seconds = %g FPS\n", Frames, seconds, fps);
+ fflush(stdout);
T0 = t;
Frames = 0;
}
diff --git a/progs/demos/glslnoise.c b/progs/demos/glslnoise.c
index 4ee12928164..e972b62673f 100644
--- a/progs/demos/glslnoise.c
+++ b/progs/demos/glslnoise.c
@@ -65,6 +65,7 @@ static void Redisplay (void)
GLfloat seconds = (GLfloat) (t - t0) / 1000.0f;
GLfloat fps = frames / seconds;
printf ("%d frames in %6.3f seconds = %6.3f FPS\n", frames, seconds, fps);
+ fflush(stdout);
t0 = t;
frames = 0;
}
diff --git a/progs/demos/isosurf.c b/progs/demos/isosurf.c
index 393741cc9d6..e280d8f507c 100644
--- a/progs/demos/isosurf.c
+++ b/progs/demos/isosurf.c
@@ -69,6 +69,7 @@
#define NO_STIPPLE 0x08000000
#define POLYGON_FILL 0x10000000
#define POLYGON_LINE 0x20000000
+#define POLYGON_POINT 0x40000000
#define LIGHT_MASK (LIT|UNLIT|REFLECT)
#define FILTER_MASK (POINT_FILTER|LINEAR_FILTER)
@@ -81,7 +82,7 @@
#define SHADE_MASK (SHADE_SMOOTH|SHADE_FLAT)
#define FOG_MASK (FOG|NO_FOG)
#define STIPPLE_MASK (STIPPLE|NO_STIPPLE)
-#define POLYGON_MASK (POLYGON_FILL|POLYGON_LINE)
+#define POLYGON_MASK (POLYGON_FILL|POLYGON_LINE|POLYGON_POINT)
#define MAXVERTS 10000
static GLint maxverts = MAXVERTS;
@@ -147,7 +148,7 @@ static void read_surface( char *filename )
static void print_flags( const char *msg, GLuint flags )
{
fprintf(stderr,
- "%s (0x%x): %s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s\n",
+ "%s (0x%x): %s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s\n",
msg, flags,
(flags & GLVERTEX) ? "glVertex, " : "",
(flags & DRAW_ARRAYS) ? "glDrawArrays, " : "",
@@ -166,7 +167,8 @@ static void print_flags( const char *msg, GLuint flags )
(flags & MATERIALS) ? "materials, " : "",
(flags & FOG) ? "fog, " : "",
(flags & STIPPLE) ? "stipple, " : "",
- (flags & POLYGON_LINE) ? "polygon mode line, " : "");
+ (flags & POLYGON_LINE) ? "polygon mode line, " : "",
+ (flags & POLYGON_POINT) ? "polygon mode point, " : "");
}
@@ -711,9 +713,12 @@ static void ModeMenu(int m)
if (m & POLYGON_FILL) {
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
}
- else {
+ else if (m & POLYGON_LINE) {
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
}
+ else {
+ glPolygonMode(GL_FRONT_AND_BACK, GL_POINT);
+ }
}
#ifdef GL_EXT_vertex_array
@@ -1089,6 +1094,7 @@ int main(int argc, char **argv)
glutAddMenuEntry("", 0);
glutAddMenuEntry("Polygon Mode Fill", POLYGON_FILL);
glutAddMenuEntry("Polygon Mode Line", POLYGON_LINE);
+ glutAddMenuEntry("Polygon Mode Points", POLYGON_POINT);
glutAddMenuEntry("", 0);
glutAddMenuEntry("Point Filtered", POINT_FILTER);
glutAddMenuEntry("Linear Filtered", LINEAR_FILTER);
diff --git a/progs/demos/reflect.c b/progs/demos/reflect.c
index 0bec0663bc2..b72af12885d 100644
--- a/progs/demos/reflect.c
+++ b/progs/demos/reflect.c
@@ -401,6 +401,7 @@ DrawWindow(void)
GLfloat seconds = (t - t0) / 1000.0;
GLfloat fps = frames / seconds;
printf("%d frames in %g seconds = %g FPS\n", frames, seconds, fps);
+ fflush(stdout);
t0 = t;
frames = 0;
}
diff --git a/progs/demos/streaming_rect.c b/progs/demos/streaming_rect.c
index 4d4656e722b..f65ac4ce36c 100644
--- a/progs/demos/streaming_rect.c
+++ b/progs/demos/streaming_rect.c
@@ -47,7 +47,10 @@ static void Idle( void )
}
/*static int max( int a, int b ) { return a > b ? a : b; }*/
+
+#ifndef min
static int min( int a, int b ) { return a < b ? a : b; }
+#endif
static void DrawObject()
{
@@ -150,6 +153,7 @@ static void Display( void )
GLfloat fps = Frames / seconds;
printf("%d frames in %6.3f seconds = %6.3f FPS\n", Frames, seconds, fps);
+ fflush(stdout);
drift_increment = 2.2 * seconds / Frames;
T0 = t;
diff --git a/progs/demos/texcyl.c b/progs/demos/texcyl.c
index e3b03039759..0e6089bced5 100644
--- a/progs/demos/texcyl.c
+++ b/progs/demos/texcyl.c
@@ -79,6 +79,7 @@ static void Display( void )
GLfloat seconds = (t - T0) / 1000.0;
GLfloat fps = Frames / seconds;
printf("%d frames in %g seconds = %g FPS\n", Frames, seconds, fps);
+ fflush(stdout);
T0 = t;
Frames = 0;
}
diff --git a/progs/fp/Makefile b/progs/fp/Makefile
index ef6644cce27..681928cf260 100755
--- a/progs/fp/Makefile
+++ b/progs/fp/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 = \
tri-tex.c \
diff --git a/progs/fp/SConscript b/progs/fp/SConscript
new file mode 100644
index 00000000000..553799758b0
--- /dev/null
+++ b/progs/fp/SConscript
@@ -0,0 +1,17 @@
+Import('env')
+
+if not env['GLUT']:
+ Return()
+
+env = env.Clone()
+
+env.Prepend(CPPPATH = [
+ '../util',
+])
+
+env.Prepend(LIBS = ['$GLUT_LIB'])
+
+env.Program(
+ target = 'fp-tri',
+ source = ['fp-tri.c'],
+ )
diff --git a/progs/fp/fp-tri.c b/progs/fp/fp-tri.c
index 843f897871b..bc490c05201 100644
--- a/progs/fp/fp-tri.c
+++ b/progs/fp/fp-tri.c
@@ -2,10 +2,19 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
-#define GL_GLEXT_PROTOTYPES
-#include <GL/glut.h>
+
+#ifndef WIN32
#include <unistd.h>
#include <signal.h>
+#endif
+
+#include <GL/glew.h>
+#include <GL/glut.h>
+
+#include "readtex.c"
+
+
+#define TEXTURE_FILE "../images/bw.rgb"
unsigned show_fps = 0;
unsigned int frame_cnt = 0;
@@ -15,11 +24,14 @@ static const char *filename = NULL;
static void usage(char *name)
{
fprintf(stderr, "usage: %s [ options ] shader_filename\n", name);
+#ifndef WIN32
fprintf(stderr, "\n" );
fprintf(stderr, "options:\n");
fprintf(stderr, " -fps show frames per second\n");
+#endif
}
+#ifndef WIN32
void alarmhandler (int sig)
{
if (sig == SIGALRM) {
@@ -31,6 +43,7 @@ void alarmhandler (int sig)
signal(SIGALRM, alarmhandler);
alarm(5);
}
+#endif
static void args(int argc, char *argv[])
{
@@ -57,6 +70,7 @@ static void args(int argc, char *argv[])
static void Init( void )
{
+ GLuint Texture;
GLint errno;
GLuint prognum;
char buf[4096];
@@ -99,7 +113,70 @@ static void Init( void )
}
glEnable(GL_FRAGMENT_PROGRAM_ARB);
- glClearColor(.3, .3, .3, 0);
+
+ /* Load texture */
+ glGenTextures(1, &Texture);
+ glBindTexture(GL_TEXTURE_2D, Texture);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
+ glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
+ if (!LoadRGBMipmaps(TEXTURE_FILE, GL_RGB)) {
+ printf("Error: couldn't load texture image file %s\n", TEXTURE_FILE);
+ exit(1);
+ }
+
+
+ glGenTextures(1, &Texture);
+ glActiveTextureARB(GL_TEXTURE0_ARB + 1);
+ glBindTexture(GL_TEXTURE_2D, Texture);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
+ glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
+
+ {
+ GLubyte data[32][32];
+ int width = 32;
+ int height = 32;
+ int i;
+ int j;
+
+ for (i = 0; i < 32; i++)
+ for (j = 0; j < 32; j++)
+ {
+ /**
+ ** +-----------+
+ ** | W |
+ ** | +-----+ |
+ ** | | | |
+ ** | | B | |
+ ** | | | |
+ ** | +-----+ |
+ ** | |
+ ** +-----------+
+ **/
+ int i2 = i - height / 2;
+ int j2 = j - width / 2;
+ int h8 = height / 8;
+ int w8 = width / 8;
+ if ( -h8 <= i2 && i2 <= h8 && -w8 <= j2 && j2 <= w8 ) {
+ data[i][j] = 0x00;
+ } else if ( -2 * h8 <= i2 && i2 <= 2 * h8 && -2 * w8 <= j2 && j2 <= 2 * w8 ) {
+ data[i][j] = 0x55;
+ } else if ( -3 * h8 <= i2 && i2 <= 3 * h8 && -3 * w8 <= j2 && j2 <= 3 * w8 ) {
+ data[i][j] = 0xaa;
+ } else {
+ data[i][j] = 0xff;
+ }
+ }
+
+ glTexImage2D( GL_TEXTURE_2D, 0,
+ GL_ALPHA8,
+ 32, 32, 0,
+ GL_ALPHA, GL_UNSIGNED_BYTE, data );
+ }
+
+
+ glClearColor(.1, .3, .5, 0);
}
static void Reshape(int width, int height)
@@ -142,7 +219,6 @@ static void Display(void)
glEnd();
glFlush();
-
if (show_fps) {
++frame_cnt;
glutPostRedisplay();
@@ -158,14 +234,17 @@ int main(int argc, char **argv)
glutInitDisplayMode(GLUT_RGB | GLUT_SINGLE | GLUT_DEPTH);
args(argc, argv);
glutCreateWindow(filename);
+ glewInit();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutDisplayFunc(Display);
Init();
+#ifndef WIN32
if (show_fps) {
signal(SIGALRM, alarmhandler);
alarm(5);
}
+#endif
glutMainLoop();
return 0;
}
diff --git a/progs/fp/kill-pos.txt b/progs/fp/kill-pos.txt
new file mode 100644
index 00000000000..5ff4f6f2c84
--- /dev/null
+++ b/progs/fp/kill-pos.txt
@@ -0,0 +1,9 @@
+!!ARBfp1.0
+TEMP R0;
+SUB R0.xy, fragment.position, {125}.x;
+MOV R0.zw, {0}.x;
+DP3 R0, R0, R0;
+SUB R0.x, R0, {10000}.x;
+KIL -R0.x;
+MOV result.color, fragment.color;
+END
diff --git a/progs/fp/position.txt b/progs/fp/position.txt
index 27fac12a3a5..1875897d781 100644
--- a/progs/fp/position.txt
+++ b/progs/fp/position.txt
@@ -1,3 +1,4 @@
!!ARBfp1.0
-MUL result.color, fragment.position, {.005}.x;
+MOV result.color, {0}.x;
+MUL result.color.xy, fragment.position, {.005}.x;
END
diff --git a/progs/fp/tex-pos-kil-1.txt b/progs/fp/tex-pos-kil-1.txt
new file mode 100644
index 00000000000..3f01e79ffe7
--- /dev/null
+++ b/progs/fp/tex-pos-kil-1.txt
@@ -0,0 +1,7 @@
+!!ARBfp1.0
+TEMP R0;
+MUL R0, fragment.position, {0.03125}.x;
+TEX R0, R0, texture[1], 2D;
+KIL -R0;
+MOV result.color, fragment.color;
+END
diff --git a/progs/fp/tex-pos-kil.txt b/progs/fp/tex-pos-kil.txt
new file mode 100644
index 00000000000..b7aaa9f7c88
--- /dev/null
+++ b/progs/fp/tex-pos-kil.txt
@@ -0,0 +1,8 @@
+!!ARBfp1.0
+TEMP R0;
+MUL R0, fragment.position, {0.008}.x;
+TEX R0, R0, texture[0], 2D;
+SUB R0, R0, {0.25}.x;
+KIL R0.xyzz;
+MOV result.color, fragment.color;
+END
diff --git a/progs/fp/tex-pos.txt b/progs/fp/tex-pos.txt
new file mode 100644
index 00000000000..b969f423f57
--- /dev/null
+++ b/progs/fp/tex-pos.txt
@@ -0,0 +1,6 @@
+!!ARBfp1.0
+TEMP R0;
+MOV R0, {0.0}.x;
+MUL R0.xy, fragment.position, {0.008}.x;
+TEX result.color, R0, texture[0], 2D;
+END
diff --git a/progs/fp/tex.txt b/progs/fp/tex.txt
new file mode 100644
index 00000000000..b3a885d9e07
--- /dev/null
+++ b/progs/fp/tex.txt
@@ -0,0 +1,3 @@
+!!ARBfp1.0
+TEX result.color, fragment.color, texture[0], 2D;
+END
diff --git a/progs/glsl/.gitignore b/progs/glsl/.gitignore
index 7a51c8cf6f9..5fdb4ef16d4 100644
--- a/progs/glsl/.gitignore
+++ b/progs/glsl/.gitignore
@@ -18,6 +18,7 @@ samplers
samplers_array
shaderutil.c
shaderutil.h
+shadow_sampler
skinning
texdemo1
toyball
diff --git a/progs/glsl/Makefile b/progs/glsl/Makefile
index 7099eeadbd9..80612770332 100644
--- a/progs/glsl/Makefile
+++ b/progs/glsl/Makefile
@@ -25,6 +25,7 @@ PROGS = \
pointcoord \
samplers \
samplers_array \
+ shadow_sampler \
skinning \
texdemo1 \
toyball \
diff --git a/progs/glsl/shadow_sampler.c b/progs/glsl/shadow_sampler.c
new file mode 100644
index 00000000000..2902b535522
--- /dev/null
+++ b/progs/glsl/shadow_sampler.c
@@ -0,0 +1,341 @@
+/**
+ * Test shadow2DRectProj() and shadow2D() functions.
+ * Brian Paul
+ * 11 April 2007
+ */
+
+#define GL_GLEXT_PROTOTYPES
+#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"
+
+
+/** Use GL_RECTANGLE texture (with projective texcoords)? */
+#define USE_RECT 01
+
+#define TEXSIZE 16
+
+
+static char *FragProgFile = NULL;
+static char *VertProgFile = NULL;
+
+static GLuint fragShader;
+static GLuint vertShader;
+static GLuint program;
+
+static GLint uTexture2D;
+static GLint uTextureRect;
+
+static GLint win = 0;
+
+static GLenum Filter = GL_LINEAR;
+
+static void
+CheckError(int line)
+{
+ GLenum err = glGetError();
+ if (err) {
+ printf("GL Error %s (0x%x) at line %d\n",
+ gluErrorString(err), (int) err, line);
+ }
+}
+
+
+static void
+PrintString(const char *s)
+{
+ while (*s) {
+ glutBitmapCharacter(GLUT_BITMAP_8_BY_13, (int) *s);
+ s++;
+ }
+}
+
+
+static void
+Redisplay(void)
+{
+ CheckError(__LINE__);
+ glClear(GL_COLOR_BUFFER_BIT);
+
+ glPushMatrix();
+
+ CheckError(__LINE__);
+ glUseProgram_func(program);
+ CheckError(__LINE__);
+
+ glBegin(GL_POLYGON);
+#if USE_RECT
+ /* scale coords by two to test projection */
+ glTexCoord4f( 0, 0, 0, 2.0); glVertex2f(-1, -1);
+ glTexCoord4f(2*TEXSIZE, 0, 2*1, 2.0); glVertex2f( 1, -1);
+ glTexCoord4f(2*TEXSIZE, 2*TEXSIZE, 2*1, 2.0); glVertex2f( 1, 1);
+ glTexCoord4f( 0, 2*TEXSIZE, 0, 2.0); glVertex2f(-1, 1);
+#else
+ glTexCoord3f(0, 0, 0); glVertex2f(-1, -1);
+ glTexCoord3f(1, 0, 1); glVertex2f( 1, -1);
+ glTexCoord3f(1, 1, 1); glVertex2f( 1, 1);
+ glTexCoord3f(0, 1, 0); glVertex2f(-1, 1);
+#endif
+ glEnd();
+
+ glPopMatrix();
+
+ glUseProgram_func(0);
+ glWindowPos2iARB(80, 20);
+ PrintString("white black white black");
+
+ 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.0f, 0.0f, -8.0f);
+}
+
+
+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 27:
+ CleanUp();
+ exit(0);
+ break;
+ }
+ glutPostRedisplay();
+}
+
+
+static void
+MakeTexture(void)
+{
+ GLfloat image[TEXSIZE][TEXSIZE];
+ GLuint i, j;
+
+ for (i = 0; i < TEXSIZE; i++) {
+ for (j = 0; j < TEXSIZE; j++) {
+ if (j < (TEXSIZE / 2)) {
+ image[i][j] = 0.25;
+ }
+ else {
+ image[i][j] = 0.75;
+ }
+ }
+ }
+
+ glActiveTexture(GL_TEXTURE0); /* unit 0 */
+ glBindTexture(GL_TEXTURE_2D, 42);
+ glTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT, TEXSIZE, TEXSIZE, 0,
+ GL_DEPTH_COMPONENT, GL_FLOAT, image);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, 1);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, Filter);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, Filter);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_COMPARE_MODE_ARB,
+ GL_COMPARE_R_TO_TEXTURE_ARB);
+ CheckError(__LINE__);
+
+ glActiveTexture(GL_TEXTURE1); /* unit 1 */
+ glBindTexture(GL_TEXTURE_RECTANGLE_ARB, 43);
+ glTexImage2D(GL_TEXTURE_RECTANGLE_ARB, 0, GL_DEPTH_COMPONENT,
+ TEXSIZE, 10, 0,/*16x10*/
+ GL_DEPTH_COMPONENT, GL_FLOAT, image);
+ glTexParameteri(GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_MIN_FILTER, Filter);
+ glTexParameteri(GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_MAG_FILTER, Filter);
+ glTexParameteri(GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_COMPARE_MODE_ARB,
+ GL_COMPARE_R_TO_TEXTURE_ARB);
+ CheckError(__LINE__);
+}
+
+
+static void
+LoadAndCompileShader(GLuint shader, const char *text)
+{
+ GLint stat;
+ glShaderSource_func(shader, 1, (const GLchar **) &text, NULL);
+ glCompileShader_func(shader);
+ glGetShaderiv_func(shader, GL_COMPILE_STATUS, &stat);
+ if (!stat) {
+ GLchar log[1000];
+ GLsizei len;
+ glGetShaderInfoLog_func(shader, 1000, &len, log);
+ fprintf(stderr, "fslight: problem compiling shader:\n%s\n", log);
+ exit(1);
+ }
+}
+
+
+/**
+ * Read a shader from a file.
+ */
+static void
+ReadShader(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, "fslight: Unable to open shader file %s\n", filename);
+ exit(1);
+ }
+
+ n = fread(buffer, 1, max, f);
+ printf("fslight: read %d bytes from shader file %s\n", n, filename);
+ if (n > 0) {
+ buffer[n] = 0;
+ LoadAndCompileShader(shader, buffer);
+ }
+
+ fclose(f);
+ free(buffer);
+}
+
+
+static void
+CheckLink(GLuint prog)
+{
+ GLint stat;
+ glGetProgramiv_func(prog, GL_LINK_STATUS, &stat);
+ if (!stat) {
+ GLchar log[1000];
+ GLsizei len;
+ glGetProgramInfoLog_func(prog, 1000, &len, log);
+ fprintf(stderr, "Linker error:\n%s\n", log);
+ }
+}
+
+
+static void
+Init(void)
+{
+ static const char *fragShaderText =
+ "uniform sampler2DShadow shadowTex2D; \n"
+ "uniform sampler2DRectShadow shadowTexRect; \n"
+ "void main() {\n"
+#if USE_RECT
+ " gl_FragColor = shadow2DRectProj(shadowTexRect, gl_TexCoord[0]); \n"
+#else
+ " gl_FragColor = shadow2D(shadowTex2D, gl_TexCoord[0].xyz); \n"
+#endif
+ "}\n";
+ static const char *vertShaderText =
+ "void main() {\n"
+ " gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;\n"
+ " gl_TexCoord[0] = gl_MultiTexCoord0; \n"
+ "}\n";
+ const char *version;
+
+#if USE_RECT
+ if (!glutExtensionSupported("GL_ARB_texture_rectangle")) {
+ printf("This program requires GL_ARB_texture_rectangle\n");
+ exit(1);
+ }
+#endif
+
+ 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);
+ }
+ printf("GL_RENDERER = %s\n",(const char *) glGetString(GL_RENDERER));
+
+ GetExtensionFuncs();
+
+ fragShader = glCreateShader_func(GL_FRAGMENT_SHADER);
+ if (FragProgFile)
+ ReadShader(fragShader, FragProgFile);
+ else
+ LoadAndCompileShader(fragShader, fragShaderText);
+
+ vertShader = glCreateShader_func(GL_VERTEX_SHADER);
+ if (VertProgFile)
+ ReadShader(vertShader, VertProgFile);
+ else
+ LoadAndCompileShader(vertShader, vertShaderText);
+
+ program = glCreateProgram_func();
+ glAttachShader_func(program, fragShader);
+ glAttachShader_func(program, vertShader);
+ glLinkProgram_func(program);
+ CheckLink(program);
+ glUseProgram_func(program);
+
+ uTexture2D = glGetUniformLocation_func(program, "shadowTex2D");
+ uTextureRect = glGetUniformLocation_func(program, "shadowTexRect");
+ printf("uTexture2D %d uTextureRect %d\n", uTexture2D, uTextureRect);
+ if (uTexture2D >= 0) {
+ glUniform1i_func(uTexture2D, 0); /* use texture unit 0 */
+ }
+ if (uTextureRect >= 0) {
+ glUniform1i_func(uTextureRect, 1); /* use texture unit 0 */
+ }
+ CheckError(__LINE__);
+
+ glClearColor(0.3f, 0.3f, 0.3f, 0.0f);
+ glColor3f(1, 1, 1);
+
+ MakeTexture();
+ CheckError(__LINE__);
+}
+
+
+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(400, 300);
+ glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE);
+ win = glutCreateWindow(argv[0]);
+ glutReshapeFunc(Reshape);
+ glutKeyboardFunc(Key);
+ glutDisplayFunc(Redisplay);
+ ParseOptions(argc, argv);
+ Init();
+ glutMainLoop();
+ return 0;
+}
+
+
diff --git a/progs/tests/.gitignore b/progs/tests/.gitignore
index c5b9e28dab1..0ed3a885c26 100644
--- a/progs/tests/.gitignore
+++ b/progs/tests/.gitignore
@@ -14,7 +14,9 @@ arbvpwarpmesh
arraytexture
blendminmax
blendsquare
+blendxor
bufferobj
+bumpmap
bug_3050
bug_3101
bug_3195
@@ -59,6 +61,8 @@ readtex.h
seccolor
sharedtex
shader_api
+shaderutil.c
+shaderutil.h
stencil_twoside
stencil_wrap
stencilwrap
diff --git a/progs/tests/Makefile b/progs/tests/Makefile
index 34c9ab1dcef..58ea5690df6 100644
--- a/progs/tests/Makefile
+++ b/progs/tests/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 = \
afsmultiarb.c \
@@ -28,6 +28,7 @@ SOURCES = \
blendsquare.c \
blendxor.c \
bufferobj.c \
+ bumpmap.c \
bug_3050.c \
bug_3101.c \
bug_3195.c \
@@ -54,7 +55,10 @@ SOURCES = \
jkrahntest.c \
lineclip.c \
manytex.c \
+ mapbufrange.c \
+ mapvbo.c \
minmag.c \
+ mipgen.c \
mipmap_limits.c \
mipmap_view.c \
multipal.c \
@@ -145,6 +149,12 @@ afsmultiarb: afsmultiarb.o readtex.o
afsmultiarb.o: afsmultiarb.c readtex.h
$(APP_CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) afsmultiarb.c -o $@
+bumpmap: bumpmap.o readtex.o
+ $(CC) $(CFLAGS) $(LDFLAGS) bumpmap.o readtex.o $(LIBS) -o $@
+
+bumpmap.o: bumpmap.c readtex.h
+ $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) bumpmap.c -o $@
+
drawbuffers: drawbuffers.o
$(APP_CC) $(CFLAGS) $(LDFLAGS) drawbuffers.o $(LIBS) -o $@
@@ -175,6 +185,11 @@ mipmap_view: mipmap_view.o readtex.o
mipmap_view.o: mipmap_view.c readtex.h
$(APP_CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
+mipmap_limits: mipmap_limits.o readtex.o
+ $(APP_CC) $(CFLAGS) mipmap_limits.o readtex.o $(LIBS) -o $@
+
+mipmap_limits.o: mipmap_limits.c readtex.h
+ $(APP_CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
fillrate: fillrate.o readtex.o
$(APP_CC) $(CFLAGS) fillrate.o readtex.o $(LIBS) -o $@
diff --git a/progs/tests/SConscript b/progs/tests/SConscript
new file mode 100644
index 00000000000..cfeb9d1c378
--- /dev/null
+++ b/progs/tests/SConscript
@@ -0,0 +1,134 @@
+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'])
+
+linux_progs = [
+ 'api_speed',
+]
+
+glx_progs = [
+ 'auxbuffer',
+ 'getprocaddress',
+ 'jkrahntest',
+ 'sharedtex',
+ 'texcompress2',
+ 'texobjshare',
+]
+
+mesa_progs = [
+ 'debugger',
+]
+
+progs = [
+ 'afsmultiarb',
+ 'antialias',
+ 'arbfpspec',
+ 'arbfptest1',
+ 'arbfptexture',
+ 'arbfptrig',
+ 'arbnpot-mipmap',
+ 'arbnpot',
+ 'arbvptest1',
+ 'arbvptest3',
+ 'arbvptorus',
+ 'arbvpwarpmesh',
+ 'arraytexture',
+ 'blendminmax',
+ 'blendsquare',
+ 'blendxor',
+ 'bufferobj',
+ 'bug_3050',
+ 'bug_3101',
+ 'bug_3195',
+ 'bug_texstore_i8',
+ 'calibrate_rast',
+ 'copypixrate',
+ 'crossbar',
+ 'cva',
+ 'dinoshade',
+ 'drawbuffers',
+ 'exactrast',
+ 'ext422square',
+ 'fbotest1',
+ 'fbotest2',
+ 'fbotexture',
+ 'fillrate',
+ 'floattex',
+ 'fog',
+ 'fogcoord',
+ 'fptest1',
+ 'fptexture',
+ 'interleave',
+ 'invert',
+ 'lineclip',
+ 'manytex',
+ 'mapbufrange',
+ 'mapvbo',
+ 'minmag',
+ 'mipgen',
+ 'mipmap_limits',
+ 'mipmap_view',
+ 'multipal',
+ 'multitexarray',
+ 'multiwindow',
+ 'no_s3tc',
+ 'packedpixels',
+ 'pbo',
+ 'prog_parameter',
+ 'projtex',
+ 'quads',
+ 'random',
+ 'readrate',
+ 'rubberband',
+ 'seccolor',
+ 'shader_api',
+ 'stencil_twoside',
+ 'stencil_wrap',
+ 'stencilwrap',
+ 'subtex',
+ 'subtexrate',
+ 'tex1d',
+ 'texcmp',
+ 'texfilt',
+ 'texgenmix',
+ 'texline',
+ 'texrect',
+ 'texwrap',
+ 'unfilledclip',
+ 'vao-01',
+ 'vao-02',
+ 'vparray',
+ 'vpeval',
+ 'vptest1',
+ 'vptest2',
+ 'vptest3',
+ 'vptorus',
+ 'vpwarpmesh',
+ 'yuvrect',
+ 'yuvsquare',
+ 'zcomp',
+ 'zdrawpix',
+ 'zreaddraw',
+]
+
+for prog in progs:
+ env.Program(
+ target = prog,
+ source = prog + '.c',
+ )
diff --git a/progs/tests/afsmultiarb.c b/progs/tests/afsmultiarb.c
index c026ecd4ce2..162ab19493c 100644
--- a/progs/tests/afsmultiarb.c
+++ b/progs/tests/afsmultiarb.c
@@ -11,7 +11,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#define GL_GLEXT_PROTOTYPES
+#include <GL/glew.h>
#include <GL/glut.h>
#include "readtex.h"
@@ -442,6 +442,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( 300, 300 );
glutInitWindowPosition( 0, 0 );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
+ glewInit();
glutCreateWindow(argv[0] );
Init( argc, argv );
diff --git a/progs/tests/antialias.c b/progs/tests/antialias.c
index f23b5aff324..656bf2471fe 100644
--- a/progs/tests/antialias.c
+++ b/progs/tests/antialias.c
@@ -9,6 +9,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
+#include <GL/glew.h>
#include <GL/glut.h>
@@ -29,7 +30,7 @@ PrintString(const char *s)
static void
-Polygon( GLint verts, GLfloat radius, GLfloat z )
+doPolygon( GLint verts, GLfloat radius, GLfloat z )
{
int i;
for (i = 0; i < verts; i++) {
@@ -47,33 +48,33 @@ DrawObject( void )
glLineWidth(3.0);
glColor3f(1, 1, 1);
glBegin(GL_LINE_LOOP);
- Polygon(12, 1.2, 0);
+ doPolygon(12, 1.2, 0);
glEnd();
glLineWidth(1.0);
glColor3f(1, 1, 1);
glBegin(GL_LINE_LOOP);
- Polygon(12, 1.1, 0);
+ doPolygon(12, 1.1, 0);
glEnd();
glColor3f(1, 0, 0);
glBegin(GL_POLYGON);
- Polygon(12, 0.4, 0.3);
+ doPolygon(12, 0.4, 0.3);
glEnd();
glColor3f(0, 1, 0);
glBegin(GL_POLYGON);
- Polygon(12, 0.6, 0.2);
+ doPolygon(12, 0.6, 0.2);
glEnd();
glColor3f(0, 0, 1);
glBegin(GL_POLYGON);
- Polygon(12, 0.8, 0.1);
+ doPolygon(12, 0.8, 0.1);
glEnd();
glColor3f(1, 1, 1);
glBegin(GL_POLYGON);
- Polygon(12, 1.0, 0);
+ doPolygon(12, 1.0, 0);
glEnd();
}
@@ -225,6 +226,7 @@ main( int argc, char *argv[] )
glutInitDisplayMode( GLUT_RGB | GLUT_ALPHA | GLUT_DOUBLE |
GLUT_DEPTH | GLUT_MULTISAMPLE );
glutCreateWindow(argv[0]);
+ glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );
diff --git a/progs/tests/api_speed.c b/progs/tests/api_speed.c
index aed65b35fe3..28e28e61d8b 100644
--- a/progs/tests/api_speed.c
+++ b/progs/tests/api_speed.c
@@ -37,9 +37,7 @@
#include <stdio.h>
#include <stdlib.h>
-#define GL_GLEXT_PROTOTYPES
-#include <GL/gl.h>
-#include <GL/glext.h>
+#include <GL/glew.h>
#include <GL/glut.h>
#define inline __inline__
@@ -127,6 +125,7 @@ int main( int argc, char *argv[] )
glutInitDisplayMode( GLUT_RGB );
glutCreateWindow( argv[0] );
+ glewInit();
if ( argc > 1 ) {
count = strtoul( argv[1], NULL, 0 );
diff --git a/progs/tests/arbfpspec.c b/progs/tests/arbfpspec.c
index eac2a9100f5..550e9543406 100644
--- a/progs/tests/arbfpspec.c
+++ b/progs/tests/arbfpspec.c
@@ -8,7 +8,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#define GL_GLEXT_PROTOTYPES
+#include <GL/glew.h>
#include <GL/glut.h>
static float Xrot = 0.0, Yrot = 0.0, Zrot = 0.0;
@@ -180,6 +180,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( 250, 250 );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
glutCreateWindow(argv[0]);
+ glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutSpecialFunc( SpecialKey );
diff --git a/progs/tests/arbfptest1.c b/progs/tests/arbfptest1.c
index 7949f87eddb..e7237b76a87 100644
--- a/progs/tests/arbfptest1.c
+++ b/progs/tests/arbfptest1.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>
@@ -201,6 +201,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( 250, 250 );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
glutCreateWindow(argv[0]);
+ glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );
diff --git a/progs/tests/arbfptexture.c b/progs/tests/arbfptexture.c
index a854908c311..f66b060cbb2 100644
--- a/progs/tests/arbfptexture.c
+++ b/progs/tests/arbfptexture.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>
#include "readtex.c"
@@ -143,6 +143,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( 250, 250 );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
glutCreateWindow(argv[0]);
+ glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutSpecialFunc( SpecialKey );
diff --git a/progs/tests/arbfptrig.c b/progs/tests/arbfptrig.c
index 26b68c6b412..95f008a078d 100644
--- a/progs/tests/arbfptrig.c
+++ b/progs/tests/arbfptrig.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>
#include "readtex.c"
@@ -146,6 +146,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( 250, 250 );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
glutCreateWindow(argv[0]);
+ glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutSpecialFunc( SpecialKey );
diff --git a/progs/tests/arbnpot-mipmap.c b/progs/tests/arbnpot-mipmap.c
index 4ed84e7acee..700ec0b09d0 100644
--- a/progs/tests/arbnpot-mipmap.c
+++ b/progs/tests/arbnpot-mipmap.c
@@ -46,6 +46,7 @@
*/
#include <stdlib.h>
#include <stdio.h>
+#include <GL/glew.h>
#include <GL/glut.h>
GLubyte mipmapImage32[40][46][3];
@@ -175,6 +176,7 @@ int main(int argc, char** argv)
glutInitDisplayMode (GLUT_SINGLE | GLUT_RGB | GLUT_DEPTH);
glutInitWindowSize (500, 500);
glutCreateWindow (argv[0]);
+ glewInit();
myinit();
glutReshapeFunc (myReshape);
glutDisplayFunc(display);
diff --git a/progs/tests/arbnpot.c b/progs/tests/arbnpot.c
index 05ba85dad9e..c51a5416413 100644
--- a/progs/tests/arbnpot.c
+++ b/progs/tests/arbnpot.c
@@ -8,6 +8,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
+#include <GL/glew.h>
#include <GL/glut.h>
#include "../util/readtex.c"
@@ -188,6 +189,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( 400, 400 );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
glutCreateWindow(argv[0]);
+ glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );
diff --git a/progs/tests/arbvptest1.c b/progs/tests/arbvptest1.c
index 0ebd3987f58..3a6d71a42bd 100644
--- a/progs/tests/arbvptest1.c
+++ b/progs/tests/arbvptest1.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 Display( void )
@@ -155,6 +155,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( 250, 250 );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
glutCreateWindow(argv[0]);
+ glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );
diff --git a/progs/tests/arbvptest3.c b/progs/tests/arbvptest3.c
index 6437062900e..56de7b46963 100644
--- a/progs/tests/arbvptest3.c
+++ b/progs/tests/arbvptest3.c
@@ -4,7 +4,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#define GL_GLEXT_PROTOTYPES
+#include <GL/glew.h>
#include <GL/glut.h>
static float Zrot = 0.0;
@@ -118,6 +118,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( 250, 250 );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
glutCreateWindow(argv[0]);
+ glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );
diff --git a/progs/tests/arbvptorus.c b/progs/tests/arbvptorus.c
index 9d19ef90da5..f1f84d87749 100644
--- a/progs/tests/arbvptorus.c
+++ b/progs/tests/arbvptorus.c
@@ -7,7 +7,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#define GL_GLEXT_PROTOTYPES
+#include <GL/glew.h>
#include <GL/glut.h>
static float Xrot = 0.0, Yrot = 0.0, Zrot = 0.0;
@@ -174,6 +174,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( 250, 250 );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
glutCreateWindow(argv[0]);
+ glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutSpecialFunc( SpecialKey );
diff --git a/progs/tests/arbvpwarpmesh.c b/progs/tests/arbvpwarpmesh.c
index 3dfe94f7596..973a1574099 100644
--- a/progs/tests/arbvpwarpmesh.c
+++ b/progs/tests/arbvpwarpmesh.c
@@ -7,7 +7,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#define GL_GLEXT_PROTOTYPES
+#include <GL/glew.h>
#include <GL/glut.h>
static float Xrot = -60.0, Yrot = 0.0, Zrot = 0.0;
@@ -234,6 +234,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( 250, 250 );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
glutCreateWindow(argv[0]);
+ glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutSpecialFunc( SpecialKey );
diff --git a/progs/tests/arraytexture.c b/progs/tests/arraytexture.c
index 48c622be302..6c0484df0de 100644
--- a/progs/tests/arraytexture.c
+++ b/progs/tests/arraytexture.c
@@ -34,6 +34,7 @@
#include <stdio.h>
#include <string.h>
#include <math.h>
+#include <GL/glew.h>
#include <GL/glut.h>
#include <GL/glext.h>
@@ -326,6 +327,7 @@ int main(int argc, char *argv[])
glutInitWindowSize(350, 350);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE);
glutCreateWindow("Array texture test");
+ glewInit();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutSpecialFunc(SpecialKey);
diff --git a/progs/tests/blendminmax.c b/progs/tests/blendminmax.c
index 2aab1a39d29..7297f41b787 100644
--- a/progs/tests/blendminmax.c
+++ b/progs/tests/blendminmax.c
@@ -34,6 +34,7 @@
#include <stdio.h>
#include <stdlib.h>
+#include <GL/glew.h>
#include <GL/glut.h>
static int Width = 400;
@@ -200,6 +201,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( Width, Height );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
glutCreateWindow( "GL_EXT_blend_minmax test" );
+ glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );
diff --git a/progs/tests/blendsquare.c b/progs/tests/blendsquare.c
index 1694866a557..3ee3ae2230c 100644
--- a/progs/tests/blendsquare.c
+++ b/progs/tests/blendsquare.c
@@ -34,6 +34,7 @@
#include <stdio.h>
#include <stdlib.h>
+#include <GL/glew.h>
#include <GL/glut.h>
static int Width = 400;
@@ -169,6 +170,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( Width, Height );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
glutCreateWindow( "GL_NV_blend_square test" );
+ glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );
diff --git a/progs/tests/blendxor.c b/progs/tests/blendxor.c
index 8961a827eab..d6dcb8b8486 100644
--- a/progs/tests/blendxor.c
+++ b/progs/tests/blendxor.c
@@ -3,10 +3,10 @@
*
*/
-#define GL_GLEXT_PROTOTYPES
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
+#include <GL/glew.h>
#include <GL/glut.h>
#include "readtex.c"
@@ -183,6 +183,7 @@ main(int argc, char *argv[])
glutInitWindowSize(Width, Height);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE);
Win = glutCreateWindow(argv[0]);
+ glewInit();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutSpecialFunc(SpecialKey);
diff --git a/progs/tests/bufferobj.c b/progs/tests/bufferobj.c
index d1a85392e1e..1d97b060efc 100644
--- a/progs/tests/bufferobj.c
+++ b/progs/tests/bufferobj.c
@@ -6,18 +6,19 @@
*/
-#define GL_GLEXT_PROTOTYPES
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
+#include <GL/glew.h>
#include <GL/glut.h>
#define NUM_OBJECTS 10
struct object
{
- GLuint BufferID;
+ GLuint VertexBufferID;
+ GLuint ColorBufferID;
GLuint ElementsBufferID;
GLuint NumVerts;
GLuint VertexOffset;
@@ -47,7 +48,7 @@ static void CheckError(int line)
static void DrawObject( const struct object *obj )
{
- glBindBufferARB(GL_ARRAY_BUFFER_ARB, obj->BufferID);
+ glBindBufferARB(GL_ARRAY_BUFFER_ARB, obj->VertexBufferID);
glVertexPointer(3, GL_FLOAT, obj->VertexStride, (void *) obj->VertexOffset);
glEnable(GL_VERTEX_ARRAY);
@@ -62,6 +63,7 @@ static void DrawObject( const struct object *obj )
glPopClientAttrib();
}
#endif
+ glBindBufferARB(GL_ARRAY_BUFFER_ARB, obj->ColorBufferID);
glColorPointer(3, GL_FLOAT, obj->ColorStride, (void *) obj->ColorOffset);
glEnable(GL_COLOR_ARRAY);
@@ -92,7 +94,7 @@ static void Display( void )
glClear( GL_COLOR_BUFFER_BIT );
for (i = 0; i < NumObjects; i++) {
- float x = 5.0 * ((float) i / (NumObjects-1) - 0.5);
+ float x = 7.0 * ((float) i / (NumObjects-1) - 0.5);
glPushMatrix();
glTranslatef(x, 0, 0);
glRotatef(Xrot, 1, 0, 0);
@@ -125,8 +127,11 @@ static void Reshape( int width, int height )
static void FreeBuffers(void)
{
int i;
- for (i = 0; i < NUM_OBJECTS; i++)
- glDeleteBuffersARB(1, &Objects[i].BufferID);
+ for (i = 0; i < NUM_OBJECTS; i++) {
+ glDeleteBuffersARB(1, &Objects[i].VertexBufferID);
+ glDeleteBuffersARB(1, &Objects[i].ColorBufferID);
+ glDeleteBuffersARB(1, &Objects[i].ElementsBufferID);
+ }
}
@@ -182,7 +187,9 @@ static void SpecialKey( int key, int x, int y )
}
-
+/*
+ * Non-interleaved position/color data.
+ */
static void MakeObject1(struct object *obj)
{
GLfloat *v, *c;
@@ -193,10 +200,11 @@ static void MakeObject1(struct object *obj)
for (i = 0; i < 500; i++)
buffer[i] = i & 0xff;
- obj->BufferID = 0;
- glGenBuffersARB(1, &obj->BufferID);
- assert(obj->BufferID != 0);
- glBindBufferARB(GL_ARRAY_BUFFER_ARB, obj->BufferID);
+ obj->VertexBufferID = 0;
+ glGenBuffersARB(1, &obj->VertexBufferID);
+ obj->ColorBufferID = obj->VertexBufferID;
+ assert(obj->VertexBufferID != 0);
+ glBindBufferARB(GL_ARRAY_BUFFER_ARB, obj->VertexBufferID);
glBufferDataARB(GL_ARRAY_BUFFER_ARB, 500, buffer, GL_STATIC_DRAW_ARB);
for (i = 0; i < 500; i++)
@@ -257,13 +265,18 @@ static void MakeObject1(struct object *obj)
}
+/*
+ * Interleaved position/color data.
+ */
static void MakeObject2(struct object *obj)
{
GLfloat *v;
int start = 40; /* bytes, to test non-zero array offsets */
- glGenBuffersARB(1, &obj->BufferID);
- glBindBufferARB(GL_ARRAY_BUFFER_ARB, obj->BufferID);
+ glGenBuffersARB(1, &obj->VertexBufferID);
+ obj->ColorBufferID = obj->VertexBufferID;
+
+ glBindBufferARB(GL_ARRAY_BUFFER_ARB, obj->VertexBufferID);
glBufferDataARB(GL_ARRAY_BUFFER_ARB, 1000, NULL, GL_STATIC_DRAW_ARB);
v = (GLfloat *) glMapBufferARB(GL_ARRAY_BUFFER_ARB, GL_WRITE_ONLY_ARB);
@@ -287,6 +300,9 @@ static void MakeObject2(struct object *obj)
}
+/*
+ * Use an index buffer and glDrawElements().
+ */
static void MakeObject3(struct object *obj)
{
GLfloat vertexData[1000];
@@ -314,8 +330,10 @@ static void MakeObject3(struct object *obj)
bytes = obj->NumVerts * (3 + 3) * sizeof(GLfloat);
/* Don't use glMap/UnmapBuffer for this object */
- glGenBuffersARB(1, &obj->BufferID);
- glBindBufferARB(GL_ARRAY_BUFFER_ARB, obj->BufferID);
+ glGenBuffersARB(1, &obj->VertexBufferID);
+ obj->ColorBufferID = obj->VertexBufferID;
+
+ glBindBufferARB(GL_ARRAY_BUFFER_ARB, obj->VertexBufferID);
glBufferDataARB(GL_ARRAY_BUFFER_ARB, bytes, vertexData, GL_STATIC_DRAW_ARB);
/* Setup a buffer of indices to test the ELEMENTS path */
@@ -332,6 +350,46 @@ static void MakeObject3(struct object *obj)
}
+/*
+ * Vertex and color data in different buffers.
+ */
+static void MakeObject4(struct object *obj)
+{
+ static const GLfloat vertexData[] = {
+ 0, -1, 0,
+ 0.5, 0, 0,
+ 0, 1, 0,
+ -0.5, 0, 0
+ };
+ static const GLfloat colorData[] = {
+ 1, 1, 1,
+ 1, 1, 0,
+ .5, .5, 0,
+ 1, 1, 0
+ };
+
+ obj->VertexOffset = 0;
+ obj->VertexStride = 0;
+ obj->ColorOffset = 0;
+ obj->ColorStride = 0;
+ obj->NumVerts = 4;
+
+ glGenBuffersARB(1, &obj->VertexBufferID);
+ glBindBufferARB(GL_ARRAY_BUFFER_ARB, obj->VertexBufferID);
+ glBufferDataARB(GL_ARRAY_BUFFER_ARB, sizeof(vertexData), vertexData,
+ GL_STATIC_DRAW_ARB);
+
+ glGenBuffersARB(1, &obj->ColorBufferID);
+ glBindBufferARB(GL_ARRAY_BUFFER_ARB, obj->ColorBufferID);
+ glBufferDataARB(GL_ARRAY_BUFFER_ARB, sizeof(colorData), colorData,
+ GL_STATIC_DRAW_ARB);
+
+ /* Setup a buffer of indices to test the ELEMENTS path */
+ obj->ElementsBufferID = 0;
+ obj->NumElements = 0;
+}
+
+
static void Init( void )
{
@@ -358,7 +416,8 @@ static void Init( void )
MakeObject1(Objects + 0);
MakeObject2(Objects + 1);
MakeObject3(Objects + 2);
- NumObjects = 3;
+ MakeObject4(Objects + 3);
+ NumObjects = 4;
}
@@ -369,6 +428,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( 600, 300 );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
Win = glutCreateWindow(argv[0]);
+ glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutSpecialFunc( SpecialKey );
diff --git a/progs/tests/bug_3050.c b/progs/tests/bug_3050.c
index 4ea7b80f231..a04e40eaf6e 100644
--- a/progs/tests/bug_3050.c
+++ b/progs/tests/bug_3050.c
@@ -39,6 +39,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <GL/glew.h>
#include <GL/glut.h>
static int Width = 400;
@@ -154,6 +155,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( Width, Height );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
glutCreateWindow( "Bug #3050 Test" );
+ glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );
diff --git a/progs/tests/bug_3101.c b/progs/tests/bug_3101.c
index 761dcbb9513..06a97761557 100644
--- a/progs/tests/bug_3101.c
+++ b/progs/tests/bug_3101.c
@@ -34,6 +34,7 @@
#include <stdio.h>
#include <stdlib.h>
+#include <GL/glew.h>
#include <GL/glut.h>
static int Width = 400;
@@ -119,6 +120,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( Width, Height );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
glutCreateWindow( "Bug #3101 Test" );
+ glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );
diff --git a/progs/tests/bug_3195.c b/progs/tests/bug_3195.c
index 4aceae04abe..a075b94e370 100644
--- a/progs/tests/bug_3195.c
+++ b/progs/tests/bug_3195.c
@@ -36,6 +36,7 @@
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
+#include <GL/glew.h>
#include <GL/glut.h>
#include <GL/glext.h>
@@ -264,6 +265,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( 350, 350 );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
glutCreateWindow( "Bug #3195 Test" );
+ glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutSpecialFunc( SpecialKey );
diff --git a/progs/tests/bug_texstore_i8.c b/progs/tests/bug_texstore_i8.c
index f8dac210f7a..10e5eba7c5e 100644
--- a/progs/tests/bug_texstore_i8.c
+++ b/progs/tests/bug_texstore_i8.c
@@ -29,6 +29,7 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
+#include <GL/glew.h>
#include <GL/glut.h>
static GLenum Target = GL_TEXTURE_2D;
@@ -180,6 +181,7 @@ int main(int argc, char **argv)
glutInitDisplayMode(type);
win = glutCreateWindow("Tex test");
+ glewInit();
if (!win) {
exit(1);
}
diff --git a/progs/tests/bumpmap.c b/progs/tests/bumpmap.c
new file mode 100644
index 00000000000..1b7ec2c135c
--- /dev/null
+++ b/progs/tests/bumpmap.c
@@ -0,0 +1,208 @@
+/*
+ * Copyright (c) 2009 VMware, Inc.
+ * 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
+ * on the rights to use, copy, modify, merge, publish, distribute, sub
+ * license, 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 (including the next
+ * paragraph) 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 NON-INFRINGEMENT. IN NO EVENT SHALL
+ * VA LINUX SYSTEM, IBM AND/OR THEIR SUPPLIERS 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.
+ */
+
+/**
+ * Simple test for testing ATI_envmap_bumpmap support.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <math.h>
+#include <GL/glut.h>
+
+#include "readtex.h"
+
+static PFNGLGETTEXBUMPPARAMETERFVATIPROC glGetTexBumpParameterfvATI_func = NULL;
+static PFNGLGETTEXBUMPPARAMETERIVATIPROC glGetTexBumpParameterivATI_func = NULL;
+static PFNGLTEXBUMPPARAMETERFVATIPROC glTexBumpParameterfvATI_func = NULL;
+
+static const char *TexFile = "../images/arch.rgb";
+
+static const GLfloat Near = 5.0, Far = 25.0;
+
+static void Display( void )
+{
+ /* together with the construction of dudv map, do fixed translation
+ in y direction (up), some cosine deformation in x and more
+ deformation in y dir */
+ GLfloat bumpMatrix[4] = {0.1, 0.0, 0.2, 0.1};
+
+
+ glClearColor(0.2, 0.2, 0.8, 0);
+ glClear( GL_COLOR_BUFFER_BIT );
+
+ glPushMatrix();
+
+ /* this is the base map */
+ glActiveTexture( GL_TEXTURE0 );
+ glEnable( GL_TEXTURE_2D );
+ glBindTexture( GL_TEXTURE_2D, 1 );
+ glTexEnvf( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE );
+ glTexEnvf( GL_TEXTURE_ENV, GL_COMBINE_RGB, GL_REPLACE );
+ glTexEnvf( GL_TEXTURE_ENV, GL_SOURCE0_RGB, GL_TEXTURE );
+
+ /* bump map */
+ glActiveTexture( GL_TEXTURE1 );
+ glEnable( GL_TEXTURE_2D );
+ glBindTexture( GL_TEXTURE_2D, 2 );
+ glTexEnvf( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE );
+ glTexEnvf( GL_TEXTURE_ENV, GL_COMBINE_RGB, GL_BUMP_ENVMAP_ATI );
+ glTexEnvf( GL_TEXTURE_ENV, GL_BUMP_TARGET_ATI, GL_TEXTURE0);
+
+ glTexBumpParameterfvATI_func(GL_BUMP_ROT_MATRIX_ATI, bumpMatrix);
+
+ glCallList(1);
+
+ glPopMatrix();
+
+ glutSwapBuffers();
+}
+
+
+static void Reshape( int width, int height )
+{
+ GLfloat ar = (float) width / (float) height;
+ glViewport( 0, 0, width, height );
+ glMatrixMode( GL_PROJECTION );
+ glLoadIdentity();
+ glFrustum( -ar, ar, -1.0, 1.0, Near, Far );
+ glMatrixMode( GL_MODELVIEW );
+ glLoadIdentity();
+ glTranslatef( 0.0, 0.0, -6.0 );
+}
+
+
+static void Key( unsigned char key, int x, int y )
+{
+ (void) x;
+ (void) y;
+ switch (key) {
+ case 27:
+ exit(0);
+ break;
+ }
+ glutPostRedisplay();
+}
+
+
+static void Init( void )
+{
+ const char * const ver_string = (const char * const)
+ glGetString( GL_VERSION );
+ GLfloat temp[16][16][2];
+ GLubyte *image = NULL;
+ GLint imgWidth, imgHeight;
+ GLenum imgFormat;
+ GLint i,j;
+ GLint param, paramArray[16];
+ GLfloat paramMat[4];
+
+ printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
+ printf("GL_VERSION = %s\n", ver_string);
+
+ if ( !glutExtensionSupported("GL_ATI_envmap_bumpmap")) {
+ printf("\nSorry, this program requires GL_ATI_envmap_bumpmap\n");
+ exit(1);
+ }
+
+ glGetTexBumpParameterfvATI_func = glutGetProcAddress("glGetTexBumpParameterfvATI");
+ glGetTexBumpParameterivATI_func = glutGetProcAddress("glGetTexBumpParameterivATI");
+ glTexBumpParameterfvATI_func = glutGetProcAddress("glTexBumpParameterfvATI");
+
+ glGetTexBumpParameterivATI_func(GL_BUMP_ROT_MATRIX_SIZE_ATI, &param);
+ printf("BUMP_ROT_MATRIX_SIZE_ATI = %d\n", param);
+ glGetTexBumpParameterivATI_func(GL_BUMP_NUM_TEX_UNITS_ATI, &param);
+ printf("BUMP_NUM_TEX_UNITS_ATI = %d\n", param);
+ glGetTexBumpParameterfvATI_func(GL_BUMP_ROT_MATRIX_ATI, paramMat);
+ printf("initial rot matrix %f %f %f %f\n", paramMat[0], paramMat[1], paramMat[2], paramMat[3]);
+ glGetTexBumpParameterivATI_func(GL_BUMP_TEX_UNITS_ATI, paramArray);
+ printf("units supporting bump mapping: ");
+ for (i = 0; i < param; i++)
+ printf("%d ", paramArray[i] - GL_TEXTURE0);
+ printf("\n");
+
+ image = LoadRGBImage(TexFile, &imgWidth, &imgHeight, &imgFormat);
+ if (!image) {
+ printf("Couldn't read %s\n", TexFile);
+ exit(0);
+ }
+
+ glBindTexture( GL_TEXTURE_2D, 1 );
+ 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_CLAMP_TO_EDGE );
+ glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE );
+ glTexImage2D( GL_TEXTURE_2D, 0, imgFormat, imgWidth, imgHeight, 0,
+ imgFormat, GL_UNSIGNED_BYTE, image );
+
+ for (j = 0; j < 16; j++) {
+ for (i = 0; i < 16; i++) {
+ temp[j][i][0] = cos((float)(i) * 3.1415 / 16.0);
+ temp[j][i][1] = -0.5;
+ }
+ }
+ glBindTexture( GL_TEXTURE_2D, 2 );
+ glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR );
+ glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR );
+ glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE );
+ glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE );
+ glTexImage2D( GL_TEXTURE_2D, 0, GL_DU8DV8_ATI, 16, 16, 0,
+ GL_DUDV_ATI, GL_FLOAT, temp );
+
+
+ glNewList( 1, GL_COMPILE );
+ glBegin(GL_QUADS);
+ glColor3f( 0.9, 0.0, 0.0 );
+ glMultiTexCoord2f( GL_TEXTURE0, 0.0, 0.0 );
+ glMultiTexCoord2f( GL_TEXTURE1, 0.0, 0.0 );
+ glVertex2f(-1, -1);
+ glMultiTexCoord2f( GL_TEXTURE0, 1.0, 0.0 );
+ glMultiTexCoord2f( GL_TEXTURE1, 1.0, 0.0 );
+ glVertex2f( 1, -1);
+ glMultiTexCoord2f( GL_TEXTURE0, 1.0, 1.0 );
+ glMultiTexCoord2f( GL_TEXTURE1, 1.0, 1.0 );
+ glVertex2f( 1, 1);
+ glMultiTexCoord2f( GL_TEXTURE0, 0.0, 1.0 );
+ glMultiTexCoord2f( GL_TEXTURE1, 0.0, 1.0 );
+ glVertex2f(-1, 1);
+ glEnd();
+ glEndList();
+}
+
+
+int main( int argc, char *argv[] )
+{
+ glutInit( &argc, argv );
+ glutInitWindowPosition( 0, 0 );
+ glutInitWindowSize( 400, 400 );
+ glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
+ glutCreateWindow( "GL_ATI_envmap_bumpmap test" );
+ glutReshapeFunc( Reshape );
+ glutKeyboardFunc( Key );
+ glutDisplayFunc( Display );
+ Init();
+ glutMainLoop();
+ return 0;
+}
diff --git a/progs/tests/calibrate_rast.c b/progs/tests/calibrate_rast.c
index 37d8ac85e54..5d89ff79c55 100644
--- a/progs/tests/calibrate_rast.c
+++ b/progs/tests/calibrate_rast.c
@@ -19,6 +19,7 @@
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
+#include <GL/glew.h>
#include <GL/glut.h>
@@ -386,6 +387,7 @@ main(int argc, char *argv[])
glutInitWindowSize(Width, Height);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE);
Win = glutCreateWindow(argv[0]);
+ glewInit();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutDisplayFunc(Draw);
diff --git a/progs/tests/copypixrate.c b/progs/tests/copypixrate.c
index 142315364c6..aa4acfc18b5 100644
--- a/progs/tests/copypixrate.c
+++ b/progs/tests/copypixrate.c
@@ -5,11 +5,11 @@
* 26 Jan 2006
*/
-#define GL_GLEXT_PROTOTYPES
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
+#include <GL/glew.h>
#include <GL/glut.h>
static GLint WinWidth = 1000, WinHeight = 800;
@@ -260,6 +260,7 @@ main(int argc, char *argv[])
glutInitWindowSize(WinWidth, WinHeight);
glutInitDisplayMode(mode);
glutCreateWindow(argv[0]);
+ glewInit();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutSpecialFunc(SpecialKey);
diff --git a/progs/tests/crossbar.c b/progs/tests/crossbar.c
index 12aabb1c9ad..3dd21372f9a 100644
--- a/progs/tests/crossbar.c
+++ b/progs/tests/crossbar.c
@@ -35,6 +35,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <GL/glew.h>
#include <GL/glut.h>
static const GLint tests[][8] = {
@@ -226,6 +227,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( Width, Height );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
glutCreateWindow( "GL_ARB_texture_env_crossbar test" );
+ glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );
diff --git a/progs/tests/cva.c b/progs/tests/cva.c
index a9393aef0ca..80483900cb7 100644
--- a/progs/tests/cva.c
+++ b/progs/tests/cva.c
@@ -15,6 +15,7 @@
#include <windows.h>
#endif
#define GL_GLEXT_LEGACY
+#include <GL/glew.h>
#include <GL/glut.h>
#include <GL/glext.h>
@@ -129,6 +130,7 @@ int main( int argc, char **argv )
glutInitWindowSize( 250, 250 );
glutInitWindowPosition( 100, 100 );
glutCreateWindow( "CVA Test" );
+ glewInit();
/* Make sure the server supports GL 1.2 vertex arrays.
*/
diff --git a/progs/tests/debugger.c b/progs/tests/debugger.c
index 4c6955bcfc6..1c2f9bebca6 100644
--- a/progs/tests/debugger.c
+++ b/progs/tests/debugger.c
@@ -9,7 +9,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#define GL_GLEXT_PROTOTYPES
+#include <GL/glew.h>
#include <GL/glut.h>
@@ -81,6 +81,7 @@ find_line_column(const GLubyte *string, const GLubyte *pos,
#define NV_FRAGMENT_PROGRAM 4
+
struct breakpoint {
enum {PIXEL, LINE} type;
int x, y;
@@ -101,7 +102,7 @@ static void Debugger2(GLenum target, GLvoid *data)
{
static GLuint skipCount = 0;
const GLubyte *ln;
- GLint pos, line, column;
+ GLint pos = 0, line, column;
GLint id;
int progType;
GLint len;
@@ -721,6 +722,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( 200, 200 );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
glutCreateWindow(argv[0]);
+ glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutSpecialFunc( SpecialKey );
diff --git a/progs/tests/dinoshade.c b/progs/tests/dinoshade.c
index 44115b9209d..fb7c3f4535c 100644
--- a/progs/tests/dinoshade.c
+++ b/progs/tests/dinoshade.c
@@ -43,6 +43,7 @@
#include <windows.h>
#endif
#define GL_GLEXT_LEGACY
+#include <GL/glew.h> /* OpenGL Utility Toolkit header */
#include <GL/glut.h> /* OpenGL Utility Toolkit header */
/* Some <math.h> files do not define M_PI... */
@@ -823,6 +824,7 @@ main(int argc, char **argv)
#endif
glutCreateWindow("Shadowy Leapin' Lizards");
+ glewInit();
if (glutGet(GLUT_WINDOW_STENCIL_SIZE) <= 1) {
printf("dinoshade: Sorry, I need at least 2 bits of stencil.\n");
diff --git a/progs/tests/drawbuffers.c b/progs/tests/drawbuffers.c
index 5e89569380a..d75a870c26b 100644
--- a/progs/tests/drawbuffers.c
+++ b/progs/tests/drawbuffers.c
@@ -7,11 +7,11 @@
*/
-#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 "extfuncs.h"
@@ -294,6 +294,7 @@ main(int argc, char *argv[])
glutInitWindowSize(Width, Height);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE);
Win = glutCreateWindow(argv[0]);
+ glewInit();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutDisplayFunc(Display);
diff --git a/progs/tests/exactrast.c b/progs/tests/exactrast.c
index 56c0c79c3fa..63b8336d973 100644
--- a/progs/tests/exactrast.c
+++ b/progs/tests/exactrast.c
@@ -26,6 +26,7 @@
#include <stdio.h>
#include <stdlib.h>
+#include <GL/glew.h>
#include <GL/glut.h>
static int Width = 400, Height = 400;
@@ -34,14 +35,14 @@ static float Xtrans = 0, Ytrans = 0;
static float Step = 0.125;
enum {
- POINTS,
- HLINES,
- VLINES,
- QUADS,
+ MODE_POINTS,
+ MODE_HLINES,
+ MODE_VLINES,
+ MODE_QUADS,
NUM_MODES
};
-static int Mode = POINTS;
+static int Mode = MODE_POINTS;
static void
@@ -58,7 +59,7 @@ Draw(void)
glPushMatrix();
glTranslatef(tx + Xtrans, ty + Ytrans, 0);
- if (Mode == POINTS) {
+ if (Mode == MODE_POINTS) {
glBegin(GL_POINTS);
for (j = 0; j < Height; j += 2) {
for (i = 0; i < Width; i += 2) {
@@ -67,7 +68,7 @@ Draw(void)
}
glEnd();
}
- else if (Mode == HLINES) {
+ else if (Mode == MODE_HLINES) {
glBegin(GL_LINES);
for (i = 0; i < Height; i += 2) {
glVertex2f(0, i);
@@ -75,7 +76,7 @@ Draw(void)
}
glEnd();
}
- else if (Mode == VLINES) {
+ else if (Mode == MODE_VLINES) {
glBegin(GL_LINES);
for (i = 0; i < Width; i += 2) {
glVertex2f(i, 0 );
@@ -83,7 +84,7 @@ Draw(void)
}
glEnd();
}
- else if (Mode == QUADS) {
+ else if (Mode == MODE_QUADS) {
glBegin(GL_QUADS);
for (j = 0; j < Height; j += 4) {
for (i = 0; i < Width; i += 4) {
@@ -189,6 +190,7 @@ main(int argc, char *argv[])
glutInitWindowSize(Width, Height);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE);
Win = glutCreateWindow(argv[0]);
+ glewInit();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutSpecialFunc(SpecialKey);
diff --git a/progs/tests/ext422square.c b/progs/tests/ext422square.c
index 6533514d697..89e99f02926 100644
--- a/progs/tests/ext422square.c
+++ b/progs/tests/ext422square.c
@@ -12,7 +12,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#define GL_GLEXT_PROTOTYPES
+#include <GL/glew.h>
#include <GL/glut.h>
#include <assert.h>
@@ -249,6 +249,7 @@ int main( int argc, char *argv[] )
glutInitWindowPosition( 0, 0 );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
glutCreateWindow(argv[0] );
+ glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutSpecialFunc( SpecialKey );
diff --git a/progs/tests/fbotest1.c b/progs/tests/fbotest1.c
index ab2757c3c3d..8dac21494e6 100644
--- a/progs/tests/fbotest1.c
+++ b/progs/tests/fbotest1.c
@@ -6,11 +6,11 @@
*/
-#define GL_GLEXT_PROTOTYPES
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
+#include <GL/glew.h>
#include <GL/glut.h>
static int Win;
@@ -202,6 +202,7 @@ main( int argc, char *argv[] )
glutInitWindowSize(Width, Height);
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
Win = glutCreateWindow(argv[0]);
+ glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );
diff --git a/progs/tests/fbotest2.c b/progs/tests/fbotest2.c
index 5283c7e1fd6..f9c506193f6 100644
--- a/progs/tests/fbotest2.c
+++ b/progs/tests/fbotest2.c
@@ -6,11 +6,11 @@
*/
-#define GL_GLEXT_PROTOTYPES
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
+#include <GL/glew.h>
#include <GL/glut.h>
static int Win = 0;
@@ -191,6 +191,7 @@ main( int argc, char *argv[] )
glutInitWindowSize(Width, Height);
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
Win = glutCreateWindow(argv[0]);
+ glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );
diff --git a/progs/tests/fbotexture.c b/progs/tests/fbotexture.c
index 1f7c45fc794..50a4b00afce 100644
--- a/progs/tests/fbotexture.c
+++ b/progs/tests/fbotexture.c
@@ -9,7 +9,7 @@
*/
-#define GL_GLEXT_PROTOTYPES
+#include <GL/glew.h>
#include <GL/glut.h>
#include <assert.h>
#include <stdio.h>
@@ -26,9 +26,16 @@
static int Win = 0;
static int Width = 400, Height = 400;
-static GLenum TexTarget = GL_TEXTURE_2D; /*GL_TEXTURE_RECTANGLE_ARB;*/
+#if 1
+static GLenum TexTarget = GL_TEXTURE_2D;
static int TexWidth = 512, TexHeight = 512;
-/*static int TexWidth = 600, TexHeight = 600;*/
+static GLenum TexIntFormat = GL_RGB; /* either GL_RGB or GL_RGBA */
+#else
+static GLenum TexTarget = GL_TEXTURE_RECTANGLE_ARB;
+static int TexWidth = 200, TexHeight = 200;
+static GLenum TexIntFormat = GL_RGB5; /* either GL_RGB or GL_RGBA */
+#endif
+static GLuint TextureLevel = 0; /* which texture level to render to */
static GLuint MyFB;
static GLuint TexObj;
@@ -38,8 +45,6 @@ static GLfloat Rot = 0.0;
static GLboolean UsePackedDepthStencil = GL_FALSE;
static GLboolean UsePackedDepthStencilBoth = GL_FALSE;
static GLboolean Use_ARB_fbo = GL_FALSE;
-static GLuint TextureLevel = 0; /* which texture level to render to */
-static GLenum TexIntFormat = GL_RGB; /* either GL_RGB or GL_RGBA */
static GLboolean Cull = GL_FALSE;
static GLboolean Wireframe = GL_FALSE;
@@ -404,8 +409,12 @@ AttachDepthAndStencilBuffers(GLuint fbo,
return GL_FALSE;
status = glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT);
- if (status != GL_FRAMEBUFFER_COMPLETE_EXT)
+ if (status != GL_FRAMEBUFFER_COMPLETE_EXT) {
+ glDeleteRenderbuffersEXT(1, depthRbOut);
+ *depthRbOut = 0;
+ glDeleteRenderbuffersEXT(1, &rb);
return GL_FALSE;
+ }
*stencilRbOut = rb;
}
@@ -554,15 +563,17 @@ Init(void)
/* make two image levels */
glTexImage2D(TexTarget, 0, TexIntFormat, TexWidth, TexHeight, 0,
GL_RGBA, GL_UNSIGNED_BYTE, NULL);
- glTexImage2D(TexTarget, 1, TexIntFormat, TexWidth/2, TexHeight/2, 0,
- GL_RGBA, GL_UNSIGNED_BYTE, NULL);
- TexWidth = TexWidth >> TextureLevel;
- TexHeight = TexHeight >> TextureLevel;
+ if (TexTarget == GL_TEXTURE_2D) {
+ glTexImage2D(TexTarget, 1, TexIntFormat, TexWidth/2, TexHeight/2, 0,
+ GL_RGBA, GL_UNSIGNED_BYTE, NULL);
+ TexWidth = TexWidth >> TextureLevel;
+ TexHeight = TexHeight >> TextureLevel;
+ glTexParameteri(TexTarget, GL_TEXTURE_MAX_LEVEL, TextureLevel);
+ }
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);
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
}
@@ -576,7 +587,7 @@ Usage(void)
printf("Usage:\n");
printf(" -ds Use combined depth/stencil renderbuffer\n");
printf(" -arb Try GL_ARB_framebuffer_object's mismatched buffer sizes\n");
- printf(" -ds2 Tye GL_ARB_framebuffer_object's GL_DEPTH_STENCIL_ATTACHMENT\n");
+ printf(" -ds2 Try GL_ARB_framebuffer_object's GL_DEPTH_STENCIL_ATTACHMENT\n");
printf("Keys:\n");
printf(" a Toggle animation\n");
printf(" s/s Step/rotate\n");
@@ -594,6 +605,7 @@ main(int argc, char *argv[])
glutInitWindowSize(Width, Height);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE);
Win = glutCreateWindow(argv[0]);
+ glewInit();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutDisplayFunc(Display);
diff --git a/progs/tests/fillrate.c b/progs/tests/fillrate.c
index 8fe636c364b..1e58df281e1 100644
--- a/progs/tests/fillrate.c
+++ b/progs/tests/fillrate.c
@@ -6,10 +6,10 @@
*/
-#define GL_GLEXT_PROTOTYPES
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
+#include <GL/glew.h>
#include <GL/glut.h>
#include "readtex.h"
@@ -194,6 +194,7 @@ main(int argc, char *argv[])
glutInitWindowSize(Width, Height);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE);
Win = glutCreateWindow(argv[0]);
+ glewInit();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutDisplayFunc(Draw);
diff --git a/progs/tests/floattex.c b/progs/tests/floattex.c
index dd6d882089c..dd99d836c64 100644
--- a/progs/tests/floattex.c
+++ b/progs/tests/floattex.c
@@ -8,6 +8,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
+#include <GL/glew.h>
#include <GL/glut.h>
#include "extfuncs.h"
#include "readtex.h"
@@ -230,6 +231,7 @@ main(int argc, char *argv[])
glutInitWindowSize(400, 400);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
glutCreateWindow(argv[0]);
+ glewInit();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutDisplayFunc(Draw);
diff --git a/progs/tests/fog.c b/progs/tests/fog.c
index ecd9f533f99..b6cea8c080a 100644
--- a/progs/tests/fog.c
+++ b/progs/tests/fog.c
@@ -30,10 +30,10 @@
* Test to exercise fog modes and for comparison with GL_EXT_fog_coord.
*/
-#define GL_GLEXT_PROTOTYPES
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
+#include <GL/glew.h>
#include <GL/glut.h>
static int Width = 600;
@@ -190,6 +190,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( Width, Height );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
glutCreateWindow(argv[0]);
+ glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );
diff --git a/progs/tests/fogcoord.c b/progs/tests/fogcoord.c
index 89355742aad..7822d33b09f 100644
--- a/progs/tests/fogcoord.c
+++ b/progs/tests/fogcoord.c
@@ -3,10 +3,10 @@
*/
-#define GL_GLEXT_PROTOTYPES
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
+#include <GL/glew.h>
#include <GL/glut.h>
static int Width = 600;
@@ -93,6 +93,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( Width, Height );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
glutCreateWindow(argv[0]);
+ glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );
diff --git a/progs/tests/fptest1.c b/progs/tests/fptest1.c
index 095190a8aef..2b8f8d0f5ec 100644
--- a/progs/tests/fptest1.c
+++ b/progs/tests/fptest1.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>
@@ -216,6 +216,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( 250, 250 );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
glutCreateWindow(argv[0]);
+ glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );
diff --git a/progs/tests/fptexture.c b/progs/tests/fptexture.c
index f57ad628282..332e07182dc 100644
--- a/progs/tests/fptexture.c
+++ b/progs/tests/fptexture.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>
#include "../util/readtex.c"
@@ -141,6 +141,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( 250, 250 );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
glutCreateWindow(argv[0]);
+ glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutSpecialFunc( SpecialKey );
diff --git a/progs/tests/interleave.c b/progs/tests/interleave.c
index e98b3ed0469..47bf9dfbe5e 100644
--- a/progs/tests/interleave.c
+++ b/progs/tests/interleave.c
@@ -36,6 +36,7 @@
#include <stdlib.h>
#include <string.h>
#include <time.h>
+#include <GL/glew.h>
#include <GL/glut.h>
static int Width = 400;
@@ -386,6 +387,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( Width, Height );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
glutCreateWindow( "glInterleavedArrays test" );
+ glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );
diff --git a/progs/tests/invert.c b/progs/tests/invert.c
index 750592ed79f..63099fbd221 100644
--- a/progs/tests/invert.c
+++ b/progs/tests/invert.c
@@ -35,6 +35,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <GL/glew.h>
#include <GL/glut.h>
#include "readtex.h"
@@ -186,6 +187,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( Width, Height );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
glutCreateWindow( "GL_MESA_pack_invert test" );
+ glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );
diff --git a/progs/tests/lineclip.c b/progs/tests/lineclip.c
index 098f5e92ebd..bb688c04a5f 100644
--- a/progs/tests/lineclip.c
+++ b/progs/tests/lineclip.c
@@ -26,6 +26,7 @@
*/
#include <stdlib.h>
+#include <GL/glew.h>
#include <GL/glut.h>
static int win_width, win_height;
@@ -164,6 +165,7 @@ main(int argc, char *argv[])
glutInitWindowSize(win_width, win_height);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
glutCreateWindow(argv[0]);
+ glewInit();
glutReshapeFunc(reshape);
glutKeyboardFunc(key);
glutDisplayFunc(display);
diff --git a/progs/tests/manytex.c b/progs/tests/manytex.c
index 83c86766571..52e7e1de44a 100644
--- a/progs/tests/manytex.c
+++ b/progs/tests/manytex.c
@@ -13,6 +13,7 @@
#include <stdlib.h>
#include <string.h>
#include <math.h>
+#include <GL/glew.h>
#include <GL/glut.h>
@@ -336,6 +337,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( WinWidth, WinHeight );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
Win = glutCreateWindow(argv[0]);
+ glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );
diff --git a/progs/tests/mapbufrange.c b/progs/tests/mapbufrange.c
new file mode 100644
index 00000000000..0021bb26071
--- /dev/null
+++ b/progs/tests/mapbufrange.c
@@ -0,0 +1,205 @@
+/*
+ * Test glMapBuffer() and glMapBufferRange()
+ *
+ * Fill a VBO with vertex data to draw several colored quads.
+ * On each redraw, update the geometry for just one rect in the VBO.
+ *
+ * Brian Paul
+ * 4 March 2009
+ */
+
+
+#include <assert.h>
+#include <math.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <GL/glew.h>
+#include <GL/glew.h>
+#include <GL/glut.h>
+
+static GLuint Win;
+static const GLuint NumRects = 10;
+static GLuint BufferID;
+static GLboolean Anim = GL_TRUE;
+static GLboolean UseBufferRange = GL_FALSE;
+
+
+
+static const float RectData[] = {
+ /* vertex */ /* color */
+ 0, -1, 0, 1, 0, 0,
+ 1, 0, 0, 1, 1, 0,
+ 0, 1, 0, 0, 1, 1,
+ -1, 0, 0, 1, 0, 1
+};
+
+
+/**
+ * The buffer contains vertex positions (float[3]) and colors (float[3])
+ * for 'NumRects' quads.
+ * This function updates/rotates one quad in the buffer.
+ */
+static void
+UpdateRect(int r, float angle)
+{
+ float *rect;
+ int i;
+
+ assert(r < NumRects);
+
+ glBindBufferARB(GL_ARRAY_BUFFER_ARB, BufferID);
+ if (UseBufferRange) {
+ GLintptr offset = r * sizeof(RectData);
+ GLsizeiptr length = sizeof(RectData);
+ GLbitfield access = GL_MAP_WRITE_BIT | GL_MAP_INVALIDATE_RANGE_BIT;
+ float *buf = (float *) glMapBufferRange(GL_ARRAY_BUFFER_ARB,
+ offset, length, access);
+ rect = buf;
+ }
+ else {
+ /* map whole buffer */
+ float *buf = (float *)
+ glMapBufferARB(GL_ARRAY_BUFFER_ARB, GL_WRITE_ONLY_ARB);
+ rect = buf + r * 24;
+ }
+
+ /* set rect verts/colors */
+ memcpy(rect, RectData, sizeof(RectData));
+
+ /* loop over four verts, updating vertices */
+ for (i = 0; i < 4; i++) {
+ float x = 0.2 * RectData[i*6+0];
+ float y = 0.2 * RectData[i*6+1];
+ float xpos = -2.5 + 0.5 * r;
+ float ypos = 0.0;
+
+ /* translate and rotate vert */
+ rect[i * 6 + 0] = xpos + x * cos(angle) + y * sin(angle);
+ rect[i * 6 + 1] = ypos + x * sin(angle) - y * cos(angle);
+ }
+
+ glUnmapBufferARB(GL_ARRAY_BUFFER_ARB);
+}
+
+
+static void
+LoadBuffer(void)
+{
+ static int frame = 0;
+ float angle = glutGet(GLUT_ELAPSED_TIME) * 0.001;
+ UpdateRect(frame % NumRects, angle);
+ frame++;
+}
+
+
+static void
+Draw(void)
+{
+ glBindBufferARB(GL_ARRAY_BUFFER_ARB, BufferID);
+ glVertexPointer(3, GL_FLOAT, 24, 0);
+ glEnable(GL_VERTEX_ARRAY);
+
+ glColorPointer(3, GL_FLOAT, 24, (void*) 12);
+ glEnable(GL_COLOR_ARRAY);
+
+ glDrawArrays(GL_QUADS, 0, NumRects * 4);
+
+ if (0)
+ glFinish();
+}
+
+
+static void
+Display(void)
+{
+ glClear(GL_COLOR_BUFFER_BIT);
+ Draw();
+ glutSwapBuffers();
+}
+
+
+static void
+Reshape(int width, int height)
+{
+ glViewport(0, 0, width, height);
+ glMatrixMode(GL_PROJECTION);
+ glLoadIdentity();
+ glOrtho(-3.0, 3.0, -1.0, 1.0, -1.0, 1.0);
+ glMatrixMode(GL_MODELVIEW);
+ glLoadIdentity();
+}
+
+
+static void
+Idle(void)
+{
+ LoadBuffer();
+ glutPostRedisplay();
+}
+
+
+static void
+Key(unsigned char key, int x, int y)
+{
+ (void) x;
+ (void) y;
+ if (key == 'a') {
+ Anim = !Anim;
+ glutIdleFunc(Anim ? Idle : NULL);
+ }
+ else if (key == 's') {
+ LoadBuffer();
+ }
+ else if (key == 27) {
+ glutDestroyWindow(Win);
+ exit(0);
+ }
+ glutPostRedisplay();
+}
+
+
+static void
+Init(void)
+{
+ GLuint BufferSize = NumRects * sizeof(RectData);
+ float *buf;
+
+ if (!glutExtensionSupported("GL_ARB_vertex_buffer_object")) {
+ printf("GL_ARB_vertex_buffer_object not found!\n");
+ exit(0);
+ }
+
+ UseBufferRange = glutExtensionSupported("GL_ARB_map_buffer_range");
+ printf("Use GL_ARB_map_buffer_range: %c\n", "NY"[UseBufferRange]);
+
+ printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
+
+ /* initially load buffer with zeros */
+ buf = (float *) calloc(1, BufferSize);
+
+ glGenBuffersARB(1, &BufferID);
+ glBindBufferARB(GL_ARRAY_BUFFER_ARB, BufferID);
+ glBufferDataARB(GL_ARRAY_BUFFER_ARB, BufferSize, buf, GL_DYNAMIC_DRAW_ARB);
+
+ free(buf);
+}
+
+
+int
+main(int argc, char *argv[])
+{
+ glutInit(&argc, argv);
+ glutInitWindowSize(800, 200);
+ glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE);
+ Win = glutCreateWindow(argv[0]);
+ glewInit();
+ glewInit();
+ glutReshapeFunc(Reshape);
+ glutKeyboardFunc(Key);
+ glutDisplayFunc(Display);
+ glutIdleFunc(Anim ? Idle : NULL);
+ Init();
+ glutMainLoop();
+ return 0;
+}
diff --git a/progs/tests/mapvbo.c b/progs/tests/mapvbo.c
new file mode 100644
index 00000000000..c392e768358
--- /dev/null
+++ b/progs/tests/mapvbo.c
@@ -0,0 +1,139 @@
+/*
+ * Test glMapBuffer() call immediately after glDrawArrays().
+ * See details below.
+ *
+ * NOTE: Do not use freeglut with this test! It calls the Display()
+ * callback twice right away instead of just once.
+ *
+ * Brian Paul
+ * 27 Feb 2009
+ */
+
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <GL/glew.h>
+#include <GL/glut.h>
+
+static GLuint BufferID;
+
+
+static GLuint Win;
+
+
+
+
+/*
+ * Create VBO (position and color) and load with data.
+ */
+static void
+SetupBuffers(void)
+{
+ static const GLfloat data[] = {
+ /* vertex */ /* color */
+ 0, -1, 0, 1, 1, 0,
+ 1, 0, 0, 1, 1, 0,
+ 0, 1, 0, 1, 1, 0,
+ -1, 0, 0, 1, 1, 0
+ };
+
+ glGenBuffersARB(1, &BufferID);
+ glBindBufferARB(GL_ARRAY_BUFFER_ARB, BufferID);
+ glBufferDataARB(GL_ARRAY_BUFFER_ARB, sizeof(data), data,
+ GL_STATIC_DRAW_ARB);
+}
+
+
+static void
+Draw(void)
+{
+ static int count = 1;
+
+ printf("Draw Frame %d\n", count);
+ count++;
+
+ glBindBufferARB(GL_ARRAY_BUFFER_ARB, BufferID);
+ glVertexPointer(3, GL_FLOAT, 24, 0);
+ glEnable(GL_VERTEX_ARRAY);
+
+ glColorPointer(3, GL_FLOAT, 24, (void*) 12);
+ glEnable(GL_COLOR_ARRAY);
+
+ glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
+
+ if (0)
+ glFinish();
+
+ /* Immediately map the color buffer and change something.
+ * This should not effect the first glDrawArrays above, but the
+ * next time we draw we should see a black vertex.
+ */
+ if (1) {
+ GLfloat *m = (GLfloat *) glMapBufferARB(GL_ARRAY_BUFFER_ARB,
+ GL_WRITE_ONLY_ARB);
+ m[3] = m[4] = m[5] = 0.0f; /* black vertex */
+ glUnmapBufferARB(GL_ARRAY_BUFFER_ARB);
+ }
+}
+
+
+static void Display( void )
+{
+ glClear( GL_COLOR_BUFFER_BIT );
+ Draw();
+ glutSwapBuffers();
+}
+
+
+static void Reshape( int width, int height )
+{
+ float ar = (float) width / (float) height;
+ glViewport( 0, 0, width, height );
+ glMatrixMode( GL_PROJECTION );
+ glLoadIdentity();
+ glFrustum( -ar, ar, -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;
+ if (key == 27) {
+ glutDestroyWindow(Win);
+ exit(0);
+ }
+ glutPostRedisplay();
+}
+
+
+static void Init( void )
+{
+ if (!glutExtensionSupported("GL_ARB_vertex_buffer_object")) {
+ printf("GL_ARB_vertex_buffer_object not found!\n");
+ exit(0);
+ }
+ printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
+
+ SetupBuffers();
+}
+
+
+int main( int argc, char *argv[] )
+{
+ glutInit( &argc, argv );
+ glutInitWindowPosition( 0, 0 );
+ glutInitWindowSize( 300, 300 );
+ glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
+ Win = glutCreateWindow(argv[0]);
+ glewInit();
+ glutReshapeFunc( Reshape );
+ glutKeyboardFunc( Key );
+ glutDisplayFunc( Display );
+ Init();
+ glutMainLoop();
+ return 0;
+}
diff --git a/progs/tests/minmag.c b/progs/tests/minmag.c
index 78ef9db03ac..03019f94faa 100644
--- a/progs/tests/minmag.c
+++ b/progs/tests/minmag.c
@@ -17,6 +17,7 @@
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
+#include <GL/glew.h>
#include <GL/glut.h>
@@ -189,6 +190,7 @@ main(int argc, char *argv[])
glutInitWindowSize(Width, Height);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
glutCreateWindow(argv[0]);
+ glewInit();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutDisplayFunc(redraw);
diff --git a/progs/tests/mipgen.c b/progs/tests/mipgen.c
new file mode 100644
index 00000000000..088f643215c
--- /dev/null
+++ b/progs/tests/mipgen.c
@@ -0,0 +1,207 @@
+/* Test GL_TEXTURE_BASE_LEVEL and GL_TEXTURE_MAX_LEVEL
+ * Brian Paul
+ * 10 May 2006
+ */
+
+
+/* Copyright (c) Mark J. Kilgard, 1994. */
+
+/*
+ * (c) Copyright 1993, 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(TM) is a trademark of Silicon Graphics, Inc.
+ */
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <GL/glew.h>
+#include <GL/glut.h>
+
+#include "readtex.h"
+
+
+static GLfloat LodBias = 6.0; /* make smallest miplevel visible */
+static GLuint texImage;
+
+#define WIDTH 2
+#define HEIGHT 2
+
+static void
+InitValues(void)
+{
+ LodBias = 6.0; /* make smallest miplevel visible */
+}
+
+
+static void MakeImage(void)
+{
+ const GLubyte color0[4] = { 0xff, 0x80, 0x20, 0xff };
+ const GLubyte color1[4] = { 0x10, 0x20, 0x40, 0xff };
+
+ GLubyte img[WIDTH*HEIGHT*3];
+ int i, j;
+ for (i = 0; i < HEIGHT; i++) {
+ for (j = 0; j < WIDTH; j++) {
+ int k = (i * WIDTH + j) * 3;
+ int p = ((i+j)%2);
+ if (p == 0) {
+ img[k + 0] = color0[0];
+ img[k + 1] = color0[1];
+ img[k + 2] = color0[2];
+ }
+ else {
+ img[k + 0] = color1[0];
+ img[k + 1] = color1[1];
+ img[k + 2] = color1[2];
+ }
+ }
+ }
+
+ glTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP_SGIS, GL_TRUE);
+ glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, WIDTH, HEIGHT, 0,
+ GL_RGB, GL_UNSIGNED_BYTE, img);
+ glTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP_SGIS, GL_FALSE);
+}
+
+
+
+static void myinit(void)
+{
+ InitValues();
+
+ glShadeModel(GL_FLAT);
+
+ glTranslatef(0.0, 0.0, -3.6);
+
+ glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
+ glGenTextures(1, &texImage);
+ glBindTexture(GL_TEXTURE_2D, texImage);
+ MakeImage();
+
+ glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
+ glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
+ glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_DECAL);
+ glEnable(GL_TEXTURE_2D);
+
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_BASE_LEVEL, 0);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, 1);
+
+ glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_LOD, -1);
+ glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_LOD, 1);
+
+ glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
+ glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER,
+ GL_NEAREST_MIPMAP_NEAREST);
+}
+
+
+
+static void display(void)
+{
+ GLfloat tcm = 1.0;
+ glBindTexture(GL_TEXTURE_2D, texImage);
+
+ printf("Bias=%.2g\n", LodBias);
+ fflush(stdout);
+
+ glTexEnvf(GL_TEXTURE_FILTER_CONTROL_EXT, GL_TEXTURE_LOD_BIAS_EXT, LodBias);
+
+ glClear(GL_COLOR_BUFFER_BIT);
+ glBegin(GL_QUADS);
+ glTexCoord2f(0.0, 0.0); glVertex3f(-2.0, -1.0, 0.0);
+ glTexCoord2f(0.0, tcm); glVertex3f(-2.0, 1.0, 0.0);
+ glTexCoord2f(tcm * 3000.0, tcm); glVertex3f(3000.0, 1.0, -6000.0);
+ glTexCoord2f(tcm * 3000.0, 0.0); glVertex3f(3000.0, -1.0, -6000.0);
+ glEnd();
+ glFlush();
+}
+
+static void myReshape(int w, int h)
+{
+ glViewport(0, 0, w, h);
+ glMatrixMode(GL_PROJECTION);
+ glLoadIdentity();
+ gluPerspective(60.0, 1.0*(GLfloat)w/(GLfloat)h, 1.0, 30000.0);
+ glMatrixMode(GL_MODELVIEW);
+ glLoadIdentity();
+}
+
+static void
+key(unsigned char k, int x, int y)
+{
+ (void) x;
+ (void) y;
+ switch (k) {
+ case 'l':
+ LodBias -= 0.25;
+ break;
+ case 'L':
+ LodBias += 0.25;
+ break;
+ case ' ':
+ InitValues();
+ break;
+ case 27: /* Escape */
+ exit(0);
+ break;
+ default:
+ return;
+ }
+ glutPostRedisplay();
+}
+
+
+static void usage(void)
+{
+ printf("usage:\n");
+ printf(" l/L decrease/increase GL_TEXTURE_LOD_BIAS\n");
+ printf(" SPACE reset values\n");
+}
+
+
+int main(int argc, char** argv)
+{
+ glutInit(&argc, argv);
+ glutInitDisplayMode (GLUT_SINGLE | GLUT_RGB );
+ glutInitWindowSize (600, 600);
+ glutCreateWindow (argv[0]);
+ glewInit();
+ myinit();
+ glutReshapeFunc (myReshape);
+ glutDisplayFunc(display);
+ glutKeyboardFunc(key);
+ usage();
+ glutMainLoop();
+ return 0; /* ANSI C requires main to return int. */
+}
diff --git a/progs/tests/mipmap_limits.c b/progs/tests/mipmap_limits.c
index 8bdad826f7c..5b899cd1551 100644
--- a/progs/tests/mipmap_limits.c
+++ b/progs/tests/mipmap_limits.c
@@ -51,19 +51,25 @@
*/
#include <stdlib.h>
#include <stdio.h>
+#include <GL/glew.h>
#include <GL/glut.h>
-static GLint BaseLevel = 0, MaxLevel = 8;
+#include "readtex.h"
+
+#define TEXTURE_FILE "../images/girl.rgb"
+
+static GLint BaseLevel = 0, MaxLevel = 9;
static GLfloat MinLod = -1, MaxLod = 9;
static GLfloat LodBias = 0.0;
static GLboolean NearestFilter = GL_TRUE;
+static GLuint texImage, texColor, texCurrent;
static void
InitValues(void)
{
BaseLevel = 0;
- MaxLevel = 8;
+ MaxLevel = 9;
MinLod = -1;
MaxLod = 9;
LodBias = 0.0;
@@ -74,7 +80,7 @@ InitValues(void)
static void MakeImage(int level, int width, int height, const GLubyte color[4])
{
const int makeStripes = 0;
- GLubyte img[256*256*3];
+ GLubyte img[512*512*3];
int i, j;
for (i = 0; i < height; i++) {
for (j = 0; j < width; j++) {
@@ -98,87 +104,138 @@ static void MakeImage(int level, int width, int height, const GLubyte color[4])
}
-static void makeImages(void)
+static void makeImages(int image)
{
- static const GLubyte colors[8][3] = {
- {128, 128, 128 },
- { 0, 255, 255 },
- { 255, 255, 0 },
- { 255, 0, 255 },
- { 255, 0, 0 },
- { 0, 255, 0 },
- { 0, 0, 255 },
- { 255, 255, 255 }
- };
- int i, sz = 128;
-
- for (i = 0; i < 8; i++) {
- MakeImage(i, sz, sz, colors[i]);
- sz /= 2;
+#define WIDTH 512
+#define HEIGHT 512
+ if (glutExtensionSupported("GL_SGIS_generate_mipmap") && image) {
+ /* 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 */
+ if (width != WIDTH || height != HEIGHT) {
+ GLubyte *newImage = malloc(WIDTH * HEIGHT * 4);
+ gluScaleImage(format, width, height, GL_UNSIGNED_BYTE, image,
+ WIDTH, HEIGHT, 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, WIDTH, HEIGHT, 0,
+ format, GL_UNSIGNED_BYTE, image);
+ glTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP_SGIS, GL_FALSE);
+ free(image);
+
+ /* make sure mipmap was really generated correctly */
+ width = WIDTH; height = HEIGHT;
+ for (i = 0; i < 10; 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);
+ width /= 2;
+ height /= 2;
+ }
+ } else {
+ static const GLubyte colors[10][3] = {
+ {128, 128, 128 },
+ { 0, 255, 255 },
+ { 255, 255, 0 },
+ { 255, 0, 255 },
+ { 255, 0, 0 },
+ { 0, 255, 0 },
+ { 0, 0, 255 },
+ { 0, 255, 255 },
+ { 255, 255, 0 },
+ { 255, 255, 255 }
+ };
+ int i, sz = 512;
+
+ for (i = 0; i < 10; i++) {
+ MakeImage(i, sz, sz, colors[i]);
+ printf("Level %d size: %d x %d\n", i, sz, sz);
+ sz /= 2;
+ }
}
}
static void myinit(void)
{
- InitValues();
+ InitValues();
+
+ glEnable(GL_DEPTH_TEST);
+ glDepthFunc(GL_LESS);
+ glShadeModel(GL_FLAT);
- glEnable(GL_DEPTH_TEST);
- glDepthFunc(GL_LESS);
- glShadeModel(GL_FLAT);
+ glTranslatef(0.0, 0.0, -3.6);
- glTranslatef(0.0, 0.0, -3.6);
+ glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
+ glGenTextures(1, &texImage);
+ glBindTexture(GL_TEXTURE_2D, texImage);
+ makeImages(1);
+ glGenTextures(1, &texColor);
+ glBindTexture(GL_TEXTURE_2D, texColor);
+ makeImages(0);
- glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
- makeImages();
- glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
- glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
- glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_DECAL);
- glEnable(GL_TEXTURE_2D);
+ texCurrent = texImage;
+
+ glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
+ glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
+ glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_DECAL);
+ glEnable(GL_TEXTURE_2D);
}
static void display(void)
{
- GLfloat tcm = 4.0;
- printf("BASE_LEVEL=%d MAX_LEVEL=%d MIN_LOD=%.2g MAX_LOD=%.2g Bias=%.2g Filter=%s\n",
- BaseLevel, MaxLevel, MinLod, MaxLod, LodBias,
- NearestFilter ? "NEAREST" : "LINEAR");
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_BASE_LEVEL, BaseLevel);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, MaxLevel);
-
- glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_LOD, MinLod);
- glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_LOD, MaxLod);
-
- if (NearestFilter) {
- glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
- glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER,
- GL_NEAREST_MIPMAP_NEAREST);
- }
- else {
- glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
- glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER,
- GL_LINEAR_MIPMAP_LINEAR);
- }
-
- glTexEnvf(GL_TEXTURE_FILTER_CONTROL_EXT, GL_TEXTURE_LOD_BIAS_EXT, LodBias);
-
- glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
- glBegin(GL_QUADS);
- glTexCoord2f(0.0, 0.0); glVertex3f(-2.0, -1.0, 0.0);
- glTexCoord2f(0.0, tcm); glVertex3f(-2.0, 1.0, 0.0);
- glTexCoord2f(tcm, tcm); glVertex3f(3000.0, 1.0, -6000.0);
- glTexCoord2f(tcm, 0.0); glVertex3f(3000.0, -1.0, -6000.0);
- glEnd();
- glFlush();
+ GLfloat tcm = 1.0;
+ glBindTexture(GL_TEXTURE_2D, texCurrent);
+
+ printf("BASE_LEVEL=%d MAX_LEVEL=%d MIN_LOD=%.2g MAX_LOD=%.2g Bias=%.2g Filter=%s\n",
+ BaseLevel, MaxLevel, MinLod, MaxLod, LodBias,
+ NearestFilter ? "NEAREST" : "LINEAR");
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_BASE_LEVEL, BaseLevel);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, MaxLevel);
+
+ glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_LOD, MinLod);
+ glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_LOD, MaxLod);
+
+ if (NearestFilter) {
+ glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
+ glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER,
+ GL_NEAREST_MIPMAP_NEAREST);
+ }
+ else {
+ glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
+ glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER,
+ GL_LINEAR_MIPMAP_LINEAR);
+ }
+
+ glTexEnvf(GL_TEXTURE_FILTER_CONTROL_EXT, GL_TEXTURE_LOD_BIAS_EXT, LodBias);
+
+ glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+ glBegin(GL_QUADS);
+ glTexCoord2f(0.0, 0.0); glVertex3f(-2.0, -1.0, 0.0);
+ glTexCoord2f(0.0, tcm); glVertex3f(-2.0, 1.0, 0.0);
+ glTexCoord2f(tcm * 3000.0, tcm); glVertex3f(3000.0, 1.0, -6000.0);
+ glTexCoord2f(tcm * 3000.0, 0.0); glVertex3f(3000.0, -1.0, -6000.0);
+ glEnd();
+ glFlush();
}
static void myReshape(int w, int h)
{
- glViewport(0, 0, w, h);
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- gluPerspective(60.0, 1.0*(GLfloat)w/(GLfloat)h, 1.0, 30000.0);
- glMatrixMode(GL_MODELVIEW);
- glLoadIdentity();
+ glViewport(0, 0, w, h);
+ glMatrixMode(GL_PROJECTION);
+ glLoadIdentity();
+ gluPerspective(60.0, 1.0*(GLfloat)w/(GLfloat)h, 1.0, 30000.0);
+ glMatrixMode(GL_MODELVIEW);
+ glLoadIdentity();
}
static void
@@ -228,6 +285,12 @@ key(unsigned char k, int x, int y)
case 'f':
NearestFilter = !NearestFilter;
break;
+ case 't':
+ if (texCurrent == texColor)
+ texCurrent = texImage;
+ else
+ texCurrent = texColor;
+ break;
case ' ':
InitValues();
break;
@@ -250,6 +313,7 @@ static void usage(void)
printf(" x/X decrease/increase GL_TEXTURE_MAX_LOD\n");
printf(" l/L decrease/increase GL_TEXTURE_LOD_BIAS\n");
printf(" f toggle nearest/linear filtering\n");
+ printf(" t toggle texture color/image\n");
printf(" SPACE reset values\n");
}
@@ -260,6 +324,7 @@ int main(int argc, char** argv)
glutInitDisplayMode (GLUT_SINGLE | GLUT_RGB | GLUT_DEPTH);
glutInitWindowSize (600, 600);
glutCreateWindow (argv[0]);
+ glewInit();
myinit();
glutReshapeFunc (myReshape);
glutDisplayFunc(display);
diff --git a/progs/tests/mipmap_view.c b/progs/tests/mipmap_view.c
index 54607b89398..16f3584f703 100644
--- a/progs/tests/mipmap_view.c
+++ b/progs/tests/mipmap_view.c
@@ -10,6 +10,7 @@
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
+#include <GL/glew.h>
#include <GL/glut.h>
#include <GL/glext.h>
@@ -242,6 +243,7 @@ main(int argc, char *argv[])
glutInitWindowSize(WinWidth, WinHeight);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE);
Win = glutCreateWindow(argv[0]);
+ glewInit();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutDisplayFunc(Display);
diff --git a/progs/tests/multipal.c b/progs/tests/multipal.c
index 7bd44735659..4a940169780 100644
--- a/progs/tests/multipal.c
+++ b/progs/tests/multipal.c
@@ -13,6 +13,7 @@
#include <windows.h>
#endif
#define GL_GLEXT_LEGACY
+#include <GL/glew.h>
#include <GL/glut.h>
#include "../util/readtex.c" /* I know, this is a hack. */
@@ -350,6 +351,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/tests/multitexarray.c b/progs/tests/multitexarray.c
index b4fab004a63..518fee2992c 100644
--- a/progs/tests/multitexarray.c
+++ b/progs/tests/multitexarray.c
@@ -16,6 +16,7 @@
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
+#include "GL/glew.h"
#include "GL/glut.h"
static GLuint Window = 0;
@@ -221,6 +222,7 @@ int main( int argc, char *argv[] )
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
Window = glutCreateWindow("Texture Objects");
+ glewInit();
if (!Window) {
exit(1);
}
diff --git a/progs/tests/multiwindow.c b/progs/tests/multiwindow.c
index b069bea91cc..6db552d195a 100644
--- a/progs/tests/multiwindow.c
+++ b/progs/tests/multiwindow.c
@@ -25,6 +25,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
+#include <GL/glew.h>
#include <GL/glut.h>
@@ -145,6 +146,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( 400, 400 );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
Window[0] = glutCreateWindow(argv[0]);
+ glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display0 );
@@ -155,6 +157,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( 400, 400 );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
Window[1] = glutCreateWindow(argv[0]);
+ glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display1 );
diff --git a/progs/tests/no_s3tc.c b/progs/tests/no_s3tc.c
index d3383ff98af..31cfb40b9d3 100644
--- a/progs/tests/no_s3tc.c
+++ b/progs/tests/no_s3tc.c
@@ -38,6 +38,7 @@
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
+#include <GL/glew.h>
#include <GL/glut.h>
#include <GL/glext.h>
@@ -59,6 +60,7 @@ main( int argc, char ** argv )
glutInitWindowPosition( 0, 0 );
glutInitWindowSize( 300, 300 );
glutCreateWindow( "No S3TC Test" );
+ glewInit();
gl_version = strtod( (const char *) glGetString( GL_VERSION ), NULL );
if ( ! glutExtensionSupported( "GL_ARB_texture_compression" )
diff --git a/progs/tests/packedpixels.c b/progs/tests/packedpixels.c
index 67ffe088259..1703b271cb0 100644
--- a/progs/tests/packedpixels.c
+++ b/progs/tests/packedpixels.c
@@ -8,6 +8,7 @@
#include <stdlib.h>
#include <math.h>
#include <string.h>
+#include <GL/glew.h>
#include <GL/glut.h>
@@ -333,6 +334,7 @@ main(int argc, char *argv[])
glutInitWindowSize(700, 800);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
glutCreateWindow(argv[0]);
+ glewInit();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutDisplayFunc(Draw);
diff --git a/progs/tests/pbo.c b/progs/tests/pbo.c
index b31b36cc121..9974486db39 100644
--- a/progs/tests/pbo.c
+++ b/progs/tests/pbo.c
@@ -5,12 +5,12 @@
* 11 March 2004
*/
-#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 "../util/readtex.c" /* a hack, I know */
@@ -287,6 +287,7 @@ main( int argc, char *argv[] )
glutInitWindowSize( 750, 250 );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
glutCreateWindow(argv[0]);
+ glewInit();
Init();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
diff --git a/progs/tests/prog_parameter.c b/progs/tests/prog_parameter.c
index 96697e5bda6..6dd956c4023 100644
--- a/progs/tests/prog_parameter.c
+++ b/progs/tests/prog_parameter.c
@@ -35,6 +35,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
+#include <GL/glew.h>
#include <GL/glut.h>
#ifndef GL_EXT_gpu_program_parameters
@@ -274,6 +275,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( Width, Height );
glutInitDisplayMode( GLUT_RGB );
glutCreateWindow( "Program Parameters Test" );
+ glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );
diff --git a/progs/tests/projtex.c b/progs/tests/projtex.c
index e3ef948ab6a..800d81ecd67 100644
--- a/progs/tests/projtex.c
+++ b/progs/tests/projtex.c
@@ -18,6 +18,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
+#include <GL/glew.h>
#include <GL/glut.h>
#if 0
#include "texture.h"
@@ -1005,6 +1006,7 @@ main(int argc, char **argv)
glutInitDisplayMode(GLUT_RGBA | GLUT_DEPTH | GLUT_DOUBLE);
(void) glutCreateWindow("projtex");
+ glewInit();
loadTexture = loadImageTextures;
drawObject = drawCube;
diff --git a/progs/tests/quads.c b/progs/tests/quads.c
index 1bf57e6337d..2098b51ccd2 100644
--- a/progs/tests/quads.c
+++ b/progs/tests/quads.c
@@ -3,10 +3,10 @@
*/
-#define GL_GLEXT_PROTOTYPES
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
+#include <GL/glew.h>
#include <GL/glut.h>
#define NUM_QUADS 20
@@ -19,7 +19,7 @@ static GLuint Vbuffer = 0;
static GLfloat buf[NUM_QUADS * 6 * 4];
-static GLboolean SwapBuffers = GL_TRUE;
+static GLboolean doSwapBuffers = GL_TRUE;
static GLint Frames = 0, T0 = 0;
@@ -48,7 +48,7 @@ Draw(void)
glPopMatrix();
- if (SwapBuffers)
+ if (doSwapBuffers)
glutSwapBuffers();
/*
else
@@ -91,7 +91,7 @@ Key(unsigned char key, int x, int y)
(void) y;
switch (key) {
case 's':
- SwapBuffers = !SwapBuffers;
+ doSwapBuffers = !doSwapBuffers;
break;
case 'a':
Anim = !Anim;
@@ -246,6 +246,7 @@ main(int argc, char *argv[])
glutInitWindowSize(600, 600);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
Win = glutCreateWindow(argv[0]);
+ glewInit();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutSpecialFunc(SpecialKey);
diff --git a/progs/tests/random.c b/progs/tests/random.c
index d52c338e0e1..4023674c05f 100644
--- a/progs/tests/random.c
+++ b/progs/tests/random.c
@@ -5,13 +5,13 @@
* 21 June 2007
*/
-#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>
static int Win;
@@ -445,6 +445,7 @@ main(int argc, char *argv[])
glutInitWindowSize(Width, Height);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
Win = glutCreateWindow(argv[0]);
+ glewInit();
ParseArgs(argc, argv);
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
diff --git a/progs/tests/readrate.c b/progs/tests/readrate.c
index 42ae62d48a9..6bdda049071 100644
--- a/progs/tests/readrate.c
+++ b/progs/tests/readrate.c
@@ -7,11 +7,11 @@
* gcc readrate.c -L/usr/X11R6/lib -lglut -lGLU -lGL -lX11 -o readrate
*/
-#define GL_GLEXT_PROTOTYPES
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
+#include <GL/glew.h>
#include <GL/glut.h>
/* Hack, to test drawing instead of reading */
@@ -275,6 +275,7 @@ main(int argc, char *argv[])
glutInitWindowSize(MAX_WIDTH, MAX_HEIGHT);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH | GLUT_STENCIL);
glutCreateWindow(argv[0]);
+ glewInit();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutSpecialFunc(SpecialKey);
diff --git a/progs/tests/rubberband.c b/progs/tests/rubberband.c
index a8e64bc0916..866a0f519e5 100644
--- a/progs/tests/rubberband.c
+++ b/progs/tests/rubberband.c
@@ -2,10 +2,10 @@
* Test rubber-band selection box w/ logicops and blend.
*/
-#define GL_GLEXT_PROTOTYPES
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
+#include <GL/glew.h>
#include <GL/glut.h>
#include "readtex.c"
@@ -232,6 +232,7 @@ main(int argc, char *argv[])
glutInitWindowSize(Width, Height);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE);
Win = glutCreateWindow(argv[0]);
+ glewInit();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutSpecialFunc(SpecialKey);
diff --git a/progs/tests/seccolor.c b/progs/tests/seccolor.c
index 77fd40647ba..f1ba314ef07 100644
--- a/progs/tests/seccolor.c
+++ b/progs/tests/seccolor.c
@@ -3,10 +3,10 @@
*/
-#define GL_GLEXT_PROTOTYPES
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
+#include <GL/glew.h>
#include <GL/glut.h>
static int Width = 600;
@@ -136,6 +136,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( Width, Height );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
glutCreateWindow(argv[0]);
+ glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );
diff --git a/progs/tests/shader_api.c b/progs/tests/shader_api.c
index 679f9137c82..a513ca6ba1f 100644
--- a/progs/tests/shader_api.c
+++ b/progs/tests/shader_api.c
@@ -5,7 +5,7 @@
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
-#define GL_GLEXT_PROTOTYPES
+#include <GL/glew.h>
#include <GL/glut.h>
static void assert_test(const char *file, int line, int cond, const char *msg)
@@ -323,6 +323,7 @@ int main(int argc, char **argv)
{
glutInit(&argc, argv);
glutCreateWindow("Mesa bug demo");
+ glewInit();
RUN_TEST(test_uniform_size_type);
RUN_TEST(test_attrib_size_type);
diff --git a/progs/tests/stencil_twoside.c b/progs/tests/stencil_twoside.c
index 8826c46fc26..1e18ca6b5ea 100644
--- a/progs/tests/stencil_twoside.c
+++ b/progs/tests/stencil_twoside.c
@@ -33,6 +33,7 @@
#include <stdio.h>
#include <stdlib.h>
+#include <GL/glew.h>
#include <GL/glut.h>
static int use20syntax = 1;
@@ -288,6 +289,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( Width, Height );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH | GLUT_STENCIL );
glutCreateWindow( "GL_ATI_separate_stencil test" );
+ glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );
diff --git a/progs/tests/stencil_wrap.c b/progs/tests/stencil_wrap.c
index 88cf3809caf..28307fef4f0 100644
--- a/progs/tests/stencil_wrap.c
+++ b/progs/tests/stencil_wrap.c
@@ -34,6 +34,7 @@
#include <stdio.h>
#include <stdlib.h>
+#include <GL/glew.h>
#include <GL/glut.h>
static int Width = 550;
@@ -248,6 +249,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( Width, Height );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH | GLUT_STENCIL );
glutCreateWindow( "GL_EXT_stencil_wrap test" );
+ glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );
diff --git a/progs/tests/stencilwrap.c b/progs/tests/stencilwrap.c
index 753375d0f3a..2e219fd8b50 100644
--- a/progs/tests/stencilwrap.c
+++ b/progs/tests/stencilwrap.c
@@ -8,6 +8,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
+#include <GL/glew.h>
#include <GL/glut.h>
GLboolean wrapping;
@@ -272,6 +273,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( 400, 400 );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_STENCIL );
glutCreateWindow(argv[0]);
+ glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );
diff --git a/progs/tests/subtex.c b/progs/tests/subtex.c
index 81ceb085aaf..86b737c01fa 100644
--- a/progs/tests/subtex.c
+++ b/progs/tests/subtex.c
@@ -9,6 +9,7 @@
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
+#include "GL/glew.h"
#include "GL/glut.h"
static GLuint Window = 0;
@@ -207,6 +208,7 @@ int main( int argc, char *argv[] )
glutInitDisplayMode( GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE );
Window = glutCreateWindow("Texture Objects");
+ glewInit();
if (!Window) {
exit(1);
}
diff --git a/progs/tests/subtexrate.c b/progs/tests/subtexrate.c
index 568b68d552d..4bda970d067 100644
--- a/progs/tests/subtexrate.c
+++ b/progs/tests/subtexrate.c
@@ -5,11 +5,11 @@
* 26 Jan 2006
*/
-#define GL_GLEXT_PROTOTYPES
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
+#include <GL/glew.h>
#include <GL/glut.h>
static GLint WinWidth = 1024, WinHeight = 512;
@@ -337,6 +337,7 @@ main(int argc, char *argv[])
glutInitWindowSize(WinWidth, WinHeight);
glutInitDisplayMode(mode);
glutCreateWindow(argv[0]);
+ glewInit();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutSpecialFunc(SpecialKey);
diff --git a/progs/tests/tex1d.c b/progs/tests/tex1d.c
index 1fab849dd3e..4abe1068c7b 100644
--- a/progs/tests/tex1d.c
+++ b/progs/tests/tex1d.c
@@ -7,6 +7,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include "GL/glew.h"
#include "GL/glut.h"
static GLuint Window = 0;
@@ -124,6 +125,7 @@ int main( int argc, char *argv[] )
glutInitDisplayMode( GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE );
Window = glutCreateWindow("Texture Objects");
+ glewInit();
if (!Window) {
exit(1);
}
diff --git a/progs/tests/texcmp.c b/progs/tests/texcmp.c
index 6e822fb6895..52c504a3188 100644
--- a/progs/tests/texcmp.c
+++ b/progs/tests/texcmp.c
@@ -7,7 +7,7 @@
#include <stdlib.h>
#include <math.h>
#include <string.h>
-#define GL_GLEXT_PROTOTYPES 1
+#include <GL/glew.h>
#include <GL/glut.h>
#include "readtex.c" /* I know, this is a hack. */
@@ -371,6 +371,7 @@ int main( int argc, char *argv[] )
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
if (glutCreateWindow(argv[0]) <= 0) {
+ glewInit();
printf("Couldn't create window\n");
exit(0);
}
diff --git a/progs/tests/texcompress2.c b/progs/tests/texcompress2.c
index e2eed756b62..3e8e9908cbe 100644
--- a/progs/tests/texcompress2.c
+++ b/progs/tests/texcompress2.c
@@ -3,9 +3,9 @@
*/
-#define GL_GLEXT_PROTOTYPES
#include <assert.h>
#include <stdio.h>
+#include <GL/glew.h>
#include <GL/glut.h>
#include <GL/glx.h>
#include "readtex.c"
@@ -258,6 +258,7 @@ main( int argc, char *argv[] )
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE);
glutCreateWindow(argv[0]);
+ glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
diff --git a/progs/tests/texfilt.c b/progs/tests/texfilt.c
index 6ee4bc4eae3..fa919dba624 100644
--- a/progs/tests/texfilt.c
+++ b/progs/tests/texfilt.c
@@ -27,6 +27,7 @@
#include <stdlib.h>
#include <string.h>
#include <math.h>
+#include <GL/glew.h>
#include <GL/glut.h>
const GLenum filter_modes[] = {
@@ -219,8 +220,8 @@ static void Init( void )
static void generate_tunnel( unsigned num_segs, GLfloat ** pos_data,
GLfloat ** tex_data )
{
- const GLfloat far = 20.0f;
- const GLfloat near = -90.0f;
+ const GLfloat far_distance = 20.0f;
+ const GLfloat near_distance = -90.0f;
const GLfloat far_tex = 30.0f;
const GLfloat near_tex = 0.0f;
const GLfloat angle_step = (2 * M_PI) / num_segs;
@@ -241,12 +242,12 @@ static void generate_tunnel( unsigned num_segs, GLfloat ** pos_data,
for ( i = 0 ; i < num_segs ; i++ ) {
position[0] = 2.5 * sinf( angle );
position[1] = 2.5 * cosf( angle );
- position[2] = (i & 1) ? far : near;
+ position[2] = (i & 1) ? far_distance : near_distance;
position[3] = 1.0f;
position[4] = position[0];
position[5] = position[1];
- position[6] = (i & 1) ? near : far;
+ position[6] = (i & 1) ? near_distance : far_distance;
position[7] = 1.0f;
position += 8;
@@ -264,12 +265,12 @@ static void generate_tunnel( unsigned num_segs, GLfloat ** pos_data,
position[0] = 2.5 * sinf( angle );
position[1] = 2.5 * cosf( angle );
- position[2] = (i & 1) ? near : far;
+ position[2] = (i & 1) ? near_distance : far_distance;
position[3] = 1.0f;
position[4] = position[0];
position[5] = position[1];
- position[6] = (i & 1) ? far : near;
+ position[6] = (i & 1) ? far_distance : near_distance;
position[7] = 1.0f;
position += 8;
@@ -381,6 +382,7 @@ int main( int argc, char ** argv )
glutInitWindowSize( 800, 600 );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
glutCreateWindow( "Texture Filter Test" );
+ glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutSpecialFunc( SpecialKey );
diff --git a/progs/tests/texgenmix.c b/progs/tests/texgenmix.c
index be8f6775c70..008da8625e2 100644
--- a/progs/tests/texgenmix.c
+++ b/progs/tests/texgenmix.c
@@ -6,6 +6,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <GL/glew.h>
#include <GL/glut.h>
#undef max
@@ -618,6 +619,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( winWidth, winHeight );
glutInitWindowPosition( 0, 0 );
glutCreateWindow( "Mixed texgen/non-texgen texture coordinate test" );
+ glewInit();
initialize();
instructions();
diff --git a/progs/tests/texline.c b/progs/tests/texline.c
index 76dfccd9b1a..1803832b47e 100644
--- a/progs/tests/texline.c
+++ b/progs/tests/texline.c
@@ -9,6 +9,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
+#include <GL/glew.h>
#include <GL/glut.h>
#include "../util/readtex.c" /* I know, this is a hack. */
@@ -263,6 +264,7 @@ int main( int argc, char *argv[] )
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
glutCreateWindow(argv[0] );
+ glewInit();
Init(argc, argv);
diff --git a/progs/tests/texrect.c b/progs/tests/texrect.c
index 43edc491801..10061ee5869 100644
--- a/progs/tests/texrect.c
+++ b/progs/tests/texrect.c
@@ -6,11 +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"
@@ -328,6 +328,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/tests/texwrap.c b/progs/tests/texwrap.c
index 8143256f8ae..12f045b72e0 100644
--- a/progs/tests/texwrap.c
+++ b/progs/tests/texwrap.c
@@ -8,10 +8,10 @@
*/
-#define GL_GLEXT_PROTOTYPES
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
+#include <GL/glew.h>
#include <GL/glut.h>
@@ -294,6 +294,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( 1000, 270 );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
glutCreateWindow(argv[0]);
+ glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );
diff --git a/progs/tests/unfilledclip.c b/progs/tests/unfilledclip.c
index f25e52616aa..db6fffa3e89 100644
--- a/progs/tests/unfilledclip.c
+++ b/progs/tests/unfilledclip.c
@@ -26,6 +26,7 @@
*/
#include <stdlib.h>
+#include <GL/glew.h>
#include <GL/glut.h>
static int win_width, win_height;
@@ -194,6 +195,7 @@ main(int argc, char *argv[])
glutInitWindowSize(win_width, win_height);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
glutCreateWindow(argv[0]);
+ glewInit();
glutReshapeFunc(reshape);
glutKeyboardFunc(key);
glutDisplayFunc(display);
diff --git a/progs/tests/vao-01.c b/progs/tests/vao-01.c
index c2d70885f05..117fae8bd9e 100644
--- a/progs/tests/vao-01.c
+++ b/progs/tests/vao-01.c
@@ -49,6 +49,7 @@ typedef void (* PFNGLGENVERTEXARRAYSAPPLEPROC) (GLsizei n, GLuint *arrays);
typedef GLboolean (* PFNGLISVERTEXARRAYAPPLEPROC) (GLuint array);
#else
+#include <GL/glew.h>
#include <GL/glut.h>
#endif
@@ -166,6 +167,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( Width, Height );
glutInitDisplayMode( GLUT_RGB );
glutCreateWindow( "GL_APPLE_vertex_array_object demo" );
+ glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );
diff --git a/progs/tests/vao-02.c b/progs/tests/vao-02.c
index 993bc368d40..7764ed51061 100644
--- a/progs/tests/vao-02.c
+++ b/progs/tests/vao-02.c
@@ -49,6 +49,7 @@ typedef void (* PFNGLGENVERTEXARRAYSAPPLEPROC) (GLsizei n, GLuint *arrays);
typedef GLboolean (* PFNGLISVERTEXARRAYAPPLEPROC) (GLuint array);
#else
+#include <GL/glew.h>
#include <GL/glut.h>
#endif
@@ -194,6 +195,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( Width, Height );
glutInitDisplayMode( GLUT_RGB );
glutCreateWindow( "GL_APPLE_vertex_array_object demo" );
+ glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );
diff --git a/progs/tests/vparray.c b/progs/tests/vparray.c
index 580a670f8e1..9c2fad97d9d 100644
--- a/progs/tests/vparray.c
+++ b/progs/tests/vparray.c
@@ -12,7 +12,7 @@
#include <stdlib.h>
#include <string.h>
#include <math.h>
-#define GL_GLEXT_PROTOTYPES
+#include "GL/glew.h"
#include "GL/glut.h"
#define MAXVERTS 10000
@@ -280,6 +280,7 @@ int main(int argc, char **argv)
glutInitWindowPosition(0, 0);
glutInitWindowSize(400, 400);
if (glutCreateWindow("Isosurface") <= 0) {
+ glewInit();
exit(0);
}
glutReshapeFunc(Reshape);
diff --git a/progs/tests/vpeval.c b/progs/tests/vpeval.c
index 8b6996d3b5c..f07737f9736 100644
--- a/progs/tests/vpeval.c
+++ b/progs/tests/vpeval.c
@@ -10,7 +10,7 @@
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
-#define GL_GLEXT_PROTOTYPES
+#include <GL/glew.h>
#include <GL/glut.h>
@@ -222,6 +222,7 @@ main(int argc, char **argv)
glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB | GLUT_DEPTH);
glutInitWindowPosition(0, 0);
glutCreateWindow(argv[0]);
+ glewInit();
myinit(argc, argv);
glutReshapeFunc(myReshape);
glutDisplayFunc(display);
diff --git a/progs/tests/vptest1.c b/progs/tests/vptest1.c
index 560df2c3fdc..51629192923 100644
--- a/progs/tests/vptest1.c
+++ b/progs/tests/vptest1.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>
@@ -161,6 +161,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( 250, 250 );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
glutCreateWindow(argv[0]);
+ glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );
diff --git a/progs/tests/vptest2.c b/progs/tests/vptest2.c
index 2158e07f042..4161b03a673 100644
--- a/progs/tests/vptest2.c
+++ b/progs/tests/vptest2.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>
@@ -140,6 +140,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( 50, 50 );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
glutCreateWindow(argv[0]);
+ glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );
diff --git a/progs/tests/vptest3.c b/progs/tests/vptest3.c
index 2c5c8000408..4e4bfee31dc 100644
--- a/progs/tests/vptest3.c
+++ b/progs/tests/vptest3.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 float Zrot = 0.0;
@@ -111,6 +111,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( 250, 250 );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
glutCreateWindow(argv[0]);
+ glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );
diff --git a/progs/tests/vptorus.c b/progs/tests/vptorus.c
index 764dea4ec22..e61ffdac217 100644
--- a/progs/tests/vptorus.c
+++ b/progs/tests/vptorus.c
@@ -7,7 +7,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#define GL_GLEXT_PROTOTYPES
+#include <GL/glew.h>
#include <GL/glut.h>
static float Xrot = 0.0, Yrot = 0.0, Zrot = 0.0;
@@ -162,6 +162,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( 250, 250 );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
glutCreateWindow(argv[0]);
+ glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutSpecialFunc( SpecialKey );
diff --git a/progs/tests/vpwarpmesh.c b/progs/tests/vpwarpmesh.c
index 56aa8200ec8..80204ea1361 100644
--- a/progs/tests/vpwarpmesh.c
+++ b/progs/tests/vpwarpmesh.c
@@ -7,7 +7,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#define GL_GLEXT_PROTOTYPES
+#include <GL/glew.h>
#include <GL/glut.h>
static float Xrot = -60.0, Yrot = 0.0, Zrot = 0.0;
@@ -224,6 +224,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( 250, 250 );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
glutCreateWindow(argv[0]);
+ glewInit();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutSpecialFunc( SpecialKey );
diff --git a/progs/tests/yuvrect.c b/progs/tests/yuvrect.c
index acef4060970..aab2f80ed9a 100644
--- a/progs/tests/yuvrect.c
+++ b/progs/tests/yuvrect.c
@@ -9,7 +9,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#define GL_GLEXT_PROTOTYPES
+#include <GL/glew.h>
#include <GL/glut.h>
#include "../util/readtex.c" /* I know, this is a hack. */
@@ -180,6 +180,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/tests/yuvsquare.c b/progs/tests/yuvsquare.c
index 3601e7a31c7..658528b7996 100644
--- a/progs/tests/yuvsquare.c
+++ b/progs/tests/yuvsquare.c
@@ -9,7 +9,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#define GL_GLEXT_PROTOTYPES
+#include <GL/glew.h>
#include <GL/glut.h>
#include "../util/readtex.c" /* I know, this is a hack. */
@@ -219,6 +219,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/tests/zcomp.c b/progs/tests/zcomp.c
index b53079d07fc..15e35f17b09 100644
--- a/progs/tests/zcomp.c
+++ b/progs/tests/zcomp.c
@@ -2,10 +2,10 @@
* 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/glew.h>
#include <GL/glut.h>
#include "../util/showbuffer.c"
@@ -211,6 +211,7 @@ main(int argc, char *argv[])
glutInitWindowSize(Width, Height);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH | GLUT_STENCIL);
Win = glutCreateWindow(argv[0]);
+ glewInit();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutSpecialFunc(SpecialKey);
diff --git a/progs/tests/zdrawpix.c b/progs/tests/zdrawpix.c
index dd222e7dd0b..ba7da571ebf 100644
--- a/progs/tests/zdrawpix.c
+++ b/progs/tests/zdrawpix.c
@@ -10,10 +10,10 @@
* 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/glew.h>
#include <GL/glut.h>
#include "../util/showbuffer.c"
@@ -180,6 +180,7 @@ 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/tests/zreaddraw.c b/progs/tests/zreaddraw.c
index e2dacbf7f2f..3d8c557b370 100644
--- a/progs/tests/zreaddraw.c
+++ b/progs/tests/zreaddraw.c
@@ -8,7 +8,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#define GL_GLEXT_PROTOTYPES
+#include <GL/glew.h>
#include <GL/glut.h>
static GLint WinWidth = 500, WinHeight = 500;
@@ -107,6 +107,7 @@ int main(int argc, char *argv[])
glutInitWindowSize(WinWidth, WinHeight);
glutInitDisplayMode(GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE);
glutCreateWindow(argv[0]);
+ glewInit();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutDisplayFunc(Display);
diff --git a/progs/trivial/.gitignore b/progs/trivial/.gitignore
index d77f120b96b..aec4c94527d 100644
--- a/progs/trivial/.gitignore
+++ b/progs/trivial/.gitignore
@@ -9,6 +9,7 @@ dlist-dangling
dlist-degenerate
dlist-edgeflag
dlist-edgeflag-dangling
+draw2arrays
drawarrays
drawelements
drawrange
@@ -58,11 +59,13 @@ quad-tex-2d
quad-tex-3d
quad-tex-alpha
quad-tex-pbo
+quad-tex-sub
quad-unfilled
quad-unfilled-clip
quad-unfilled-stipple
quads
quadstrip
+quadstrip-clip
quadstrip-cont
quadstrip-flat
readtex.c
@@ -83,12 +86,15 @@ tri-dlist
tri-edgeflag
tri-fbo
tri-fbo-tex
+tri-fbo-tex-mip
tri-flat
tri-flat-clip
tri-fog
tri-fp
tri-fp-const-imm
tri-lit
+tri-logicop-none
+tri-logicop-xor
tri-mask-tri
tri-orig
tri-query
@@ -102,12 +108,14 @@ tri-tri
tri-unfilled
tri-unfilled-clip
tri-unfilled-edgeflag
+tri-unfilled-fog
tri-unfilled-smooth
tri-unfilled-tri
tri-unfilled-tri-lit
tri-unfilled-userclip
tri-unfilled-userclip-stip
tri-userclip
+tri-viewport
tri-z
tri-z-eq
trifan
diff --git a/progs/trivial/Makefile b/progs/trivial/Makefile
index dce96f6bc8c..082387d86ea 100644
--- a/progs/trivial/Makefile
+++ b/progs/trivial/Makefile
@@ -23,6 +23,7 @@ SOURCES = \
dlist-edgeflag.c \
dlist-degenerate.c \
drawarrays.c \
+ draw2arrays.c \
drawelements.c \
drawrange.c \
flat-clip.c \
@@ -69,11 +70,13 @@ SOURCES = \
quad-tex-3d.c \
quad-tex-alpha.c \
quad-tex-pbo.c \
+ quad-tex-sub.c \
quad-unfilled-clip.c \
quad-unfilled-stipple.c \
quad-unfilled.c \
quad.c \
quads.c \
+ quadstrip-clip.c \
quadstrip-cont.c \
quadstrip-flat.c \
quadstrip.c \
@@ -88,8 +91,11 @@ SOURCES = \
tri-clip.c \
tri-cull-both.c \
tri-cull.c \
+ tri-logicop-none.c \
+ tri-logicop-xor.c \
tri-dlist.c \
tri-edgeflag.c \
+ tri-fbo-tex-mip.c \
tri-fbo-tex.c \
tri-fbo.c \
tri-flat-clip.c \
@@ -108,6 +114,7 @@ SOURCES = \
tri-tex.c \
tri-tex-3d.c \
tri-tri.c \
+ tri-unfilled-fog.c \
tri-unfilled-edgeflag.c \
tri-unfilled-clip.c \
tri-unfilled-smooth.c \
@@ -117,6 +124,7 @@ SOURCES = \
tri-unfilled-userclip.c \
tri-unfilled.c \
tri-userclip.c \
+ tri-viewport.c \
tri-z-eq.c \
tri-z.c \
tri.c \
diff --git a/progs/trivial/SConscript b/progs/trivial/SConscript
index 76826d9be08..6a9ffafe509 100644
--- a/progs/trivial/SConscript
+++ b/progs/trivial/SConscript
@@ -19,6 +19,7 @@ progs = [
'dlist-edgeflag',
'dlist-degenerate',
'drawarrays',
+ 'draw2arrays',
'drawelements',
'drawrange',
'flat-clip',
@@ -65,11 +66,13 @@ progs = [
'quad-tex-3d',
'quad-tex-alpha',
'quad-tex-pbo',
+ 'quad-tex-sub',
'quad-unfilled-clip',
'quad-unfilled-stipple',
'quad-unfilled',
'quad',
'quads',
+ 'quadstrip-clip',
'quadstrip-cont',
'quadstrip-flat',
'quadstrip',
@@ -86,6 +89,7 @@ progs = [
'tri-cull',
'tri-dlist',
'tri-edgeflag',
+ 'tri-fbo-tex-mip',
'tri-fbo-tex',
'tri-fbo',
'tri-flat-clip',
@@ -94,15 +98,19 @@ progs = [
'tri-fp',
'tri-fp-const-imm',
'tri-lit',
+ 'tri-logicop-none',
+ 'tri-logicop-xor',
'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-fog',
'tri-unfilled-edgeflag',
'tri-unfilled-clip',
'tri-unfilled-smooth',
@@ -112,6 +120,7 @@ progs = [
'tri-unfilled-userclip',
'tri-unfilled',
'tri-userclip',
+ 'tri-viewport',
'tri-z-eq',
'tri-z',
'tri',
diff --git a/progs/trivial/clear-random.c b/progs/trivial/clear-random.c
index 16bd83339b8..f3a67dbe8a8 100644
--- a/progs/trivial/clear-random.c
+++ b/progs/trivial/clear-random.c
@@ -118,7 +118,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/clear-repeat.c b/progs/trivial/clear-repeat.c
index 9f9490c6c87..9c618d492f3 100644
--- a/progs/trivial/clear-repeat.c
+++ b/progs/trivial/clear-repeat.c
@@ -72,6 +72,24 @@ static void Draw(void)
glClearColor((sin(f)+1)/2.0,(cos(f)+1)/2.0,0.5,1);
glClear(GL_COLOR_BUFFER_BIT);
glutSwapBuffers();
+
+ {
+ static GLint T0 = 0;
+ static GLint Frames = 0;
+ 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);
+ fflush(stdout);
+ T0 = t;
+ Frames = 0;
+ }
+ }
+
}
glutPostRedisplay();
}
@@ -91,13 +109,13 @@ int main(int argc, char **argv)
exit(1);
}
- glutInitWindowPosition(0, 0); glutInitWindowSize( 250, 250);
+ glutInitWindowPosition(0, 0); glutInitWindowSize( 300, 300);
type = GLUT_RGB | GLUT_ALPHA;
type |= GLUT_DOUBLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/clear.c b/progs/trivial/clear.c
index da4fff04590..37cfd54fbe2 100644
--- a/progs/trivial/clear.c
+++ b/progs/trivial/clear.c
@@ -113,7 +113,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/createwin.c b/progs/trivial/createwin.c
index 901048555a9..44d5b1b2c5f 100644
--- a/progs/trivial/createwin.c
+++ b/progs/trivial/createwin.c
@@ -106,7 +106,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/dlist-dangling.c b/progs/trivial/dlist-dangling.c
index 00a75078444..64054ec96c1 100644
--- a/progs/trivial/dlist-dangling.c
+++ b/progs/trivial/dlist-dangling.c
@@ -135,7 +135,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/dlist-edgeflag-dangling.c b/progs/trivial/dlist-edgeflag-dangling.c
index 08fae549c31..1b66244cabf 100644
--- a/progs/trivial/dlist-edgeflag-dangling.c
+++ b/progs/trivial/dlist-edgeflag-dangling.c
@@ -140,7 +140,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/dlist-edgeflag.c b/progs/trivial/dlist-edgeflag.c
index ae799dc3557..350100681e5 100644
--- a/progs/trivial/dlist-edgeflag.c
+++ b/progs/trivial/dlist-edgeflag.c
@@ -144,7 +144,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/draw2arrays.c b/progs/trivial/draw2arrays.c
new file mode 100644
index 00000000000..95a89981d3a
--- /dev/null
+++ b/progs/trivial/draw2arrays.c
@@ -0,0 +1,117 @@
+/* Basic VBO */
+
+#include <assert.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <GL/glew.h>
+#include <GL/glut.h>
+
+GLfloat pos[][3] =
+ { { 0.9, -0.9, 0.0 },
+ { 0.9, 0.9, 0.0 },
+ { -0.9, 0.9, 0.0 },
+ { -0.9, -0.9, 0.0 } };
+
+GLubyte color[][4] =
+{ { 0x00, 0x00, 0xff, 0x00 },
+ { 0x00, 0xff, 0x00, 0x00 },
+ { 0xff, 0x00, 0x00, 0x00 },
+ { 0xff, 0xff, 0xff, 0x00 } };
+
+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(pos[0]), pos );
+ glColorPointer( 4, GL_UNSIGNED_BYTE, sizeof(color[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_ARB);
+
+// glDrawArrays( GL_TRIANGLES, 0, 3 );
+ glDrawArrays( GL_TRIANGLES, 1, 3 );
+
+ 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/line-clip.c b/progs/trivial/line-clip.c
index fd79d049c4f..bcee32e25fc 100644
--- a/progs/trivial/line-clip.c
+++ b/progs/trivial/line-clip.c
@@ -126,7 +126,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/line-cull.c b/progs/trivial/line-cull.c
index 038004b4c4a..98218731304 100644
--- a/progs/trivial/line-cull.c
+++ b/progs/trivial/line-cull.c
@@ -122,7 +122,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/line-stipple-wide.c b/progs/trivial/line-stipple-wide.c
index 09e5e1fe089..28d96c797b0 100644
--- a/progs/trivial/line-stipple-wide.c
+++ b/progs/trivial/line-stipple-wide.c
@@ -134,7 +134,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/line-userclip-clip.c b/progs/trivial/line-userclip-clip.c
index 5c9c1b3b291..1b9f059729c 100644
--- a/progs/trivial/line-userclip-clip.c
+++ b/progs/trivial/line-userclip-clip.c
@@ -128,7 +128,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/line-userclip-nop-clip.c b/progs/trivial/line-userclip-nop-clip.c
index a6ee44fbd0f..9f144a6e9a3 100644
--- a/progs/trivial/line-userclip-nop-clip.c
+++ b/progs/trivial/line-userclip-nop-clip.c
@@ -128,7 +128,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/line-userclip-nop.c b/progs/trivial/line-userclip-nop.c
index cebea5f4812..7588faeb98f 100644
--- a/progs/trivial/line-userclip-nop.c
+++ b/progs/trivial/line-userclip-nop.c
@@ -128,7 +128,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/line-userclip.c b/progs/trivial/line-userclip.c
index ecfd28cac71..77d8228188c 100644
--- a/progs/trivial/line-userclip.c
+++ b/progs/trivial/line-userclip.c
@@ -128,7 +128,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/line-wide.c b/progs/trivial/line-wide.c
index 543b1f67f34..f20505378cb 100644
--- a/progs/trivial/line-wide.c
+++ b/progs/trivial/line-wide.c
@@ -133,7 +133,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/line.c b/progs/trivial/line.c
index de5f9274e41..7ccbce3750a 100644
--- a/progs/trivial/line.c
+++ b/progs/trivial/line.c
@@ -131,7 +131,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/lineloop-clip.c b/progs/trivial/lineloop-clip.c
index 211056720fe..fbeca985b90 100644
--- a/progs/trivial/lineloop-clip.c
+++ b/progs/trivial/lineloop-clip.c
@@ -122,7 +122,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/lineloop.c b/progs/trivial/lineloop.c
index fab7d1ea022..5863df654b8 100644
--- a/progs/trivial/lineloop.c
+++ b/progs/trivial/lineloop.c
@@ -122,7 +122,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/linestrip-clip.c b/progs/trivial/linestrip-clip.c
index acab0f4e1cf..dae27c31d44 100644
--- a/progs/trivial/linestrip-clip.c
+++ b/progs/trivial/linestrip-clip.c
@@ -127,7 +127,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/linestrip-flat-stipple.c b/progs/trivial/linestrip-flat-stipple.c
index b691437346a..ee79f150194 100644
--- a/progs/trivial/linestrip-flat-stipple.c
+++ b/progs/trivial/linestrip-flat-stipple.c
@@ -128,7 +128,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/linestrip-stipple-wide.c b/progs/trivial/linestrip-stipple-wide.c
index 53dfa554e98..c6307d59941 100644
--- a/progs/trivial/linestrip-stipple-wide.c
+++ b/progs/trivial/linestrip-stipple-wide.c
@@ -128,7 +128,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/linestrip-stipple.c b/progs/trivial/linestrip-stipple.c
index 5933d1a136f..2b40b5f1b8e 100644
--- a/progs/trivial/linestrip-stipple.c
+++ b/progs/trivial/linestrip-stipple.c
@@ -127,7 +127,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/linestrip.c b/progs/trivial/linestrip.c
index 06dd1c10872..865a752796c 100644
--- a/progs/trivial/linestrip.c
+++ b/progs/trivial/linestrip.c
@@ -124,7 +124,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/long-fixed-func.c b/progs/trivial/long-fixed-func.c
index 41ad25c1b3d..f2a29a9d376 100644
--- a/progs/trivial/long-fixed-func.c
+++ b/progs/trivial/long-fixed-func.c
@@ -139,7 +139,7 @@ main(int argc, char **argv)
glutInitWindowPosition(0, 0);
glutInitWindowSize( 250, 250);
glutInitDisplayMode(type);
- if (glutCreateWindow("tri-long-fixedfunc") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
glewInit();
diff --git a/progs/trivial/point-clip.c b/progs/trivial/point-clip.c
index 7fec54e1db9..6aaee0d1a5f 100644
--- a/progs/trivial/point-clip.c
+++ b/progs/trivial/point-clip.c
@@ -124,7 +124,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/point-sprite.c b/progs/trivial/point-sprite.c
index 583bdca1b71..2f8226ee273 100644
--- a/progs/trivial/point-sprite.c
+++ b/progs/trivial/point-sprite.c
@@ -160,7 +160,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/point-wide-smooth.c b/progs/trivial/point-wide-smooth.c
index 55cbcaec70b..63f83badf8c 100644
--- a/progs/trivial/point-wide-smooth.c
+++ b/progs/trivial/point-wide-smooth.c
@@ -131,7 +131,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/point-wide.c b/progs/trivial/point-wide.c
index 265b20097b1..725edae49ec 100644
--- a/progs/trivial/point-wide.c
+++ b/progs/trivial/point-wide.c
@@ -128,7 +128,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/point.c b/progs/trivial/point.c
index 8dabfb6ca64..3c472c1b91e 100644
--- a/progs/trivial/point.c
+++ b/progs/trivial/point.c
@@ -124,7 +124,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/poly-flat-clip.c b/progs/trivial/poly-flat-clip.c
index 72c2a29a0d2..d58a3a358f8 100644
--- a/progs/trivial/poly-flat-clip.c
+++ b/progs/trivial/poly-flat-clip.c
@@ -126,7 +126,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/poly-flat-unfilled-clip.c b/progs/trivial/poly-flat-unfilled-clip.c
index d3a14a516a4..74249eb4999 100644
--- a/progs/trivial/poly-flat-unfilled-clip.c
+++ b/progs/trivial/poly-flat-unfilled-clip.c
@@ -130,7 +130,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/poly-flat.c b/progs/trivial/poly-flat.c
index a847d6828a7..82098bc1bbc 100644
--- a/progs/trivial/poly-flat.c
+++ b/progs/trivial/poly-flat.c
@@ -126,7 +126,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/poly-unfilled.c b/progs/trivial/poly-unfilled.c
index ae092a830ab..5cc8523f815 100644
--- a/progs/trivial/poly-unfilled.c
+++ b/progs/trivial/poly-unfilled.c
@@ -125,7 +125,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/poly.c b/progs/trivial/poly.c
index 2f254de4815..8944f148d09 100644
--- a/progs/trivial/poly.c
+++ b/progs/trivial/poly.c
@@ -124,7 +124,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/quad-clip-all-vertices.c b/progs/trivial/quad-clip-all-vertices.c
index 3e0f3d94948..6559adf4af8 100644
--- a/progs/trivial/quad-clip-all-vertices.c
+++ b/progs/trivial/quad-clip-all-vertices.c
@@ -124,7 +124,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/quad-clip-nearplane.c b/progs/trivial/quad-clip-nearplane.c
index 1e8056c474b..0e4f4c947c3 100644
--- a/progs/trivial/quad-clip-nearplane.c
+++ b/progs/trivial/quad-clip-nearplane.c
@@ -137,7 +137,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/quad-clip.c b/progs/trivial/quad-clip.c
index 504fef3dc59..fd3522a89a2 100644
--- a/progs/trivial/quad-clip.c
+++ b/progs/trivial/quad-clip.c
@@ -124,7 +124,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/quad-degenerate.c b/progs/trivial/quad-degenerate.c
index 83047408573..29fb2774deb 100644
--- a/progs/trivial/quad-degenerate.c
+++ b/progs/trivial/quad-degenerate.c
@@ -129,7 +129,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/quad-flat.c b/progs/trivial/quad-flat.c
index bd8be7c43e3..570eb6bc715 100644
--- a/progs/trivial/quad-flat.c
+++ b/progs/trivial/quad-flat.c
@@ -134,7 +134,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/quad-offset-factor.c b/progs/trivial/quad-offset-factor.c
index 90943d908ff..2c4946a13a6 100644
--- a/progs/trivial/quad-offset-factor.c
+++ b/progs/trivial/quad-offset-factor.c
@@ -142,7 +142,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/quad-offset-unfilled.c b/progs/trivial/quad-offset-unfilled.c
index 1ad44cdcaec..40762825bd1 100644
--- a/progs/trivial/quad-offset-unfilled.c
+++ b/progs/trivial/quad-offset-unfilled.c
@@ -155,7 +155,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/quad-offset-units.c b/progs/trivial/quad-offset-units.c
index d5db21469e6..b4b138b4b44 100644
--- a/progs/trivial/quad-offset-units.c
+++ b/progs/trivial/quad-offset-units.c
@@ -143,7 +143,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/quad-tex-2d.c b/progs/trivial/quad-tex-2d.c
index 97c9fc54d86..ed6f4a07330 100644
--- a/progs/trivial/quad-tex-2d.c
+++ b/progs/trivial/quad-tex-2d.c
@@ -173,7 +173,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- win = glutCreateWindow("First Tri");
+ win = glutCreateWindow(*argv);
if (!win) {
exit(1);
}
diff --git a/progs/trivial/quad-tex-3d.c b/progs/trivial/quad-tex-3d.c
index ca7ea91d2f3..84acb35fd82 100644
--- a/progs/trivial/quad-tex-3d.c
+++ b/progs/trivial/quad-tex-3d.c
@@ -164,7 +164,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/quad-tex-alpha.c b/progs/trivial/quad-tex-alpha.c
index cd73f013eb0..be24255a3e2 100644
--- a/progs/trivial/quad-tex-alpha.c
+++ b/progs/trivial/quad-tex-alpha.c
@@ -156,7 +156,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/quad-tex-pbo.c b/progs/trivial/quad-tex-pbo.c
index c6f60f51fa6..dcb4ae0e7f8 100644
--- a/progs/trivial/quad-tex-pbo.c
+++ b/progs/trivial/quad-tex-pbo.c
@@ -167,7 +167,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/quad-tex-sub.c b/progs/trivial/quad-tex-sub.c
new file mode 100644
index 00000000000..aabbb9edce9
--- /dev/null
+++ b/progs/trivial/quad-tex-sub.c
@@ -0,0 +1,203 @@
+/*
+ * 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
+
+#define SIZE 16
+GLenum doubleBuffer;
+GLint line = 0;
+
+static void MakeImage()
+{
+ GLubyte tex2d[SIZE][SIZE][3];
+ GLint s, t;
+
+ for (s = 0; s < SIZE; s++) {
+ for (t = 0; t < SIZE; t++) {
+ tex2d[t][s][0] = s*255/(SIZE-1);
+ tex2d[t][s][1] = t*255/(SIZE-1);
+ tex2d[t][s][2] = 0*255/(SIZE-1);
+ }
+ }
+
+ glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
+ glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB,
+ SIZE, SIZE,
+ 0,
+ GL_RGB, GL_UNSIGNED_BYTE, tex2d);
+ glPixelStorei(GL_UNPACK_ALIGNMENT, 4);
+ glEnable(GL_TEXTURE_2D);
+}
+
+static void UpdateLine()
+{
+ GLubyte tex[SIZE][3];
+ GLubyte b = 0;
+ GLint s, t;
+
+ t = line % SIZE;
+ if (line % (SIZE * 2) < SIZE)
+ b = 255;
+ else
+ b = 0;
+
+ for (s = 0; s < SIZE; s++) {
+ tex[s][0] = s*255/(SIZE-1);
+ tex[s][1] = t*255/(SIZE-1);
+ tex[s][2] = b;
+ }
+
+ glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
+ glTexSubImage2D(GL_TEXTURE_2D, 0,
+ 0, t,
+ SIZE, 1,
+ GL_RGB, GL_UNSIGNED_BYTE, tex);
+ glPixelStorei(GL_UNPACK_ALIGNMENT, 4);
+}
+
+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);
+
+ glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
+ glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
+ glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
+ glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
+ glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
+
+ MakeImage();
+ UpdateLine();
+ line++;
+}
+
+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:
+ UpdateLine();
+ line++;
+ break;
+ }
+
+ glutPostRedisplay();
+}
+
+static void Draw(void)
+{
+ glClear(GL_COLOR_BUFFER_BIT);
+
+ 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(0, 0);
+ glutInitWindowSize(250, 250);
+
+ type = GLUT_RGB | GLUT_ALPHA;
+ type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
+ glutInitDisplayMode(type);
+
+ if (glutCreateWindow(*argv) == GL_FALSE) {
+ exit(1);
+ }
+
+ glewInit();
+
+ Init();
+
+ glutReshapeFunc(Reshape);
+ glutKeyboardFunc(Key);
+ glutDisplayFunc(Draw);
+ glutMainLoop();
+ return 0;
+}
diff --git a/progs/trivial/quad-unfilled-clip.c b/progs/trivial/quad-unfilled-clip.c
index e298bd455bf..e25a34bda85 100644
--- a/progs/trivial/quad-unfilled-clip.c
+++ b/progs/trivial/quad-unfilled-clip.c
@@ -125,7 +125,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/quad-unfilled-stipple.c b/progs/trivial/quad-unfilled-stipple.c
index 2036aacbaab..d33e5918bce 100644
--- a/progs/trivial/quad-unfilled-stipple.c
+++ b/progs/trivial/quad-unfilled-stipple.c
@@ -128,7 +128,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/quad-unfilled.c b/progs/trivial/quad-unfilled.c
index 9d0087ce08d..b60af3e7f56 100644
--- a/progs/trivial/quad-unfilled.c
+++ b/progs/trivial/quad-unfilled.c
@@ -125,7 +125,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/quad.c b/progs/trivial/quad.c
index 85424b7b388..c4773ec7dab 100644
--- a/progs/trivial/quad.c
+++ b/progs/trivial/quad.c
@@ -124,7 +124,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/quads.c b/progs/trivial/quads.c
index 307a9e07209..5bc622144ed 100644
--- a/progs/trivial/quads.c
+++ b/progs/trivial/quads.c
@@ -142,7 +142,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/quadstrip-clip.c b/progs/trivial/quadstrip-clip.c
new file mode 100644
index 00000000000..82a6d4e0769
--- /dev/null
+++ b/progs/trivial/quadstrip-clip.c
@@ -0,0 +1,137 @@
+/*
+ * 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);
+ }
+
+ glutPostRedisplay();
+}
+
+static void Draw(void)
+{
+ glClear(GL_COLOR_BUFFER_BIT);
+
+ glBegin(GL_QUAD_STRIP);
+ glColor3f(1,1,1);
+ glVertex3f( 1.9, -0.9, -30.0);
+ glVertex3f( 0.9, 0.9, -30.0);
+
+ glColor3f(1,0,0);
+ glVertex3f( 0.1, -0.8, -30.0);
+ glVertex3f( 0.1, 0.8, -30.0);
+
+ glColor3f(0,1,0);
+ glVertex3f(-0.1, -0.9, -30.0);
+ glVertex3f(-0.1, 0.9, -30.0);
+
+ glColor3f(0,0,0);
+ glVertex3f(-0.9, -0.8, -30.0);
+ glVertex3f(-0.9, 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 | GLUT_ALPHA;
+ type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
+ glutInitDisplayMode(type);
+
+ if (glutCreateWindow(*argv) == GL_FALSE) {
+ exit(1);
+ }
+
+ Init();
+
+ glutReshapeFunc(Reshape);
+ glutKeyboardFunc(Key);
+ glutDisplayFunc(Draw);
+ glutMainLoop();
+ return 0;
+}
diff --git a/progs/trivial/quadstrip-cont.c b/progs/trivial/quadstrip-cont.c
index c6c8f69f8ca..62208dfae75 100644
--- a/progs/trivial/quadstrip-cont.c
+++ b/progs/trivial/quadstrip-cont.c
@@ -147,7 +147,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/quadstrip-flat.c b/progs/trivial/quadstrip-flat.c
index d02135f702a..9011ee0873f 100644
--- a/progs/trivial/quadstrip-flat.c
+++ b/progs/trivial/quadstrip-flat.c
@@ -136,7 +136,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/quadstrip.c b/progs/trivial/quadstrip.c
index ff8644be09e..6923afc04b5 100644
--- a/progs/trivial/quadstrip.c
+++ b/progs/trivial/quadstrip.c
@@ -130,7 +130,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/tri-alpha-tex.c b/progs/trivial/tri-alpha-tex.c
index 776f39dcc35..382d7b21029 100644
--- a/progs/trivial/tri-alpha-tex.c
+++ b/progs/trivial/tri-alpha-tex.c
@@ -165,7 +165,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/tri-alpha.c b/progs/trivial/tri-alpha.c
index 90cfdbe199d..1a653713bbf 100644
--- a/progs/trivial/tri-alpha.c
+++ b/progs/trivial/tri-alpha.c
@@ -127,7 +127,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/tri-blend-color.c b/progs/trivial/tri-blend-color.c
index d2d72d0b62f..db831e3d6e0 100644
--- a/progs/trivial/tri-blend-color.c
+++ b/progs/trivial/tri-blend-color.c
@@ -128,7 +128,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/tri-clear.c b/progs/trivial/tri-clear.c
index 25ea77cfa75..a3908e38e9d 100644
--- a/progs/trivial/tri-clear.c
+++ b/progs/trivial/tri-clear.c
@@ -129,7 +129,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/tri-clip.c b/progs/trivial/tri-clip.c
index f30445cdba1..0d31086c855 100644
--- a/progs/trivial/tri-clip.c
+++ b/progs/trivial/tri-clip.c
@@ -143,7 +143,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/tri-cull-both.c b/progs/trivial/tri-cull-both.c
index 51b5865ae5c..73c5583cfdd 100644
--- a/progs/trivial/tri-cull-both.c
+++ b/progs/trivial/tri-cull-both.c
@@ -127,7 +127,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/tri-cull.c b/progs/trivial/tri-cull.c
index 2eead841155..c6bcf444e42 100644
--- a/progs/trivial/tri-cull.c
+++ b/progs/trivial/tri-cull.c
@@ -158,7 +158,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/tri-dlist.c b/progs/trivial/tri-dlist.c
index c21c4714adf..1c0e320f61a 100644
--- a/progs/trivial/tri-dlist.c
+++ b/progs/trivial/tri-dlist.c
@@ -136,7 +136,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/tri-edgeflag.c b/progs/trivial/tri-edgeflag.c
index 41899c2eb4f..e1278dd6490 100644
--- a/progs/trivial/tri-edgeflag.c
+++ b/progs/trivial/tri-edgeflag.c
@@ -123,7 +123,7 @@ int main(int argc, char **argv)
type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
glutInitDisplayMode(type);
- if (glutCreateWindow("First Tri") == GL_FALSE) {
+ if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
diff --git a/progs/trivial/tri-fbo-tex-mip.c b/progs/trivial/tri-fbo-tex-mip.c
new file mode 100644
index 00000000000..07443695011
--- /dev/null
+++ b/progs/trivial/tri-fbo-tex-mip.c
@@ -0,0 +1,261 @@
+/* Framebuffer object test */
+
+
+#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 = 4; /* 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");