summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJose Fonseca <jfonseca@vmware.com>2016-08-05 15:06:11 +0100
committerJose Fonseca <jfonseca@vmware.com>2020-09-16 10:03:35 +0100
commit5435fc7fbd332e171da9a71e33a9b190e9462cf0 (patch)
tree26455b177ddd89cf3ee69b8d23e5df8f97a696aa
parent13cf8beb8ee9f9c5d9ef7ee402d93512c6e9dc2e (diff)
downloadmesa-demos-5435fc7fbd332e171da9a71e33a9b190e9462cf0.tar.gz
Use glad instead of GLEW.
glad is a more modern, cleaner, and flexible alternative to GLEW. In particular it has first-class citizen support for OpenGL ES end EGL. Glad can't be used just for defines. For old demos which only need defines, we could bundle Khronos glext, but for now place the necessary defines on gl_wrap.h
-rw-r--r--.gitlab-ci.yml1
-rw-r--r--CMakeLists.txt10
-rw-r--r--configure.ac5
-rw-r--r--index.html13
-rw-r--r--src/demos/CMakeLists.txt4
-rw-r--r--src/demos/Makefile.am46
-rw-r--r--src/demos/arbfplight.c4
-rw-r--r--src/demos/arbfslight.c4
-rw-r--r--src/demos/arbocclude.c4
-rw-r--r--src/demos/arbocclude2.c4
-rw-r--r--src/demos/copypix.c4
-rw-r--r--src/demos/cubemap.c15
-rw-r--r--src/demos/cuberender.c4
-rw-r--r--src/demos/dinoshade.c8
-rw-r--r--src/demos/engine.c4
-rw-r--r--src/demos/fbo_firecube.c4
-rw-r--r--src/demos/fbotexture.c4
-rw-r--r--src/demos/fogcoord.c10
-rw-r--r--src/demos/fplight.c4
-rw-r--r--src/demos/fslight.c6
-rw-r--r--src/demos/gloss.c4
-rw-r--r--src/demos/ipers.c2
-rw-r--r--src/demos/isosurf.c8
-rw-r--r--src/demos/lodbias.c2
-rw-r--r--src/demos/multiarb.c4
-rw-r--r--src/demos/normal.c6
-rw-r--r--src/demos/paltex.c4
-rw-r--r--src/demos/pixeltest.c2
-rw-r--r--src/demos/pointblast.c4
-rw-r--r--src/demos/projtex.c4
-rw-r--r--src/demos/renormal.c2
-rw-r--r--src/demos/shadowtex.c4
-rw-r--r--src/demos/spriteblast.c6
-rw-r--r--src/demos/stex3d.c4
-rw-r--r--src/demos/texenv.c2
-rw-r--r--src/demos/textures.c4
-rw-r--r--src/demos/vao_demo.c4
-rw-r--r--src/demos/winpos.c8
-rw-r--r--src/fp/CMakeLists.txt4
-rw-r--r--src/fp/Makefile.am3
-rw-r--r--src/fp/fp-tri.c6
-rw-r--r--src/fp/point-position.c6
-rw-r--r--src/fp/tri-depth.c6
-rw-r--r--src/fp/tri-depth2.c6
-rw-r--r--src/fp/tri-depthwrite.c6
-rw-r--r--src/fp/tri-depthwrite2.c6
-rw-r--r--src/fp/tri-param.c6
-rw-r--r--src/fp/tri-tex.c6
-rw-r--r--src/fpglsl/CMakeLists.txt4
-rw-r--r--src/fpglsl/Makefile.am3
-rw-r--r--src/fpglsl/fp-tri.c4
-rw-r--r--src/glad/CMakeLists.txt4
-rw-r--r--src/glad/Makefile.am2
-rw-r--r--src/glsl/CMakeLists.txt4
-rw-r--r--src/glsl/Makefile.am73
-rw-r--r--src/glsl/array.c4
-rw-r--r--src/glsl/bezier.c4
-rw-r--r--src/glsl/bitmap.c4
-rw-r--r--src/glsl/blinking-teapot.c4
-rw-r--r--src/glsl/brick.c6
-rw-r--r--src/glsl/bump.c4
-rw-r--r--src/glsl/convolutions.c4
-rw-r--r--src/glsl/deriv.c4
-rw-r--r--src/glsl/fragcoord.c4
-rw-r--r--src/glsl/fsraytrace.c4
-rw-r--r--src/glsl/geom-outlining-130.c4
-rw-r--r--src/glsl/geom-outlining-150.c10
-rw-r--r--src/glsl/geom-sprites.c4
-rw-r--r--src/glsl/geom-stipple-lines.c4
-rw-r--r--src/glsl/geom-wide-lines.c4
-rw-r--r--src/glsl/gsraytrace.cpp9
-rw-r--r--src/glsl/identity.c4
-rw-r--r--src/glsl/linktest.c4
-rw-r--r--src/glsl/mandelbrot.c4
-rw-r--r--src/glsl/multinoise.c6
-rw-r--r--src/glsl/multitex.c6
-rw-r--r--src/glsl/noise.c4
-rw-r--r--src/glsl/noise2.c4
-rw-r--r--src/glsl/pointcoord.c4
-rw-r--r--src/glsl/points.c4
-rw-r--r--src/glsl/samplers.c4
-rw-r--r--src/glsl/shadow_sampler.c6
-rw-r--r--src/glsl/shtest.c4
-rw-r--r--src/glsl/simplex-noise.c4
-rw-r--r--src/glsl/skinning.c4
-rw-r--r--src/glsl/texaaline.c6
-rw-r--r--src/glsl/texdemo1.c4
-rw-r--r--src/glsl/toyball.c4
-rw-r--r--src/glsl/trirast.c4
-rw-r--r--src/glsl/twoside.c4
-rw-r--r--src/glsl/vert-or-frag-only.c4
-rw-r--r--src/glsl/vert-tex.c4
-rw-r--r--src/glsl/vsraytrace.c4
-rw-r--r--src/gs/CMakeLists.txt4
-rw-r--r--src/gs/Makefile.am3
-rw-r--r--src/gs/gs-tri.c4
-rw-r--r--src/objviewer/CMakeLists.txt4
-rw-r--r--src/objviewer/Makefile.am3
-rw-r--r--src/objviewer/glmdraw.c2
-rw-r--r--src/objviewer/objview.c14
-rw-r--r--src/objviewer/skybox.c2
-rw-r--r--src/osdemos/Makefile.am7
-rw-r--r--src/perf/CMakeLists.txt4
-rw-r--r--src/perf/Makefile.am7
-rw-r--r--src/perf/glmain.c4
-rw-r--r--src/perf/glmain.h2
-rw-r--r--src/perf/glsl-compile-time.c4
-rw-r--r--src/perf/glslstateschange.c2
-rw-r--r--src/redbook/CMakeLists.txt4
-rw-r--r--src/redbook/Makefile.am3
-rw-r--r--src/redbook/combiner.c4
-rw-r--r--src/redbook/convolution.c4
-rw-r--r--src/redbook/cubemap.c2
-rw-r--r--src/redbook/fogcoord.c4
-rw-r--r--src/redbook/histogram.c4
-rw-r--r--src/redbook/minmax.c4
-rw-r--r--src/redbook/multisamp.c2
-rw-r--r--src/redbook/multitex.c4
-rw-r--r--src/redbook/mvarray.c4
-rw-r--r--src/redbook/pointp.c4
-rw-r--r--src/redbook/shadowmap.c4
-rw-r--r--src/redbook/texture3d.c4
-rw-r--r--src/samples/CMakeLists.txt4
-rw-r--r--src/samples/Makefile.am4
-rw-r--r--src/samples/blendeq.c4
-rw-r--r--src/samples/blendxor.c4
-rw-r--r--src/samples/copy.c4
-rw-r--r--src/slang/CMakeLists.txt4
-rw-r--r--src/slang/Makefile.am3
-rw-r--r--src/slang/framework.c2
-rw-r--r--src/slang/framework.h2
-rw-r--r--src/tests/CMakeLists.txt6
-rw-r--r--src/tests/Makefile.am34
-rw-r--r--src/tests/afsmultiarb.c4
-rw-r--r--src/tests/antialias.c4
-rw-r--r--src/tests/api_speed.c4
-rw-r--r--src/tests/arbfpspec.c4
-rw-r--r--src/tests/arbfptest1.c4
-rw-r--r--src/tests/arbfptexture.c4
-rw-r--r--src/tests/arbfptrig.c4
-rw-r--r--src/tests/arbgpuprog.c4
-rw-r--r--src/tests/arbnpot-mipmap.c4
-rw-r--r--src/tests/arbnpot.c4
-rw-r--r--src/tests/arbvparray.c6
-rw-r--r--src/tests/arbvptest1.c4
-rw-r--r--src/tests/arbvptest3.c4
-rw-r--r--src/tests/arbvptorus.c4
-rw-r--r--src/tests/arbvpwarpmesh.c4
-rw-r--r--src/tests/arraytexture.c4
-rw-r--r--src/tests/auxbuffer.c4
-rw-r--r--src/tests/backspecular.c2
-rw-r--r--src/tests/blendxor.c4
-rw-r--r--src/tests/blitfb.c4
-rw-r--r--src/tests/bufferobj.c4
-rw-r--r--src/tests/bug_3050.c4
-rw-r--r--src/tests/bug_3101.c4
-rw-r--r--src/tests/bug_3195.c4
-rw-r--r--src/tests/bug_texstore_i8.c4
-rw-r--r--src/tests/bumpmap.c4
-rw-r--r--src/tests/calibrate_rast.c4
-rw-r--r--src/tests/condrender.c4
-rw-r--r--src/tests/copypixrate.c4
-rw-r--r--src/tests/cva.c10
-rw-r--r--src/tests/debugger.c4
-rw-r--r--src/tests/drawbuffers.c10
-rw-r--r--src/tests/drawbuffers2.c6
-rw-r--r--src/tests/drawstencil.c4
-rw-r--r--src/tests/exactrast.c4
-rw-r--r--src/tests/ext422square.c4
-rw-r--r--src/tests/fbotest1.c4
-rw-r--r--src/tests/fbotest2.c4
-rw-r--r--src/tests/fbotest3.c4
-rw-r--r--src/tests/fillrate.c4
-rw-r--r--src/tests/floattex.c4
-rw-r--r--src/tests/fogcoord.c4
-rw-r--r--src/tests/fptest1.c4
-rw-r--r--src/tests/fptexture.c4
-rw-r--r--src/tests/getteximage.c4
-rw-r--r--src/tests/gremedy.c16
-rw-r--r--src/tests/interleave.c4
-rw-r--r--src/tests/invert.c4
-rw-r--r--src/tests/line-sample.c2
-rw-r--r--src/tests/lineclip.c4
-rw-r--r--src/tests/linehacks.c4
-rw-r--r--src/tests/manytex.c4
-rw-r--r--src/tests/mapbufrange.c8
-rw-r--r--src/tests/minmag.c4
-rw-r--r--src/tests/mipgen.c4
-rw-r--r--src/tests/mipmap_comp.c4
-rw-r--r--src/tests/mipmap_comp_tests.c4
-rw-r--r--src/tests/mipmap_limits.c4
-rw-r--r--src/tests/mipmap_tunnel.c4
-rw-r--r--src/tests/mipmap_view.c4
-rw-r--r--src/tests/multipal.c4
-rw-r--r--src/tests/multitexarray.c4
-rw-r--r--src/tests/multiwindow.c6
-rw-r--r--src/tests/no_s3tc.c4
-rw-r--r--src/tests/packedpixels.c4
-rw-r--r--src/tests/pbo.c4
-rw-r--r--src/tests/prim.c4
-rw-r--r--src/tests/prog_parameter.c8
-rw-r--r--src/tests/quads.c4
-rw-r--r--src/tests/random.c4
-rw-r--r--src/tests/readrate.c4
-rw-r--r--src/tests/rubberband.c4
-rw-r--r--src/tests/seccolor.c4
-rw-r--r--src/tests/shader-interp.c4
-rw-r--r--src/tests/shader_api.c6
-rw-r--r--src/tests/shadow-sample.c4
-rw-r--r--src/tests/stencilreaddraw.c4
-rw-r--r--src/tests/stencilwrap.c4
-rw-r--r--src/tests/streaming_rect.c4
-rw-r--r--src/tests/subtex.c4
-rw-r--r--src/tests/subtexrate.c4
-rw-r--r--src/tests/tex1d.c4
-rw-r--r--src/tests/texcmp.c4
-rw-r--r--src/tests/texcompress2.c4
-rw-r--r--src/tests/texcompsub.c4
-rw-r--r--src/tests/texdown.c2
-rw-r--r--src/tests/texfilt.c4
-rw-r--r--src/tests/texgenmix.c4
-rw-r--r--src/tests/texleak.c4
-rw-r--r--src/tests/texline.c4
-rw-r--r--src/tests/texrect.c4
-rw-r--r--src/tests/unfilledclip.c4
-rw-r--r--src/tests/viewmemory.c4
-rw-r--r--src/tests/vparray.c6
-rw-r--r--src/tests/vpeval.c4
-rw-r--r--src/tests/vptest1.c4
-rw-r--r--src/tests/vptest2.c4
-rw-r--r--src/tests/vptest3.c4
-rw-r--r--src/tests/vptorus.c4
-rw-r--r--src/tests/vpwarpmesh.c4
-rw-r--r--src/tests/yuvrect.c4
-rw-r--r--src/tests/yuvsquare.c4
-rw-r--r--src/tests/zbitmap.c4
-rw-r--r--src/tests/zcomp.c4
-rw-r--r--src/tests/zdrawpix.c4
-rw-r--r--src/tests/zreaddraw.c4
-rw-r--r--src/tools/CMakeLists.txt4
-rw-r--r--src/tools/dds.c4
-rw-r--r--src/trivial/CMakeLists.txt4
-rw-r--r--src/trivial/Makefile.am3
-rw-r--r--src/trivial/clear-fbo-scissor.c4
-rw-r--r--src/trivial/clear-fbo-tex.c4
-rw-r--r--src/trivial/clear-fbo.c4
-rw-r--r--src/trivial/draw2arrays.c4
-rw-r--r--src/trivial/drawarrays.c4
-rw-r--r--src/trivial/drawelements-large.c4
-rw-r--r--src/trivial/drawelements.c4
-rw-r--r--src/trivial/drawrange.c4
-rw-r--r--src/trivial/fs-tri.c6
-rw-r--r--src/trivial/line-smooth.c2
-rw-r--r--src/trivial/lineloop-elts.c4
-rw-r--r--src/trivial/long-fixed-func.c4
-rw-r--r--src/trivial/point-param.c4
-rw-r--r--src/trivial/point-sprite.c2
-rw-r--r--src/trivial/quad-tex-2d.c2
-rw-r--r--src/trivial/quad-tex-3d.c4
-rw-r--r--src/trivial/quad-tex-alpha.c2
-rw-r--r--src/trivial/quad-tex-pbo.c4
-rw-r--r--src/trivial/quad-tex-sub.c4
-rw-r--r--src/trivial/readpixels.c4
-rw-r--r--src/trivial/sub-tex.c4
-rw-r--r--src/trivial/tex-quads.c4
-rw-r--r--src/trivial/tri-2101010-dlist.c4
-rw-r--r--src/trivial/tri-2101010.c4
-rw-r--r--src/trivial/tri-alpha-tex.c2
-rw-r--r--src/trivial/tri-array-interleaved.c4
-rw-r--r--src/trivial/tri-blend-color.c4
-rw-r--r--src/trivial/tri-blend-max.c4
-rw-r--r--src/trivial/tri-blend-min.c4
-rw-r--r--src/trivial/tri-blend-revsub.c4
-rw-r--r--src/trivial/tri-blend-sub.c4
-rw-r--r--src/trivial/tri-edgeflag-pv.c4
-rw-r--r--src/trivial/tri-fbo-tex-mip.c4
-rw-r--r--src/trivial/tri-fbo-tex.c4
-rw-r--r--src/trivial/tri-fbo.c4
-rw-r--r--src/trivial/tri-fp-const-imm.c4
-rw-r--r--src/trivial/tri-fp.c4
-rw-r--r--src/trivial/tri-multitex-vbo.c4
-rw-r--r--src/trivial/tri-query.c4
-rw-r--r--src/trivial/tri-tex-1d.c2
-rw-r--r--src/trivial/tri-tex-3d.c4
-rw-r--r--src/trivial/tri-tex-stipple.c2
-rw-r--r--src/trivial/tri-tex.c2
-rw-r--r--src/trivial/vbo-drawarrays-2101010.c6
-rw-r--r--src/trivial/vbo-drawarrays.c4
-rw-r--r--src/trivial/vbo-drawelements.c4
-rw-r--r--src/trivial/vbo-drawrange.c4
-rw-r--r--src/trivial/vbo-noninterleaved.c4
-rw-r--r--src/trivial/vbo-tri.c4
-rw-r--r--src/trivial/vp-array-hf.c4
-rw-r--r--src/trivial/vp-array-int.c4
-rw-r--r--src/trivial/vp-array.c4
-rw-r--r--src/trivial/vp-clip.c4
-rw-r--r--src/trivial/vp-line-clip.c4
-rw-r--r--src/trivial/vp-tri-cb-pos.c4
-rw-r--r--src/trivial/vp-tri-cb-tex.c4
-rw-r--r--src/trivial/vp-tri-cb.c4
-rw-r--r--src/trivial/vp-tri-imm.c4
-rw-r--r--src/trivial/vp-tri-invariant.c4
-rw-r--r--src/trivial/vp-tri-swap.c4
-rw-r--r--src/trivial/vp-tri-tex.c4
-rw-r--r--src/trivial/vp-tri.c4
-rw-r--r--src/trivial/vp-unfilled.c4
-rw-r--r--src/util/CMakeLists.txt2
-rw-r--r--src/util/Makefile.am3
-rw-r--r--src/util/gl_wrap.h88
-rw-r--r--src/util/shaderutil.c10
-rw-r--r--src/vp/CMakeLists.txt4
-rw-r--r--src/vp/Makefile.am3
-rw-r--r--src/vp/vp-tris.c4
-rw-r--r--src/vpglsl/CMakeLists.txt4
-rw-r--r--src/vpglsl/Makefile.am3
-rw-r--r--src/vpglsl/vp-tris.c4
-rw-r--r--src/wgl/CMakeLists.txt4
-rw-r--r--src/wgl/wglcontext.c24
-rw-r--r--src/wgl/wglgears.c57
-rw-r--r--src/wgl/wglinfo.c93
-rw-r--r--src/xdemos/CMakeLists.txt4
-rw-r--r--src/xdemos/Makefile.am2
-rw-r--r--src/xdemos/glinfo_common.h2
323 files changed, 886 insertions, 882 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 11fdc688..5d025a20 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -50,7 +50,6 @@ x86_build:
libegl1-mesa-dev
libgbm-dev
libgl1-mesa-dev
- libglew-dev
libudev-dev
libwayland-dev
libx11-dev
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1272e0b0..c6510502 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -10,16 +10,9 @@ find_package (OpenGL REQUIRED)
find_package (GLUT REQUIRED)
find_package (X11)
-find_library (GLEW_glew_LIBRARY GLEW
- /usr/lib
-)
-
-find_path (GLEW_INCLUDE_DIR GL/glew.h
- /usr/include/GL
-)
+set (GLAD_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/src/glad/include)
if (PKG_CONFIG_FOUND AND NOT WIN32)
- pkg_check_modules (GLEW REQUIRED glew>=1.5.4)
pkg_check_modules (EGL egl)
pkg_check_modules (GLESV1 glesv1_cm)
pkg_check_modules (GLESV2 glesv2)
@@ -84,7 +77,6 @@ endif ()
if (WIN32)
# Nobody likes to include windows.h:
# - Microsoft's GL/gl.h header depends on windows.h but doesn't include it;
- # - GLEW temporarily defines the necessary defines but undefines them later
# - certain GLUT distributions don't include it;
# - most of our programs are meant to be portable so don't include it.
#
diff --git a/configure.ac b/configure.ac
index 80a62efa..6b4521c0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -92,11 +92,6 @@ AC_EGREP_HEADER([glutInitContextProfile],
[AC_DEFINE(HAVE_FREEGLUT)],
[])
-dnl Check for GLEW
-PKG_CHECK_MODULES(GLEW, [glew >= 1.5.4])
-DEMO_CFLAGS="$DEMO_CFLAGS $GLEW_CFLAGS"
-DEMO_LIBS="$DEMO_LIBS $GLEW_LIBS"
-
# LIBS was set by AC_CHECK_LIB above
LIBS=""
diff --git a/index.html b/index.html
index e88b61b5..0bd549d3 100644
--- a/index.html
+++ b/index.html
@@ -67,15 +67,13 @@ The Mesa demos can be built with autoconf or <a href="http://www.cmake.org/">CMa
<h2>Prerequisites</h2>
<p>
-You'll need <a href="http://glew.sourceforge.net/">glew</a> version 1.5.4
-or later and glut or <a href="http://freeglut.sourceforge.net/">freeglut</a> (runtime libraries and header files).
+You'll need glut or <a href="http://freeglut.sourceforge.net/">freeglut</a> (runtime libraries and header files).
</p>
<p>
If you're using an RPM-based Linux distro you can install these items with:
</p>
<pre>
-yum install glew glew-devel
yum install freeglut freeglut-devel
</pre>
@@ -83,7 +81,7 @@ yum install freeglut freeglut-devel
And if you're using a Debian based Linux distro you can install these items with:
</p>
<pre>
-apt-get install libglew-dev freeglut3-dev
+apt-get install freeglut3-dev
</pre>
@@ -123,8 +121,8 @@ make
<li>Start the CMake GUI.</li>
<li>Specify where this source is and where to build the binaries.</li>
<li>Click <i>Configure</i>.</li>
- <li>Specify where GLEW and GLUT headers and libraries are; specifically via the
- <b>GLEW_INCLUDE_DIR</b>, <b>GLEW_glew_LIBRARY</b>, <b>GLUT_INCLUDE_DIR</b>, and <b>GLUT_glut_LIBRARY</b> variables.</li>
+ <li>Specify where GLUT headers and libraries are; specifically via the
+ <b>GLUT_INCLUDE_DIR</b>, and <b>GLUT_glut_LIBRARY</b> variables.</li>
<li>Click <i>Generate</i>.</li>
<li>Open the generated <b>mesademos.sln</b> Visual Studio solution file and build the target <b>ALL</b>.
</ul>
@@ -158,9 +156,6 @@ set (CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
Create a <b>Cache.cmake</b> file containing:
</p>
<pre>
-set (GLEW_INCLUDE_DIR "/path/to/glew/include" CACHE PATH "" FORCE)
-set (GLEW_glew_LIBRARY "/path/to/glew/lib/libglew32.a" CACHE FILEPATH "" FORCE)
-
set (GLUT_INCLUDE_DIR "/path/to/glut/include" CACHE PATH "" FORCE)
set (GLUT_glut_LIBRARY "/path/to/glut/lib/libglut32.a" CACHE FILEPATH "" FORCE)
</pre>
diff --git a/src/demos/CMakeLists.txt b/src/demos/CMakeLists.txt
index b35fae66..6c37c33e 100644
--- a/src/demos/CMakeLists.txt
+++ b/src/demos/CMakeLists.txt
@@ -2,7 +2,7 @@ include_directories (
${CMAKE_SOURCE_DIR}/src/util
${OPENGL_INCLUDE_PATH}
${GLUT_INCLUDE_DIR}
- ${GLEW_INCLUDE_DIR}
+ ${GLAD_INCLUDE_DIR}
)
link_directories (
@@ -14,7 +14,7 @@ link_libraries (
${OPENGL_gl_LIBRARY}
${OPENGL_glu_LIBRARY}
${GLUT_glut_LIBRARY}
- ${GLEW_glew_LIBRARY}
+ glad
)
set (subdir demos)
diff --git a/src/demos/Makefile.am b/src/demos/Makefile.am
index 41603fa8..2a971327 100644
--- a/src/demos/Makefile.am
+++ b/src/demos/Makefile.am
@@ -25,6 +25,7 @@
AM_CFLAGS = \
$(DEMO_CFLAGS) \
$(GLUT_CFLAGS) \
+ -I$(top_srcdir)/src/glad/include \
-I$(top_srcdir)/src/util
AM_LDFLAGS = \
$(DEMO_LIBS) \
@@ -93,28 +94,29 @@ tunnel_SOURCES = \
tunnel.c \
tunneldat.h
-copypix_LDADD = ../util/libutil.la
-cubemap_LDADD = ../util/libutil.la
-cuberender_LDADD = ../util/libutil.la
-drawpix_LDADD = ../util/libutil.la
-dissolve_LDADD = ../util/libutil.la
-engine_LDADD = ../util/libutil.la
-fbo_firecube_LDADD = ../util/libutil.la
-fire_LDADD = ../util/libutil.la
-gloss_LDADD = ../util/libutil.la
-ipers_LDADD = ../util/libutil.la
-isosurf_LDADD = ../util/libutil.la
-lodbias_LDADD = ../util/libutil.la
-multiarb_LDADD = ../util/libutil.la
-projtex_LDADD = ../util/libutil.la
-readpix_LDADD = ../util/libutil.la
-reflect_LDADD = ../util/libutil.la
-teapot_LDADD = ../util/libutil.la
-texcyl_LDADD = ../util/libutil.la
-textures_LDADD = ../util/libutil.la
-tunnel_LDADD = ../util/libutil.la
-tunnel2_LDADD = ../util/libutil.la
-winpos_LDADD = ../util/libutil.la
+LDADD = ../glad/libglad.la
+copypix_LDADD = ../util/libutil.la ../glad/libglad.la
+cubemap_LDADD = ../util/libutil.la ../glad/libglad.la
+cuberender_LDADD = ../util/libutil.la ../glad/libglad.la
+drawpix_LDADD = ../util/libutil.la ../glad/libglad.la
+dissolve_LDADD = ../util/libutil.la ../glad/libglad.la
+engine_LDADD = ../util/libutil.la ../glad/libglad.la
+fbo_firecube_LDADD = ../util/libutil.la ../glad/libglad.la
+fire_LDADD = ../util/libutil.la ../glad/libglad.la
+gloss_LDADD = ../util/libutil.la ../glad/libglad.la
+ipers_LDADD = ../util/libutil.la ../glad/libglad.la
+isosurf_LDADD = ../util/libutil.la ../glad/libglad.la
+lodbias_LDADD = ../util/libutil.la ../glad/libglad.la
+multiarb_LDADD = ../util/libutil.la ../glad/libglad.la
+projtex_LDADD = ../util/libutil.la ../glad/libglad.la
+readpix_LDADD = ../util/libutil.la ../glad/libglad.la
+reflect_LDADD = ../util/libutil.la ../glad/libglad.la
+teapot_LDADD = ../util/libutil.la ../glad/libglad.la
+texcyl_LDADD = ../util/libutil.la ../glad/libglad.la
+textures_LDADD = ../util/libutil.la ../glad/libglad.la
+tunnel_LDADD = ../util/libutil.la ../glad/libglad.la
+tunnel2_LDADD = ../util/libutil.la ../glad/libglad.la
+winpos_LDADD = ../util/libutil.la ../glad/libglad.la
EXTRA_DIST = \
README
diff --git a/src/demos/arbfplight.c b/src/demos/arbfplight.c
index 4c0d21d0..0295675e 100644
--- a/src/demos/arbfplight.c
+++ b/src/demos/arbfplight.c
@@ -11,7 +11,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
@@ -358,7 +358,7 @@ int main( int argc, char *argv[] )
glutInit( &argc, argv );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
Win = glutCreateWindow(argv[0]);
- glewInit();
+ gladLoadGL();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutSpecialFunc( SpecialKey );
diff --git a/src/demos/arbfslight.c b/src/demos/arbfslight.c
index 1736ec11..4092dd62 100644
--- a/src/demos/arbfslight.c
+++ b/src/demos/arbfslight.c
@@ -13,7 +13,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
static GLfloat diffuse[4] = { 0.5f, 0.5f, 1.0f, 1.0f };
@@ -256,7 +256,7 @@ main(int argc, char *argv[])
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
glutCreateWindow(argv[0]);
- glewInit();
+ gladLoadGL();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutSpecialFunc(SpecialKey);
diff --git a/src/demos/arbocclude.c b/src/demos/arbocclude.c
index 98efc744..9015418e 100644
--- a/src/demos/arbocclude.c
+++ b/src/demos/arbocclude.c
@@ -29,7 +29,7 @@
#include <stdlib.h>
#include <string.h>
#include <math.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
#define NUM_OCC 10
@@ -272,7 +272,7 @@ int main( int argc, char *argv[] )
glutInit( &argc, argv );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
Win = glutCreateWindow(argv[0]);
- glewInit();
+ gladLoadGL();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutSpecialFunc( SpecialKey );
diff --git a/src/demos/arbocclude2.c b/src/demos/arbocclude2.c
index 19c27660..a50cb6e5 100644
--- a/src/demos/arbocclude2.c
+++ b/src/demos/arbocclude2.c
@@ -31,7 +31,7 @@
#include <stdlib.h>
#include <string.h>
#include <math.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
static GLboolean Anim = GL_TRUE;
@@ -331,7 +331,7 @@ int main( int argc, char *argv[] )
glutInit( &argc, argv );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
Win = glutCreateWindow(argv[0]);
- glewInit();
+ gladLoadGL();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutSpecialFunc( SpecialKey );
diff --git a/src/demos/copypix.c b/src/demos/copypix.c
index 286c5a97..164d8c01 100644
--- a/src/demos/copypix.c
+++ b/src/demos/copypix.c
@@ -9,7 +9,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
#include "readtex.h"
@@ -254,7 +254,7 @@ int main( int argc, char *argv[] )
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE);
glutCreateWindow(argv[0]);
- glewInit();
+ gladLoadGL();
Init(ciMode, filename);
Usage();
diff --git a/src/demos/cubemap.c b/src/demos/cubemap.c
index 2c3edbdb..3ef1a30e 100644
--- a/src/demos/cubemap.c
+++ b/src/demos/cubemap.c
@@ -39,7 +39,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
#include "readtex.h"
@@ -539,25 +539,22 @@ static void load_envmaps(void)
static void init( GLboolean useImageFiles )
{
/* check for extensions */
- if (!GLEW_ARB_texture_cube_map) {
+ if (!GLAD_GL_ARB_texture_cube_map) {
printf("Sorry, this demo requires GL_ARB_texture_cube_map\n");
exit(0);
}
/* Needed for glGenerateMipmapEXT / auto mipmapping
*/
- supportFBO = GLEW_EXT_framebuffer_object;
+ supportFBO = GLAD_GL_EXT_framebuffer_object;
- if (!supportFBO && !GLEW_SGIS_generate_mipmap) {
+ if (!supportFBO && !GLAD_GL_SGIS_generate_mipmap) {
printf("Sorry, this demo requires GL_EXT_framebuffer_object or "
"GL_SGIS_generate_mipmap\n");
exit(0);
}
- /* GLEW doesn't know about this extension yet, so use the old GLUT function
- * to check for availability.
- */
- supportSeamless = glutExtensionSupported("GL_ARB_seamless_cube_map");
+ supportSeamless = GLAD_GL_ARB_seamless_cube_map;
printf("GL_RENDERER: %s\n", (char *) glGetString(GL_RENDERER));
@@ -619,7 +616,7 @@ int main( int argc, char *argv[] )
glutInit(&argc, argv);
glutInitDisplayMode( GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE );
glutCreateWindow("Texture Cube Mapping");
- glewInit();
+ gladLoadGL();
glutReshapeFunc( reshape );
glutKeyboardFunc( key );
glutSpecialFunc( specialkey );
diff --git a/src/demos/cuberender.c b/src/demos/cuberender.c
index 19fbd7df..4d2b0a67 100644
--- a/src/demos/cuberender.c
+++ b/src/demos/cuberender.c
@@ -10,7 +10,7 @@
#include <stdlib.h>
#include <string.h>
#include <math.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
#include "shaderutil.h"
@@ -572,7 +572,7 @@ main(int argc, char *argv[])
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH | GLUT_STENCIL);
Win = glutCreateWindow(argv[0]);
- glewInit();
+ gladLoadGL();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutSpecialFunc(SpecialKey);
diff --git a/src/demos/dinoshade.c b/src/demos/dinoshade.c
index 6d5a1303..9f61a3bd 100644
--- a/src/demos/dinoshade.c
+++ b/src/demos/dinoshade.c
@@ -43,7 +43,7 @@
#include <windows.h>
#endif
#define GL_GLEXT_LEGACY
-#include <GL/glew.h> /* OpenGL Utility Toolkit header */
+#include <glad/glad.h> /* OpenGL Utility Toolkit header */
#include "glut_wrap.h" /* OpenGL Utility Toolkit header */
/* Some <math.h> files do not define M_PI... */
@@ -813,7 +813,7 @@ main(int argc, char **argv)
#endif
glutCreateWindow("Shadowy Leapin' Lizards");
- glewInit();
+ gladLoadGL();
if (glutGet(GLUT_WINDOW_STENCIL_SIZE) <= 1) {
printf("dinoshade: Sorry, I need at least 2 bits of stencil.\n");
@@ -850,7 +850,7 @@ main(int argc, char **argv)
makeDinosaur();
#ifdef GL_VERSION_1_1
- if (GLEW_VERSION_1_1 && !forceExtension) {
+ if (GLAD_GL_VERSION_1_1 && !forceExtension) {
polygonOffsetVersion = ONE_DOT_ONE;
glPolygonOffset(-2.0, -9.0);
} else
@@ -858,7 +858,7 @@ main(int argc, char **argv)
{
#ifdef GL_EXT_polygon_offset
/* check for the polygon offset extension */
- if (GLEW_EXT_polygon_offset) {
+ if (GLAD_GL_EXT_polygon_offset) {
polygonOffsetVersion = EXTENSION;
glPolygonOffsetEXT(-2.0, -0.002);
} else
diff --git a/src/demos/engine.c b/src/demos/engine.c
index 928fcbb8..410d8893 100644
--- a/src/demos/engine.c
+++ b/src/demos/engine.c
@@ -9,7 +9,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
#include "readtex.h"
#include "trackball.h"
@@ -1328,7 +1328,7 @@ main(int argc, char *argv[])
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
Win = glutCreateWindow("OpenGL Engine Demo");
- glewInit();
+ gladLoadGL();
glutReshapeFunc(Reshape);
glutMouseFunc(Mouse);
glutMotionFunc(Motion);
diff --git a/src/demos/fbo_firecube.c b/src/demos/fbo_firecube.c
index eefbb640..c8e5d2bc 100644
--- a/src/demos/fbo_firecube.c
+++ b/src/demos/fbo_firecube.c
@@ -33,7 +33,7 @@
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
#include "readtex.h"
@@ -1060,7 +1060,7 @@ main(int argc, char *argv[])
glutInitDisplayMode(GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE);
Win = glutCreateWindow("fbo_firecube");
- glewInit();
+ gladLoadGL();
init(argc, argv);
glutDisplayFunc(draw);
diff --git a/src/demos/fbotexture.c b/src/demos/fbotexture.c
index ae3894fa..e76ab8f4 100644
--- a/src/demos/fbotexture.c
+++ b/src/demos/fbotexture.c
@@ -13,7 +13,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
/* For debug */
@@ -699,7 +699,7 @@ main(int argc, char *argv[])
glutIdleFunc(Idle);
ParseArgs(argc, argv);
- glewInit();
+ gladLoadGL();
Init();
Usage();
diff --git a/src/demos/fogcoord.c b/src/demos/fogcoord.c
index 567eec0a..ea9a3ae2 100644
--- a/src/demos/fogcoord.c
+++ b/src/demos/fogcoord.c
@@ -10,7 +10,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
#define DEPTH 5.0f
@@ -116,7 +116,7 @@ SetFogMode(GLint fogMode)
static GLboolean
SetFogCoord(GLboolean fogCoord)
{
- if (!GLEW_EXT_fog_coord) {
+ if (!GLAD_GL_EXT_fog_coord) {
return GL_FALSE;
}
@@ -365,7 +365,7 @@ Init(void)
printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
- if (!GLEW_EXT_fog_coord) {
+ if (!GLAD_GL_EXT_fog_coord) {
printf("GL_EXT_fog_coord not supported!\n");
}
@@ -392,7 +392,7 @@ Init(void)
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
glTexCoordPointer(2, GL_FLOAT, 0, texcoord_pointer);
- if (GLEW_EXT_fog_coord) {
+ if (GLAD_GL_EXT_fog_coord) {
glEnableClientState(GL_FOG_COORDINATE_ARRAY_EXT);
glFogCoordPointerEXT(GL_FLOAT, 0, fogcoord_pointer);
}
@@ -408,7 +408,7 @@ main( int argc, char *argv[] )
glutInit( &argc, argv );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
glutCreateWindow(argv[0]);
- glewInit();
+ gladLoadGL();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );
diff --git a/src/demos/fplight.c b/src/demos/fplight.c
index 71a963be..182ef44c 100644
--- a/src/demos/fplight.c
+++ b/src/demos/fplight.c
@@ -10,7 +10,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
@@ -272,7 +272,7 @@ int main( int argc, char *argv[] )
glutInit( &argc, argv );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
Win = glutCreateWindow(argv[0]);
- glewInit();
+ gladLoadGL();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutSpecialFunc( SpecialKey );
diff --git a/src/demos/fslight.c b/src/demos/fslight.c
index 773108a4..ba264468 100644
--- a/src/demos/fslight.c
+++ b/src/demos/fslight.c
@@ -17,7 +17,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
@@ -463,7 +463,7 @@ Init(void)
" normal = gl_NormalMatrix * gl_Normal;\n"
"}\n";
- if (!GLEW_VERSION_2_0) {
+ if (!GLAD_GL_VERSION_2_0) {
printf("This program requires OpenGL 2.x or higher\n");
exit(1);
}
@@ -598,7 +598,7 @@ main(int argc, char *argv[])
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
win = glutCreateWindow(argv[0]);
- glewInit();
+ gladLoadGL();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutSpecialFunc(SpecialKey);
diff --git a/src/demos/gloss.c b/src/demos/gloss.c
index a198a636..8dc81f33 100644
--- a/src/demos/gloss.c
+++ b/src/demos/gloss.c
@@ -22,7 +22,7 @@
#include <stdlib.h>
#include <math.h>
#include <string.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
#include "readtex.h"
@@ -452,7 +452,7 @@ int main( int argc, char *argv[] )
glutInit( &argc, argv );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
Win = glutCreateWindow(argv[0] );
- glewInit();
+ gladLoadGL();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );
diff --git a/src/demos/ipers.c b/src/demos/ipers.c
index 4ecf7cc9..c939d9be 100644
--- a/src/demos/ipers.c
+++ b/src/demos/ipers.c
@@ -16,7 +16,7 @@
#include <mmsystem.h>
#endif
-#include <GL/glew.h> /* for GL_RESCALE_NORMAL_EXT */
+#include "gl_wrap.h"
#include "glut_wrap.h"
#include "readtex.h"
diff --git a/src/demos/isosurf.c b/src/demos/isosurf.c
index 747da2f6..d12bc70d 100644
--- a/src/demos/isosurf.c
+++ b/src/demos/isosurf.c
@@ -32,7 +32,7 @@
#include <windows.h>
#undef CLIP_MASK
#endif
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
#include "readtex.h"
@@ -1066,15 +1066,15 @@ int main(int argc, char **argv)
exit(0);
}
- glewInit();
+ gladLoadGL();
/* Make sure server supports vertex arrays */
- if (!GLEW_VERSION_1_1)
+ if (!GLAD_GL_VERSION_1_1)
{
printf("Vertex arrays not supported by this renderer\n");
allowed &= ~(LOCKED|DRAW_ARRAYS|DRAW_ELTS|ARRAY_ELT);
}
- else if (!GLEW_EXT_compiled_vertex_array)
+ else if (!GLAD_GL_EXT_compiled_vertex_array)
{
printf("Compiled vertex arrays not supported by this renderer\n");
allowed &= ~LOCKED;
diff --git a/src/demos/lodbias.c b/src/demos/lodbias.c
index 8fb015ef..c9683f81 100644
--- a/src/demos/lodbias.c
+++ b/src/demos/lodbias.c
@@ -31,7 +31,7 @@
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
-#include <GL/glew.h>
+#include "gl_wrap.h"
#include "glut_wrap.h"
#include "readtex.h"
diff --git a/src/demos/multiarb.c b/src/demos/multiarb.c
index a5eff64f..b9191742 100644
--- a/src/demos/multiarb.c
+++ b/src/demos/multiarb.c
@@ -14,7 +14,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
#include "readtex.h"
@@ -342,7 +342,7 @@ int main( int argc, char *argv[] )
glutInit( &argc, argv );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
glutCreateWindow(argv[0] );
- glewInit();
+ gladLoadGL();
Init( argc, argv );
diff --git a/src/demos/normal.c b/src/demos/normal.c
index 0e04c8b6..08377d0c 100644
--- a/src/demos/normal.c
+++ b/src/demos/normal.c
@@ -21,7 +21,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
@@ -459,7 +459,7 @@ Init(void)
" gl_Position = ftransform();\n"
"}\n";
- if (!GLEW_VERSION_2_0) {
+ if (!GLAD_GL_VERSION_2_0) {
printf("This program requires OpenGL 2.x or higher\n");
exit(1);
}
@@ -580,7 +580,7 @@ main(int argc, char *argv[])
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
win = glutCreateWindow(argv[0]);
- glewInit();
+ gladLoadGL();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutSpecialFunc(SpecialKey);
diff --git a/src/demos/paltex.c b/src/demos/paltex.c
index ebd95306..d4e2b3d7 100644
--- a/src/demos/paltex.c
+++ b/src/demos/paltex.c
@@ -11,7 +11,7 @@
#ifdef _WIN32
#include <windows.h>
#endif
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
@@ -252,7 +252,7 @@ int main( int argc, char *argv[] )
glutInit( &argc, argv );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
glutCreateWindow(argv[0]);
- glewInit();
+ gladLoadGL();
Init();
(void) Init2; /* silence warning */
diff --git a/src/demos/pixeltest.c b/src/demos/pixeltest.c
index 0348daaf..3b2260cb 100644
--- a/src/demos/pixeltest.c
+++ b/src/demos/pixeltest.c
@@ -11,7 +11,7 @@
#include <stdlib.h>
#include <math.h>
#include <string.h>
-#include <GL/glew.h> /* for GL_UNSIGNED_SHORT_5_6_5 */
+#include "gl_wrap.h" /* for GL_UNSIGNED_SHORT_5_6_5 */
#include "glut_wrap.h"
diff --git a/src/demos/pointblast.c b/src/demos/pointblast.c
index 1c3c480d..505a3fed 100644
--- a/src/demos/pointblast.c
+++ b/src/demos/pointblast.c
@@ -18,7 +18,7 @@
#ifdef _WIN32
#include <windows.h>
#endif
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
/* Some <math.h> files do not define M_PI... */
@@ -444,7 +444,7 @@ main(int argc, char **argv)
}
glutCreateWindow("point burst");
- glewInit();
+ gladLoadGL();
glutDisplayFunc(redraw);
glutMouseFunc(mouse);
glutMotionFunc(mouseMotion);
diff --git a/src/demos/projtex.c b/src/demos/projtex.c
index ea551422..3575a35a 100644
--- a/src/demos/projtex.c
+++ b/src/demos/projtex.c
@@ -18,7 +18,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
#include "readtex.h"
@@ -1002,7 +1002,7 @@ main(int argc, char **argv)
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_RGBA | GLUT_DEPTH | GLUT_DOUBLE);
(void) glutCreateWindow("projtex");
- glewInit();
+ gladLoadGL();
if (argc > 1) {
NumTextures = atoi(argv[1]);
diff --git a/src/demos/renormal.c b/src/demos/renormal.c
index cebf92cc..fd5082ff 100644
--- a/src/demos/renormal.c
+++ b/src/demos/renormal.c
@@ -7,7 +7,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#include <GL/glew.h> /* for GL_RESCALE_NORMAL_EXT */
+#include "gl_wrap.h" /* for GL_RESCALE_NORMAL_EXT */
#include "glut_wrap.h"
diff --git a/src/demos/shadowtex.c b/src/demos/shadowtex.c
index 9f66686b..74587408 100644
--- a/src/demos/shadowtex.c
+++ b/src/demos/shadowtex.c
@@ -36,7 +36,7 @@
#include <stdlib.h>
#include <string.h>
#include <math.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
#define DEG_TO_RAD (3.14159 / 180.0)
@@ -1025,7 +1025,7 @@ main(int argc, char *argv[])
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH | GLUT_STENCIL);
glutCreateWindow(argv[0]);
- glewInit();
+ gladLoadGL();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutSpecialFunc(SpecialKey);
diff --git a/src/demos/spriteblast.c b/src/demos/spriteblast.c
index 0361f28a..9aeae506 100644
--- a/src/demos/spriteblast.c
+++ b/src/demos/spriteblast.c
@@ -22,7 +22,7 @@
#ifdef _WIN32
#include <windows.h>
#endif
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
/* Some <math.h> files do not define M_PI... */
@@ -113,7 +113,7 @@ makeFragShader(void)
{
GLint stat;
- HaveShaders = GLEW_VERSION_2_0;
+ HaveShaders = GLAD_GL_VERSION_2_0;
if (!HaveShaders)
return;
@@ -618,7 +618,7 @@ main(int argc, char **argv)
}
}
glutCreateWindow("sprite blast");
- glewInit();
+ gladLoadGL();
glutReshapeFunc(reshape);
glutDisplayFunc(redraw);
glutMouseFunc(mouse);
diff --git a/src/demos/stex3d.c b/src/demos/stex3d.c
index 45738c66..ad773645 100644
--- a/src/demos/stex3d.c
+++ b/src/demos/stex3d.c
@@ -18,7 +18,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
@@ -676,7 +676,7 @@ main(int argc, char **argv)
exit(0);
}
- glewInit();
+ gladLoadGL();
init();
diff --git a/src/demos/texenv.c b/src/demos/texenv.c
index cd6033b9..38fa2604 100644
--- a/src/demos/texenv.c
+++ b/src/demos/texenv.c
@@ -49,7 +49,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <GL/glew.h> /* for GL_BGRA */
+#include "gl_wrap.h" /* for GL_BGRA */
#include "glut_wrap.h"
#undef max
diff --git a/src/demos/textures.c b/src/demos/textures.c
index 70229bfe..cc43bda3 100644
--- a/src/demos/textures.c
+++ b/src/demos/textures.c
@@ -6,7 +6,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
#include "readtex.h"
@@ -441,7 +441,7 @@ main(int argc, char *argv[])
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
Win = glutCreateWindow(argv[0]);
- glewInit();
+ gladLoadGL();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutSpecialFunc(SpecialKey);
diff --git a/src/demos/vao_demo.c b/src/demos/vao_demo.c
index 48401b3c..3344b332 100644
--- a/src/demos/vao_demo.c
+++ b/src/demos/vao_demo.c
@@ -26,7 +26,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
@@ -301,7 +301,7 @@ int main( int argc, char *argv[] )
glutKeyboardFunc( Key );
glutDisplayFunc( Display );
glutVisibilityFunc( Visible );
- glewInit();
+ gladLoadGL();
Init();
glutMainLoop();
return 0;
diff --git a/src/demos/winpos.c b/src/demos/winpos.c
index 162974ef..8aa88a83 100644
--- a/src/demos/winpos.c
+++ b/src/demos/winpos.c
@@ -11,7 +11,7 @@
#ifdef _WIN32
#include <windows.h>
#endif
-#include "GL/glew.h"
+#include "glad/glad.h"
#include "glut_wrap.h"
#include "readtex.h"
@@ -70,12 +70,12 @@ static void reshape( int width, int height )
static void init( void )
{
- if (GLEW_ARB_window_pos) {
+ if (GLAD_GL_ARB_window_pos) {
printf("Using GL_ARB_window_pos\n");
WindowPosFunc = glWindowPos2fARB;
}
else
- if (GLEW_MESA_window_pos) {
+ if (GLAD_GL_MESA_window_pos) {
printf("Using GL_MESA_window_pos\n");
WindowPosFunc = glWindowPos2fMESA;
}
@@ -104,7 +104,7 @@ int main( int argc, char *argv[] )
exit(0);
}
- glewInit();
+ gladLoadGL();
init();
diff --git a/src/fp/CMakeLists.txt b/src/fp/CMakeLists.txt
index a8aaad20..5008c5e4 100644
--- a/src/fp/CMakeLists.txt
+++ b/src/fp/CMakeLists.txt
@@ -2,7 +2,7 @@ include_directories (
${CMAKE_SOURCE_DIR}/src/util
${OPENGL_INCLUDE_PATH}
${GLUT_INCLUDE_DIR}
- ${GLEW_INCLUDE_DIR}
+ ${GLAD_INCLUDE_DIR}
)
link_directories (
@@ -14,7 +14,7 @@ link_libraries (
${OPENGL_gl_LIBRARY}
${OPENGL_glu_LIBRARY}
${GLUT_glut_LIBRARY}
- ${GLEW_glew_LIBRARY}
+ glad
)
set (subdir fp)
diff --git a/src/fp/Makefile.am b/src/fp/Makefile.am
index 10c745e5..06298426 100644
--- a/src/fp/Makefile.am
+++ b/src/fp/Makefile.am
@@ -28,6 +28,7 @@
AM_CFLAGS = \
$(DEMO_CFLAGS) \
$(GLUT_CFLAGS) \
+ -I$(top_srcdir)/src/glad/include \
-I$(top_srcdir)/src/util
AM_LDFLAGS = \
$(DEMO_LIBS) \
@@ -45,6 +46,8 @@ noinst_PROGRAMS = \
fp-tri
endif
+LDADD = ../glad/libglad.la
+
EXTRA_DIST = \
abs.txt \
add-sat.txt \
diff --git a/src/fp/fp-tri.c b/src/fp/fp-tri.c
index 4994d5d2..ebd61e92 100644
--- a/src/fp/fp-tri.c
+++ b/src/fp/fp-tri.c
@@ -8,7 +8,7 @@
#include <signal.h>
#endif
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
#include "readtex.c"
@@ -89,7 +89,7 @@ static void Init( void )
}
fprintf(stderr, "%.*s\n", sz, buf);
- if (!GLEW_ARB_fragment_program) {
+ if (!GLAD_GL_ARB_fragment_program) {
printf("Error: GL_ARB_fragment_program not supported!\n");
exit(1);
}
@@ -252,7 +252,7 @@ int main(int argc, char **argv)
glutInitDisplayMode(GLUT_RGB | GLUT_SINGLE | GLUT_DEPTH);
args(argc, argv);
glutCreateWindow(filename);
- glewInit();
+ gladLoadGL();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutDisplayFunc(Draw);
diff --git a/src/fp/point-position.c b/src/fp/point-position.c
index cfa5b9ac..acb3212c 100644
--- a/src/fp/point-position.c
+++ b/src/fp/point-position.c
@@ -2,7 +2,7 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
@@ -16,7 +16,7 @@ static void Init( void )
;
GLuint modulateProg;
- if (!GLEW_ARB_fragment_program) {
+ if (!GLAD_GL_ARB_fragment_program) {
printf("Error: GL_ARB_fragment_program not supported!\n");
exit(1);
}
@@ -108,7 +108,7 @@ int main(int argc, char **argv)
exit(1);
}
- glewInit();
+ gladLoadGL();
Init();
diff --git a/src/fp/tri-depth.c b/src/fp/tri-depth.c
index 2a2ce287..a2c7bc43 100644
--- a/src/fp/tri-depth.c
+++ b/src/fp/tri-depth.c
@@ -2,7 +2,7 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
@@ -18,7 +18,7 @@ static void Init( void )
;
GLuint modulateProg;
- if (!GLEW_ARB_fragment_program) {
+ if (!GLAD_GL_ARB_fragment_program) {
printf("Error: GL_ARB_fragment_program not supported!\n");
exit(1);
}
@@ -98,7 +98,7 @@ int main(int argc, char **argv)
exit(1);
}
- glewInit();
+ gladLoadGL();
Init();
diff --git a/src/fp/tri-depth2.c b/src/fp/tri-depth2.c
index 227c5b8d..a1ef6638 100644
--- a/src/fp/tri-depth2.c
+++ b/src/fp/tri-depth2.c
@@ -2,7 +2,7 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
@@ -20,7 +20,7 @@ static void Init( void )
;
GLuint modulateProg;
- if (!GLEW_ARB_fragment_program) {
+ if (!GLAD_GL_ARB_fragment_program) {
printf("Error: GL_ARB_fragment_program not supported!\n");
exit(1);
}
@@ -105,7 +105,7 @@ int main(int argc, char **argv)
exit(1);
}
- glewInit();
+ gladLoadGL();
Init();
diff --git a/src/fp/tri-depthwrite.c b/src/fp/tri-depthwrite.c
index 88a9d4b9..6969f303 100644
--- a/src/fp/tri-depthwrite.c
+++ b/src/fp/tri-depthwrite.c
@@ -2,7 +2,7 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
@@ -16,7 +16,7 @@ static void Init(void)
;
GLuint modulateProg;
- if (!GLEW_ARB_fragment_program) {
+ if (!GLAD_GL_ARB_fragment_program) {
printf("Error: GL_ARB_fragment_program not supported!\n");
exit(1);
}
@@ -97,7 +97,7 @@ int main(int argc, char **argv)
exit(1);
}
- glewInit();
+ gladLoadGL();
Init();
diff --git a/src/fp/tri-depthwrite2.c b/src/fp/tri-depthwrite2.c
index fcf7dc34..26f0997c 100644
--- a/src/fp/tri-depthwrite2.c
+++ b/src/fp/tri-depthwrite2.c
@@ -2,7 +2,7 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
@@ -16,7 +16,7 @@ static void Init(void)
;
GLuint modulateProg;
- if (!GLEW_ARB_fragment_program) {
+ if (!GLAD_GL_ARB_fragment_program) {
printf("Error: GL_ARB_fragment_program not supported!\n");
exit(1);
}
@@ -97,7 +97,7 @@ int main(int argc, char **argv)
exit(1);
}
- glewInit();
+ gladLoadGL();
Init();
diff --git a/src/fp/tri-param.c b/src/fp/tri-param.c
index 9e691f05..76b0705d 100644
--- a/src/fp/tri-param.c
+++ b/src/fp/tri-param.c
@@ -2,7 +2,7 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
@@ -15,7 +15,7 @@ static void Init( void )
;
GLuint modulateProg;
- if (!GLEW_ARB_fragment_program) {
+ if (!GLAD_GL_ARB_fragment_program) {
printf("Error: GL_ARB_fragment_program not supported!\n");
exit(1);
}
@@ -104,7 +104,7 @@ int main(int argc, char **argv)
exit(1);
}
- glewInit();
+ gladLoadGL();
Init();
diff --git a/src/fp/tri-tex.c b/src/fp/tri-tex.c
index fd04a53e..f81c4be1 100644
--- a/src/fp/tri-tex.c
+++ b/src/fp/tri-tex.c
@@ -3,7 +3,7 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
#include "readtex.c"
@@ -23,7 +23,7 @@ static void Init( void )
GLuint modulateProg;
GLuint Texture;
- if (!GLEW_ARB_fragment_program) {
+ if (!GLAD_GL_ARB_fragment_program) {
printf("Error: GL_ARB_fragment_program not supported!\n");
exit(1);
}
@@ -120,7 +120,7 @@ int main(int argc, char **argv)
exit(1);
}
- glewInit();
+ gladLoadGL();
Init();
diff --git a/src/fpglsl/CMakeLists.txt b/src/fpglsl/CMakeLists.txt
index deb335bb..e1cae470 100644
--- a/src/fpglsl/CMakeLists.txt
+++ b/src/fpglsl/CMakeLists.txt
@@ -2,7 +2,7 @@ include_directories (
${CMAKE_SOURCE_DIR}/src/util
${OPENGL_INCLUDE_PATH}
${GLUT_INCLUDE_DIR}
- ${GLEW_INCLUDE_DIR}
+ ${GLAD_INCLUDE_DIR}
)
link_directories (
@@ -14,7 +14,7 @@ link_libraries (
${OPENGL_gl_LIBRARY}
${OPENGL_glu_LIBRARY}
${GLUT_glut_LIBRARY}
- ${GLEW_glew_LIBRARY}
+ glad
)
set (subdir fpglsl)
diff --git a/src/fpglsl/Makefile.am b/src/fpglsl/Makefile.am
index 47c1039f..f34cb456 100644
--- a/src/fpglsl/Makefile.am
+++ b/src/fpglsl/Makefile.am
@@ -28,6 +28,7 @@
AM_CFLAGS = \
$(DEMO_CFLAGS) \
$(GLUT_CFLAGS) \
+ -I$(top_srcdir)/src/glad/include \
-I$(top_srcdir)/src/util
AM_LDFLAGS = \
$(DEMO_LIBS) \
@@ -38,6 +39,8 @@ noinst_PROGRAMS = \
fp-tri
endif
+LDADD = ../glad/libglad.la
+
EXTRA_DIST = \
dowhile2.glsl \
dowhile.glsl \
diff --git a/src/fpglsl/fp-tri.c b/src/fpglsl/fp-tri.c
index ebaadbe2..b8ac6fcf 100644
--- a/src/fpglsl/fp-tri.c
+++ b/src/fpglsl/fp-tri.c
@@ -8,7 +8,7 @@
#include <signal.h>
#endif
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
#include "readtex.c"
@@ -413,7 +413,7 @@ int main(int argc, char **argv)
glutInitDisplayMode(GLUT_RGB | GLUT_SINGLE | GLUT_DEPTH);
args(argc, argv);
glutCreateWindow(filename ? filename : "fp-tri");
- glewInit();
+ gladLoadGL();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutDisplayFunc(Display);
diff --git a/src/glad/CMakeLists.txt b/src/glad/CMakeLists.txt
index b99992a4..664fba51 100644
--- a/src/glad/CMakeLists.txt
+++ b/src/glad/CMakeLists.txt
@@ -8,3 +8,7 @@ endif ()
add_library (glad STATIC
${GLAD_SOURCES}
)
+
+target_link_libraries (glad
+ ${CMAKE_DL_LIBS}
+)
diff --git a/src/glad/Makefile.am b/src/glad/Makefile.am
index 71010efc..49f038b6 100644
--- a/src/glad/Makefile.am
+++ b/src/glad/Makefile.am
@@ -33,5 +33,7 @@ noinst_LTLIBRARIES = libglad.la
libglad_la_SOURCES = \
src/glad.c
+libglad_la_LIBADD = -ldl
+
EXTRA_DIST = \
README
diff --git a/src/glsl/CMakeLists.txt b/src/glsl/CMakeLists.txt
index 59b398af..f6159029 100644
--- a/src/glsl/CMakeLists.txt
+++ b/src/glsl/CMakeLists.txt
@@ -2,7 +2,7 @@ include_directories (
${CMAKE_SOURCE_DIR}/src/util
${OPENGL_INCLUDE_PATH}
${GLUT_INCLUDE_DIR}
- ${GLEW_INCLUDE_DIR}
+ ${GLAD_INCLUDE_DIR}
)
link_directories (
@@ -14,7 +14,7 @@ link_libraries (
${OPENGL_gl_LIBRARY}
${OPENGL_glu_LIBRARY}
${GLUT_glut_LIBRARY}
- ${GLEW_glew_LIBRARY}
+ glad
)
set (subdir glsl)
diff --git a/src/glsl/Makefile.am b/src/glsl/Makefile.am
index 4faa8dbf..43e74ce9 100644
--- a/src/glsl/Makefile.am
+++ b/src/glsl/Makefile.am
@@ -25,10 +25,12 @@
AM_CFLAGS = \
$(DEMO_CFLAGS) \
$(GLUT_CFLAGS) \
+ -I$(top_srcdir)/src/glad/include \
-I$(top_srcdir)/src/util
AM_CXXFLAGS = \
$(DEMO_CXXFLAGS) \
$(GLUT_CXXFLAGS) \
+ -I$(top_srcdir)/src/glad/include \
-I$(top_srcdir)/src/util
AM_LDFLAGS = \
$(DEMO_LIBS) \
@@ -82,41 +84,42 @@ gsraytrace_SOURCES = gsraytrace.cpp
samplers_array_SOURCES = samplers.c
samplers_array_CFLAGS = $(AM_CFLAGS) -DSAMPLERS_ARRAY
-array_LDADD = ../util/libutil.la
-bitmap_LDADD = ../util/libutil.la
-bezier_LDADD = ../util/libutil.la
-brick_LDADD = ../util/libutil.la
-bump_LDADD = ../util/libutil.la
-blinking_teapot_LDADD = ../util/libutil.la
-convolutions_LDADD = ../util/libutil.la
-deriv_LDADD = ../util/libutil.la
-geom_outlining_130_LDADD = ../util/libutil.la
-geom_outlining_150_LDADD = ../util/libutil.la
-geom_sprites_LDADD = ../util/libutil.la
-geom_stipple_lines_LDADD = ../util/libutil.la
-geom_wide_lines_LDADD = ../util/libutil.la
-gsraytrace_LDADD = ../util/libutil.la
-fsraytrace_LDADD = ../util/libutil.la
-fragcoord_LDADD = ../util/libutil.la
-identity_LDADD = ../util/libutil.la
-linktest_LDADD = ../util/libutil.la
-mandelbrot_LDADD = ../util/libutil.la
-multitex_LDADD = ../util/libutil.la
-noise_LDADD = ../util/libutil.la
-simplex_noise_LDADD = ../util/libutil.la
-pointcoord_LDADD = ../util/libutil.la
-points_LDADD = ../util/libutil.la
-samplers_LDADD = ../util/libutil.la
-samplers_array_LDADD = ../util/libutil.la
-shtest_LDADD = ../util/libutil.la
-skinning_LDADD = ../util/libutil.la
-texdemo1_LDADD = ../util/libutil.la
-toyball_LDADD = ../util/libutil.la
-trirast_LDADD = ../util/libutil.la
-twoside_LDADD = ../util/libutil.la
-vert_or_frag_only_LDADD = ../util/libutil.la
-vert_tex_LDADD = ../util/libutil.la
-vsraytrace_LDADD = ../util/libutil.la
+LDADD = ../glad/libglad.la
+array_LDADD = ../util/libutil.la ../glad/libglad.la
+bitmap_LDADD = ../util/libutil.la ../glad/libglad.la
+bezier_LDADD = ../util/libutil.la ../glad/libglad.la
+brick_LDADD = ../util/libutil.la ../glad/libglad.la
+bump_LDADD = ../util/libutil.la ../glad/libglad.la
+blinking_teapot_LDADD = ../util/libutil.la ../glad/libglad.la
+convolutions_LDADD = ../util/libutil.la ../glad/libglad.la
+deriv_LDADD = ../util/libutil.la ../glad/libglad.la
+geom_outlining_130_LDADD = ../util/libutil.la ../glad/libglad.la
+geom_outlining_150_LDADD = ../util/libutil.la ../glad/libglad.la
+geom_sprites_LDADD = ../util/libutil.la ../glad/libglad.la
+geom_stipple_lines_LDADD = ../util/libutil.la ../glad/libglad.la
+geom_wide_lines_LDADD = ../util/libutil.la ../glad/libglad.la
+gsraytrace_LDADD = ../util/libutil.la ../glad/libglad.la
+fsraytrace_LDADD = ../util/libutil.la ../glad/libglad.la
+fragcoord_LDADD = ../util/libutil.la ../glad/libglad.la
+identity_LDADD = ../util/libutil.la ../glad/libglad.la
+linktest_LDADD = ../util/libutil.la ../glad/libglad.la
+mandelbrot_LDADD = ../util/libutil.la ../glad/libglad.la
+multitex_LDADD = ../util/libutil.la ../glad/libglad.la
+noise_LDADD = ../util/libutil.la ../glad/libglad.la
+simplex_noise_LDADD = ../util/libutil.la ../glad/libglad.la
+pointcoord_LDADD = ../util/libutil.la ../glad/libglad.la
+points_LDADD = ../util/libutil.la ../glad/libglad.la
+samplers_LDADD = ../util/libutil.la ../glad/libglad.la
+samplers_array_LDADD = ../util/libutil.la ../glad/libglad.la
+shtest_LDADD = ../util/libutil.la ../glad/libglad.la
+skinning_LDADD = ../util/libutil.la ../glad/libglad.la
+texdemo1_LDADD = ../util/libutil.la ../glad/libglad.la
+toyball_LDADD = ../util/libutil.la ../glad/libglad.la
+trirast_LDADD = ../util/libutil.la ../glad/libglad.la
+twoside_LDADD = ../util/libutil.la ../glad/libglad.la
+vert_or_frag_only_LDADD = ../util/libutil.la ../glad/libglad.la
+vert_tex_LDADD = ../util/libutil.la ../glad/libglad.la
+vsraytrace_LDADD = ../util/libutil.la ../glad/libglad.la
EXTRA_DIST = \
CH06-brick.frag \
diff --git a/src/glsl/array.c b/src/glsl/array.c
index 1601f68d..19bb10d5 100644
--- a/src/glsl/array.c
+++ b/src/glsl/array.c
@@ -9,7 +9,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
#include "shaderutil.h"
@@ -244,7 +244,7 @@ main(int argc, char *argv[])
glutInitWindowSize(500, 500);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
win = glutCreateWindow(argv[0]);
- glewInit();
+ gladLoadGL();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutSpecialFunc(SpecialKey);
diff --git a/src/glsl/bezier.c b/src/glsl/bezier.c
index 0b56bc1c..84e03675 100644
--- a/src/glsl/bezier.c
+++ b/src/glsl/bezier.c
@@ -9,7 +9,7 @@
#include <stdlib.h>
#include <math.h>
#define GL_GLEXT_PROTOTYPES
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
#include "shaderutil.h"
@@ -275,7 +275,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( 250, 250 );
glutInitDisplayMode( GLUT_RGB | GLUT_SINGLE | GLUT_DEPTH );
glutCreateWindow(argv[0]);
- glewInit();
+ gladLoadGL();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );
diff --git a/src/glsl/bitmap.c b/src/glsl/bitmap.c
index 4b8751cd..2b1da04c 100644
--- a/src/glsl/bitmap.c
+++ b/src/glsl/bitmap.c
@@ -9,7 +9,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
#include "shaderutil.h"
@@ -305,7 +305,7 @@ main(int argc, char *argv[])
glutInitWindowSize(WinWidth, WinHeight);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
Win = glutCreateWindow(argv[0]);
- glewInit();
+ gladLoadGL();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutSpecialFunc(SpecialKey);
diff --git a/src/glsl/blinking-teapot.c b/src/glsl/blinking-teapot.c
index e3bf24d8..50aabe7e 100644
--- a/src/glsl/blinking-teapot.c
+++ b/src/glsl/blinking-teapot.c
@@ -9,7 +9,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
#include "shaderutil.h"
@@ -175,7 +175,7 @@ main (int argc, char **argv)
glutDisplayFunc (render);
glutMouseFunc (mouse);
glutMotionFunc (motion);
- glewInit ();
+ gladLoadGL();
init_opengl ();
glutMainLoop ();
return 0;
diff --git a/src/glsl/brick.c b/src/glsl/brick.c
index 3021856f..0b8d08e0 100644
--- a/src/glsl/brick.c
+++ b/src/glsl/brick.c
@@ -9,7 +9,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
#include "shaderutil.h"
@@ -157,7 +157,7 @@ Init(void)
printf("GL_RENDERER = %s\n",(const char *) glGetString(GL_RENDERER));
- if (GLEW_VERSION_2_0) {
+ if (GLAD_GL_VERSION_2_0) {
assert(glIsProgram(program));
assert(glIsShader(fragShader));
assert(glIsShader(vertShader));
@@ -189,7 +189,7 @@ main(int argc, char *argv[])
glutInitWindowSize(400, 400);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
win = glutCreateWindow(argv[0]);
- glewInit();
+ gladLoadGL();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutSpecialFunc(SpecialKey);
diff --git a/src/glsl/bump.c b/src/glsl/bump.c
index 59f62cdb..95ad19f3 100644
--- a/src/glsl/bump.c
+++ b/src/glsl/bump.c
@@ -9,7 +9,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
#include "shaderutil.h"
#include "readtex.h"
@@ -334,7 +334,7 @@ main(int argc, char *argv[])
glutInitWindowSize(400, 400);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
win = glutCreateWindow(argv[0]);
- glewInit();
+ gladLoadGL();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutSpecialFunc(SpecialKey);
diff --git a/src/glsl/convolutions.c b/src/glsl/convolutions.c
index a120cfe5..567b358f 100644
--- a/src/glsl/convolutions.c
+++ b/src/glsl/convolutions.c
@@ -5,7 +5,7 @@
* Author: Zack Rusin
*/
-#include <GL/glew.h>
+#include <glad/glad.h>
#define GL_GLEXT_PROTOTYPES
#include "readtex.h"
@@ -456,7 +456,7 @@ int main(int argc, char **argv)
exit(1);
}
- glewInit();
+ gladLoadGL();
init();
glutReshapeFunc(reshape);
diff --git a/src/glsl/deriv.c b/src/glsl/deriv.c
index 92ed4f22..9f230100 100644
--- a/src/glsl/deriv.c
+++ b/src/glsl/deriv.c
@@ -13,7 +13,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
#include "shaderutil.h"
@@ -235,7 +235,7 @@ main(int argc, char *argv[])
glutInitWindowSize(WinSize[0], WinSize[1]);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
win = glutCreateWindow(argv[0]);
- glewInit();
+ gladLoadGL();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutSpecialFunc(SpecialKey);
diff --git a/src/glsl/fragcoord.c b/src/glsl/fragcoord.c
index 81bd26e3..5ccb1a4c 100644
--- a/src/glsl/fragcoord.c
+++ b/src/glsl/fragcoord.c
@@ -12,7 +12,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
#include "shaderutil.h"
@@ -169,7 +169,7 @@ main(int argc, char *argv[])
glutInitWindowSize(WinWidth, WinHeight);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE);
win = glutCreateWindow(argv[0]);
- glewInit();
+ gladLoadGL();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutDisplayFunc(Redisplay);
diff --git a/src/glsl/fsraytrace.c b/src/glsl/fsraytrace.c
index 4cb141f4..89d612b6 100644
--- a/src/glsl/fsraytrace.c
+++ b/src/glsl/fsraytrace.c
@@ -24,7 +24,7 @@
#include <stdio.h>
#include <stdlib.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
#include "shaderutil.h"
#include <math.h>
@@ -398,7 +398,7 @@ main(int argc, char *argv[])
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
Win = glutCreateWindow(argv[0]);
- glewInit();
+ gladLoadGL();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutDisplayFunc(Draw);
diff --git a/src/glsl/geom-outlining-130.c b/src/glsl/geom-outlining-130.c
index 1f3ceab8..4a1eb242 100644
--- a/src/glsl/geom-outlining-130.c
+++ b/src/glsl/geom-outlining-130.c
@@ -14,7 +14,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
#include "shaderutil.h"
#include "trackball.h"
@@ -287,7 +287,7 @@ main(int argc, char *argv[])
glutInitWindowSize(WinWidth, WinHeight);
glutInitDisplayMode(GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE);
Win = glutCreateWindow(argv[0]);
- glewInit();
+ gladLoadGL();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutDisplayFunc(Redisplay);
diff --git a/src/glsl/geom-outlining-150.c b/src/glsl/geom-outlining-150.c
index 030401dc..0f8d795e 100644
--- a/src/glsl/geom-outlining-150.c
+++ b/src/glsl/geom-outlining-150.c
@@ -15,7 +15,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
#include "shaderutil.h"
#include "trackball.h"
@@ -309,7 +309,7 @@ Init(void)
if (!ShadersSupported())
exit(1);
- if (!GLEW_VERSION_3_2) {
+ if (!GLAD_GL_VERSION_3_2) {
fprintf(stderr, "Sorry, OpenGL 3.2 or later required.\n");
exit(1);
}
@@ -373,11 +373,7 @@ main(int argc, char *argv[])
glutInitDisplayMode(GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE);
#endif
Win = glutCreateWindow(argv[0]);
- /* glewInit requires glewExperimentel set to true for core profiles.
- * Depending on the glew version it also generates a GL_INVALID_ENUM.
- */
- glewExperimental = GL_TRUE;
- glewInit();
+ gladLoadGL();
glGetError();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
diff --git a/src/glsl/geom-sprites.c b/src/glsl/geom-sprites.c
index 168d7567..9c5cee96 100644
--- a/src/glsl/geom-sprites.c
+++ b/src/glsl/geom-sprites.c
@@ -11,7 +11,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
#include "shaderutil.h"
@@ -290,7 +290,7 @@ main(int argc, char *argv[])
glutInitWindowSize(WinWidth, WinHeight);
glutInitDisplayMode(GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE);
Win = glutCreateWindow(argv[0]);
- glewInit();
+ gladLoadGL();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutDisplayFunc(Redisplay);
diff --git a/src/glsl/geom-stipple-lines.c b/src/glsl/geom-stipple-lines.c
index fa24605f..6168587b 100644
--- a/src/glsl/geom-stipple-lines.c
+++ b/src/glsl/geom-stipple-lines.c
@@ -10,7 +10,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
#include "shaderutil.h"
@@ -333,7 +333,7 @@ main(int argc, char *argv[])
glutInitWindowSize(WinWidth, WinHeight);
glutInitDisplayMode(GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE);
Win = glutCreateWindow(argv[0]);
- glewInit();
+ gladLoadGL();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutDisplayFunc(Redisplay);
diff --git a/src/glsl/geom-wide-lines.c b/src/glsl/geom-wide-lines.c
index 038f1fe9..ebcbb32f 100644
--- a/src/glsl/geom-wide-lines.c
+++ b/src/glsl/geom-wide-lines.c
@@ -10,7 +10,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
#include "shaderutil.h"
@@ -326,7 +326,7 @@ main(int argc, char *argv[])
glutInitWindowSize(WinWidth, WinHeight);
glutInitDisplayMode(GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE);
Win = glutCreateWindow(argv[0]);
- glewInit();
+ gladLoadGL();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutDisplayFunc(Redisplay);
diff --git a/src/glsl/gsraytrace.cpp b/src/glsl/gsraytrace.cpp
index be4903a7..906c495e 100644
--- a/src/glsl/gsraytrace.cpp
+++ b/src/glsl/gsraytrace.cpp
@@ -28,7 +28,7 @@
#include <stdio.h>
#include <stdlib.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
#include "shaderutil.h"
#include <math.h>
@@ -844,7 +844,7 @@ Init(void)
exit(-1);
}
- if (!GLEW_VERSION_3_2)
+ if (!GLAD_GL_VERSION_3_2)
{
fprintf(stderr, "OpenGL 3.2 (needed for transform feedback and "
"geometry shaders) not supported!\n");
@@ -935,10 +935,7 @@ main(int argc, char *argv[])
#endif
Win = glutCreateWindow(argv[0]);
- // glewInit requires glewExperimentel set to true for core profiles.
- // Depending on the glew version it also generates GL_INVALID_ENUM.
- glewExperimental = GL_TRUE;
- glewInit();
+ gladLoadGL();
glGetError();
glutReshapeFunc(Reshape);
diff --git a/src/glsl/identity.c b/src/glsl/identity.c
index 51c0081c..f48d96bd 100644
--- a/src/glsl/identity.c
+++ b/src/glsl/identity.c
@@ -9,7 +9,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
#include "shaderutil.h"
@@ -111,7 +111,7 @@ main(int argc, char *argv[])
glutInitWindowSize(200, 200);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE);
win = glutCreateWindow(argv[0]);
- glewInit();
+ gladLoadGL();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutDisplayFunc(Redisplay);
diff --git a/src/glsl/linktest.c b/src/glsl/linktest.c
index b86a0c39..5d52accc 100644
--- a/src/glsl/linktest.c
+++ b/src/glsl/linktest.c
@@ -9,7 +9,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
#include "shaderutil.h"
@@ -241,7 +241,7 @@ main(int argc, char *argv[])
glutInitWindowSize(300, 300);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
Win = glutCreateWindow(argv[0]);
- glewInit();
+ gladLoadGL();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutDisplayFunc(Redisplay);
diff --git a/src/glsl/mandelbrot.c b/src/glsl/mandelbrot.c
index 31ede1df..18b817c4 100644
--- a/src/glsl/mandelbrot.c
+++ b/src/glsl/mandelbrot.c
@@ -9,7 +9,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
#include "shaderutil.h"
@@ -202,7 +202,7 @@ main(int argc, char *argv[])
glutInitWindowSize(400, 400);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
win = glutCreateWindow(argv[0]);
- glewInit();
+ gladLoadGL();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutSpecialFunc(SpecialKey);
diff --git a/src/glsl/multinoise.c b/src/glsl/multinoise.c
index b5ed14cf..57426cde 100644
--- a/src/glsl/multinoise.c
+++ b/src/glsl/multinoise.c
@@ -8,7 +8,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
static const char *VertShaderText =
@@ -225,7 +225,7 @@ Init(void)
{
GLint i;
- if (!GLEW_VERSION_2_0) {
+ if (!GLAD_GL_VERSION_2_0) {
printf("Warning: this program expects OpenGL 2.0\n");
/*exit(1);*/
}
@@ -264,7 +264,7 @@ main(int argc, char *argv[])
glutInitWindowSize(400, 400);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
win = glutCreateWindow(argv[0]);
- glewInit();
+ gladLoadGL();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutSpecialFunc(SpecialKey);
diff --git a/src/glsl/multitex.c b/src/glsl/multitex.c
index 262ea50f..2f9a2fa1 100644
--- a/src/glsl/multitex.c
+++ b/src/glsl/multitex.c
@@ -28,7 +28,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
#include "readtex.h"
#include "shaderutil.h"
@@ -117,7 +117,7 @@ SetupVertexBuffer(void)
static void
DrawPolygonArray(void)
{
- void *vertPtr, *tex0Ptr, *tex1Ptr;
+ const void *vertPtr, *tex0Ptr, *tex1Ptr;
if (UseVBO) {
glBindBufferARB(GL_ARRAY_BUFFER_ARB, VBO);
@@ -399,7 +399,7 @@ main(int argc, char *argv[])
glutInitWindowSize(500, 400);
glutInitDisplayMode(GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE);
glutCreateWindow(Demo);
- glewInit();
+ gladLoadGL();
glutReshapeFunc(Reshape);
glutKeyboardFunc(key);
glutSpecialFunc(specialkey);
diff --git a/src/glsl/noise.c b/src/glsl/noise.c
index 6693396e..23b50edd 100644
--- a/src/glsl/noise.c
+++ b/src/glsl/noise.c
@@ -8,7 +8,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
#include "shaderutil.h"
@@ -204,7 +204,7 @@ main(int argc, char *argv[])
glutInitWindowSize(400, 400);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
win = glutCreateWindow(argv[0]);
- glewInit();
+ gladLoadGL();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutSpecialFunc(SpecialKey);
diff --git a/src/glsl/noise2.c b/src/glsl/noise2.c
index 05b0cb56..8daa620c 100644
--- a/src/glsl/noise2.c
+++ b/src/glsl/noise2.c
@@ -10,7 +10,7 @@
#include <stdio.h>
#include <stdlib.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
@@ -152,7 +152,7 @@ main(int argc, char *argv[])
glutKeyboardFunc(Key);
glutDisplayFunc(Redisplay);
glutIdleFunc(Idle);
- glewInit();
+ gladLoadGL();
Init();
glutMainLoop();
return 0;
diff --git a/src/glsl/pointcoord.c b/src/glsl/pointcoord.c
index 1dff2b9a..85298fd9 100644
--- a/src/glsl/pointcoord.c
+++ b/src/glsl/pointcoord.c
@@ -10,7 +10,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
#include "shaderutil.h"
@@ -203,7 +203,7 @@ main(int argc, char *argv[])
glutInitWindowSize(WinWidth, WinHeight);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE);
win = glutCreateWindow(argv[0]);
- glewInit();
+ gladLoadGL();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutDisplayFunc(Redisplay);
diff --git a/src/glsl/points.c b/src/glsl/points.c
index 3b11f338..92319c33 100644
--- a/src/glsl/points.c
+++ b/src/glsl/points.c
@@ -10,7 +10,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
#include "shaderutil.h"
@@ -244,7 +244,7 @@ main(int argc, char *argv[])
glutInitWindowSize(WinWidth, WinHeight);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
Win = glutCreateWindow(argv[0]);
- glewInit();
+ gladLoadGL();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutSpecialFunc(SpecialKey);
diff --git a/src/glsl/samplers.c b/src/glsl/samplers.c
index 99047d57..1ce68e2f 100644
--- a/src/glsl/samplers.c
+++ b/src/glsl/samplers.c
@@ -39,7 +39,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
#include "shaderutil.h"
@@ -362,7 +362,7 @@ main(int argc, char *argv[])
glutInitWindowSize(500, 400);
glutInitDisplayMode(GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE);
glutCreateWindow(Demo);
- glewInit();
+ gladLoadGL();
glutReshapeFunc(Reshape);
glutKeyboardFunc(key);
glutSpecialFunc(specialkey);
diff --git a/src/glsl/shadow_sampler.c b/src/glsl/shadow_sampler.c
index b830030d..5f0f1929 100644
--- a/src/glsl/shadow_sampler.c
+++ b/src/glsl/shadow_sampler.c
@@ -10,7 +10,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
@@ -268,7 +268,7 @@ Init(void)
}
#endif
- if (!GLEW_VERSION_2_0) {
+ if (!GLAD_GL_VERSION_2_0) {
printf("This program requires OpenGL 2.x\n");
exit(1);
}
@@ -334,7 +334,7 @@ main(int argc, char *argv[])
glutInitWindowSize(400, 300);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE);
win = glutCreateWindow(argv[0]);
- glewInit();
+ gladLoadGL();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutDisplayFunc(Redisplay);
diff --git a/src/glsl/shtest.c b/src/glsl/shtest.c
index b3c02fa9..cea88012 100644
--- a/src/glsl/shtest.c
+++ b/src/glsl/shtest.c
@@ -33,7 +33,7 @@
#include <stdlib.h>
#include <string.h>
#include <math.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
#include "shaderutil.h"
#include "readtex.h"
@@ -695,7 +695,7 @@ main(int argc, char *argv[])
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
win = glutCreateWindow(argv[0]);
- glewInit();
+ gladLoadGL();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutSpecialFunc(SpecialKey);
diff --git a/src/glsl/simplex-noise.c b/src/glsl/simplex-noise.c
index 13fdd5df..a687508e 100644
--- a/src/glsl/simplex-noise.c
+++ b/src/glsl/simplex-noise.c
@@ -11,7 +11,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
#include "shaderutil.h"
@@ -222,7 +222,7 @@ main(int argc, char *argv[])
glutInitWindowSize(400, 400);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
win = glutCreateWindow(argv[0]);
- glewInit();
+ gladLoadGL();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutSpecialFunc(SpecialKey);
diff --git a/src/glsl/skinning.c b/src/glsl/skinning.c
index bf38d770..b451d13c 100644
--- a/src/glsl/skinning.c
+++ b/src/glsl/skinning.c
@@ -12,7 +12,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
#include "shaderutil.h"
@@ -265,7 +265,7 @@ main(int argc, char *argv[])
glutInitWindowSize(500, 500);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
win = glutCreateWindow(argv[0]);
- glewInit();
+ gladLoadGL();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutSpecialFunc(SpecialKey);
diff --git a/src/glsl/texaaline.c b/src/glsl/texaaline.c
index 315800ad..c990b9e5 100644
--- a/src/glsl/texaaline.c
+++ b/src/glsl/texaaline.c
@@ -11,7 +11,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
#ifndef M_PI
@@ -325,7 +325,7 @@ Init(void)
(void) ramp4;
(void) ramp2;
- if (!GLEW_VERSION_2_0) {
+ if (!GLAD_GL_VERSION_2_0) {
printf("This program requires OpenGL 2.x\n");
exit(1);
}
@@ -358,7 +358,7 @@ main(int argc, char *argv[])
glutInitWindowSize(WinWidth, WinHeight);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE);
win = glutCreateWindow(argv[0]);
- glewInit();
+ gladLoadGL();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutDisplayFunc(Redisplay);
diff --git a/src/glsl/texdemo1.c b/src/glsl/texdemo1.c
index 6cde2397..861d6962 100644
--- a/src/glsl/texdemo1.c
+++ b/src/glsl/texdemo1.c
@@ -28,7 +28,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
#include "readtex.h"
#include "shaderutil.h"
@@ -422,7 +422,7 @@ main(int argc, char *argv[])
glutInitWindowSize(500, 400);
glutInitDisplayMode(GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE);
win = glutCreateWindow(Demo);
- glewInit();
+ gladLoadGL();
glutReshapeFunc(Reshape);
glutKeyboardFunc(key);
glutSpecialFunc(specialkey);
diff --git a/src/glsl/toyball.c b/src/glsl/toyball.c
index 5f279513..17aa7652 100644
--- a/src/glsl/toyball.c
+++ b/src/glsl/toyball.c
@@ -9,7 +9,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
#include "shaderutil.h"
@@ -208,7 +208,7 @@ main(int argc, char *argv[])
glutInitWindowSize(400, 400);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
win = glutCreateWindow(argv[0]);
- glewInit();
+ gladLoadGL();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutSpecialFunc(SpecialKey);
diff --git a/src/glsl/trirast.c b/src/glsl/trirast.c
index 9df0c9f9..aa041545 100644
--- a/src/glsl/trirast.c
+++ b/src/glsl/trirast.c
@@ -15,7 +15,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
#include "shaderutil.h"
@@ -241,7 +241,7 @@ main(int argc, char *argv[])
glutInitWindowSize(WinWidth, WinHeight);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
win = glutCreateWindow(argv[0]);
- glewInit();
+ gladLoadGL();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutDisplayFunc(Redisplay);
diff --git a/src/glsl/twoside.c b/src/glsl/twoside.c
index a355e3b4..e6b70001 100644
--- a/src/glsl/twoside.c
+++ b/src/glsl/twoside.c
@@ -12,7 +12,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
#include "shaderutil.h"
@@ -291,7 +291,7 @@ main(int argc, char *argv[])
glutInitWindowSize(WinWidth, WinHeight);
glutInitDisplayMode(GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE);
win = glutCreateWindow(argv[0]);
- glewInit();
+ gladLoadGL();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutDisplayFunc(Redisplay);
diff --git a/src/glsl/vert-or-frag-only.c b/src/glsl/vert-or-frag-only.c
index aded4a24..6b9468c1 100644
--- a/src/glsl/vert-or-frag-only.c
+++ b/src/glsl/vert-or-frag-only.c
@@ -11,7 +11,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
#include "shaderutil.h"
@@ -176,7 +176,7 @@ main(int argc, char *argv[])
glutInitWindowSize(400, 200);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
Win = glutCreateWindow(argv[0]);
- glewInit();
+ gladLoadGL();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutDisplayFunc(Redisplay);
diff --git a/src/glsl/vert-tex.c b/src/glsl/vert-tex.c
index 85cea49f..29b8ec49 100644
--- a/src/glsl/vert-tex.c
+++ b/src/glsl/vert-tex.c
@@ -9,7 +9,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
#include "shaderutil.h"
@@ -253,7 +253,7 @@ main(int argc, char *argv[])
glutInitWindowSize(500, 500);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
win = glutCreateWindow(argv[0]);
- glewInit();
+ gladLoadGL();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutSpecialFunc(SpecialKey);
diff --git a/src/glsl/vsraytrace.c b/src/glsl/vsraytrace.c
index ec1ff2ee..263c4361 100644
--- a/src/glsl/vsraytrace.c
+++ b/src/glsl/vsraytrace.c
@@ -24,7 +24,7 @@
#include <stdio.h>
#include <stdlib.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
#include "shaderutil.h"
#include <math.h>
@@ -387,7 +387,7 @@ main(int argc, char *argv[])
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
Win = glutCreateWindow(argv[0]);
- glewInit();
+ gladLoadGL();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutDisplayFunc(Draw);
diff --git a/src/gs/CMakeLists.txt b/src/gs/CMakeLists.txt
index eef685d0..81148764 100644
--- a/src/gs/CMakeLists.txt
+++ b/src/gs/CMakeLists.txt
@@ -2,7 +2,7 @@ include_directories (
${CMAKE_SOURCE_DIR}/src/util
${OPENGL_INCLUDE_PATH}
${GLUT_INCLUDE_DIR}
- ${GLEW_INCLUDE_DIR}
+ ${GLAD_INCLUDE_DIR}
)
link_directories (
@@ -14,7 +14,7 @@ link_libraries (
${OPENGL_gl_LIBRARY}
${OPENGL_glu_LIBRARY}
${GLUT_glut_LIBRARY}
- ${GLEW_glew_LIBRARY}
+ glad
)
set (subdir gs)
diff --git a/src/gs/Makefile.am b/src/gs/Makefile.am
index a5a2e280..3366633e 100644
--- a/src/gs/Makefile.am
+++ b/src/gs/Makefile.am
@@ -1,6 +1,7 @@
AM_CFLAGS = \
$(DEMO_CFLAGS) \
$(GLUT_CFLAGS) \
+ -I$(top_srcdir)/src/glad/include \
-I$(top_srcdir)/src/util
AM_LDFLAGS = \
$(DEMO_LIBS) \
@@ -11,5 +12,7 @@ bin_PROGRAMS = \
gs-tri
endif
+LDADD = ../glad/libglad.la
+
EXTRA_DIST = \
basic.glsl
diff --git a/src/gs/gs-tri.c b/src/gs/gs-tri.c
index a94b26b6..2eb2ac59 100644
--- a/src/gs/gs-tri.c
+++ b/src/gs/gs-tri.c
@@ -8,7 +8,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
static const char *filename = NULL;
@@ -291,7 +291,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( 250, 250 );
glutInitDisplayMode( GLUT_RGB | GLUT_SINGLE | GLUT_DEPTH );
glutCreateWindow(argv[0]);
- glewInit();
+ gladLoadGL();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );
diff --git a/src/objviewer/CMakeLists.txt b/src/objviewer/CMakeLists.txt
index fc617200..4f5a2b13 100644
--- a/src/objviewer/CMakeLists.txt
+++ b/src/objviewer/CMakeLists.txt
@@ -2,7 +2,7 @@ include_directories (
${CMAKE_SOURCE_DIR}/src/util
${OPENGL_INCLUDE_PATH}
${GLUT_INCLUDE_DIR}
- ${GLEW_INCLUDE_DIR}
+ ${GLAD_INCLUDE_DIR}
)
link_directories (
@@ -14,7 +14,7 @@ link_libraries (
${OPENGL_gl_LIBRARY}
${OPENGL_glu_LIBRARY}
${GLUT_glut_LIBRARY}
- ${GLEW_glew_LIBRARY}
+ glad
)
diff --git a/src/objviewer/Makefile.am b/src/objviewer/Makefile.am
index 5fb20044..28c6a7d3 100644
--- a/src/objviewer/Makefile.am
+++ b/src/objviewer/Makefile.am
@@ -25,6 +25,7 @@
AM_CFLAGS = \
$(DEMO_CFLAGS) \
$(GLUT_CFLAGS) \
+ -I$(top_srcdir)/src/glad/include \
-I$(top_srcdir)/src/util
AM_LDFLAGS = \
$(DEMO_LIBS) \
@@ -42,7 +43,7 @@ objview_SOURCES = \
skybox.c \
skybox.h
-objview_LDADD = ../util/libutil.la
+objview_LDADD = ../util/libutil.la ../glad/libglad.la
EXTRA_DIST = \
bobcat.obj \
diff --git a/src/objviewer/glmdraw.c b/src/objviewer/glmdraw.c
index 26f1e971..1888684a 100644
--- a/src/objviewer/glmdraw.c
+++ b/src/objviewer/glmdraw.c
@@ -6,7 +6,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glm.h"
#include "readtex.h"
#include "shaderutil.h"
diff --git a/src/objviewer/objview.c b/src/objviewer/objview.c
index 6def7267..ce6c944a 100644
--- a/src/objviewer/objview.c
+++ b/src/objviewer/objview.c
@@ -10,7 +10,7 @@
#include <stdio.h>
#include <assert.h>
#include <stdarg.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
#include "glm.h"
#include "skybox.h"
@@ -437,21 +437,21 @@ Motion(int x, int y)
static void
DoFeatureChecks(void)
{
- if (!GLEW_VERSION_2_0) {
+ if (!GLAD_GL_VERSION_2_0) {
/* check for individual extensions */
- if (!GLEW_ARB_texture_cube_map) {
+ if (!GLAD_GL_ARB_texture_cube_map) {
printf("Sorry, GL_ARB_texture_cube_map is required.\n");
exit(1);
}
- if (!GLEW_ARB_vertex_shader) {
+ if (!GLAD_GL_ARB_vertex_shader) {
printf("Sorry, GL_ARB_vertex_shader is required.\n");
exit(1);
}
- if (!GLEW_ARB_fragment_shader) {
+ if (!GLAD_GL_ARB_fragment_shader) {
printf("Sorry, GL_ARB_fragment_shader is required.\n");
exit(1);
}
- if (!GLEW_ARB_vertex_buffer_object) {
+ if (!GLAD_GL_ARB_vertex_buffer_object) {
printf("Sorry, GL_ARB_vertex_buffer_object is required.\n");
exit(1);
}
@@ -481,7 +481,7 @@ main(int argc, char** argv)
glutInitDisplayMode(GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE);
glutCreateWindow("objview");
- glewInit();
+ gladLoadGL();
DoFeatureChecks();
diff --git a/src/objviewer/skybox.c b/src/objviewer/skybox.c
index 8079c6a2..97b1309a 100644
--- a/src/objviewer/skybox.c
+++ b/src/objviewer/skybox.c
@@ -5,7 +5,7 @@
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "readtex.h"
#include "skybox.h"
diff --git a/src/osdemos/Makefile.am b/src/osdemos/Makefile.am
index 81df02e2..666af299 100644
--- a/src/osdemos/Makefile.am
+++ b/src/osdemos/Makefile.am
@@ -24,6 +24,7 @@
AM_CFLAGS = \
$(OSMESA_CFLAGS) \
+ -I$(top_srcdir)/src/glad/include \
-I$(top_srcdir)/src/util
if HAVE_OSMESA
@@ -35,6 +36,6 @@ endif
osdemo16_SOURCES = osdemo16.c
osdemo32_SOURCES = osdemo32.c
-osdemo_LDADD = $(OSMESA_LIBS) ../util/libutil.la
-osdemo16_LDADD = $(OSMESA_LIBS) $(OSMESA16_LIBS) ../util/libutil.la
-osdemo32_LDADD = $(OSMESA32_LIBS) ../util/libutil.la
+osdemo_LDADD = $(OSMESA_LIBS) ../util/libutil.la ../glad/libglad.la
+osdemo16_LDADD = $(OSMESA_LIBS) $(OSMESA16_LIBS) ../util/libutil.la ../glad/libglad.la
+osdemo32_LDADD = $(OSMESA32_LIBS) ../util/libutil.la ../glad/libglad.la
diff --git a/src/perf/CMakeLists.txt b/src/perf/CMakeLists.txt
index 33d43be8..f094e717 100644
--- a/src/perf/CMakeLists.txt
+++ b/src/perf/CMakeLists.txt
@@ -2,7 +2,7 @@ include_directories (
${CMAKE_SOURCE_DIR}/src/util
${OPENGL_INCLUDE_PATH}
${GLUT_INCLUDE_DIR}
- ${GLEW_INCLUDE_DIR}
+ ${GLAD_INCLUDE_DIR}
)
link_directories (
@@ -14,7 +14,7 @@ link_libraries (
${OPENGL_gl_LIBRARY}
${OPENGL_glu_LIBRARY}
${GLUT_glut_LIBRARY}
- ${GLEW_glew_LIBRARY}
+ glad
)
set (subdir perf)
diff --git a/src/perf/Makefile.am b/src/perf/Makefile.am
index f0031fea..83fac33d 100644
--- a/src/perf/Makefile.am
+++ b/src/perf/Makefile.am
@@ -34,13 +34,14 @@ libperf_la_SOURCES = \
AM_CFLAGS = \
$(DEMO_CFLAGS) \
$(GLUT_CFLAGS) \
+ -I$(top_srcdir)/src/glad/include \
-I$(top_srcdir)/src/util
AM_LDFLAGS = \
$(DEMO_LIBS) \
$(GLUT_LIBS)
-LDADD = libperf.la
+LDADD = libperf.la ../glad/libglad.la
bin_PROGRAMS = \
copytex \
@@ -57,5 +58,5 @@ bin_PROGRAMS = \
glslstateschange
endif
-glslstateschange_LDADD = libperf.la ../util/libutil.la
-glsl_compile_time_LDADD = ../util/libutil.la
+glslstateschange_LDADD = libperf.la ../util/libutil.la ../glad/libglad.la
+glsl_compile_time_LDADD = ../util/libutil.la ../glad/libglad.la
diff --git a/src/perf/glmain.c b/src/perf/glmain.c
index 81c11734..91fced07 100644
--- a/src/perf/glmain.c
+++ b/src/perf/glmain.c
@@ -119,7 +119,7 @@ PerfShaderProgram(const char *vertShader, const char *fragShader)
GLuint prog;
GLint stat;
- if (!GLEW_VERSION_2_0) {
+ if (!GLAD_GL_VERSION_2_0) {
fprintf(stderr, "Error: GL version 2.x or better required\n");
exit(1);
}
@@ -252,7 +252,7 @@ main(int argc, char *argv[])
glutInitWindowSize(WinWidth, WinHeight);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH | GLUT_STENCIL);
Win = glutCreateWindow(argv[0]);
- glewInit();
+ gladLoadGL();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutSpecialFunc(SpecialKey);
diff --git a/src/perf/glmain.h b/src/perf/glmain.h
index d9bcd5f4..0d78c97b 100644
--- a/src/perf/glmain.h
+++ b/src/perf/glmain.h
@@ -25,7 +25,7 @@
#define GL_GLEXT_PROTOTYPES
-#include <GL/glew.h>
+#include <glad/glad.h>
#include <stdlib.h>
#include <math.h>
diff --git a/src/perf/glsl-compile-time.c b/src/perf/glsl-compile-time.c
index a8e774f3..2ba64a7c 100644
--- a/src/perf/glsl-compile-time.c
+++ b/src/perf/glsl-compile-time.c
@@ -16,7 +16,7 @@
#include <stdlib.h>
#include <string.h>
#include <math.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
#include "shaderutil.h"
@@ -288,7 +288,7 @@ main(int argc, char *argv[])
glutInitWindowSize(WinWidth, WinHeight);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
Win = glutCreateWindow(argv[0]);
- glewInit();
+ gladLoadGL();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutDisplayFunc(Draw);
diff --git a/src/perf/glslstateschange.c b/src/perf/glslstateschange.c
index 7422b782..962142b5 100644
--- a/src/perf/glslstateschange.c
+++ b/src/perf/glslstateschange.c
@@ -26,7 +26,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
#include "readtex.h"
#include "shaderutil.h"
diff --git a/src/redbook/CMakeLists.txt b/src/redbook/CMakeLists.txt
index 37201af4..030ec9c9 100644
--- a/src/redbook/CMakeLists.txt
+++ b/src/redbook/CMakeLists.txt
@@ -2,7 +2,7 @@ include_directories (
${CMAKE_SOURCE_DIR}/src/util
${OPENGL_INCLUDE_PATH}
${GLUT_INCLUDE_DIR}
- ${GLEW_INCLUDE_DIR}
+ ${GLAD_INCLUDE_DIR}
)
link_directories (
@@ -14,7 +14,7 @@ link_libraries (
${OPENGL_gl_LIBRARY}
${OPENGL_glu_LIBRARY}
${GLUT_glut_LIBRARY}
- ${GLEW_glew_LIBRARY}
+ glad
)
set (subdir redbook)
diff --git a/src/redbook/Makefile.am b/src/redbook/Makefile.am
index 264541d8..b25e389d 100644
--- a/src/redbook/Makefile.am
+++ b/src/redbook/Makefile.am
@@ -25,6 +25,7 @@
AM_CFLAGS = \
$(DEMO_CFLAGS) \
$(GLUT_CFLAGS) \
+ -I$(top_srcdir)/src/glad/include \
-I$(top_srcdir)/src/util
AM_LDFLAGS = \
$(DEMO_LIBS) \
@@ -110,6 +111,8 @@ noinst_PROGRAMS = \
wrap
endif
+LDADD = ../glad/libglad.la
+
EXTRA_DIST = \
README \
jitter.h
diff --git a/src/redbook/combiner.c b/src/redbook/combiner.c
index ac13d4bf..fb413c5d 100644
--- a/src/redbook/combiner.c
+++ b/src/redbook/combiner.c
@@ -58,7 +58,7 @@
* scaling factor and reversing the order of subtraction
* for a combination function.
*/
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
#include <stdlib.h>
#include <stdio.h>
@@ -369,7 +369,7 @@ int main(int argc, char** argv)
glutInitWindowSize(400, 400);
glutInitWindowPosition(100, 100);
glutCreateWindow(argv[0]);
- glewInit();
+ gladLoadGL();
init();
glutDisplayFunc(display);
glutReshapeFunc(reshape);
diff --git a/src/redbook/convolution.c b/src/redbook/convolution.c
index fa5eb4a0..097a2951 100644
--- a/src/redbook/convolution.c
+++ b/src/redbook/convolution.c
@@ -45,7 +45,7 @@
* Use various 2D convolutions filters to find edges in an image.
*
*/
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
#include <assert.h>
#include <stdio.h>
@@ -208,7 +208,7 @@ int main(int argc, char** argv)
glutInitWindowSize(width, height);
glutInitWindowPosition(100, 100);
glutCreateWindow(argv[0]);
- glewInit();
+ gladLoadGL();
init();
glutReshapeFunc(reshape);
glutKeyboardFunc(keyboard);
diff --git a/src/redbook/cubemap.c b/src/redbook/cubemap.c
index 404ce16f..7bf04cbf 100644
--- a/src/redbook/cubemap.c
+++ b/src/redbook/cubemap.c
@@ -50,7 +50,7 @@
* forward and backward.
*/
-#include <GL/glew.h>
+#include "gl_wrap.h"
#include "glut_wrap.h"
#include <stdlib.h>
#include <stdio.h>
diff --git a/src/redbook/fogcoord.c b/src/redbook/fogcoord.c
index 3ce88b37..12b477a5 100644
--- a/src/redbook/fogcoord.c
+++ b/src/redbook/fogcoord.c
@@ -58,7 +58,7 @@
* three vertices of the triangle.
*/
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
#include <math.h>
#include <stdlib.h>
@@ -184,7 +184,7 @@ int main(int argc, char** argv)
glutInitDisplayMode (GLUT_DOUBLE | GLUT_RGB);
glutInitWindowSize(500, 500);
glutCreateWindow(argv[0]);
- glewInit();
+ gladLoadGL();
init();
glutReshapeFunc (reshape);
glutKeyboardFunc (keyboard);
diff --git a/src/redbook/histogram.c b/src/redbook/histogram.c
index 91ed3d90..c5729e2b 100644
--- a/src/redbook/histogram.c
+++ b/src/redbook/histogram.c
@@ -46,7 +46,7 @@
* use of the glHistogram() function.
*/
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
#include <assert.h>
#include <stdlib.h>
@@ -203,7 +203,7 @@ int main(int argc, char** argv)
glutInitWindowSize(width, height);
glutInitWindowPosition(100, 100);
glutCreateWindow(argv[0]);
- glewInit();
+ gladLoadGL();
init();
glutReshapeFunc(reshape);
glutKeyboardFunc(keyboard);
diff --git a/src/redbook/minmax.c b/src/redbook/minmax.c
index de439f4b..2eec31f8 100644
--- a/src/redbook/minmax.c
+++ b/src/redbook/minmax.c
@@ -45,7 +45,7 @@
* Determine the minimum and maximum values of a group of pixels.
* This demonstrates use of the glMinmax() call.
*/
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
#include <assert.h>
#include <stdlib.h>
@@ -172,7 +172,7 @@ int main(int argc, char** argv)
glutInitWindowSize(width, height);
glutInitWindowPosition(100, 100);
glutCreateWindow(argv[0]);
- glewInit();
+ gladLoadGL();
init();
glutReshapeFunc(reshape);
glutKeyboardFunc(keyboard);
diff --git a/src/redbook/multisamp.c b/src/redbook/multisamp.c
index 3d17e16a..ae6a50f0 100644
--- a/src/redbook/multisamp.c
+++ b/src/redbook/multisamp.c
@@ -53,7 +53,7 @@
* background. Antialiasing is sometimes easier to see
* when objects are rendered over a contrasting background.
*/
-#include <GL/glew.h>
+#include "gl_wrap.h"
#include "glut_wrap.h"
#include <stdlib.h>
#include <stdio.h>
diff --git a/src/redbook/multitex.c b/src/redbook/multitex.c
index b01109c1..9623fbaf 100644
--- a/src/redbook/multitex.c
+++ b/src/redbook/multitex.c
@@ -42,7 +42,7 @@
/* multitex.c
*/
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
#include <stdlib.h>
#include <stdio.h>
@@ -167,7 +167,7 @@ int main(int argc, char** argv)
glutInitWindowSize(250, 250);
glutInitWindowPosition(100, 100);
glutCreateWindow(argv[0]);
- glewInit();
+ gladLoadGL();
init();
glutReshapeFunc(reshape);
glutDisplayFunc(display);
diff --git a/src/redbook/mvarray.c b/src/redbook/mvarray.c
index 5d0b9eb7..0e1a3051 100644
--- a/src/redbook/mvarray.c
+++ b/src/redbook/mvarray.c
@@ -46,7 +46,7 @@
* specifically the OpenGL routine glMultiDrawElements().
*/
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
#include <stdlib.h>
#include <stdio.h>
@@ -117,7 +117,7 @@ int main(int argc, char** argv)
glutInitWindowSize (350, 350);
glutInitWindowPosition (100, 100);
glutCreateWindow (argv[0]);
- glewInit();
+ gladLoadGL();
init ();
glutDisplayFunc(display);
glutReshapeFunc(reshape);
diff --git a/src/redbook/pointp.c b/src/redbook/pointp.c
index 568ba839..90dbb373 100644
--- a/src/redbook/pointp.c
+++ b/src/redbook/pointp.c
@@ -60,7 +60,7 @@
* will not get less than 2.0, nor greater than GL_POINT_SIZE_MAX.
*/
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
#include <stdlib.h>
#include <stdio.h>
@@ -169,7 +169,7 @@ int main(int argc, char** argv)
glutInitWindowSize (500, 500);
glutInitWindowPosition (100, 100);
glutCreateWindow (argv[0]);
- glewInit();
+ gladLoadGL();
init ();
glutDisplayFunc (display);
glutReshapeFunc (reshape);
diff --git a/src/redbook/shadowmap.c b/src/redbook/shadowmap.c
index b35c65d7..d94cb5e0 100644
--- a/src/redbook/shadowmap.c
+++ b/src/redbook/shadowmap.c
@@ -43,7 +43,7 @@
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
/*#include "helpers.h"*/
@@ -337,7 +337,7 @@ main( int argc, char** argv )
glutInitWindowSize( 512, 512 );
glutInitWindowPosition( 100, 100 );
glutCreateWindow( argv[0] );
- glewInit();
+ gladLoadGL();
init();
diff --git a/src/redbook/texture3d.c b/src/redbook/texture3d.c
index aa2dc7de..c865eef2 100644
--- a/src/redbook/texture3d.c
+++ b/src/redbook/texture3d.c
@@ -46,7 +46,7 @@
* with different texture coordinates to obtain different
* "slices" of the 3D texture.
*/
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
#include <stdlib.h>
#include <stdio.h>
@@ -143,7 +143,7 @@ int main(int argc, char** argv)
glutInitWindowSize(250, 250);
glutInitWindowPosition(100, 100);
glutCreateWindow(argv[0]);
- glewInit();
+ gladLoadGL();
init();
glutReshapeFunc(reshape);
glutDisplayFunc(display);
diff --git a/src/samples/CMakeLists.txt b/src/samples/CMakeLists.txt
index b83ee916..efe08f64 100644
--- a/src/samples/CMakeLists.txt
+++ b/src/samples/CMakeLists.txt
@@ -2,7 +2,7 @@ include_directories (
${CMAKE_SOURCE_DIR}/src/util
${OPENGL_INCLUDE_PATH}
${GLUT_INCLUDE_DIR}
- ${GLEW_INCLUDE_DIR}
+ ${GLAD_INCLUDE_DIR}
)
link_directories (
@@ -54,7 +54,7 @@ foreach (target ${targets})
${OPENGL_gl_LIBRARY}
${OPENGL_glu_LIBRARY}
${GLUT_glut_LIBRARY}
- ${GLEW_glew_LIBRARY}
+ glad
)
install (TARGETS ${subdir}_${target} DESTINATION ${subdir})
endforeach (target)
diff --git a/src/samples/Makefile.am b/src/samples/Makefile.am
index 6930cc71..4a14d70e 100644
--- a/src/samples/Makefile.am
+++ b/src/samples/Makefile.am
@@ -25,6 +25,7 @@
AM_CFLAGS = \
$(DEMO_CFLAGS) \
$(GLUT_CFLAGS) \
+ -I$(top_srcdir)/src/glad/include \
-I$(top_srcdir)/src/util
AM_LDFLAGS = \
$(DEMO_LIBS) \
@@ -62,7 +63,8 @@ noinst_PROGRAMS = \
wave
endif
-sphere_LDADD = ../util/libutil.la
+LDADD = ../glad/libglad.la
+sphere_LDADD = ../util/libutil.la ../glad/libglad.la
EXTRA_DIST = \
README \
diff --git a/src/samples/blendeq.c b/src/samples/blendeq.c
index a370f2e8..13f11cff 100644
--- a/src/samples/blendeq.c
+++ b/src/samples/blendeq.c
@@ -11,7 +11,7 @@
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
GLenum doubleBuffer;
@@ -271,7 +271,7 @@ int main(int argc, char **argv)
exit(1);
}
- glewInit();
+ gladLoadGL();
/* Make sure blend_logic_op extension is there. */
s = (char *) glGetString(GL_EXTENSIONS);
diff --git a/src/samples/blendxor.c b/src/samples/blendxor.c
index c6532e91..360a0837 100644
--- a/src/samples/blendxor.c
+++ b/src/samples/blendxor.c
@@ -10,7 +10,7 @@
#include <unistd.h>
#endif
#include <stdlib.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
@@ -171,7 +171,7 @@ int main(int argc, char **argv)
exit(1);
}
- glewInit();
+ gladLoadGL();
/* Make sure blend_logic_op extension is there. */
s = (char *) glGetString(GL_EXTENSIONS);
diff --git a/src/samples/copy.c b/src/samples/copy.c
index a354056e..18fc77c9 100644
--- a/src/samples/copy.c
+++ b/src/samples/copy.c
@@ -25,7 +25,7 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
@@ -182,7 +182,7 @@ int main(int argc, char **argv)
exit(1);
}
- glewInit();
+ gladLoadGL();
Init();
glutReshapeFunc(Reshape);
diff --git a/src/slang/CMakeLists.txt b/src/slang/CMakeLists.txt
index 8e5c7e10..1e03b1f2 100644
--- a/src/slang/CMakeLists.txt
+++ b/src/slang/CMakeLists.txt
@@ -2,7 +2,7 @@ include_directories (
${CMAKE_SOURCE_DIR}/src/util
${OPENGL_INCLUDE_PATH}
${GLUT_INCLUDE_DIR}
- ${GLEW_INCLUDE_DIR}
+ ${GLAD_INCLUDE_DIR}
)
link_directories (
@@ -14,7 +14,7 @@ link_libraries (
${OPENGL_gl_LIBRARY}
${OPENGL_glu_LIBRARY}
${GLUT_glut_LIBRARY}
- ${GLEW_glew_LIBRARY}
+ glad
)
set (subdir slang)
diff --git a/src/slang/Makefile.am b/src/slang/Makefile.am
index 6c5f8e04..8b04187d 100644
--- a/src/slang/Makefile.am
+++ b/src/slang/Makefile.am
@@ -25,6 +25,7 @@
AM_CFLAGS = \
$(DEMO_CFLAGS) \
$(GLUT_CFLAGS) \
+ -I$(top_srcdir)/src/glad/include \
-I$(top_srcdir)/src/util
AM_LDFLAGS = \
@@ -53,6 +54,8 @@ vstest_SOURCES = \
framework.c \
framework.h
+LDADD = ../glad/libglad.la
+
tests: cltest sotest vstest
! ./sotest 2> /dev/null | (grep -e ^[*][*][*])
! ./vstest 2> /dev/null | (grep -e ^[*][*][*])
diff --git a/src/slang/framework.c b/src/slang/framework.c
index dbbf99c8..2ab33170 100644
--- a/src/slang/framework.c
+++ b/src/slang/framework.c
@@ -19,7 +19,7 @@ void InitFramework (int *argc, char *argv[])
glutInitWindowSize (200, 200);
glutInitDisplayMode (GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
glutCreateWindow (argv[0]);
- glewInit();
+ gladLoadGL();
printf ("VENDOR: %s\n", glGetString (GL_VENDOR));
printf ("RENDERER: %s\n", glGetString (GL_RENDERER));
diff --git a/src/slang/framework.h b/src/slang/framework.h
index 6b62bb20..24639c6a 100644
--- a/src/slang/framework.h
+++ b/src/slang/framework.h
@@ -6,7 +6,7 @@
#include <string.h>
#include <assert.h>
#include <math.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
extern void InitFramework (int *argc, char *argv[]);
diff --git a/src/tests/CMakeLists.txt b/src/tests/CMakeLists.txt
index b72474ac..1c283f15 100644
--- a/src/tests/CMakeLists.txt
+++ b/src/tests/CMakeLists.txt
@@ -2,7 +2,7 @@ include_directories (
${CMAKE_SOURCE_DIR}/src/util
${OPENGL_INCLUDE_PATH}
${GLUT_INCLUDE_DIR}
- ${GLEW_INCLUDE_DIR}
+ ${GLAD_INCLUDE_DIR}
)
link_directories (
@@ -148,7 +148,7 @@ foreach (target ${targets})
${OPENGL_gl_LIBRARY}
${OPENGL_glu_LIBRARY}
${GLUT_glut_LIBRARY}
- ${GLEW_glew_LIBRARY}
+ glad
)
install (TARGETS ${subdir}_${target} DESTINATION ${subdir})
endforeach (target)
@@ -169,7 +169,7 @@ if (X11_FOUND)
add_executable (${subdir}_${target} ${target}.c)
set_target_properties (${subdir}_${target} PROPERTIES OUTPUT_NAME ${target})
target_link_libraries (${subdir}_${target}
- ${GLEW_glew_LIBRARY}
+ glad
${X11_GLU_LIB}
${X11_GL_LIB}
${X11_Xext_LIB}
diff --git a/src/tests/Makefile.am b/src/tests/Makefile.am
index 8a6641bb..41d5bc43 100644
--- a/src/tests/Makefile.am
+++ b/src/tests/Makefile.am
@@ -28,6 +28,7 @@
AM_CFLAGS = \
$(DEMO_CFLAGS) \
$(GLUT_CFLAGS) \
+ -I$(top_srcdir)/src/glad/include \
-I$(top_srcdir)/src/util
AM_LDFLAGS = \
$(DEMO_LIBS) \
@@ -169,22 +170,23 @@ noinst_PROGRAMS = \
zreaddraw
endif
-afsmultiarb_LDADD = ../util/libutil.la
-arraytexture_LDADD = ../util/libutil.la
-auxbuffer_LDADD = -lX11
-bug_3195_LDADD = ../util/libutil.la
-bumpmap_LDADD = ../util/libutil.la
-floattex_LDADD = ../util/libutil.la
-fillrate_LDADD = ../util/libutil.la
-invert_LDADD = ../util/libutil.la
-jkrahntest_LDADD = -lX11
-linehacks_LDADD = ../util/libutil.la
-mipmap_limits_LDADD = ../util/libutil.la
-mipmap_view_LDADD = ../util/libutil.la
-sharedtex_LDADD = -lX11
-shader_interp_LDADD = ../util/libutil.la
-texobjshare_LDADD = -lX11
-texrect_LDADD = ../util/libutil.la
+LDADD = ../glad/libglad.la
+afsmultiarb_LDADD = ../util/libutil.la ../glad/libglad.la
+arraytexture_LDADD = ../util/libutil.la ../glad/libglad.la
+auxbuffer_LDADD = ../glad/libglad.la -lX11
+bug_3195_LDADD = ../util/libutil.la ../glad/libglad.la
+bumpmap_LDADD = ../util/libutil.la ../glad/libglad.la
+floattex_LDADD = ../util/libutil.la ../glad/libglad.la
+fillrate_LDADD = ../util/libutil.la ../glad/libglad.la
+invert_LDADD = ../util/libutil.la ../glad/libglad.la
+jkrahntest_LDADD = ../glad/libglad.la -lX11
+linehacks_LDADD = ../util/libutil.la ../glad/libglad.la
+mipmap_limits_LDADD = ../util/libutil.la ../glad/libglad.la
+mipmap_view_LDADD = ../util/libutil.la ../glad/libglad.la
+sharedtex_LDADD = ../glad/libglad.la -lX11
+shader_interp_LDADD = ../util/libutil.la ../glad/libglad.la
+texobjshare_LDADD = ../glad/libglad.la -lX11
+texrect_LDADD = ../util/libutil.la ../glad/libglad.la
EXTRA_DIST = \
Makefile.am \
diff --git a/src/tests/afsmultiarb.c b/src/tests/afsmultiarb.c
index 51e76184..23270891 100644
--- a/src/tests/afsmultiarb.c
+++ b/src/tests/afsmultiarb.c
@@ -11,7 +11,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
#include "readtex.h"
@@ -443,7 +443,7 @@ int main( int argc, char *argv[] )
glutInitWindowPosition( 0, 0 );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
glutCreateWindow(argv[0] );
- glewInit();
+ gladLoadGL();
Init( argc, argv );
diff --git a/src/tests/antialias.c b/src/tests/antialias.c
index 031876f8..91ff335a 100644
--- a/src/tests/antialias.c
+++ b/src/tests/antialias.c
@@ -9,7 +9,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
@@ -219,7 +219,7 @@ main( int argc, char *argv[] )
glutInitDisplayMode( GLUT_RGB | GLUT_ALPHA | GLUT_DOUBLE |
GLUT_DEPTH | GLUT_MULTISAMPLE );
glutCreateWindow(argv[0]);
- glewInit();
+ gladLoadGL();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );
diff --git a/src/tests/api_speed.c b/src/tests/api_speed.c
index 27278117..419325c7 100644
--- a/src/tests/api_speed.c
+++ b/src/tests/api_speed.c
@@ -37,7 +37,7 @@
#include <stdio.h>
#include <stdlib.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
#define inline __inline__
@@ -125,7 +125,7 @@ int main( int argc, char *argv[] )
glutInitDisplayMode( GLUT_RGB );
glutCreateWindow( argv[0] );
- glewInit();
+ gladLoadGL();
if ( argc > 1 ) {
count = strtoul( argv[1], NULL, 0 );
diff --git a/src/tests/arbfpspec.c b/src/tests/arbfpspec.c
index fcc50528..82d5f33f 100644
--- a/src/tests/arbfpspec.c
+++ b/src/tests/arbfpspec.c
@@ -8,7 +8,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
static float Xrot = 0.0, Yrot = 0.0, Zrot = 0.0;
@@ -180,7 +180,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( 250, 250 );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
glutCreateWindow(argv[0]);
- glewInit();
+ gladLoadGL();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutSpecialFunc( SpecialKey );
diff --git a/src/tests/arbfptest1.c b/src/tests/arbfptest1.c
index 40b8aab8..ca155d4a 100644
--- a/src/tests/arbfptest1.c
+++ b/src/tests/arbfptest1.c
@@ -5,7 +5,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
@@ -201,7 +201,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( 250, 250 );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
glutCreateWindow(argv[0]);
- glewInit();
+ gladLoadGL();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );
diff --git a/src/tests/arbfptexture.c b/src/tests/arbfptexture.c
index 8f68551f..65959afb 100644
--- a/src/tests/arbfptexture.c
+++ b/src/tests/arbfptexture.c
@@ -5,7 +5,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
#include "readtex.c"
@@ -143,7 +143,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( 250, 250 );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
glutCreateWindow(argv[0]);
- glewInit();
+ gladLoadGL();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutSpecialFunc( SpecialKey );
diff --git a/src/tests/arbfptrig.c b/src/tests/arbfptrig.c
index f590751f..d8b31123 100644
--- a/src/tests/arbfptrig.c
+++ b/src/tests/arbfptrig.c
@@ -5,7 +5,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
#include "readtex.c"
@@ -146,7 +146,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( 250, 250 );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
glutCreateWindow(argv[0]);
- glewInit();
+ gladLoadGL();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutSpecialFunc( SpecialKey );
diff --git a/src/tests/arbgpuprog.c b/src/tests/arbgpuprog.c
index 623b7061..fa37ad4a 100644
--- a/src/tests/arbgpuprog.c
+++ b/src/tests/arbgpuprog.c
@@ -7,7 +7,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
@@ -169,7 +169,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( 200, 200 );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
Win = glutCreateWindow(argv[0]);
- glewInit();
+ gladLoadGL();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Redisplay );
diff --git a/src/tests/arbnpot-mipmap.c b/src/tests/arbnpot-mipmap.c
index 8bcc9b47..d02f0b75 100644
--- a/src/tests/arbnpot-mipmap.c
+++ b/src/tests/arbnpot-mipmap.c
@@ -46,7 +46,7 @@
*/
#include <stdlib.h>
#include <stdio.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
GLubyte mipmapImage32[40][46][3];
@@ -176,7 +176,7 @@ int main(int argc, char** argv)
glutInitDisplayMode (GLUT_SINGLE | GLUT_RGB | GLUT_DEPTH);
glutInitWindowSize (500, 500);
glutCreateWindow (argv[0]);
- glewInit();
+ gladLoadGL();
myinit();
glutReshapeFunc (myReshape);
glutDisplayFunc(display);
diff --git a/src/tests/arbnpot.c b/src/tests/arbnpot.c
index 21875af5..ef1f8932 100644
--- a/src/tests/arbnpot.c
+++ b/src/tests/arbnpot.c
@@ -8,7 +8,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
#include "../util/readtex.c"
@@ -189,7 +189,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( 400, 400 );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
glutCreateWindow(argv[0]);
- glewInit();
+ gladLoadGL();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );
diff --git a/src/tests/arbvparray.c b/src/tests/arbvparray.c
index 1111afdc..19f3f0d0 100644
--- a/src/tests/arbvparray.c
+++ b/src/tests/arbvparray.c
@@ -11,7 +11,7 @@
#include <stdlib.h>
#include <string.h>
#include <math.h>
-#include "GL/glew.h"
+#include "glad/glad.h"
#include "glut_wrap.h"
#define MAXVERTS 10000
@@ -180,7 +180,7 @@ static void init_program(void)
static const GLfloat scale[4] = {2.0, 2.0, 2.0, 0.0};
static const GLfloat bias[4] = {1.0, 1.0, 1.0, 0.0};
- if (!GLEW_ARB_vertex_program) {
+ if (!GLAD_GL_ARB_vertex_program) {
printf("Sorry, this program requires GL_ARB_vertex_program\n");
exit(1);
}
@@ -289,7 +289,7 @@ int main(int argc, char **argv)
if (glutCreateWindow("Isosurface") <= 0) {
exit(0);
}
- glewInit();
+ gladLoadGL();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutSpecialFunc(SpecialKey);
diff --git a/src/tests/arbvptest1.c b/src/tests/arbvptest1.c
index 35fd62cb..c545c0ac 100644
--- a/src/tests/arbvptest1.c
+++ b/src/tests/arbvptest1.c
@@ -5,7 +5,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
static void Display( void )
@@ -155,7 +155,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( 250, 250 );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
glutCreateWindow(argv[0]);
- glewInit();
+ gladLoadGL();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );
diff --git a/src/tests/arbvptest3.c b/src/tests/arbvptest3.c
index d14f2e93..d9cb7aac 100644
--- a/src/tests/arbvptest3.c
+++ b/src/tests/arbvptest3.c
@@ -4,7 +4,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
static float Zrot = 0.0;
@@ -118,7 +118,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( 250, 250 );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
glutCreateWindow(argv[0]);
- glewInit();
+ gladLoadGL();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );
diff --git a/src/tests/arbvptorus.c b/src/tests/arbvptorus.c
index 29bee37c..790e6a5a 100644
--- a/src/tests/arbvptorus.c
+++ b/src/tests/arbvptorus.c
@@ -7,7 +7,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
static float Xrot = 0.0, Yrot = 0.0, Zrot = 0.0;
@@ -174,7 +174,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( 250, 250 );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
glutCreateWindow(argv[0]);
- glewInit();
+ gladLoadGL();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutSpecialFunc( SpecialKey );
diff --git a/src/tests/arbvpwarpmesh.c b/src/tests/arbvpwarpmesh.c
index 5a045cc2..2bf2a0e6 100644
--- a/src/tests/arbvpwarpmesh.c
+++ b/src/tests/arbvpwarpmesh.c
@@ -7,7 +7,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
static float Xrot = -60.0, Yrot = 0.0, Zrot = 0.0;
@@ -234,7 +234,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( 250, 250 );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
glutCreateWindow(argv[0]);
- glewInit();
+ gladLoadGL();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutSpecialFunc( SpecialKey );
diff --git a/src/tests/arraytexture.c b/src/tests/arraytexture.c
index 4d6b5c09..4620c821 100644
--- a/src/tests/arraytexture.c
+++ b/src/tests/arraytexture.c
@@ -34,7 +34,7 @@
#include <stdio.h>
#include <string.h>
#include <math.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
#if !defined(GL_EXT_texture_array) && !defined(GL_MESA_texture_array)
@@ -317,7 +317,7 @@ int main(int argc, char *argv[])
glutInitWindowSize(350, 350);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE);
glutCreateWindow("Array texture test");
- glewInit();
+ gladLoadGL();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutSpecialFunc(SpecialKey);
diff --git a/src/tests/auxbuffer.c b/src/tests/auxbuffer.c
index 73129e62..8346d48a 100644
--- a/src/tests/auxbuffer.c
+++ b/src/tests/auxbuffer.c
@@ -41,7 +41,7 @@
#include <string.h>
#include <X11/Xlib.h>
#include <X11/keysym.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include <GL/glx.h>
@@ -480,7 +480,7 @@ main(int argc, char *argv[])
XMapWindow(dpy, win);
glXMakeCurrent(dpy, win, ctx);
- glewInit();
+ gladLoadGL();
if (printInfo) {
printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
diff --git a/src/tests/backspecular.c b/src/tests/backspecular.c
index 962071f4..2e26efeb 100644
--- a/src/tests/backspecular.c
+++ b/src/tests/backspecular.c
@@ -1,5 +1,5 @@
#include <stdlib.h>
-#include <GL/glew.h>
+#include "gl_wrap.h"
#include "glut_wrap.h"
diff --git a/src/tests/blendxor.c b/src/tests/blendxor.c
index 16bfea6f..302164dd 100644
--- a/src/tests/blendxor.c
+++ b/src/tests/blendxor.c
@@ -6,7 +6,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
#include "readtex.c"
@@ -177,7 +177,7 @@ main(int argc, char *argv[])
glutInitWindowSize(Width, Height);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE);
Win = glutCreateWindow(argv[0]);
- glewInit();
+ gladLoadGL();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutSpecialFunc(SpecialKey);
diff --git a/src/tests/blitfb.c b/src/tests/blitfb.c
index 156f7b61..169753d1 100644
--- a/src/tests/blitfb.c
+++ b/src/tests/blitfb.c
@@ -9,7 +9,7 @@
#include <stdlib.h>
#include <string.h>
#include <math.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
@@ -248,7 +248,7 @@ main(int argc, char *argv[])
glutInitWindowSize(WinWidth, WinHeight);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
Win = glutCreateWindow(argv[0]);
- glewInit();
+ gladLoadGL();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutSpecialFunc(SpecialKey);
diff --git a/src/tests/bufferobj.c b/src/tests/bufferobj.c
index 1d6da849..c98593f2 100644
--- a/src/tests/bufferobj.c
+++ b/src/tests/bufferobj.c
@@ -12,7 +12,7 @@
#include <stdlib.h>
#include <string.h>
#include <math.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
#define NUM_OBJECTS 10
@@ -504,7 +504,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( 600, 300 );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
Win = glutCreateWindow(argv[0]);
- glewInit();
+ gladLoadGL();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutSpecialFunc( SpecialKey );
diff --git a/src/tests/bug_3050.c b/src/tests/bug_3050.c
index 00c6bbd9..c26d86ed 100644
--- a/src/tests/bug_3050.c
+++ b/src/tests/bug_3050.c
@@ -39,7 +39,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
static int Width = 400;
@@ -153,7 +153,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( Width, Height );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
glutCreateWindow( "Bug #3050 Test" );
- glewInit();
+ gladLoadGL();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );
diff --git a/src/tests/bug_3101.c b/src/tests/bug_3101.c
index 26453917..a2f9d493 100644
--- a/src/tests/bug_3101.c
+++ b/src/tests/bug_3101.c
@@ -34,7 +34,7 @@
#include <stdio.h>
#include <stdlib.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
static int Width = 400;
@@ -120,7 +120,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( Width, Height );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
glutCreateWindow( "Bug #3101 Test" );
- glewInit();
+ gladLoadGL();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );
diff --git a/src/tests/bug_3195.c b/src/tests/bug_3195.c
index fd76307b..b50d6d18 100644
--- a/src/tests/bug_3195.c
+++ b/src/tests/bug_3195.c
@@ -36,7 +36,7 @@
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
#include "readtex.h"
@@ -264,7 +264,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( 350, 350 );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
glutCreateWindow( "Bug #3195 Test" );
- glewInit();
+ gladLoadGL();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutSpecialFunc( SpecialKey );
diff --git a/src/tests/bug_texstore_i8.c b/src/tests/bug_texstore_i8.c
index 93977053..6f98755e 100644
--- a/src/tests/bug_texstore_i8.c
+++ b/src/tests/bug_texstore_i8.c
@@ -29,7 +29,7 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
static GLenum Target = GL_TEXTURE_2D;
@@ -181,7 +181,7 @@ int main(int argc, char **argv)
glutInitDisplayMode(type);
win = glutCreateWindow("Tex test");
- glewInit();
+ gladLoadGL();
if (!win) {
exit(1);
}
diff --git a/src/tests/bumpmap.c b/src/tests/bumpmap.c
index c77394a9..31243d7a 100644
--- a/src/tests/bumpmap.c
+++ b/src/tests/bumpmap.c
@@ -30,7 +30,7 @@
#include <stdlib.h>
#include <string.h>
#include <math.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
#include "readtex.h"
@@ -192,7 +192,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( 400, 400 );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
glutCreateWindow( "GL_ATI_envmap_bumpmap test" );
- glewInit();
+ gladLoadGL();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );
diff --git a/src/tests/calibrate_rast.c b/src/tests/calibrate_rast.c
index 0bbbf849..293e9dad 100644
--- a/src/tests/calibrate_rast.c
+++ b/src/tests/calibrate_rast.c
@@ -21,7 +21,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
@@ -564,7 +564,7 @@ main(int argc, char *argv[])
glutInitWindowSize(Width, Height);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE);
Win = glutCreateWindow(argv[0]);
- glewInit();
+ gladLoadGL();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutDisplayFunc(Draw);
diff --git a/src/tests/condrender.c b/src/tests/condrender.c
index eb228fa5..56faea46 100644
--- a/src/tests/condrender.c
+++ b/src/tests/condrender.c
@@ -29,7 +29,7 @@
#include <stdlib.h>
#include <string.h>
#include <math.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
#define TEST_DISPLAY_LISTS 0
@@ -230,7 +230,7 @@ int main( int argc, char *argv[] )
glutInit( &argc, argv );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
Win = glutCreateWindow(argv[0]);
- glewInit();
+ gladLoadGL();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutSpecialFunc( SpecialKey );
diff --git a/src/tests/copypixrate.c b/src/tests/copypixrate.c
index 2f64e0ac..4c12fbd3 100644
--- a/src/tests/copypixrate.c
+++ b/src/tests/copypixrate.c
@@ -9,7 +9,7 @@
#include <stdlib.h>
#include <string.h>
#include <math.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
static GLint WinWidth = 1000, WinHeight = 800;
@@ -256,7 +256,7 @@ main(int argc, char *argv[])
glutInitWindowSize(WinWidth, WinHeight);
glutInitDisplayMode(mode);
glutCreateWindow(argv[0]);
- glewInit();
+ gladLoadGL();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutSpecialFunc(SpecialKey);
diff --git a/src/tests/cva.c b/src/tests/cva.c
index f097736b..bdf95361 100644
--- a/src/tests/cva.c
+++ b/src/tests/cva.c
@@ -15,7 +15,7 @@
#include <windows.h>
#endif
#define GL_GLEXT_LEGACY
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
GLfloat verts[][4] = {
@@ -61,7 +61,7 @@ static void init( void )
glVertexPointer( 3, GL_FLOAT, sizeof(verts[0]), verts );
glColorPointer( 4, GL_UNSIGNED_BYTE, 0, color );
- if ( GLEW_EXT_compiled_vertex_array ) {
+ if ( GLAD_GL_EXT_compiled_vertex_array ) {
glLockArraysEXT( 0, 4 );
}
}
@@ -125,18 +125,18 @@ int main( int argc, char **argv )
glutInitWindowSize( 250, 250 );
glutInitWindowPosition( 100, 100 );
glutCreateWindow( "CVA Test" );
- glewInit();
+ gladLoadGL();
/* Make sure the server supports GL 1.2 vertex arrays.
*/
- if ( !GLEW_VERSION_1_2 ) {
+ if ( !GLAD_GL_VERSION_1_2 ) {
fprintf( stderr, "This program requires OpenGL 1.2 vertex arrays.\n" );
exit( -1 );
}
/* See if the server supports compiled vertex arrays.
*/
- if ( !GLEW_EXT_compiled_vertex_array ) {
+ if ( !GLAD_GL_EXT_compiled_vertex_array ) {
fprintf( stderr, "Compiled vertex arrays not supported by this renderer.\n" );
}
diff --git a/src/tests/debugger.c b/src/tests/debugger.c
index 707e7700..d4074ddd 100644
--- a/src/tests/debugger.c
+++ b/src/tests/debugger.c
@@ -9,7 +9,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
@@ -722,7 +722,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( 200, 200 );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
glutCreateWindow(argv[0]);
- glewInit();
+ gladLoadGL();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutSpecialFunc( SpecialKey );
diff --git a/src/tests/drawbuffers.c b/src/tests/drawbuffers.c
index fa2f8a7c..f017d257 100644
--- a/src/tests/drawbuffers.c
+++ b/src/tests/drawbuffers.c
@@ -11,7 +11,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
@@ -158,15 +158,15 @@ CheckExtensions(void)
{
GLint numBuf;
- if (!GLEW_EXT_framebuffer_object) {
+ if (!GLAD_GL_EXT_framebuffer_object) {
printf("Sorry, GL_EXT_framebuffer_object is required!\n");
exit(1);
}
- if (!GLEW_ARB_draw_buffers) {
+ if (!GLAD_GL_ARB_draw_buffers) {
printf("Sorry, GL_ARB_draw_buffers is required!\n");
exit(1);
}
- if (!GLEW_VERSION_2_0) {
+ if (!GLAD_GL_VERSION_2_0) {
printf("Sorry, OpenGL 2.0 is required!\n");
exit(1);
}
@@ -299,7 +299,7 @@ main(int argc, char *argv[])
glutInitWindowSize(Width, Height);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE);
Win = glutCreateWindow(argv[0]);
- glewInit();
+ gladLoadGL();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutDisplayFunc(Display);
diff --git a/src/tests/drawbuffers2.c b/src/tests/drawbuffers2.c
index 5bcf0b21..0cb8d47c 100644
--- a/src/tests/drawbuffers2.c
+++ b/src/tests/drawbuffers2.c
@@ -18,7 +18,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
@@ -213,7 +213,7 @@ CheckExtensions(void)
exit(1);
}
}
- if (!GLEW_VERSION_2_0) {
+ if (!GLAD_GL_VERSION_2_0) {
printf("Sorry, OpenGL 2.0 is required!\n");
exit(1);
}
@@ -351,7 +351,7 @@ main(int argc, char *argv[])
glutInitWindowSize(Width, Height);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE);
Win = glutCreateWindow(argv[0]);
- glewInit();
+ gladLoadGL();
glutIdleFunc(Anim ? Idle : NULL);
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
diff --git a/src/tests/drawstencil.c b/src/tests/drawstencil.c
index 3c488cbc..18d8b57d 100644
--- a/src/tests/drawstencil.c
+++ b/src/tests/drawstencil.c
@@ -7,7 +7,7 @@
#include <stdlib.h>
#include <string.h>
#include <math.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
static int Win;
@@ -213,7 +213,7 @@ main(int argc, char *argv[])
glutInitWindowSize(WinWidth, WinHeight);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_STENCIL);
Win = glutCreateWindow(argv[0]);
- glewInit();
+ gladLoadGL();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutSpecialFunc(SpecialKey);
diff --git a/src/tests/exactrast.c b/src/tests/exactrast.c
index b7535331..76842a4d 100644
--- a/src/tests/exactrast.c
+++ b/src/tests/exactrast.c
@@ -26,7 +26,7 @@
#include <stdio.h>
#include <stdlib.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
static int Width = 400, Height = 400;
@@ -190,7 +190,7 @@ main(int argc, char *argv[])
glutInitWindowSize(Width, Height);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE);
Win = glutCreateWindow(argv[0]);
- glewInit();
+ gladLoadGL();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutSpecialFunc(SpecialKey);
diff --git a/src/tests/ext422square.c b/src/tests/ext422square.c
index cf4bbdc1..49b5fda1 100644
--- a/src/tests/ext422square.c
+++ b/src/tests/ext422square.c
@@ -12,7 +12,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
#include <assert.h>
@@ -249,7 +249,7 @@ int main( int argc, char *argv[] )
glutInitWindowPosition( 0, 0 );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
glutCreateWindow(argv[0] );
- glewInit();
+ gladLoadGL();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutSpecialFunc( SpecialKey );
diff --git a/src/tests/fbotest1.c b/src/tests/fbotest1.c
index 161903cc..322ea30a 100644
--- a/src/tests/fbotest1.c
+++ b/src/tests/fbotest1.c
@@ -10,7 +10,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
static int Win;
@@ -202,7 +202,7 @@ main( int argc, char *argv[] )
glutInitWindowSize(Width, Height);
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
Win = glutCreateWindow(argv[0]);
- glewInit();
+ gladLoadGL();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );
diff --git a/src/tests/fbotest2.c b/src/tests/fbotest2.c
index 6ef7f125..05554e4b 100644
--- a/src/tests/fbotest2.c
+++ b/src/tests/fbotest2.c
@@ -10,7 +10,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
static int Win = 0;
@@ -219,7 +219,7 @@ main( int argc, char *argv[] )
glutInitWindowSize(Width, Height);
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
Win = glutCreateWindow(argv[0]);
- glewInit();
+ gladLoadGL();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );
diff --git a/src/tests/fbotest3.c b/src/tests/fbotest3.c
index 19f684d8..a3ac3409 100644
--- a/src/tests/fbotest3.c
+++ b/src/tests/fbotest3.c
@@ -18,7 +18,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
@@ -219,7 +219,7 @@ main( int argc, char *argv[] )
glutInitWindowSize(Width, Height);
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
Win = glutCreateWindow(argv[0]);
- glewInit();
+ gladLoadGL();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );
diff --git a/src/tests/fillrate.c b/src/tests/fillrate.c
index f1365b82..1e46f1c1 100644
--- a/src/tests/fillrate.c
+++ b/src/tests/fillrate.c
@@ -9,7 +9,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
#include "readtex.h"
@@ -194,7 +194,7 @@ main(int argc, char *argv[])
glutInitWindowSize(Width, Height);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE);
Win = glutCreateWindow(argv[0]);
- glewInit();
+ gladLoadGL();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutDisplayFunc(Draw);
diff --git a/src/tests/floattex.c b/src/tests/floattex.c
index 1da850be..ad988e32 100644
--- a/src/tests/floattex.c
+++ b/src/tests/floattex.c
@@ -7,7 +7,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
#include "readtex.h"
#include "shaderutil.h"
@@ -225,7 +225,7 @@ main(int argc, char *argv[])
glutInitWindowSize(400, 400);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
glutCreateWindow(argv[0]);
- glewInit();
+ gladLoadGL();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutDisplayFunc(Draw);
diff --git a/src/tests/fogcoord.c b/src/tests/fogcoord.c
index 408e6ca3..3ecf4026 100644
--- a/src/tests/fogcoord.c
+++ b/src/tests/fogcoord.c
@@ -6,7 +6,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
static int Width = 600;
@@ -93,7 +93,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( Width, Height );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
glutCreateWindow(argv[0]);
- glewInit();
+ gladLoadGL();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );
diff --git a/src/tests/fptest1.c b/src/tests/fptest1.c
index 1ae4bb09..f9f71283 100644
--- a/src/tests/fptest1.c
+++ b/src/tests/fptest1.c
@@ -5,7 +5,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
@@ -218,7 +218,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( 250, 250 );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
glutCreateWindow(argv[0]);
- glewInit();
+ gladLoadGL();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );
diff --git a/src/tests/fptexture.c b/src/tests/fptexture.c
index ab7cfc4f..8c73f308 100644
--- a/src/tests/fptexture.c
+++ b/src/tests/fptexture.c
@@ -5,7 +5,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
#include "../util/readtex.c"
@@ -141,7 +141,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( 250, 250 );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
glutCreateWindow(argv[0]);
- glewInit();
+ gladLoadGL();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutSpecialFunc( SpecialKey );
diff --git a/src/tests/getteximage.c b/src/tests/getteximage.c
index b54c97b9..91c90548 100644
--- a/src/tests/getteximage.c
+++ b/src/tests/getteximage.c
@@ -8,7 +8,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
static int Win;
@@ -263,7 +263,7 @@ main(int argc, char *argv[])
glutInitWindowSize(400, 400);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
Win = glutCreateWindow(argv[0]);
- glewInit();
+ gladLoadGL();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutDisplayFunc(Draw);
diff --git a/src/tests/gremedy.c b/src/tests/gremedy.c
index 2e911a8b..2da9ac84 100644
--- a/src/tests/gremedy.c
+++ b/src/tests/gremedy.c
@@ -25,7 +25,7 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
@@ -41,11 +41,11 @@ static void Init(void)
fprintf(stderr, "GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
fprintf(stderr, "GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
fprintf(stderr, "GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
- fprintf(stderr, "GL_GREMEDY_string_marker = %i\n", GLEW_GREMEDY_string_marker);
- fprintf(stderr, "GL_GREMEDY_frame_terminator = %i\n", GLEW_GREMEDY_frame_terminator);
+ fprintf(stderr, "GL_GREMEDY_string_marker = %i\n", GLAD_GL_GREMEDY_string_marker);
+ fprintf(stderr, "GL_GREMEDY_frame_terminator = %i\n", GLAD_GL_GREMEDY_frame_terminator);
fflush(stderr);
- if (GLEW_GREMEDY_string_marker) {
+ if (GLAD_GL_GREMEDY_string_marker) {
glStringMarkerGREMEDY(0, __FUNCTION__);
}
@@ -54,7 +54,7 @@ static void Init(void)
static void Reshape(int width, int height)
{
- if (GLEW_GREMEDY_string_marker) {
+ if (GLAD_GL_GREMEDY_string_marker) {
glStringMarkerGREMEDY(0, __FUNCTION__);
}
@@ -80,7 +80,7 @@ static void Key(unsigned char key, int x, int y)
static void Draw(void)
{
- if (GLEW_GREMEDY_string_marker) {
+ if (GLAD_GL_GREMEDY_string_marker) {
glStringMarkerGREMEDY(0, __FUNCTION__);
}
@@ -97,7 +97,7 @@ static void Draw(void)
glFlush();
- if (GLEW_GREMEDY_frame_terminator) {
+ if (GLAD_GL_GREMEDY_frame_terminator) {
glFrameTerminatorGREMEDY();
}
@@ -144,7 +144,7 @@ int main(int argc, char **argv)
exit(1);
}
- glewInit();
+ gladLoadGL();
Init();
diff --git a/src/tests/interleave.c b/src/tests/interleave.c
index 3e862411..acb01aa9 100644
--- a/src/tests/interleave.c
+++ b/src/tests/interleave.c
@@ -36,7 +36,7 @@
#include <stdlib.h>
#include <string.h>
#include <time.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
static int Width = 400;
@@ -387,7 +387,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( Width, Height );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
glutCreateWindow( "glInterleavedArrays test" );
- glewInit();
+ gladLoadGL();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );
diff --git a/src/tests/invert.c b/src/tests/invert.c
index a44b7697..c94e66e5 100644
--- a/src/tests/invert.c
+++ b/src/tests/invert.c
@@ -35,7 +35,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
#include "readtex.h"
@@ -169,7 +169,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( Width, Height );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
glutCreateWindow( "GL_MESA_pack_invert test" );
- glewInit();
+ gladLoadGL();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );
diff --git a/src/tests/line-sample.c b/src/tests/line-sample.c
index d55b0768..196daad2 100644
--- a/src/tests/line-sample.c
+++ b/src/tests/line-sample.c
@@ -11,7 +11,7 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
-#include <GL/glew.h> // just for GL_ALIASED_LINE_WIDTH_RANGE
+#include "gl_wrap.h" // just for GL_ALIASED_LINE_WIDTH_RANGE
#include "glut_wrap.h"
diff --git a/src/tests/lineclip.c b/src/tests/lineclip.c
index eae2aeaa..423b0e06 100644
--- a/src/tests/lineclip.c
+++ b/src/tests/lineclip.c
@@ -26,7 +26,7 @@
*/
#include <stdlib.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
static int win_width, win_height;
@@ -165,7 +165,7 @@ main(int argc, char *argv[])
glutInitWindowSize(win_width, win_height);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
glutCreateWindow(argv[0]);
- glewInit();
+ gladLoadGL();
glutReshapeFunc(reshape);
glutKeyboardFunc(key);
glutDisplayFunc(display);
diff --git a/src/tests/linehacks.c b/src/tests/linehacks.c
index e4d0e16c..5c0aeae9 100644
--- a/src/tests/linehacks.c
+++ b/src/tests/linehacks.c
@@ -11,7 +11,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
#include "shaderutil.h"
@@ -322,7 +322,7 @@ main(int argc, char *argv[])
glutKeyboardFunc(Key);
glutSpecialFunc(SpecialKey);
glutDisplayFunc(Draw);
- glewInit();
+ gladLoadGL();
Usage();
Init();
glutMainLoop();
diff --git a/src/tests/manytex.c b/src/tests/manytex.c
index 3874addd..7322073f 100644
--- a/src/tests/manytex.c
+++ b/src/tests/manytex.c
@@ -13,7 +13,7 @@
#include <stdlib.h>
#include <string.h>
#include <math.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
@@ -337,7 +337,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( WinWidth, WinHeight );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
Win = glutCreateWindow(argv[0]);
- glewInit();
+ gladLoadGL();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );
diff --git a/src/tests/mapbufrange.c b/src/tests/mapbufrange.c
index a3d3d16c..27395c22 100644
--- a/src/tests/mapbufrange.c
+++ b/src/tests/mapbufrange.c
@@ -14,8 +14,8 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <GL/glew.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
static GLuint Win;
@@ -193,8 +193,8 @@ main(int argc, char *argv[])
glutInitWindowSize(800, 200);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE);
Win = glutCreateWindow(argv[0]);
- glewInit();
- glewInit();
+ gladLoadGL();
+ gladLoadGL();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutDisplayFunc(Display);
diff --git a/src/tests/minmag.c b/src/tests/minmag.c
index 338d7cc5..8aeb0ce2 100644
--- a/src/tests/minmag.c
+++ b/src/tests/minmag.c
@@ -16,7 +16,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
@@ -189,7 +189,7 @@ main(int argc, char *argv[])
glutInitWindowSize(Width, Height);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
glutCreateWindow(argv[0]);
- glewInit();
+ gladLoadGL();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutDisplayFunc(redraw);
diff --git a/src/tests/mipgen.c b/src/tests/mipgen.c
index 72e4890c..3ebf81e5 100644
--- a/src/tests/mipgen.c
+++ b/src/tests/mipgen.c
@@ -45,7 +45,7 @@
#include <stdlib.h>
#include <stdio.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
@@ -194,7 +194,7 @@ int main(int argc, char** argv)
glutInitDisplayMode (GLUT_SINGLE | GLUT_RGB );
glutInitWindowSize (600, 600);
glutCreateWindow (argv[0]);
- glewInit();
+ gladLoadGL();
myinit();
glutReshapeFunc (myReshape);
glutDisplayFunc(display);
diff --git a/src/tests/mipmap_comp.c b/src/tests/mipmap_comp.c
index 41f73cbd..819a5146 100644
--- a/src/tests/mipmap_comp.c
+++ b/src/tests/mipmap_comp.c
@@ -45,7 +45,7 @@
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
#define SIZE 16 /* not larger then 16 */
@@ -282,7 +282,7 @@ main(int argc, char** argv)
glutInitDisplayMode (GLUT_SINGLE | GLUT_RGB | GLUT_DEPTH);
glutInitWindowSize (600, 600);
glutCreateWindow (argv[0]);
- glewInit();
+ gladLoadGL();
if (!glutExtensionSupported("GL_EXT_texture_compression_s3tc")) {
fprintf(stderr, "This test requires GL_EXT_texture_compression_s3tc.\n");
diff --git a/src/tests/mipmap_comp_tests.c b/src/tests/mipmap_comp_tests.c
index d1cadde4..6575e7ea 100644
--- a/src/tests/mipmap_comp_tests.c
+++ b/src/tests/mipmap_comp_tests.c
@@ -45,7 +45,7 @@
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
#define SIZE 16 /* not larger then 16 */
@@ -305,7 +305,7 @@ main(int argc, char** argv)
glutInitDisplayMode (GLUT_SINGLE | GLUT_RGB | GLUT_DEPTH);
glutInitWindowSize (600, 600);
glutCreateWindow (argv[0]);
- glewInit();
+ gladLoadGL();
myInit();
glutReshapeFunc (myReshape);
glutDisplayFunc(display);
diff --git a/src/tests/mipmap_limits.c b/src/tests/mipmap_limits.c
index c7743faa..7066a797 100644
--- a/src/tests/mipmap_limits.c
+++ b/src/tests/mipmap_limits.c
@@ -51,7 +51,7 @@
*/
#include <stdlib.h>
#include <stdio.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
#include "readtex.h"
@@ -439,7 +439,7 @@ main(int argc, char **argv)
glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB | GLUT_DEPTH);
glutInitWindowSize(Width, Height);
glutCreateWindow(argv[0]);
- glewInit();
+ gladLoadGL();
myinit();
glutReshapeFunc(myReshape);
glutDisplayFunc(display);
diff --git a/src/tests/mipmap_tunnel.c b/src/tests/mipmap_tunnel.c
index cefc2bdd..46d07021 100644
--- a/src/tests/mipmap_tunnel.c
+++ b/src/tests/mipmap_tunnel.c
@@ -13,7 +13,7 @@
#include <stdlib.h>
#include <stdio.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
@@ -263,7 +263,7 @@ main(int argc, char **argv)
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB);
glutCreateWindow(argv[0]);
- glewInit();
+ gladLoadGL();
glutReshapeFunc(Reshape);
glutDisplayFunc(Display);
glutKeyboardFunc(Key);
diff --git a/src/tests/mipmap_view.c b/src/tests/mipmap_view.c
index 32df8dac..27f3d1c0 100644
--- a/src/tests/mipmap_view.c
+++ b/src/tests/mipmap_view.c
@@ -10,7 +10,7 @@
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
#include "readtex.h"
@@ -424,7 +424,7 @@ main(int argc, char *argv[])
glutInitWindowSize(WinWidth, WinHeight);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE);
Win = glutCreateWindow(argv[0]);
- glewInit();
+ gladLoadGL();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutDisplayFunc(Display);
diff --git a/src/tests/multipal.c b/src/tests/multipal.c
index 5ba4f86b..822c36e6 100644
--- a/src/tests/multipal.c
+++ b/src/tests/multipal.c
@@ -13,7 +13,7 @@
#include <windows.h>
#endif
#define GL_GLEXT_LEGACY
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
#include "../util/readtex.c" /* I know, this is a hack. */
@@ -351,7 +351,7 @@ int main( int argc, char *argv[] )
glutInitWindowPosition( 0, 0 );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
glutCreateWindow(argv[0] );
- glewInit();
+ gladLoadGL();
Init( argc, argv );
diff --git a/src/tests/multitexarray.c b/src/tests/multitexarray.c
index e0a883d0..fada543a 100644
--- a/src/tests/multitexarray.c
+++ b/src/tests/multitexarray.c
@@ -16,7 +16,7 @@
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
-#include "GL/glew.h"
+#include "glad/glad.h"
#include "glut_wrap.h"
static GLuint Window = 0;
@@ -222,7 +222,7 @@ int main( int argc, char *argv[] )
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
Window = glutCreateWindow("Texture Objects");
- glewInit();
+ gladLoadGL();
if (!Window) {
exit(1);
}
diff --git a/src/tests/multiwindow.c b/src/tests/multiwindow.c
index 54c7ba77..ce0dfa29 100644
--- a/src/tests/multiwindow.c
+++ b/src/tests/multiwindow.c
@@ -25,7 +25,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
@@ -146,7 +146,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( 400, 400 );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
Window[0] = glutCreateWindow(argv[0]);
- glewInit();
+ gladLoadGL();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display0 );
@@ -157,7 +157,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( 400, 400 );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
Window[1] = glutCreateWindow(argv[0]);
- glewInit();
+ gladLoadGL();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display1 );
diff --git a/src/tests/no_s3tc.c b/src/tests/no_s3tc.c
index 5ad34a58..5ac58716 100644
--- a/src/tests/no_s3tc.c
+++ b/src/tests/no_s3tc.c
@@ -38,7 +38,7 @@
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
static unsigned data[16];
@@ -59,7 +59,7 @@ main( int argc, char ** argv )
glutInitWindowPosition( 0, 0 );
glutInitWindowSize( 300, 300 );
glutCreateWindow( "No S3TC Test" );
- glewInit();
+ gladLoadGL();
gl_version = strtod( (const char *) glGetString( GL_VERSION ), NULL );
if ( ! glutExtensionSupported( "GL_ARB_texture_compression" )
diff --git a/src/tests/packedpixels.c b/src/tests/packedpixels.c
index 3032be1f..4c95ca5f 100644
--- a/src/tests/packedpixels.c
+++ b/src/tests/packedpixels.c
@@ -8,7 +8,7 @@
#include <stdlib.h>
#include <math.h>
#include <string.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
@@ -367,7 +367,7 @@ main(int argc, char *argv[])
glutInitWindowSize(700, 800);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
glutCreateWindow(argv[0]);
- glewInit();
+ gladLoadGL();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutDisplayFunc(Draw);
diff --git a/src/tests/pbo.c b/src/tests/pbo.c
index dd0106fd..f367fd74 100644
--- a/src/tests/pbo.c
+++ b/src/tests/pbo.c
@@ -10,7 +10,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
#include "../util/readtex.c" /* a hack, I know */
@@ -287,7 +287,7 @@ main( int argc, char *argv[] )
glutInitWindowSize( 750, 250 );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
glutCreateWindow(argv[0]);
- glewInit();
+ gladLoadGL();
Init();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
diff --git a/src/tests/prim.c b/src/tests/prim.c
index 75db437d..f2a81948 100644
--- a/src/tests/prim.c
+++ b/src/tests/prim.c
@@ -1,7 +1,7 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
@@ -547,7 +547,7 @@ int main(int argc, char **argv)
exit(1);
}
- glewInit();
+ gladLoadGL();
InitMap();
Init();
diff --git a/src/tests/prog_parameter.c b/src/tests/prog_parameter.c
index 12cdab5c..f9c4910f 100644
--- a/src/tests/prog_parameter.c
+++ b/src/tests/prog_parameter.c
@@ -35,7 +35,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
#ifndef GL_EXT_gpu_program_parameters
@@ -196,7 +196,7 @@ static void Init( void )
printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
printf("GL_VERSION = %s\n\n", ver_string);
- if ( !GLEW_ARB_vertex_program ) {
+ if ( !GLAD_GL_ARB_vertex_program ) {
printf("Sorry, this program requires GL_ARB_vertex_program\n");
exit(2);
}
@@ -208,7 +208,7 @@ static void Init( void )
get_program_local_parameterfv = glGetProgramLocalParameterfvARB;
get_program_env_parameterfv = glGetProgramEnvParameterfvARB;
- if ( GLEW_EXT_gpu_program_parameters ) {
+ if ( GLAD_GL_EXT_gpu_program_parameters ) {
printf("GL_EXT_gpu_program_parameters available, testing that path.\n");
program_local_parameters4fv = glProgramLocalParameters4fvEXT;
@@ -275,7 +275,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( Width, Height );
glutInitDisplayMode( GLUT_RGB );
glutCreateWindow( "Program Parameters Test" );
- glewInit();
+ gladLoadGL();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );
diff --git a/src/tests/quads.c b/src/tests/quads.c
index 11d983d4..208245ce 100644
--- a/src/tests/quads.c
+++ b/src/tests/quads.c
@@ -6,7 +6,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
#define NUM_QUADS 20
@@ -249,7 +249,7 @@ main(int argc, char *argv[])
glutInitWindowSize(600, 600);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
Win = glutCreateWindow(argv[0]);
- glewInit();
+ gladLoadGL();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutSpecialFunc(SpecialKey);
diff --git a/src/tests/random.c b/src/tests/random.c
index 982b64af..b57f00c9 100644
--- a/src/tests/random.c
+++ b/src/tests/random.c
@@ -11,7 +11,7 @@
#include <stdlib.h>
#include <string.h>
#include <math.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
static int Win;
@@ -445,7 +445,7 @@ main(int argc, char *argv[])
glutInitWindowSize(Width, Height);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
Win = glutCreateWindow(argv[0]);
- glewInit();
+ gladLoadGL();
ParseArgs(argc, argv);
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
diff --git a/src/tests/readrate.c b/src/tests/readrate.c
index 3859cf4c..8a9a02f7 100644
--- a/src/tests/readrate.c
+++ b/src/tests/readrate.c
@@ -11,7 +11,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
/* Hack, to test drawing instead of reading */
@@ -275,7 +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();
+ gladLoadGL();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutSpecialFunc(SpecialKey);
diff --git a/src/tests/rubberband.c b/src/tests/rubberband.c
index 9b58732c..81a6f2af 100644
--- a/src/tests/rubberband.c
+++ b/src/tests/rubberband.c
@@ -5,7 +5,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
#include "readtex.c"
@@ -255,7 +255,7 @@ main(int argc, char *argv[])
glutInitWindowSize(Width, Height);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE);
Win = glutCreateWindow(argv[0]);
- glewInit();
+ gladLoadGL();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutSpecialFunc(SpecialKey);
diff --git a/src/tests/seccolor.c b/src/tests/seccolor.c
index 1c549f4e..939adee8 100644
--- a/src/tests/seccolor.c
+++ b/src/tests/seccolor.c
@@ -6,7 +6,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
static int Width = 600;
@@ -136,7 +136,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( Width, Height );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
glutCreateWindow(argv[0]);
- glewInit();
+ gladLoadGL();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );
diff --git a/src/tests/shader-interp.c b/src/tests/shader-interp.c
index 06e1f1c6..0b124d35 100644
--- a/src/tests/shader-interp.c
+++ b/src/tests/shader-interp.c
@@ -11,7 +11,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
#include "shaderutil.h"
@@ -203,7 +203,7 @@ main(int argc, char *argv[])
glutInitWindowSize(Width, Height);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
Win = glutCreateWindow(argv[0]);
- glewInit();
+ gladLoadGL();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutDisplayFunc(Redisplay);
diff --git a/src/tests/shader_api.c b/src/tests/shader_api.c
index dec7a20d..3da001a9 100644
--- a/src/tests/shader_api.c
+++ b/src/tests/shader_api.c
@@ -5,7 +5,7 @@
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
static void assert_test(const char *file, int line, int cond, const char *msg)
@@ -324,9 +324,9 @@ int main(int argc, char **argv)
{
glutInit(&argc, argv);
glutCreateWindow("Mesa bug demo");
- glewInit();
+ gladLoadGL();
- if (!GLEW_VERSION_2_0) {
+ if (!GLAD_GL_VERSION_2_0) {
printf("Sorry, this test requires OpenGL 2.x GLSL support\n");
exit(0);
}
diff --git a/src/tests/shadow-sample.c b/src/tests/shadow-sample.c
index fff9165e..c5ed2b4c 100644
--- a/src/tests/shadow-sample.c
+++ b/src/tests/shadow-sample.c
@@ -3,7 +3,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
#define windowSize 100
@@ -309,7 +309,7 @@ main(int argc, char *argv[])
glutInitWindowSize(windowSize, windowSize);
glutInitDisplayMode(GLUT_DEPTH | GLUT_RGBA | GLUT_SINGLE | GLUT_ALPHA);
glutCreateWindow(argv[0]);
- glewInit();
+ gladLoadGL();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutDisplayFunc(Display);
diff --git a/src/tests/stencilreaddraw.c b/src/tests/stencilreaddraw.c
index 3d2b3e8c..5a94c1fa 100644
--- a/src/tests/stencilreaddraw.c
+++ b/src/tests/stencilreaddraw.c
@@ -9,7 +9,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
static GLint WinWidth = 500, WinHeight = 500;
@@ -177,7 +177,7 @@ int main(int argc, char *argv[])
glutInitWindowSize(WinWidth, WinHeight);
glutInitDisplayMode(GLUT_RGB | GLUT_DEPTH | GLUT_STENCIL | GLUT_DOUBLE);
glutCreateWindow(argv[0]);
- glewInit();
+ gladLoadGL();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutDisplayFunc(Display);
diff --git a/src/tests/stencilwrap.c b/src/tests/stencilwrap.c
index 0e954ba8..b24e213a 100644
--- a/src/tests/stencilwrap.c
+++ b/src/tests/stencilwrap.c
@@ -8,7 +8,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
GLboolean wrapping;
@@ -273,7 +273,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( 400, 400 );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_STENCIL );
glutCreateWindow(argv[0]);
- glewInit();
+ gladLoadGL();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );
diff --git a/src/tests/streaming_rect.c b/src/tests/streaming_rect.c
index 50ca76af..881db697 100644
--- a/src/tests/streaming_rect.c
+++ b/src/tests/streaming_rect.c
@@ -10,7 +10,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
@@ -304,7 +304,7 @@ int main( int argc, char *argv[] )
glutInitWindowPosition( 0, 0 );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
glutCreateWindow(argv[0] );
- glewInit();
+ gladLoadGL();
Init( argc, argv );
diff --git a/src/tests/subtex.c b/src/tests/subtex.c
index 4fdc2fad..e3cf2ba1 100644
--- a/src/tests/subtex.c
+++ b/src/tests/subtex.c
@@ -9,7 +9,7 @@
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
-#include "GL/glew.h"
+#include "glad/glad.h"
#include "glut_wrap.h"
static GLuint Window = 0;
@@ -208,7 +208,7 @@ int main( int argc, char *argv[] )
glutInitDisplayMode( GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE );
Window = glutCreateWindow("Texture Objects");
- glewInit();
+ gladLoadGL();
if (!Window) {
exit(1);
}
diff --git a/src/tests/subtexrate.c b/src/tests/subtexrate.c
index b65ee085..6dba9f19 100644
--- a/src/tests/subtexrate.c
+++ b/src/tests/subtexrate.c
@@ -9,7 +9,7 @@
#include <stdlib.h>
#include <string.h>
#include <math.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
static GLint WinWidth = 1024, WinHeight = 512;
@@ -337,7 +337,7 @@ main(int argc, char *argv[])
glutInitWindowSize(WinWidth, WinHeight);
glutInitDisplayMode(mode);
glutCreateWindow(argv[0]);
- glewInit();
+ gladLoadGL();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutSpecialFunc(SpecialKey);
diff --git a/src/tests/tex1d.c b/src/tests/tex1d.c
index d8675019..471f544a 100644
--- a/src/tests/tex1d.c
+++ b/src/tests/tex1d.c
@@ -7,7 +7,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include "GL/glew.h"
+#include "glad/glad.h"
#include "glut_wrap.h"
static GLuint Window = 0;
@@ -127,7 +127,7 @@ int main( int argc, char *argv[] )
glutInitDisplayMode( GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE );
Window = glutCreateWindow("Texture Objects");
- glewInit();
+ gladLoadGL();
if (!Window) {
exit(1);
}
diff --git a/src/tests/texcmp.c b/src/tests/texcmp.c
index 9782b79e..5d1daa65 100644
--- a/src/tests/texcmp.c
+++ b/src/tests/texcmp.c
@@ -7,7 +7,7 @@
#include <stdlib.h>
#include <math.h>
#include <string.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
#include "readtex.c" /* I know, this is a hack. */
@@ -398,7 +398,7 @@ int main( int argc, char *argv[] )
exit(0);
}
- glewInit();
+ gladLoadGL();
gl_version = atof( (const char *) glGetString( GL_VERSION ) );
if ( (gl_version < 1.3)
&& !glutExtensionSupported("GL_ARB_texture_compression") ) {
diff --git a/src/tests/texcompress2.c b/src/tests/texcompress2.c
index 142bba1d..26d07892 100644
--- a/src/tests/texcompress2.c
+++ b/src/tests/texcompress2.c
@@ -5,7 +5,7 @@
#include <assert.h>
#include <stdio.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
#include "readtex.c"
@@ -276,7 +276,7 @@ main( int argc, char *argv[] )
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE);
glutCreateWindow(argv[0]);
- glewInit();
+ gladLoadGL();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
diff --git a/src/tests/texcompsub.c b/src/tests/texcompsub.c
index 9a7de09b..e92a50aa 100644
--- a/src/tests/texcompsub.c
+++ b/src/tests/texcompsub.c
@@ -7,7 +7,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
#include "texcomp_image.h"
@@ -170,7 +170,7 @@ main( int argc, char *argv[] )
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE);
glutCreateWindow(argv[0]);
- glewInit();
+ gladLoadGL();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
diff --git a/src/tests/texdown.c b/src/tests/texdown.c
index 9777bc31..cd50fe10 100644
--- a/src/tests/texdown.c
+++ b/src/tests/texdown.c
@@ -35,7 +35,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#include <GL/glew.h>
+#include "gl_wrap.h"
#include "glut_wrap.h"
diff --git a/src/tests/texfilt.c b/src/tests/texfilt.c
index 0b0b1e8c..88c58c6b 100644
--- a/src/tests/texfilt.c
+++ b/src/tests/texfilt.c
@@ -27,7 +27,7 @@
#include <stdlib.h>
#include <string.h>
#include <math.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
const GLenum filter_modes[] = {
@@ -382,7 +382,7 @@ int main( int argc, char ** argv )
glutInitWindowSize( 800, 600 );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
glutCreateWindow( "Texture Filter Test" );
- glewInit();
+ gladLoadGL();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutSpecialFunc( SpecialKey );
diff --git a/src/tests/texgenmix.c b/src/tests/texgenmix.c
index 44b5b778..0e119cf4 100644
--- a/src/tests/texgenmix.c
+++ b/src/tests/texgenmix.c
@@ -6,7 +6,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
#undef max
@@ -619,7 +619,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( winWidth, winHeight );
glutInitWindowPosition( 0, 0 );
glutCreateWindow( "Mixed texgen/non-texgen texture coordinate test" );
- glewInit();
+ gladLoadGL();
initialize();
instructions();
diff --git a/src/tests/texleak.c b/src/tests/texleak.c
index 6f0ddc4c..a05d1403 100644
--- a/src/tests/texleak.c
+++ b/src/tests/texleak.c
@@ -15,7 +15,7 @@
#include <string.h>
#include <sys/time.h>
#include <unistd.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
@@ -127,7 +127,7 @@ int main( int argc, char *argv[] )
glutInitWindowPosition( 0, 0 );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
glutCreateWindow(argv[0] );
- glewInit();
+ gladLoadGL();
Init( argc, argv );
diff --git a/src/tests/texline.c b/src/tests/texline.c
index 815de125..ca138d2b 100644
--- a/src/tests/texline.c
+++ b/src/tests/texline.c
@@ -9,7 +9,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
#include "../util/readtex.c" /* I know, this is a hack. */
@@ -264,7 +264,7 @@ int main( int argc, char *argv[] )
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
glutCreateWindow(argv[0] );
- glewInit();
+ gladLoadGL();
Init(argc, argv);
diff --git a/src/tests/texrect.c b/src/tests/texrect.c
index fa844498..510b3e9e 100644
--- a/src/tests/texrect.c
+++ b/src/tests/texrect.c
@@ -10,7 +10,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
#include "readtex.h"
@@ -328,7 +328,7 @@ int main( int argc, char *argv[] )
glutInitWindowPosition( 0, 0 );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
glutCreateWindow(argv[0] );
- glewInit();
+ gladLoadGL();
Init( argc, argv );
diff --git a/src/tests/unfilledclip.c b/src/tests/unfilledclip.c
index 018e8de1..52351226 100644
--- a/src/tests/unfilledclip.c
+++ b/src/tests/unfilledclip.c
@@ -26,7 +26,7 @@
*/
#include <stdlib.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
static int win_width, win_height;
@@ -197,7 +197,7 @@ main(int argc, char *argv[])
glutInitWindowSize(win_width, win_height);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
glutCreateWindow(argv[0]);
- glewInit();
+ gladLoadGL();
glutReshapeFunc(reshape);
glutKeyboardFunc(key);
glutDisplayFunc(display);
diff --git a/src/tests/viewmemory.c b/src/tests/viewmemory.c
index 16044b93..16054b67 100644
--- a/src/tests/viewmemory.c
+++ b/src/tests/viewmemory.c
@@ -15,7 +15,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
static int Win;
@@ -192,7 +192,7 @@ main(int argc, char *argv[])
glutInitWindowSize(WinWidth, WinHeight);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE);
Win = glutCreateWindow(argv[0]);
- glewInit();
+ gladLoadGL();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutSpecialFunc(SpecialKey);
diff --git a/src/tests/vparray.c b/src/tests/vparray.c
index 3de6180e..f26a67e9 100644
--- a/src/tests/vparray.c
+++ b/src/tests/vparray.c
@@ -11,7 +11,7 @@
#include <stdlib.h>
#include <string.h>
#include <math.h>
-#include "GL/glew.h"
+#include "glad/glad.h"
#include "glut_wrap.h"
#define MAXVERTS 10000
@@ -181,7 +181,7 @@ static void init_program(void)
static const GLfloat scale[4] = {2.0, 2.0, 2.0, 0.0};
static const GLfloat bias[4] = {1.0, 1.0, 1.0, 0.0};
- if (!GLEW_NV_vertex_program) {
+ if (!GLAD_GL_NV_vertex_program) {
printf("Sorry, this program requires GL_NV_vertex_program\n");
exit(1);
}
@@ -284,7 +284,7 @@ int main(int argc, char **argv)
if (glutCreateWindow("Isosurface") <= 0) {
exit(0);
}
- glewInit();
+ gladLoadGL();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutSpecialFunc(SpecialKey);
diff --git a/src/tests/vpeval.c b/src/tests/vpeval.c
index cdd73883..58450253 100644
--- a/src/tests/vpeval.c
+++ b/src/tests/vpeval.c
@@ -10,7 +10,7 @@
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
@@ -227,7 +227,7 @@ main(int argc, char **argv)
glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB | GLUT_DEPTH);
glutInitWindowPosition(0, 0);
glutCreateWindow(argv[0]);
- glewInit();
+ gladLoadGL();
myinit(argc, argv);
glutReshapeFunc(myReshape);
glutDisplayFunc(display);
diff --git a/src/tests/vptest1.c b/src/tests/vptest1.c
index c044da3d..90e2fe21 100644
--- a/src/tests/vptest1.c
+++ b/src/tests/vptest1.c
@@ -5,7 +5,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
@@ -166,7 +166,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( 250, 250 );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
glutCreateWindow(argv[0]);
- glewInit();
+ gladLoadGL();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );
diff --git a/src/tests/vptest2.c b/src/tests/vptest2.c
index 538ff162..45f9d726 100644
--- a/src/tests/vptest2.c
+++ b/src/tests/vptest2.c
@@ -5,7 +5,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
@@ -140,7 +140,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( 50, 50 );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
glutCreateWindow(argv[0]);
- glewInit();
+ gladLoadGL();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );
diff --git a/src/tests/vptest3.c b/src/tests/vptest3.c
index d2a09add..a0ec9edb 100644
--- a/src/tests/vptest3.c
+++ b/src/tests/vptest3.c
@@ -5,7 +5,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
static float Zrot = 0.0;
@@ -116,7 +116,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( 250, 250 );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
glutCreateWindow(argv[0]);
- glewInit();
+ gladLoadGL();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );
diff --git a/src/tests/vptorus.c b/src/tests/vptorus.c
index 99cd49f6..cb97928b 100644
--- a/src/tests/vptorus.c
+++ b/src/tests/vptorus.c
@@ -7,7 +7,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
static float Xrot = 0.0, Yrot = 0.0, Zrot = 0.0;
@@ -162,7 +162,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( 250, 250 );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
glutCreateWindow(argv[0]);
- glewInit();
+ gladLoadGL();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutSpecialFunc( SpecialKey );
diff --git a/src/tests/vpwarpmesh.c b/src/tests/vpwarpmesh.c
index 541c7a35..c6aa6c33 100644
--- a/src/tests/vpwarpmesh.c
+++ b/src/tests/vpwarpmesh.c
@@ -7,7 +7,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
static float Xrot = -60.0, Yrot = 0.0, Zrot = 0.0;
@@ -224,7 +224,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( 250, 250 );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
glutCreateWindow(argv[0]);
- glewInit();
+ gladLoadGL();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutSpecialFunc( SpecialKey );
diff --git a/src/tests/yuvrect.c b/src/tests/yuvrect.c
index c39ac1b8..fd7271ff 100644
--- a/src/tests/yuvrect.c
+++ b/src/tests/yuvrect.c
@@ -9,7 +9,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
#include "../util/readtex.c" /* I know, this is a hack. */
@@ -180,7 +180,7 @@ int main( int argc, char *argv[] )
glutInitWindowPosition( 0, 0 );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
glutCreateWindow(argv[0] );
- glewInit();
+ gladLoadGL();
Init( argc, argv );
diff --git a/src/tests/yuvsquare.c b/src/tests/yuvsquare.c
index 35b53bf0..4ee605bc 100644
--- a/src/tests/yuvsquare.c
+++ b/src/tests/yuvsquare.c
@@ -9,7 +9,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
#include "../util/readtex.c" /* I know, this is a hack. */
@@ -219,7 +219,7 @@ int main( int argc, char *argv[] )
glutInitWindowPosition( 0, 0 );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
glutCreateWindow(argv[0] );
- glewInit();
+ gladLoadGL();
Init( argc, argv );
diff --git a/src/tests/zbitmap.c b/src/tests/zbitmap.c
index 0515a2aa..464da59d 100644
--- a/src/tests/zbitmap.c
+++ b/src/tests/zbitmap.c
@@ -10,7 +10,7 @@
#include <stdlib.h>
#include <string.h>
#include <math.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
@@ -117,7 +117,7 @@ main(int argc, char *argv[])
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
Win = glutCreateWindow(argv[0]);
- glewInit();
+ gladLoadGL();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutDisplayFunc(Display);
diff --git a/src/tests/zcomp.c b/src/tests/zcomp.c
index 33614f6e..01ced7f9 100644
--- a/src/tests/zcomp.c
+++ b/src/tests/zcomp.c
@@ -5,7 +5,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
@@ -210,7 +210,7 @@ main(int argc, char *argv[])
glutInitWindowSize(Width, Height);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH | GLUT_STENCIL);
Win = glutCreateWindow(argv[0]);
- glewInit();
+ gladLoadGL();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutSpecialFunc(SpecialKey);
diff --git a/src/tests/zdrawpix.c b/src/tests/zdrawpix.c
index 4b0d7f90..40e1844e 100644
--- a/src/tests/zdrawpix.c
+++ b/src/tests/zdrawpix.c
@@ -13,7 +13,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
#include "../util/showbuffer.c"
@@ -180,7 +180,7 @@ main(int argc, char *argv[])
glutInitWindowSize(400, 400);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
Win = glutCreateWindow(argv[0]);
- glewInit();
+ gladLoadGL();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutSpecialFunc(SpecialKey);
diff --git a/src/tests/zreaddraw.c b/src/tests/zreaddraw.c
index cf9ef88e..89b3b472 100644
--- a/src/tests/zreaddraw.c
+++ b/src/tests/zreaddraw.c
@@ -8,7 +8,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
@@ -209,7 +209,7 @@ int main(int argc, char *argv[])
glutInitWindowSize(WinWidth, WinHeight);
glutInitDisplayMode(GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE);
glutCreateWindow(argv[0]);
- glewInit();
+ gladLoadGL();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutDisplayFunc(Display);
diff --git a/src/tools/CMakeLists.txt b/src/tools/CMakeLists.txt
index dbf7c4f6..7bca2c5e 100644
--- a/src/tools/CMakeLists.txt
+++ b/src/tools/CMakeLists.txt
@@ -2,7 +2,7 @@ include_directories (
${CMAKE_SOURCE_DIR}/src/util
${OPENGL_INCLUDE_PATH}
${GLUT_INCLUDE_DIR}
- ${GLEW_INCLUDE_DIR}
+ ${GLAD_INCLUDE_DIR}
)
link_directories (
@@ -14,7 +14,7 @@ link_libraries (
${OPENGL_gl_LIBRARY}
${OPENGL_glu_LIBRARY}
${GLUT_glut_LIBRARY}
- ${GLEW_glew_LIBRARY}
+ glad
)
set (subdir tools)
diff --git a/src/tools/dds.c b/src/tools/dds.c
index a4a438c8..43ba59d7 100644
--- a/src/tools/dds.c
+++ b/src/tools/dds.c
@@ -31,7 +31,7 @@
#include <stdlib.h>
#include <string.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
@@ -370,7 +370,7 @@ main (int argc, char *argv[])
glutCreateWindow ("DDS Texture Demo");
/* Initialize OpenGL extensions */
- glewInit();
+ gladLoadGL();
atexit (cleanup);
init (argv[1]);
diff --git a/src/trivial/CMakeLists.txt b/src/trivial/CMakeLists.txt
index 04f739b1..dd06574e 100644
--- a/src/trivial/CMakeLists.txt
+++ b/src/trivial/CMakeLists.txt
@@ -2,7 +2,7 @@ include_directories (
${CMAKE_SOURCE_DIR}/src/util
${OPENGL_INCLUDE_PATH}
${GLUT_INCLUDE_DIR}
- ${GLEW_INCLUDE_DIR}
+ ${GLAD_INCLUDE_DIR}
)
link_directories (
@@ -14,7 +14,7 @@ link_libraries (
${OPENGL_gl_LIBRARY}
${OPENGL_glu_LIBRARY}
${GLUT_glut_LIBRARY}
- ${GLEW_glew_LIBRARY}
+ glad
)
set (subdir trivial)
diff --git a/src/trivial/Makefile.am b/src/trivial/Makefile.am
index 1c53ef5a..03bfe148 100644
--- a/src/trivial/Makefile.am
+++ b/src/trivial/Makefile.am
@@ -25,6 +25,7 @@
AM_CFLAGS = \
$(DEMO_CFLAGS) \
$(GLUT_CFLAGS) \
+ -I$(top_srcdir)/src/glad/include \
-I$(top_srcdir)/src/util
AM_LDFLAGS = \
$(DEMO_LIBS) \
@@ -209,3 +210,5 @@ bin_PROGRAMS = \
vp-tri-tex \
vp-unfilled
endif
+
+LDADD = ../glad/libglad.la
diff --git a/src/trivial/clear-fbo-scissor.c b/src/trivial/clear-fbo-scissor.c
index a30935c7..2d1ee4fc 100644
--- a/src/trivial/clear-fbo-scissor.c
+++ b/src/trivial/clear-fbo-scissor.c
@@ -9,7 +9,7 @@
#include <stdlib.h>
#include <math.h>
#include <string.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
@@ -223,7 +223,7 @@ main(int argc, char *argv[])
exit(1);
}
- glewInit();
+ gladLoadGL();
Init();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
diff --git a/src/trivial/clear-fbo-tex.c b/src/trivial/clear-fbo-tex.c
index de84f98f..94534bdb 100644
--- a/src/trivial/clear-fbo-tex.c
+++ b/src/trivial/clear-fbo-tex.c
@@ -5,7 +5,7 @@
#include <math.h>
#include <string.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
@@ -213,7 +213,7 @@ main( int argc, char *argv[] )
exit(1);
}
- glewInit();
+ gladLoadGL();
Init();
diff --git a/src/trivial/clear-fbo.c b/src/trivial/clear-fbo.c
index 10d830b9..20658363 100644
--- a/src/trivial/clear-fbo.c
+++ b/src/trivial/clear-fbo.c
@@ -5,7 +5,7 @@
#include <math.h>
#include <string.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
@@ -155,7 +155,7 @@ main(int argc, char *argv[])
exit(1);
}
- glewInit();
+ gladLoadGL();
Init();
glutReshapeFunc(Reshape);
diff --git a/src/trivial/draw2arrays.c b/src/trivial/draw2arrays.c
index fd75270f..2125727f 100644
--- a/src/trivial/draw2arrays.c
+++ b/src/trivial/draw2arrays.c
@@ -5,7 +5,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
GLfloat pos[][3] =
@@ -107,7 +107,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( 250, 250 );
glutInitDisplayMode( GLUT_RGB | GLUT_SINGLE | GLUT_DEPTH );
glutCreateWindow(argv[0]);
- glewInit();
+ gladLoadGL();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );
diff --git a/src/trivial/drawarrays.c b/src/trivial/drawarrays.c
index 82de4463..da4de10c 100644
--- a/src/trivial/drawarrays.c
+++ b/src/trivial/drawarrays.c
@@ -5,7 +5,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
@@ -118,7 +118,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( 250, 250 );
glutInitDisplayMode( GLUT_RGB | GLUT_SINGLE | GLUT_DEPTH );
glutCreateWindow(argv[0]);
- glewInit();
+ gladLoadGL();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );
diff --git a/src/trivial/drawelements-large.c b/src/trivial/drawelements-large.c
index 2c915241..e0be25b3 100644
--- a/src/trivial/drawelements-large.c
+++ b/src/trivial/drawelements-large.c
@@ -5,7 +5,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
#define NR_VERTS 20000
@@ -111,7 +111,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( 250, 250 );
glutInitDisplayMode( GLUT_RGB | GLUT_SINGLE | GLUT_DEPTH );
glutCreateWindow(argv[0]);
- glewInit();
+ gladLoadGL();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );
diff --git a/src/trivial/drawelements.c b/src/trivial/drawelements.c
index 328a5977..7ef9318b 100644
--- a/src/trivial/drawelements.c
+++ b/src/trivial/drawelements.c
@@ -5,7 +5,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
GLfloat verts[][4] = {
@@ -111,7 +111,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( 250, 250 );
glutInitDisplayMode( GLUT_RGB | GLUT_SINGLE | GLUT_DEPTH );
glutCreateWindow(argv[0]);
- glewInit();
+ gladLoadGL();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );
diff --git a/src/trivial/drawrange.c b/src/trivial/drawrange.c
index cfe17d81..e610c58b 100644
--- a/src/trivial/drawrange.c
+++ b/src/trivial/drawrange.c
@@ -5,7 +5,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
GLfloat verts[][4] = {
@@ -109,7 +109,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( 250, 250 );
glutInitDisplayMode( GLUT_RGB | GLUT_SINGLE | GLUT_DEPTH );
glutCreateWindow(argv[0]);
- glewInit();
+ gladLoadGL();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );
diff --git a/src/trivial/fs-tri.c b/src/trivial/fs-tri.c
index 3022b097..863b1766 100644
--- a/src/trivial/fs-tri.c
+++ b/src/trivial/fs-tri.c
@@ -5,7 +5,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
@@ -156,7 +156,7 @@ Init(void)
"}\n";
#endif
- if (!GLEW_VERSION_2_0) {
+ if (!GLAD_GL_VERSION_2_0) {
printf("This program requires OpenGL 2.x\n");
exit(1);
}
@@ -194,7 +194,7 @@ main(int argc, char *argv[])
glutInitWindowSize(200, 200);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
win = glutCreateWindow(argv[0]);
- glewInit();
+ gladLoadGL();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutSpecialFunc(SpecialKey);
diff --git a/src/trivial/line-smooth.c b/src/trivial/line-smooth.c
index f235308d..e57ebda5 100644
--- a/src/trivial/line-smooth.c
+++ b/src/trivial/line-smooth.c
@@ -26,7 +26,7 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
-#include <GL/glew.h>
+#include "gl_wrap.h"
#include "glut_wrap.h"
diff --git a/src/trivial/lineloop-elts.c b/src/trivial/lineloop-elts.c
index 2f524e05..e5919f65 100644
--- a/src/trivial/lineloop-elts.c
+++ b/src/trivial/lineloop-elts.c
@@ -5,7 +5,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
GLfloat verts[][4] = {
@@ -111,7 +111,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( 250, 250 );
glutInitDisplayMode( GLUT_RGB | GLUT_SINGLE | GLUT_DEPTH );
glutCreateWindow(argv[0]);
- glewInit();
+ gladLoadGL();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );
diff --git a/src/trivial/long-fixed-func.c b/src/trivial/long-fixed-func.c
index a1667f9f..d49c6624 100644
--- a/src/trivial/long-fixed-func.c
+++ b/src/trivial/long-fixed-func.c
@@ -5,7 +5,7 @@
-#include <GL/glew.h>
+#include <glad/glad.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
@@ -143,7 +143,7 @@ main(int argc, char **argv)
if (glutCreateWindow(*argv) == GL_FALSE) {
exit(1);
}
- glewInit();
+ gladLoadGL();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutDisplayFunc(Draw);
diff --git a/src/trivial/point-param.c b/src/trivial/point-param.c
index 38a149b4..1e41f97b 100644
--- a/src/trivial/point-param.c
+++ b/src/trivial/point-param.c
@@ -22,7 +22,7 @@
* OF THIS SOFTWARE.
*/
-#include <GL/glew.h>
+#include <glad/glad.h>
#include <math.h>
#include <stdio.h>
#include <string.h>
@@ -147,7 +147,7 @@ int main(int argc, char **argv)
exit(1);
}
- glewInit();
+ gladLoadGL();
Init();
diff --git a/src/trivial/point-sprite.c b/src/trivial/point-sprite.c
index 83e6c3a5..e98b17f1 100644
--- a/src/trivial/point-sprite.c
+++ b/src/trivial/point-sprite.c
@@ -25,7 +25,7 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
-#include <GL/glew.h>
+#include "gl_wrap.h"
#include "glut_wrap.h"
diff --git a/src/trivial/quad-tex-2d.c b/src/trivial/quad-tex-2d.c
index 510d550f..484eef32 100644
--- a/src/trivial/quad-tex-2d.c
+++ b/src/trivial/quad-tex-2d.c
@@ -25,7 +25,7 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
-#include <GL/glew.h>
+#include "gl_wrap.h"
#include "glut_wrap.h"
static GLenum Target = GL_TEXTURE_2D;
diff --git a/src/trivial/quad-tex-3d.c b/src/trivial/quad-tex-3d.c
index 40047e1a..3421a36a 100644
--- a/src/trivial/quad-tex-3d.c
+++ b/src/trivial/quad-tex-3d.c
@@ -25,7 +25,7 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
@@ -169,7 +169,7 @@ int main(int argc, char **argv)
exit(1);
}
- glewInit();
+ gladLoadGL();
Init();
diff --git a/src/trivial/quad-tex-alpha.c b/src/trivial/quad-tex-alpha.c
index 8c0cbc9d..c76afa22 100644
--- a/src/trivial/quad-tex-alpha.c
+++ b/src/trivial/quad-tex-alpha.c
@@ -25,7 +25,7 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
-#include <GL/glew.h>
+#include "gl_wrap.h"
#include "glut_wrap.h"
diff --git a/src/trivial/quad-tex-pbo.c b/src/trivial/quad-tex-pbo.c
index 356f340f..45a0301c 100644
--- a/src/trivial/quad-tex-pbo.c
+++ b/src/trivial/quad-tex-pbo.c
@@ -22,7 +22,7 @@
* OF THIS SOFTWARE.
*/
-#include <GL/glew.h>
+#include <glad/glad.h>
#include <stdio.h>
#include <string.h>
@@ -172,7 +172,7 @@ int main(int argc, char **argv)
exit(1);
}
- glewInit();
+ gladLoadGL();
Init();
diff --git a/src/trivial/quad-tex-sub.c b/src/trivial/quad-tex-sub.c
index 604821b6..6c8313a7 100644
--- a/src/trivial/quad-tex-sub.c
+++ b/src/trivial/quad-tex-sub.c
@@ -25,7 +25,7 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
@@ -192,7 +192,7 @@ int main(int argc, char **argv)
exit(1);
}
- glewInit();
+ gladLoadGL();
Init();
diff --git a/src/trivial/readpixels.c b/src/trivial/readpixels.c
index ccce4ed8..fb88570c 100644
--- a/src/trivial/readpixels.c
+++ b/src/trivial/readpixels.c
@@ -3,7 +3,7 @@
*/
-#include <GL/glew.h>
+#include <glad/glad.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
@@ -92,7 +92,7 @@ int main(int argc, char **argv)
if (argc > 1)
Zoom = atof(argv[1]);
- glewInit();
+ gladLoadGL();
Init();
diff --git a/src/trivial/sub-tex.c b/src/trivial/sub-tex.c
index 0a114862..6277cfc7 100644
--- a/src/trivial/sub-tex.c
+++ b/src/trivial/sub-tex.c
@@ -6,7 +6,7 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
@@ -127,7 +127,7 @@ int main(int argc, char **argv)
if (!Win) {
exit(1);
}
- glewInit();
+ gladLoadGL();
Init();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
diff --git a/src/trivial/tex-quads.c b/src/trivial/tex-quads.c
index cb8fba46..d6158812 100644
--- a/src/trivial/tex-quads.c
+++ b/src/trivial/tex-quads.c
@@ -5,7 +5,7 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
#define NUM_TEX 10
@@ -133,7 +133,7 @@ int main(int argc, char **argv)
if (!Win) {
exit(1);
}
- glewInit();
+ gladLoadGL();
Init();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
diff --git a/src/trivial/tri-2101010-dlist.c b/src/trivial/tri-2101010-dlist.c
index a4f393e1..ccc6b6ec 100644
--- a/src/trivial/tri-2101010-dlist.c
+++ b/src/trivial/tri-2101010-dlist.c
@@ -28,7 +28,7 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
GLenum doubleBuffer = 1;
@@ -163,7 +163,7 @@ int main(int argc, char **argv)
exit(1);
}
- glewInit();
+ gladLoadGL();
Init();
glutReshapeFunc(Reshape);
diff --git a/src/trivial/tri-2101010.c b/src/trivial/tri-2101010.c
index 1945b29f..d166f519 100644
--- a/src/trivial/tri-2101010.c
+++ b/src/trivial/tri-2101010.c
@@ -28,7 +28,7 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
GLenum doubleBuffer = 1;
@@ -152,7 +152,7 @@ int main(int argc, char **argv)
exit(1);
}
- glewInit();
+ gladLoadGL();
Init();
glutReshapeFunc(Reshape);
diff --git a/src/trivial/tri-alpha-tex.c b/src/trivial/tri-alpha-tex.c
index 6fac1e47..112b89ef 100644
--- a/src/trivial/tri-alpha-tex.c
+++ b/src/trivial/tri-alpha-tex.c
@@ -25,7 +25,7 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
-#include <GL/glew.h>
+#include "gl_wrap.h"
#include "glut_wrap.h"
diff --git a/src/trivial/tri-array-interleaved.c b/src/trivial/tri-array-interleaved.c
index 25fbb5e0..b0272063 100644
--- a/src/trivial/tri-array-interleaved.c
+++ b/src/trivial/tri-array-interleaved.c
@@ -5,7 +5,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
struct {
@@ -110,7 +110,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( 250, 250 );
glutInitDisplayMode( GLUT_RGB | GLUT_SINGLE | GLUT_DEPTH );
glutCreateWindow(argv[0]);
- glewInit();
+ gladLoadGL();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );
diff --git a/src/trivial/tri-blend-color.c b/src/trivial/tri-blend-color.c
index e052d7fa..92d46018 100644
--- a/src/trivial/tri-blend-color.c
+++ b/src/trivial/tri-blend-color.c
@@ -25,7 +25,7 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
@@ -133,7 +133,7 @@ int main(int argc, char **argv)
exit(1);
}
- glewInit();
+ gladLoadGL();
Init();
diff --git a/src/trivial/tri-blend-max.c b/src/trivial/tri-blend-max.c
index bf05c620..57489659 100644
--- a/src/trivial/tri-blend-max.c
+++ b/src/trivial/tri-blend-max.c
@@ -42,7 +42,7 @@
* Use the 't' key to toggle the order of drawing polygons.
*/
#include <stdlib.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
static int leftFirst = GL_TRUE;
@@ -137,7 +137,7 @@ int main(int argc, char** argv)
glutInitDisplayMode (GLUT_SINGLE | GLUT_RGB);
glutInitWindowSize (200, 200);
glutCreateWindow (argv[0]);
- glewInit();
+ gladLoadGL();
init();
glutReshapeFunc (reshape);
glutKeyboardFunc (keyboard);
diff --git a/src/trivial/tri-blend-min.c b/src/trivial/tri-blend-min.c
index 7166c54a..cece08d3 100644
--- a/src/trivial/tri-blend-min.c
+++ b/src/trivial/tri-blend-min.c
@@ -42,7 +42,7 @@
* Use the 't' key to toggle the order of drawing polygons.
*/
#include <stdlib.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
static int leftFirst = GL_TRUE;
@@ -137,7 +137,7 @@ int main(int argc, char** argv)
glutInitDisplayMode (GLUT_SINGLE | GLUT_RGB);
glutInitWindowSize (200, 200);
glutCreateWindow (argv[0]);
- glewInit();
+ gladLoadGL();
init();
glutReshapeFunc (reshape);
glutKeyboardFunc (keyboard);
diff --git a/src/trivial/tri-blend-revsub.c b/src/trivial/tri-blend-revsub.c
index 67237d4a..5018a125 100644
--- a/src/trivial/tri-blend-revsub.c
+++ b/src/trivial/tri-blend-revsub.c
@@ -42,7 +42,7 @@
* Use the 't' key to toggle the order of drawing polygons.
*/
#include <stdlib.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
static int leftFirst = GL_TRUE;
@@ -137,7 +137,7 @@ int main(int argc, char** argv)
glutInitDisplayMode (GLUT_SINGLE | GLUT_RGB);
glutInitWindowSize (200, 200);
glutCreateWindow (argv[0]);
- glewInit();
+ gladLoadGL();
init();
glutReshapeFunc (reshape);
glutKeyboardFunc (keyboard);
diff --git a/src/trivial/tri-blend-sub.c b/src/trivial/tri-blend-sub.c
index 4f177a93..6870112f 100644
--- a/src/trivial/tri-blend-sub.c
+++ b/src/trivial/tri-blend-sub.c
@@ -42,7 +42,7 @@
* Use the 't' key to toggle the order of drawing polygons.
*/
#include <stdlib.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
static int leftFirst = GL_TRUE;
@@ -137,7 +137,7 @@ int main(int argc, char** argv)
glutInitDisplayMode (GLUT_SINGLE | GLUT_RGB);
glutInitWindowSize (200, 200);
glutCreateWindow (argv[0]);
- glewInit();
+ gladLoadGL();
init();
glutReshapeFunc (reshape);
glutKeyboardFunc (keyboard);
diff --git a/src/trivial/tri-edgeflag-pv.c b/src/trivial/tri-edgeflag-pv.c
index 386c3c94..482becaa 100644
--- a/src/trivial/tri-edgeflag-pv.c
+++ b/src/trivial/tri-edgeflag-pv.c
@@ -25,7 +25,7 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
static GLenum doubleBuffer;
@@ -139,7 +139,7 @@ int main(int argc, char **argv)
exit(1);
}
- glewInit();
+ gladLoadGL();
Init();
glutReshapeFunc(Reshape);
diff --git a/src/trivial/tri-fbo-tex-mip.c b/src/trivial/tri-fbo-tex-mip.c
index a8d21774..293974b9 100644
--- a/src/trivial/tri-fbo-tex-mip.c
+++ b/src/trivial/tri-fbo-tex-mip.c
@@ -1,7 +1,7 @@
/* Framebuffer object test */
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
#include <assert.h>
#include <stdio.h>
@@ -247,7 +247,7 @@ main(int argc, char *argv[])
glutInitWindowSize(Width, Height);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE);
Win = glutCreateWindow(argv[0]);
- glewInit();
+ gladLoadGL();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutDisplayFunc(Display);
diff --git a/src/trivial/tri-fbo-tex.c b/src/trivial/tri-fbo-tex.c
index 8810f12e..327fe38b 100644
--- a/src/trivial/tri-fbo-tex.c
+++ b/src/trivial/tri-fbo-tex.c
@@ -1,7 +1,7 @@
/* Framebuffer object test */
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
#include <assert.h>
#include <stdio.h>
@@ -243,7 +243,7 @@ main(int argc, char *argv[])
glutInitWindowSize(Width, Height);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE);
Win = glutCreateWindow(argv[0]);
- glewInit();
+ gladLoadGL();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutDisplayFunc(Display);
diff --git a/src/trivial/tri-fbo.c b/src/trivial/tri-fbo.c
index d5800b29..76985a96 100644
--- a/src/trivial/tri-fbo.c
+++ b/src/trivial/tri-fbo.c
@@ -5,7 +5,7 @@
#include <math.h>
#include <string.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
@@ -191,7 +191,7 @@ main( int argc, char *argv[] )
exit(1);
}
- glewInit();
+ gladLoadGL();
Init();
diff --git a/src/trivial/tri-fp-const-imm.c b/src/trivial/tri-fp-const-imm.c
index a9756f0a..627d67da 100644
--- a/src/trivial/tri-fp-const-imm.c
+++ b/src/trivial/tri-fp-const-imm.c
@@ -25,7 +25,7 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
@@ -160,7 +160,7 @@ int main(int argc, char **argv)
exit(1);
}
- glewInit();
+ gladLoadGL();
Init();
diff --git a/src/trivial/tri-fp.c b/src/trivial/tri-fp.c
index 3cca7797..b4fedd35 100644
--- a/src/trivial/tri-fp.c
+++ b/src/trivial/tri-fp.c
@@ -25,7 +25,7 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
@@ -158,7 +158,7 @@ int main(int argc, char **argv)
exit(1);
}
- glewInit();
+ gladLoadGL();
Init();
diff --git a/src/trivial/tri-multitex-vbo.c b/src/trivial/tri-multitex-vbo.c
index 6765ed21..fbd8d743 100644
--- a/src/trivial/tri-multitex-vbo.c
+++ b/src/trivial/tri-multitex-vbo.c
@@ -25,7 +25,7 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
#define NR_VERTS 4
@@ -250,7 +250,7 @@ int main(int argc, char **argv)
exit(1);
}
- glewInit();
+ gladLoadGL();
Init();
glutReshapeFunc(Reshape);
diff --git a/src/trivial/tri-query.c b/src/trivial/tri-query.c
index 640eb6d1..3c6172b3 100644
--- a/src/trivial/tri-query.c
+++ b/src/trivial/tri-query.c
@@ -25,7 +25,7 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
@@ -154,7 +154,7 @@ int main(int argc, char **argv)
exit(1);
}
- glewInit();
+ gladLoadGL();
Init();
diff --git a/src/trivial/tri-tex-1d.c b/src/trivial/tri-tex-1d.c
index c83e7c03..0fc1d82f 100644
--- a/src/trivial/tri-tex-1d.c
+++ b/src/trivial/tri-tex-1d.c
@@ -25,7 +25,7 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
-#include <GL/glew.h>
+#include "gl_wrap.h"
#include "glut_wrap.h"
static GLenum Target = GL_TEXTURE_1D;
diff --git a/src/trivial/tri-tex-3d.c b/src/trivial/tri-tex-3d.c
index 364d0ca9..5982ebb5 100644
--- a/src/trivial/tri-tex-3d.c
+++ b/src/trivial/tri-tex-3d.c
@@ -25,7 +25,7 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
@@ -162,7 +162,7 @@ int main(int argc, char **argv)
exit(1);
}
- glewInit();
+ gladLoadGL();
Init();
diff --git a/src/trivial/tri-tex-stipple.c b/src/trivial/tri-tex-stipple.c
index 8f1ac901..c78733c6 100644
--- a/src/trivial/tri-tex-stipple.c
+++ b/src/trivial/tri-tex-stipple.c
@@ -3,7 +3,7 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
-#include <GL/glew.h>
+#include "gl_wrap.h"
#include "glut_wrap.h"
diff --git a/src/trivial/tri-tex.c b/src/trivial/tri-tex.c
index 230df1fd..1af88a18 100644
--- a/src/trivial/tri-tex.c
+++ b/src/trivial/tri-tex.c
@@ -25,7 +25,7 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
-#include <GL/glew.h>
+#include "gl_wrap.h"
#include "glut_wrap.h"
diff --git a/src/trivial/vbo-drawarrays-2101010.c b/src/trivial/vbo-drawarrays-2101010.c
index e200b561..e4cf50d9 100644
--- a/src/trivial/vbo-drawarrays-2101010.c
+++ b/src/trivial/vbo-drawarrays-2101010.c
@@ -8,7 +8,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
GLboolean bgra = GL_FALSE;
@@ -178,12 +178,12 @@ int main( int argc, char *argv[] )
glutInitWindowSize( 250, 250 );
glutInitDisplayMode( GLUT_RGB | GLUT_SINGLE | GLUT_DEPTH );
glutCreateWindow(argv[0]);
- glewInit();
+ gladLoadGL();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );
- glewInit();
+ gladLoadGL();
Init();
glutMainLoop();
return 0;
diff --git a/src/trivial/vbo-drawarrays.c b/src/trivial/vbo-drawarrays.c
index 815cc7ad..2811c22b 100644
--- a/src/trivial/vbo-drawarrays.c
+++ b/src/trivial/vbo-drawarrays.c
@@ -5,7 +5,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
@@ -124,7 +124,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( 250, 250 );
glutInitDisplayMode( GLUT_RGB | GLUT_SINGLE | GLUT_DEPTH );
glutCreateWindow(argv[0]);
- glewInit();
+ gladLoadGL();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );
diff --git a/src/trivial/vbo-drawelements.c b/src/trivial/vbo-drawelements.c
index d68d491c..cb387aea 100644
--- a/src/trivial/vbo-drawelements.c
+++ b/src/trivial/vbo-drawelements.c
@@ -5,7 +5,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
struct {
@@ -128,7 +128,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( 250, 250 );
glutInitDisplayMode( GLUT_RGB | GLUT_SINGLE | GLUT_DEPTH );
glutCreateWindow(argv[0]);
- glewInit();
+ gladLoadGL();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );
diff --git a/src/trivial/vbo-drawrange.c b/src/trivial/vbo-drawrange.c
index d7ea4c6c..90260a4c 100644
--- a/src/trivial/vbo-drawrange.c
+++ b/src/trivial/vbo-drawrange.c
@@ -5,7 +5,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
#define ELTOBJ 0
@@ -136,7 +136,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( 250, 250 );
glutInitDisplayMode( GLUT_RGB | GLUT_SINGLE | GLUT_DEPTH );
glutCreateWindow(argv[0]);
- glewInit();
+ gladLoadGL();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );
diff --git a/src/trivial/vbo-noninterleaved.c b/src/trivial/vbo-noninterleaved.c
index 0ef05295..5a67e71a 100644
--- a/src/trivial/vbo-noninterleaved.c
+++ b/src/trivial/vbo-noninterleaved.c
@@ -5,7 +5,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
@@ -129,7 +129,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( 250, 250 );
glutInitDisplayMode( GLUT_RGB | GLUT_SINGLE | GLUT_DEPTH );
glutCreateWindow(argv[0]);
- glewInit();
+ gladLoadGL();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );
diff --git a/src/trivial/vbo-tri.c b/src/trivial/vbo-tri.c
index 6fd7553b..70bd35ed 100644
--- a/src/trivial/vbo-tri.c
+++ b/src/trivial/vbo-tri.c
@@ -7,7 +7,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
@@ -121,7 +121,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( 250, 250 );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
glutCreateWindow(argv[0]);
- glewInit();
+ gladLoadGL();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );
diff --git a/src/trivial/vp-array-hf.c b/src/trivial/vp-array-hf.c
index d500b98f..7eefb96a 100644
--- a/src/trivial/vp-array-hf.c
+++ b/src/trivial/vp-array-hf.c
@@ -5,7 +5,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
typedef union { GLfloat f; GLint i; } fi_type;
@@ -205,7 +205,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( 250, 250 );
glutInitDisplayMode( GLUT_RGB | GLUT_SINGLE | GLUT_DEPTH );
glutCreateWindow(argv[0]);
- glewInit();
+ gladLoadGL();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );
diff --git a/src/trivial/vp-array-int.c b/src/trivial/vp-array-int.c
index f528e7ab..d84574ab 100644
--- a/src/trivial/vp-array-int.c
+++ b/src/trivial/vp-array-int.c
@@ -5,7 +5,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
GLint verts[][4] = {
@@ -108,7 +108,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( 250, 250 );
glutInitDisplayMode( GLUT_RGB | GLUT_SINGLE | GLUT_DEPTH );
glutCreateWindow(argv[0]);
- glewInit();
+ gladLoadGL();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );
diff --git a/src/trivial/vp-array.c b/src/trivial/vp-array.c
index b9e3b84b..bb50d39d 100644
--- a/src/trivial/vp-array.c
+++ b/src/trivial/vp-array.c
@@ -5,7 +5,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
GLfloat verts[][4] = {
@@ -108,7 +108,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( 250, 250 );
glutInitDisplayMode( GLUT_RGB | GLUT_SINGLE | GLUT_DEPTH );
glutCreateWindow(argv[0]);
- glewInit();
+ gladLoadGL();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );
diff --git a/src/trivial/vp-clip.c b/src/trivial/vp-clip.c
index cf71dd35..6151d1db 100644
--- a/src/trivial/vp-clip.c
+++ b/src/trivial/vp-clip.c
@@ -5,7 +5,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
static void Init( void )
@@ -93,7 +93,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( 250, 250 );
glutInitDisplayMode( GLUT_RGB | GLUT_SINGLE | GLUT_DEPTH );
glutCreateWindow(argv[0]);
- glewInit();
+ gladLoadGL();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );
diff --git a/src/trivial/vp-line-clip.c b/src/trivial/vp-line-clip.c
index cfa0987c..5220663e 100644
--- a/src/trivial/vp-line-clip.c
+++ b/src/trivial/vp-line-clip.c
@@ -5,7 +5,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
static void Init( void )
@@ -107,7 +107,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( 250, 250 );
glutInitDisplayMode( GLUT_RGB | GLUT_SINGLE | GLUT_DEPTH );
glutCreateWindow(argv[0]);
- glewInit();
+ gladLoadGL();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );
diff --git a/src/trivial/vp-tri-cb-pos.c b/src/trivial/vp-tri-cb-pos.c
index b72c8cfc..49fe7a85 100644
--- a/src/trivial/vp-tri-cb-pos.c
+++ b/src/trivial/vp-tri-cb-pos.c
@@ -5,7 +5,7 @@
#include <string.h>
#include <stdlib.h>
#include <math.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
@@ -146,7 +146,7 @@ int main(int argc, char **argv)
exit(1);
}
- glewInit();
+ gladLoadGL();
Init();
diff --git a/src/trivial/vp-tri-cb-tex.c b/src/trivial/vp-tri-cb-tex.c
index 7745e703..08217eae 100644
--- a/src/trivial/vp-tri-cb-tex.c
+++ b/src/trivial/vp-tri-cb-tex.c
@@ -5,7 +5,7 @@
#include <string.h>
#include <stdlib.h>
#include <math.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
@@ -179,7 +179,7 @@ int main(int argc, char **argv)
exit(1);
}
- glewInit();
+ gladLoadGL();
Init();
diff --git a/src/trivial/vp-tri-cb.c b/src/trivial/vp-tri-cb.c
index caf09a87..19e1d2a2 100644
--- a/src/trivial/vp-tri-cb.c
+++ b/src/trivial/vp-tri-cb.c
@@ -5,7 +5,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
static void Init( void )
@@ -98,7 +98,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( 250, 250 );
glutInitDisplayMode( GLUT_DEPTH | GLUT_RGB | GLUT_SINGLE );
glutCreateWindow(argv[0]);
- glewInit();
+ gladLoadGL();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );
diff --git a/src/trivial/vp-tri-imm.c b/src/trivial/vp-tri-imm.c
index 97b1c51b..cb93c9c6 100644
--- a/src/trivial/vp-tri-imm.c
+++ b/src/trivial/vp-tri-imm.c
@@ -5,7 +5,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
static void Init( void )
@@ -92,7 +92,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( 250, 250 );
glutInitDisplayMode( GLUT_DEPTH | GLUT_RGB | GLUT_SINGLE );
glutCreateWindow(argv[0]);
- glewInit();
+ gladLoadGL();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );
diff --git a/src/trivial/vp-tri-invariant.c b/src/trivial/vp-tri-invariant.c
index 09241066..39d1bc01 100644
--- a/src/trivial/vp-tri-invariant.c
+++ b/src/trivial/vp-tri-invariant.c
@@ -4,7 +4,7 @@
#include <string.h>
#include <stdlib.h>
#include <math.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
@@ -136,7 +136,7 @@ int main(int argc, char **argv)
exit(1);
}
- glewInit();
+ gladLoadGL();
Init();
glutReshapeFunc(Reshape);
diff --git a/src/trivial/vp-tri-swap.c b/src/trivial/vp-tri-swap.c
index a59506f1..82dcf3ff 100644
--- a/src/trivial/vp-tri-swap.c
+++ b/src/trivial/vp-tri-swap.c
@@ -5,7 +5,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
static void Init( void )
@@ -94,7 +94,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( 250, 250 );
glutInitDisplayMode( GLUT_DEPTH | GLUT_RGB | GLUT_SINGLE );
glutCreateWindow(argv[0]);
- glewInit();
+ gladLoadGL();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );
diff --git a/src/trivial/vp-tri-tex.c b/src/trivial/vp-tri-tex.c
index c2c7dc8b..7b4150cd 100644
--- a/src/trivial/vp-tri-tex.c
+++ b/src/trivial/vp-tri-tex.c
@@ -5,7 +5,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
static void Init( void )
@@ -128,7 +128,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( 250, 250 );
glutInitDisplayMode( GLUT_DEPTH | GLUT_RGB | GLUT_SINGLE );
glutCreateWindow(argv[0]);
- glewInit();
+ gladLoadGL();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );
diff --git a/src/trivial/vp-tri.c b/src/trivial/vp-tri.c
index b276497e..9ec66db0 100644
--- a/src/trivial/vp-tri.c
+++ b/src/trivial/vp-tri.c
@@ -5,7 +5,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
static void Init( void )
@@ -95,7 +95,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( 250, 250 );
glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
glutCreateWindow(argv[0]);
- glewInit();
+ gladLoadGL();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );
diff --git a/src/trivial/vp-unfilled.c b/src/trivial/vp-unfilled.c
index 79a882a7..669e282f 100644
--- a/src/trivial/vp-unfilled.c
+++ b/src/trivial/vp-unfilled.c
@@ -5,7 +5,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
static void Init( void )
@@ -95,7 +95,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( 250, 250 );
glutInitDisplayMode( GLUT_RGB | GLUT_SINGLE | GLUT_DEPTH );
glutCreateWindow(argv[0]);
- glewInit();
+ gladLoadGL();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );
diff --git a/src/util/CMakeLists.txt b/src/util/CMakeLists.txt
index 08290343..11ad9f70 100644
--- a/src/util/CMakeLists.txt
+++ b/src/util/CMakeLists.txt
@@ -2,7 +2,7 @@ include_directories(
${CMAKE_SOURCE_DIR}/src/util
${OPENGL_INCLUDE_PATH}
${GLUT_INCLUDE_DIR}
- ${GLEW_INCLUDE_DIR}
+ ${GLAD_INCLUDE_DIR}
)
add_library (util
diff --git a/src/util/Makefile.am b/src/util/Makefile.am
index 759a293a..e89e49c5 100644
--- a/src/util/Makefile.am
+++ b/src/util/Makefile.am
@@ -23,7 +23,8 @@
# Eric Anholt <eric@anholt.net>
AM_CFLAGS = \
- $(DEMO_CFLAGS)
+ $(DEMO_CFLAGS) \
+ -I$(top_srcdir)/src/glad/include
AM_LDFLAGS = \
$(DEMO_LIBS)
diff --git a/src/util/gl_wrap.h b/src/util/gl_wrap.h
index e5ba412b..d73c7817 100644
--- a/src/util/gl_wrap.h
+++ b/src/util/gl_wrap.h
@@ -13,4 +13,92 @@
#define GLAPIENTRY
#endif
+
+/*
+ * A few defines used by old apps, part of Linux GL headers, but missing from
+ * Windows. For new apps, it's better to just use Glad.
+ */
+
+#ifndef GL_RESCALE_NORMAL_EXT
+#define GL_RESCALE_NORMAL_EXT 0x803A
+#endif
+
+#ifndef GL_BGR
+#define GL_BGR 0x80E0
+#endif
+
+#ifndef GL_BGRA
+#define GL_BGRA 0x80E1
+#endif
+
+#ifndef GL_TEXTURE_WRAP_R
+#define GL_TEXTURE_WRAP_R 0x8072
+#endif
+
+#ifndef GL_ARB_multisample
+#define GL_MULTISAMPLE_ARB 0x809D
+#define GL_SAMPLE_BUFFERS_ARB 0x80A8
+#define GL_SAMPLES_ARB 0x80A9
+#endif
+
+#ifndef GL_GENERATE_MIPMAP_SGIS
+#define GL_GENERATE_MIPMAP_SGIS 0x8191
+#endif
+
+#ifndef GL_LIGHT_MODEL_COLOR_CONTROL
+#define GL_LIGHT_MODEL_COLOR_CONTROL 0x81F8
+#endif
+
+#ifndef GL_UNSIGNED_SHORT_5_6_5
+#define GL_UNSIGNED_SHORT_5_6_5 0x8363
+#endif
+#ifndef GL_UNSIGNED_SHORT_5_6_5_REV
+#define GL_UNSIGNED_SHORT_5_6_5_REV 0x8364
+#endif
+
+#ifndef GL_SEPARATE_SPECULAR_COLOR
+#define GL_SEPARATE_SPECULAR_COLOR 0x81FA
+#endif
+
+#ifndef GL_ALIASED_LINE_WIDTH_RANGE
+#define GL_ALIASED_LINE_WIDTH_RANGE 0x846E
+#endif
+
+#ifndef GL_MAX_TEXTURE_LOD_BIAS_EXT
+#define GL_MAX_TEXTURE_LOD_BIAS_EXT 0x84FD
+#endif
+
+#ifndef GL_TEXTURE_FILTER_CONTROL_EXT
+#define GL_TEXTURE_FILTER_CONTROL_EXT 0x8500
+#endif
+
+#ifndef GL_TEXTURE_LOD_BIAS_EXT
+#define GL_TEXTURE_LOD_BIAS_EXT 0x8501
+#endif
+
+#ifndef GL_NORMAL_MAP_EXT
+#define GL_NORMAL_MAP_EXT 0x8511
+#endif
+
+#ifndef GL_EXT_texture_cube_map
+#define GL_TEXTURE_CUBE_MAP_EXT 0x8513
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_EXT 0x8516
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_EXT 0x8518
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_EXT 0x851A
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_EXT 0x8515
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_EXT 0x8517
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_EXT 0x8519
+#endif
+
+#ifndef GL_COORD_REPLACE_ARB
+#define GL_COORD_REPLACE_ARB 0x8862
+#endif
+
+#ifndef GL_POINT_SPRITE
+#define GL_POINT_SPRITE 0x8861
+#endif
+#ifndef GL_POINT_SPRITE_ARB
+#define GL_POINT_SPRITE_ARB 0x8861
+#endif
+
#endif /* ! GL_WRAP_H */
diff --git a/src/util/shaderutil.c b/src/util/shaderutil.c
index a9385026..dc7a06d0 100644
--- a/src/util/shaderutil.c
+++ b/src/util/shaderutil.c
@@ -10,7 +10,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
#include "shaderutil.h"
@@ -51,7 +51,7 @@ fake_ValidateProgram(GLuint prog)
GLboolean
ShadersSupported(void)
{
- if (GLEW_VERSION_2_0) {
+ if (GLAD_GL_VERSION_2_0) {
CreateShader = glCreateShader;
DeleteShader = glDeleteShader;
ShaderSource = glShaderSource;
@@ -64,7 +64,7 @@ ShadersSupported(void)
UseProgram = glUseProgram;
GetProgramiv = glGetProgramiv;
GetProgramInfoLog = glGetProgramInfoLog;
- ValidateProgramARB = (GLEW_ARB_shader_objects)
+ ValidateProgramARB = (GLAD_GL_ARB_shader_objects)
? glValidateProgramARB : fake_ValidateProgram;
Uniform1i = glUniform1i;
Uniform1fv = glUniform1fv;
@@ -76,8 +76,8 @@ ShadersSupported(void)
GetAttribLocation = glGetAttribLocation;
return GL_TRUE;
}
- else if (GLEW_ARB_vertex_shader && GLEW_ARB_fragment_shader
- && GLEW_ARB_shader_objects) {
+ else if (GLAD_GL_ARB_vertex_shader && GLAD_GL_ARB_fragment_shader
+ && GLAD_GL_ARB_shader_objects) {
fprintf(stderr, "Warning: Trying ARB GLSL instead of OpenGL 2.x. This may not work.\n");
CreateShader = glCreateShaderObjectARB;
DeleteShader = glDeleteObjectARB;
diff --git a/src/vp/CMakeLists.txt b/src/vp/CMakeLists.txt
index 5bc49119..553a77a3 100644
--- a/src/vp/CMakeLists.txt
+++ b/src/vp/CMakeLists.txt
@@ -2,7 +2,7 @@ include_directories (
${CMAKE_SOURCE_DIR}/src/util
${OPENGL_INCLUDE_PATH}
${GLUT_INCLUDE_DIR}
- ${GLEW_INCLUDE_DIR}
+ ${GLAD_INCLUDE_DIR}
)
link_directories (
@@ -14,7 +14,7 @@ link_libraries (
${OPENGL_gl_LIBRARY}
${OPENGL_glu_LIBRARY}
${GLUT_glut_LIBRARY}
- ${GLEW_glew_LIBRARY}
+ glad
)
set (subdir vp)
diff --git a/src/vp/Makefile.am b/src/vp/Makefile.am
index 67641d2c..04a96161 100644
--- a/src/vp/Makefile.am
+++ b/src/vp/Makefile.am
@@ -28,6 +28,7 @@
AM_CFLAGS = \
$(DEMO_CFLAGS) \
$(GLUT_CFLAGS) \
+ -I$(top_srcdir)/src/glad/include \
-I$(top_srcdir)/src/util
AM_LDFLAGS = \
$(DEMO_LIBS) \
@@ -38,6 +39,8 @@ noinst_PROGRAMS = \
vp-tris
endif
+LDADD = ../glad/libglad.la
+
EXTRA_DIST = \
abs.txt \
addimm.txt \
diff --git a/src/vp/vp-tris.c b/src/vp/vp-tris.c
index 99e1e57c..687e219c 100644
--- a/src/vp/vp-tris.c
+++ b/src/vp/vp-tris.c
@@ -11,7 +11,7 @@
#include <signal.h>
#endif
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
static const char *filename = NULL;
@@ -317,7 +317,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( 250, 250 );
glutInitDisplayMode( GLUT_RGB | GLUT_SINGLE | GLUT_DEPTH );
glutCreateWindow(argv[argc-1]);
- glewInit();
+ gladLoadGL();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );
diff --git a/src/vpglsl/CMakeLists.txt b/src/vpglsl/CMakeLists.txt
index 36ee9862..f3ee3779 100644
--- a/src/vpglsl/CMakeLists.txt
+++ b/src/vpglsl/CMakeLists.txt
@@ -2,7 +2,7 @@ include_directories (
${CMAKE_SOURCE_DIR}/src/util
${OPENGL_INCLUDE_PATH}
${GLUT_INCLUDE_DIR}
- ${GLEW_INCLUDE_DIR}
+ ${GLAD_INCLUDE_DIR}
)
link_directories (
@@ -14,7 +14,7 @@ link_libraries (
${OPENGL_gl_LIBRARY}
${OPENGL_glu_LIBRARY}
${GLUT_glut_LIBRARY}
- ${GLEW_glew_LIBRARY}
+ glad
)
set (subdir vpglsl)
diff --git a/src/vpglsl/Makefile.am b/src/vpglsl/Makefile.am
index 4a85ed40..9356afe0 100644
--- a/src/vpglsl/Makefile.am
+++ b/src/vpglsl/Makefile.am
@@ -28,6 +28,7 @@
AM_CFLAGS = \
$(DEMO_CFLAGS) \
$(GLUT_CFLAGS) \
+ -I$(top_srcdir)/src/glad/include \
-I$(top_srcdir)/src/util
AM_LDFLAGS = \
$(DEMO_LIBS) \
@@ -53,3 +54,5 @@ EXTRA_DIST = \
varfor1f.glsl \
varfor2f.glsl \
varfor4f.glsl
+
+LDADD = ../glad/libglad.la
diff --git a/src/vpglsl/vp-tris.c b/src/vpglsl/vp-tris.c
index a51935e4..7f6498c4 100644
--- a/src/vpglsl/vp-tris.c
+++ b/src/vpglsl/vp-tris.c
@@ -5,7 +5,7 @@
#include <stdlib.h>
#include <math.h>
-#include <GL/glew.h>
+#include <glad/glad.h>
#include "glut_wrap.h"
static const char *filename = NULL;
@@ -352,7 +352,7 @@ int main( int argc, char *argv[] )
glutInitWindowSize( 250, 250 );
glutInitDisplayMode( GLUT_RGB | GLUT_SINGLE | GLUT_DEPTH );
glutCreateWindow(argv[argc-1]);
- glewInit();
+ gladLoadGL();
glutReshapeFunc( Reshape );
glutKeyboardFunc( Key );
glutDisplayFunc( Display );
diff --git a/src/wgl/CMakeLists.txt b/src/wgl/CMakeLists.txt
index 2b94711e..add04bad 100644
--- a/src/wgl/CMakeLists.txt
+++ b/src/wgl/CMakeLists.txt
@@ -1,12 +1,12 @@
include_directories (
${OPENGL_INCLUDE_PATH}
- ${GLEW_INCLUDE_DIR}
+ ${GLAD_INCLUDE_DIR}
${CMAKE_SOURCE_DIR}/src/xdemos
)
link_libraries (
${OPENGL_gl_LIBRARY}
- ${GLEW_glew_LIBRARY}
+ glad
)
add_executable (wglthreads wglthreads.c)
diff --git a/src/wgl/wglcontext.c b/src/wgl/wglcontext.c
index b116270e..afabf5af 100644
--- a/src/wgl/wglcontext.c
+++ b/src/wgl/wglcontext.c
@@ -22,21 +22,8 @@
#include <windows.h>
#include <stdio.h>
#include <stdlib.h>
-#include <GL/glew.h>
-#include <GL/wglew.h>
-#include <GL/glext.h>
-
-#ifndef GL_CONTEXT_FLAG_DEBUG_BIT
-#define GL_CONTEXT_FLAG_DEBUG_BIT 0x00000002
-#endif
-#ifndef GL_CONTEXT_FLAG_ROBUST_ACCESS_BIT
-#define GL_CONTEXT_FLAG_ROBUST_ACCESS_BIT 0x00000004
-#endif
-
-#ifndef GL_CONTEXT_FLAG_NO_ERROR_BIT_KHR
-#define GL_CONTEXT_FLAG_NO_ERROR_BIT_KHR 0x00000008
-#endif
-
+#include <glad/glad.h>
+#include <glad/glad_wgl.h>
static LRESULT CALLBACK
WndProc(HWND hWnd,
@@ -168,7 +155,6 @@ create_context(int majorVersion, int minorVersion, int profileMask, int contextF
PIXELFORMATDESCRIPTOR pfd;
int pixelFormat;
HGLRC tmp, ctx;
- PFNWGLCREATECONTEXTATTRIBSARBPROC wglCreateContextAttribsARB;
memset(&wc, 0, sizeof(wc));
wc.style = CS_OWNDC | CS_HREDRAW | CS_VREDRAW;
@@ -237,10 +223,10 @@ create_context(int majorVersion, int minorVersion, int profileMask, int contextF
return;
}
- wglCreateContextAttribsARB =
- (PFNWGLCREATECONTEXTATTRIBSARBPROC)wglGetProcAddress("wglCreateContextAttribsARB");
+ gladLoadGL();
+ gladLoadWGL(hdc);
- if (!wglCreateContextAttribsARB) {
+ if (!GLAD_WGL_ARB_create_context) {
fprintf(stderr, "wglCreateContextAttribsARB isn't supported\n");
return;
}
diff --git a/src/wgl/wglgears.c b/src/wgl/wglgears.c
index 24ab8780..1aef836e 100644
--- a/src/wgl/wglgears.c
+++ b/src/wgl/wglgears.c
@@ -32,8 +32,8 @@
#include <assert.h>
#include <windows.h>
-#include <GL/gl.h>
-#include <GL/wglext.h>
+#include <glad/glad.h>
+#include <glad/glad_wgl.h>
#include <math.h>
#include <stdlib.h>
#include <stdio.h>
@@ -45,14 +45,6 @@
#define M_PI 3.14159265
#endif /* !M_PI */
-#ifndef WGL_FRAMEBUFFER_SRGB_CAPABLE_ARB
-#define WGL_FRAMEBUFFER_SRGB_CAPABLE_ARB 0x20A9
-#endif
-
-#ifndef GL_FRAMEBUFFER_SRGB
-#define GL_FRAMEBUFFER_SRGB 0x8db9
-#endif
-
/* Global vars */
static HDC hDC;
@@ -453,6 +445,8 @@ make_window(const char *name, int x, int y, int width, int height)
hRC = wglCreateContext(hDC);
wglMakeCurrent(hDC, hRC);
+ gladLoadWGL(hDC);
+
if (use_srgb || samples > 0) {
/* We can't query/use extension functions until after we've
* created and bound a rendering context (done above).
@@ -461,10 +455,7 @@ make_window(const char *name, int x, int y, int width, int height)
* create a new device context in order to use the pixel format returned
* from wglChoosePixelFormatARB, and then create a new window.
*/
- PFNWGLCHOOSEPIXELFORMATARBPROC wglChoosePixelFormatARB_func =
- (PFNWGLCHOOSEPIXELFORMATARBPROC)
- wglGetProcAddress("wglChoosePixelFormatARB");
- assert(wglChoosePixelFormatARB_func);
+ assert(GLAD_WGL_ARB_create_context);
int int_attribs[64] = {
WGL_SUPPORT_OPENGL_ARB, TRUE,
@@ -493,8 +484,8 @@ make_window(const char *name, int x, int y, int width, int height)
UINT numFormats;
pixelFormat = 0;
- if (!wglChoosePixelFormatARB_func(hDC, int_attribs, float_attribs, 1,
- &pixelFormat, &numFormats) ||
+ if (!wglChoosePixelFormatARB(hDC, int_attribs, float_attribs, 1,
+ &pixelFormat, &numFormats) ||
!numFormats)
goto nopixelformat;
@@ -520,6 +511,8 @@ make_window(const char *name, int x, int y, int width, int height)
wglMakeCurrent(hDC, hRC);
}
+ gladLoadGL();
+
ShowWindow(hWnd, SW_SHOW);
SetForegroundWindow(hWnd);
SetFocus(hWnd);
@@ -573,42 +566,14 @@ draw_frame()
}
/**
- * Determine whether or not a WGL extension is supported.
- */
-static int
-is_wgl_extension_supported(HDC hdc, const char *query)
-{
- static const char *wgl_extensions = NULL;
- const size_t len = strlen(query);
- const char *ptr;
-
- if (wgl_extensions == NULL) {
- PFNWGLGETEXTENSIONSSTRINGARBPROC wglGetExtensionsStringARB_func =
- (PFNWGLGETEXTENSIONSSTRINGARBPROC)
- wglGetProcAddress("wglGetExtensionsStringARB");
- if (!wglGetExtensionsStringARB_func)
- return 0;
-
- wgl_extensions = wglGetExtensionsStringARB_func(hdc);
- }
-
- ptr = strstr(wgl_extensions, query);
- return ((ptr != NULL) && ((ptr[len] == ' ') || (ptr[len] == '\0')));
-}
-
-
-/**
* Attempt to determine whether or not the display is synched to vblank.
*/
static void
query_vsync()
{
int interval = 0;
- if (is_wgl_extension_supported(hDC, "WGL_EXT_swap_control")) {
- PFNWGLGETSWAPINTERVALEXTPROC wglGetSwapIntervalEXT_func =
- (PFNWGLGETSWAPINTERVALEXTPROC)
- wglGetProcAddress("wglGetSwapIntervalEXT");
- interval = wglGetSwapIntervalEXT_func();
+ if (GLAD_WGL_EXT_swap_control) {
+ interval = wglGetSwapIntervalEXT();
}
if (interval > 0) {
diff --git a/src/wgl/wglinfo.c b/src/wgl/wglinfo.c
index faccbb12..a08fed48 100644
--- a/src/wgl/wglinfo.c
+++ b/src/wgl/wglinfo.c
@@ -34,8 +34,8 @@
#include <windows.h>
#include <stdbool.h>
-#include <GL/glew.h>
-#include <GL/wglew.h>
+#include <glad/glad.h>
+#include <glad/glad_wgl.h>
#include <assert.h>
#include <stdio.h>
#include <string.h>
@@ -43,16 +43,6 @@
#include "glinfo_common.h"
-static GLboolean have_WGL_ARB_create_context;
-static GLboolean have_WGL_ARB_pbuffer;
-static GLboolean have_WGL_ARB_pixel_format;
-static GLboolean have_WGL_ARB_multisample;
-static GLboolean have_WGL_ARB_framebuffer_sRGB; /* or EXT version */
-
-static PFNWGLGETPIXELFORMATATTRIBIVARBPROC wglGetPixelFormatAttribivARB_func;
-static PFNWGLCREATECONTEXTATTRIBSARBPROC wglCreateContextAttribsARB_func;
-
-
/**
* An extension of PIXELFORMATDESCRIPTOR to handle multisample, etc.
*/
@@ -160,50 +150,21 @@ print_screen_info(HDC _hdc, const struct options *opts, GLboolean coreProfile)
}
if (wglMakeCurrent(hdc, ctx)) {
-#if defined(WGL_ARB_extensions_string)
- PFNWGLGETEXTENSIONSSTRINGARBPROC wglGetExtensionsStringARB_func =
- (PFNWGLGETEXTENSIONSSTRINGARBPROC)wglGetProcAddress("wglGetExtensionsStringARB");
-#endif
+ gladLoadGL();
+ gladLoadWGL(hdc);
const char *glVendor, *glRenderer, *glVersion, *glExtensions;
const char *wglExtensions = NULL;
struct ext_functions extfuncs;
-#if defined(WGL_ARB_extensions_string)
- if (wglGetExtensionsStringARB_func) {
- wglExtensions = wglGetExtensionsStringARB_func(hdc);
- if (extension_supported("WGL_ARB_pbuffer", wglExtensions)) {
- have_WGL_ARB_pbuffer = GL_TRUE;
- }
- if (extension_supported("WGL_ARB_pixel_format", wglExtensions)) {
- have_WGL_ARB_pixel_format = GL_TRUE;
- }
- if (extension_supported("WGL_ARB_multisample", wglExtensions)) {
- have_WGL_ARB_multisample = GL_TRUE;
- }
- if (extension_supported("WGL_ARB_create_context", wglExtensions)) {
- have_WGL_ARB_create_context = GL_TRUE;
- }
- if (extension_supported("WGL_ARB_framebuffer_sRGB", wglExtensions) ||
- extension_supported("WGL_EXT_framebuffer_sRGB", wglExtensions)) {
- have_WGL_ARB_framebuffer_sRGB = GL_TRUE;
- }
+ if (GLAD_WGL_ARB_extensions_string) {
+ wglExtensions = wglGetExtensionsStringARB(hdc);
}
-#endif
- if (coreProfile && have_WGL_ARB_create_context) {
+ if (coreProfile && GLAD_WGL_ARB_create_context) {
/* Try to create a new, core context */
HGLRC core_ctx = 0;
int i;
- wglCreateContextAttribsARB_func =
- (PFNWGLCREATECONTEXTATTRIBSARBPROC)
- wglGetProcAddress("wglCreateContextAttribsARB");
- assert(wglCreateContextAttribsARB_func);
- if (!wglCreateContextAttribsARB_func) {
- printf("Failed to get wglCreateContextAttribsARB pointer.");
- return;
- }
-
for (i = 0; gl_versions[i].major > 0; i++) {
int attribs[10], n;
@@ -223,7 +184,7 @@ print_screen_info(HDC _hdc, const struct options *opts, GLboolean coreProfile)
}
attribs[n++] = 0;
- core_ctx = wglCreateContextAttribsARB_func(hdc, 0, attribs);
+ core_ctx = wglCreateContextAttribsARB(hdc, 0, attribs);
if (core_ctx) {
break;
}
@@ -245,12 +206,9 @@ print_screen_info(HDC _hdc, const struct options *opts, GLboolean coreProfile)
coreProfile = GL_FALSE;
}
- extfuncs.GetProgramivARB = (PFNGLGETPROGRAMIVARBPROC)
- wglGetProcAddress("glGetProgramivARB");
- extfuncs.GetStringi = (PFNGLGETSTRINGIPROC)
- wglGetProcAddress("glGetStringi");
- extfuncs.GetConvolutionParameteriv = (GETCONVOLUTIONPARAMETERIVPROC)
- wglGetProcAddress("glGetConvolutionParameteriv");
+ extfuncs.GetProgramivARB = glGetProgramivARB;
+ extfuncs.GetStringi = glGetStringi;
+ extfuncs.GetConvolutionParameteriv = glGetConvolutionParameteriv;
glVendor = (const char *) glGetString(GL_VENDOR);
glRenderer = (const char *) glGetString(GL_RENDERER);
@@ -279,26 +237,20 @@ print_screen_info(HDC _hdc, const struct options *opts, GLboolean coreProfile)
version = (glVersion[0] - '0') * 10 + (glVersion[2] - '0');
-#ifdef GL_VERSION_2_0
- if (version >= 20) {
+ if (GLAD_GL_VERSION_2_0) {
char *v = (char *) glGetString(GL_SHADING_LANGUAGE_VERSION);
printf("%s shading language version string: %s\n", oglString, v);
}
-#endif
-#ifdef GL_VERSION_3_0
- if (version >= 30) {
+ if (GLAD_GL_VERSION_3_0) {
GLint flags;
glGetIntegerv(GL_CONTEXT_FLAGS, &flags);
printf("%s context flags: %s\n", oglString, context_flags_string(flags));
}
-#endif
-#ifdef GL_VERSION_3_2
- if (version >= 32) {
+ if (GLAD_GL_VERSION_3_2) {
GLint mask;
glGetIntegerv(GL_CONTEXT_PROFILE_MASK, &mask);
printf("%s profile mask: %s\n", oglString, profile_mask_string(mask));
}
-#endif
if (opts->mode != Brief) {
printf("%s extensions:\n", oglString);
@@ -453,8 +405,8 @@ static int
get_pf_attrib(HDC hdc, int pf, int attrib)
{
int layer = 0, value;
- assert(have_WGL_ARB_pixel_format);
- if (wglGetPixelFormatAttribivARB_func(hdc, pf, layer, 1, &attrib, &value)) {
+ assert(GLAD_WGL_ARB_pixel_format);
+ if (wglGetPixelFormatAttribivARB(hdc, pf, layer, 1, &attrib, &value)) {
return value;
}
else {
@@ -471,7 +423,7 @@ get_format_info(HDC hdc, int pf, struct format_info *info)
{
memset(info, 0, sizeof(*info));
- if (have_WGL_ARB_pixel_format) {
+ if (GLAD_WGL_ARB_pixel_format) {
int swapMethod;
info->pfd.dwFlags = 0;
@@ -488,7 +440,7 @@ get_format_info(HDC hdc, int pf, struct format_info *info)
if (get_pf_attrib(hdc, pf, WGL_DRAW_TO_BITMAP_ARB))
info->draw_to_bitmap = true;
- if (have_WGL_ARB_pbuffer && get_pf_attrib(hdc, pf, WGL_DRAW_TO_PBUFFER_ARB))
+ if (GLAD_WGL_ARB_pbuffer && get_pf_attrib(hdc, pf, WGL_DRAW_TO_PBUFFER_ARB))
info->draw_to_pbuffer = true;
if (get_pf_attrib(hdc, pf, WGL_SUPPORT_GDI_ARB))
info->gdi_drawing = true;
@@ -533,7 +485,8 @@ get_format_info(HDC hdc, int pf, struct format_info *info)
info->transparency = get_pf_attrib(hdc, pf, WGL_TRANSPARENT_ARB);
- if (have_WGL_ARB_framebuffer_sRGB) {
+ if (GLAD_WGL_ARB_framebuffer_sRGB ||
+ GLAD_WGL_EXT_framebuffer_sRGB) {
info->srgb = get_pf_attrib(hdc, pf, WGL_FRAMEBUFFER_SRGB_CAPABLE_ARB);
}
}
@@ -554,16 +507,12 @@ print_visual_info(HDC hdc, InfoMode mode)
int numVisuals, numWglVisuals;
int i;
- wglGetPixelFormatAttribivARB_func =
- (PFNWGLGETPIXELFORMATATTRIBIVARBPROC)
- wglGetProcAddress("wglGetPixelFormatAttribivARB");
-
/* Get number of visuals / pixel formats */
numVisuals = DescribePixelFormat(hdc, 1,
sizeof(PIXELFORMATDESCRIPTOR), NULL);
printf("%d Regular pixel formats\n", numVisuals);
- if (have_WGL_ARB_pixel_format) {
+ if (GLAD_WGL_ARB_pixel_format) {
int numExtVisuals = get_pf_attrib(hdc, 0, WGL_NUMBER_PIXEL_FORMATS_ARB);
printf("%d Regular + Extended pixel formats\n", numExtVisuals);
numVisuals = numExtVisuals;
diff --git a/src/xdemos/CMakeLists.txt b/src/xdemos/CMakeLists.txt
index d49a6e61..cacaaa13 100644
--- a/src/xdemos/CMakeLists.txt
+++ b/src/xdemos/CMakeLists.txt
@@ -1,7 +1,7 @@
include_directories (
${CMAKE_SOURCE_DIR}/src/util
${X11_INCLUDE_DIR}
- ${GLEW_INCLUDE_DIR}
+ ${GLAD_INCLUDE_DIR}
)
link_directories (
@@ -12,7 +12,7 @@ link_libraries (
util
${X11_GL_LIB}
${X11_GLU_LIB}
- ${GLEW_glew_LIBRARY}
+ glad
${X11_X11_LIB}
${X11_Xext_LIB}
)
diff --git a/src/xdemos/Makefile.am b/src/xdemos/Makefile.am
index 625b2782..56d8d24b 100644
--- a/src/xdemos/Makefile.am
+++ b/src/xdemos/Makefile.am
@@ -25,6 +25,7 @@
AM_CFLAGS = \
$(DEMO_CFLAGS) \
$(X11_CFLAGS) \
+ -I$(top_srcdir)/src/glad/include \
-I$(top_srcdir)/src/util
AM_LDFLAGS = \
$(DEMO_LIBS) \
@@ -76,6 +77,7 @@ glxinfo_SOURCES = \
glinfo_common.c \
glinfo_common.h
+LDADD = ../glad/libglad.la
glthreads_LDADD = -lpthread
glxgears_fbconfig_LDADD = libpbutil.la
pbdemo_LDADD = libpbutil.la
diff --git a/src/xdemos/glinfo_common.h b/src/xdemos/glinfo_common.h
index 4d07f667..72bc0458 100644
--- a/src/xdemos/glinfo_common.h
+++ b/src/xdemos/glinfo_common.h
@@ -30,7 +30,7 @@
#ifdef _WIN32
/* GL/glext.h is not commonly available on Windows. */
-#include <GL/glew.h>
+#include <glad/glad.h>
#else
#include <GL/gl.h>
#include <GL/glext.h>