diff options
author | Paulo Zanoni <pzanoni@mandriva.com> | 2011-01-28 17:34:24 -0200 |
---|---|---|
committer | Brian Paul <brianp@vmware.com> | 2011-02-02 16:45:38 -0700 |
commit | 2ec1a249ddb1fe18fd01cc9147f7f5600c613ed7 (patch) | |
tree | 9140b072fa262683df7e6ecdcc8feef3b990eccf | |
parent | 0838d8038f2a53341a492c62a6368c9d33390521 (diff) |
Add --with-system-data-files option
If you specify --with-system-data-files, binaries will try to find .dat and
image files inside ${datadir}/${PACKAGE}. If you don't specify, they will try to
find the files inside "../data" (keeping backwards compatibility).
Signed-off-by: Paulo Zanoni <pzanoni@mandriva.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
-rw-r--r-- | .gitignore | 5 | ||||
-rw-r--r-- | CMakeLists.txt | 2 | ||||
-rw-r--r-- | Makefile.am | 3 | ||||
-rw-r--r-- | configure.ac | 18 | ||||
-rw-r--r-- | index.html | 2 | ||||
-rw-r--r-- | m4/ac_define_dir.m4 | 49 | ||||
-rw-r--r-- | src/CMakeLists.txt | 2 | ||||
-rw-r--r-- | src/Makefile.am | 2 | ||||
-rw-r--r-- | src/data/CMakeLists.txt (renamed from src/images/CMakeLists.txt) | 2 | ||||
-rw-r--r-- | src/data/Makefile.am (renamed from src/images/Makefile.am) | 9 | ||||
-rw-r--r-- | src/data/arch.rgb (renamed from src/images/arch.rgb) | bin | 793398 -> 793398 bytes | |||
-rw-r--r-- | src/data/bw.rgb (renamed from src/images/bw.rgb) | bin | 206452 -> 206452 bytes | |||
-rw-r--r-- | src/data/geartrain.dat (renamed from src/demos/geartrain.dat) | 0 | ||||
-rw-r--r-- | src/data/girl.rgb (renamed from src/images/girl.rgb) | bin | 117075 -> 117075 bytes | |||
-rw-r--r-- | src/data/girl2.rgb (renamed from src/images/girl2.rgb) | bin | 117139 -> 117139 bytes | |||
-rw-r--r-- | src/data/isosurf.dat (renamed from src/demos/isosurf.dat) | 0 | ||||
-rw-r--r-- | src/data/reflect.rgb (renamed from src/images/reflect.rgb) | bin | 39632 -> 39632 bytes | |||
-rw-r--r-- | src/data/s128.rgb (renamed from src/images/s128.rgb) | bin | 54258 -> 54258 bytes | |||
-rw-r--r-- | src/data/terrain.dat (renamed from src/demos/terrain.dat) | 0 | ||||
-rw-r--r-- | src/data/tile.rgb (renamed from src/images/tile.rgb) | bin | 206534 -> 206534 bytes | |||
-rw-r--r-- | src/data/tree2.rgba (renamed from src/images/tree2.rgba) | bin | 66048 -> 66048 bytes | |||
-rw-r--r-- | src/data/tree3.rgb (renamed from src/images/tree3.rgb) | bin | 24816 -> 24816 bytes | |||
-rw-r--r-- | src/data/wrs_logo.rgb (renamed from src/images/wrs_logo.rgb) | bin | 37574 -> 37574 bytes | |||
-rw-r--r-- | src/demos/CMakeLists.txt | 4 | ||||
-rw-r--r-- | src/demos/Makefile.am | 5 | ||||
-rw-r--r-- | src/demos/copypix.c | 2 | ||||
-rw-r--r-- | src/demos/dissolve.c | 4 | ||||
-rw-r--r-- | src/demos/drawpix.c | 2 | ||||
-rw-r--r-- | src/demos/engine.c | 2 | ||||
-rw-r--r-- | src/demos/fbo_firecube.c | 7 | ||||
-rw-r--r-- | src/demos/fire.c | 7 | ||||
-rw-r--r-- | src/demos/geartrain.c | 2 | ||||
-rw-r--r-- | src/demos/gloss.c | 4 | ||||
-rw-r--r-- | src/demos/ipers.c | 2 | ||||
-rw-r--r-- | src/demos/isosurf.c | 4 | ||||
-rw-r--r-- | src/demos/lodbias.c | 2 | ||||
-rw-r--r-- | src/demos/multiarb.c | 4 | ||||
-rw-r--r-- | src/demos/projtex.c | 8 | ||||
-rw-r--r-- | src/demos/rain.cxx | 3 | ||||
-rw-r--r-- | src/demos/readpix.c | 2 | ||||
-rw-r--r-- | src/demos/reflect.c | 2 | ||||
-rw-r--r-- | src/demos/teapot.c | 4 | ||||
-rw-r--r-- | src/demos/terrain.c | 2 | ||||
-rw-r--r-- | src/demos/texcyl.c | 2 | ||||
-rw-r--r-- | src/demos/textures.c | 8 | ||||
-rw-r--r-- | src/demos/tunnel.c | 4 | ||||
-rw-r--r-- | src/demos/tunnel2.c | 4 | ||||
-rw-r--r-- | src/demos/winpos.c | 2 | ||||
-rw-r--r-- | src/fp/fp-tri.c | 2 | ||||
-rw-r--r-- | src/fp/tri-tex.c | 2 | ||||
-rw-r--r-- | src/fpglsl/fp-tri.c | 2 | ||||
-rw-r--r-- | src/glsl/bump.c | 2 | ||||
-rw-r--r-- | src/glsl/convolutions.c | 2 | ||||
-rw-r--r-- | src/glsl/multitex.c | 4 | ||||
-rw-r--r-- | src/glsl/texdemo1.c | 2 | ||||
-rw-r--r-- | src/perf/glslstateschange.c | 8 | ||||
-rw-r--r-- | src/samples/sphere.c | 2 | ||||
-rw-r--r-- | src/tests/afsmultiarb.c | 4 | ||||
-rw-r--r-- | src/tests/arbfptexture.c | 2 | ||||
-rw-r--r-- | src/tests/arbfptrig.c | 2 | ||||
-rw-r--r-- | src/tests/arbnpot.c | 2 | ||||
-rw-r--r-- | src/tests/arraytexture.c | 18 | ||||
-rw-r--r-- | src/tests/blendxor.c | 2 | ||||
-rw-r--r-- | src/tests/bug_3195.c | 2 | ||||
-rw-r--r-- | src/tests/bumpmap.c | 2 | ||||
-rw-r--r-- | src/tests/ext422square.c | 2 | ||||
-rw-r--r-- | src/tests/fillrate.c | 4 | ||||
-rw-r--r-- | src/tests/floattex.c | 2 | ||||
-rw-r--r-- | src/tests/fptexture.c | 2 | ||||
-rw-r--r-- | src/tests/invert.c | 2 | ||||
-rw-r--r-- | src/tests/mipmap_limits.c | 2 | ||||
-rw-r--r-- | src/tests/mipmap_view.c | 2 | ||||
-rw-r--r-- | src/tests/multipal.c | 4 | ||||
-rw-r--r-- | src/tests/pbo.c | 2 | ||||
-rw-r--r-- | src/tests/rubberband.c | 2 | ||||
-rw-r--r-- | src/tests/texcmp.c | 2 | ||||
-rw-r--r-- | src/tests/texcompress2.c | 2 | ||||
-rw-r--r-- | src/tests/texline.c | 2 | ||||
-rw-r--r-- | src/tests/texrect.c | 4 | ||||
-rw-r--r-- | src/tests/vparray.c | 2 | ||||
-rw-r--r-- | src/tests/yuvrect.c | 2 | ||||
-rw-r--r-- | src/tests/yuvsquare.c | 2 | ||||
-rw-r--r-- | src/xdemos/yuvrect_client.c | 2 |
83 files changed, 181 insertions, 107 deletions
@@ -32,7 +32,12 @@ cscope* depcomp install-sh libtool +libtool.m4 ltmain.sh +ltoptions.m4 +ltsugar.m4 +ltversion.m4 +lt~obsolete.m4 missing Makefile Makefile.in diff --git a/CMakeLists.txt b/CMakeLists.txt index 7b5dcf9c..3f8fc9f1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -49,4 +49,6 @@ if (MSVC) add_definitions (-wd4244) # conversion' conversion from 'type1' to 'type2', possible loss of data endif (MSVC) +add_definitions(-DDEMOS_DATA_DIR=\"../data/\") + add_subdirectory (src) diff --git a/Makefile.am b/Makefile.am index 63ca19e2..024bff3a 100644 --- a/Makefile.am +++ b/Makefile.am @@ -23,5 +23,6 @@ # Eric Anholt <eric@anholt.net> AUTOMAKE_OPTIONS = foreign +ACLOCAL_AMFLAGS = -I m4 -SUBDIRS = src
\ No newline at end of file +SUBDIRS = src diff --git a/configure.ac b/configure.ac index 49cd80f5..e17fbcfd 100644 --- a/configure.ac +++ b/configure.ac @@ -38,6 +38,8 @@ AC_PROG_CXX AC_PROG_LIBTOOL AM_PROG_CC_C_O +AC_CONFIG_MACRO_DIR([m4]) + # Enable quiet compiles on automake 1.11. m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) @@ -166,6 +168,20 @@ AC_ARG_WITH([mesa-source], [mesa_source_enabled="no"]) MESA_GLAPI="$mesa_source_dir/src/mesa/glapi" +use_system_data=no +AC_ARG_WITH([system-data-files], + [AS_HELP_STRING([--with-system-data-files], + [Use system data files for demos (default: no)])], + [use_system_data=yes], []) +if test "x$use_system_data" = xyes; then + demos_data_dir="${datadir}/${PACKAGE}/" +else + demos_data_dir="../data/" +fi +AC_DEFINE_DIR(DEMOS_DATA_DIR, demos_data_dir, [Data dir for demos]) +AC_DEFINE_UNQUOTED([DEMOS_DATA_DIR], "$DEMOS_DATA_DIR", + [Directory for demos data files]) + dnl dnl Program library dependencies dnl Only libm is added here if necessary as the libraries should @@ -228,7 +244,7 @@ AC_OUTPUT([ src/fpglsl/Makefile src/glsl/Makefile src/gs/Makefile - src/images/Makefile + src/data/Makefile src/objviewer/Makefile src/osdemos/Makefile src/perf/Makefile @@ -187,7 +187,7 @@ Look in the <b>src/</b> directory for these sub-directories, among others: <li>wgl - WGL-based demos <li>fp - fragment program tests <li>vp - vertex program tests -<li>images - sample image files (in SGI .rgb format) +<li>data - data files used by the demos <li>perf - performance tests <li>tests - assorted test programs <li>objviewer - program to view .obj modes with a skybox diff --git a/m4/ac_define_dir.m4 b/m4/ac_define_dir.m4 new file mode 100644 index 00000000..db42d3eb --- /dev/null +++ b/m4/ac_define_dir.m4 @@ -0,0 +1,49 @@ +# =========================================================================== +# http://autoconf-archive.cryp.to/ac_define_dir.html +# =========================================================================== +# +# SYNOPSIS +# +# AC_DEFINE_DIR(VARNAME, DIR [, DESCRIPTION]) +# +# DESCRIPTION +# +# This macro sets VARNAME to the expansion of the DIR variable, taking +# care of fixing up ${prefix} and such. +# +# VARNAME is then offered as both an output variable and a C preprocessor +# symbol. +# +# Example: +# +# AC_DEFINE_DIR([DATADIR], [datadir], [Where data are placed to.]) +# +# LAST MODIFICATION +# +# 2008-04-12 +# +# COPYLEFT +# +# Copyright (c) 2008 Stepan Kasal <kasal@ucw.cz> +# Copyright (c) 2008 Andreas Schwab <schwab@suse.de> +# Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de> +# Copyright (c) 2008 Alexandre Oliva +# +# Copying and distribution of this file, with or without modification, are +# permitted in any medium without royalty provided the copyright notice +# and this notice are preserved. + +AC_DEFUN([AC_DEFINE_DIR], [ + prefix_NONE= + exec_prefix_NONE= + test "x$prefix" = xNONE && prefix_NONE=yes && prefix=$ac_default_prefix + test "x$exec_prefix" = xNONE && exec_prefix_NONE=yes && exec_prefix=$prefix +dnl In Autoconf 2.60, ${datadir} refers to ${datarootdir}, which in turn +dnl refers to ${prefix}. Thus we have to use `eval' twice. + eval ac_define_dir="\"[$]$2\"" + eval ac_define_dir="\"$ac_define_dir\"" + AC_SUBST($1, "$ac_define_dir") + AC_DEFINE_UNQUOTED($1, "$ac_define_dir", [$3]) + test "$prefix_NONE" && prefix=NONE + test "$exec_prefix_NONE" && exec_prefix=NONE +]) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index ac745f03..a7f37334 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -26,4 +26,4 @@ if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows") add_subdirectory (wgl) endif (${CMAKE_SYSTEM_NAME} STREQUAL "Windows") -add_subdirectory (images) +add_subdirectory (data) diff --git a/src/Makefile.am b/src/Makefile.am index a9f04522..1647d647 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -24,13 +24,13 @@ SUBDIRS = \ util \ + data \ demos \ egl \ fp \ fpglsl \ glsl \ gs \ - images \ objviewer \ osdemos \ perf \ diff --git a/src/images/CMakeLists.txt b/src/data/CMakeLists.txt index 5bcd4f20..a21cc0be 100644 --- a/src/images/CMakeLists.txt +++ b/src/data/CMakeLists.txt @@ -1,3 +1,3 @@ -file (GLOB data *.rgb *.rgba) +file (GLOB data *.rgb *.rgba *.dat) install (FILES ${data} DESTINATION images) diff --git a/src/images/Makefile.am b/src/data/Makefile.am index b08c4cb4..28022c96 100644 --- a/src/images/Makefile.am +++ b/src/data/Makefile.am @@ -22,7 +22,8 @@ # Authors: # Eric Anholt <eric@anholt.net> -EXTRA_DIST = \ +demosdatadir=$(datadir)/$(PACKAGE)/ +dist_demosdata_DATA= \ arch.rgb \ bw.rgb \ girl2.rgb \ @@ -32,4 +33,8 @@ EXTRA_DIST = \ tile.rgb \ tree2.rgba \ tree3.rgb \ - wrs_logo.rgb + wrs_logo.rgb \ + \ + geartrain.dat \ + isosurf.dat \ + terrain.dat diff --git a/src/images/arch.rgb b/src/data/arch.rgb Binary files differindex 5f35bbd0..5f35bbd0 100644 --- a/src/images/arch.rgb +++ b/src/data/arch.rgb diff --git a/src/images/bw.rgb b/src/data/bw.rgb Binary files differindex f5de0f14..f5de0f14 100644 --- a/src/images/bw.rgb +++ b/src/data/bw.rgb diff --git a/src/demos/geartrain.dat b/src/data/geartrain.dat index 09fe4c64..09fe4c64 100644 --- a/src/demos/geartrain.dat +++ b/src/data/geartrain.dat diff --git a/src/images/girl.rgb b/src/data/girl.rgb Binary files differindex ed5459c9..ed5459c9 100644 --- a/src/images/girl.rgb +++ b/src/data/girl.rgb diff --git a/src/images/girl2.rgb b/src/data/girl2.rgb Binary files differindex d5e557de..d5e557de 100644 --- a/src/images/girl2.rgb +++ b/src/data/girl2.rgb diff --git a/src/demos/isosurf.dat b/src/data/isosurf.dat index 5cadecdb..5cadecdb 100644 --- a/src/demos/isosurf.dat +++ b/src/data/isosurf.dat diff --git a/src/images/reflect.rgb b/src/data/reflect.rgb Binary files differindex 45319e96..45319e96 100644 --- a/src/images/reflect.rgb +++ b/src/data/reflect.rgb diff --git a/src/images/s128.rgb b/src/data/s128.rgb Binary files differindex 79f5c1d9..79f5c1d9 100644 --- a/src/images/s128.rgb +++ b/src/data/s128.rgb diff --git a/src/demos/terrain.dat b/src/data/terrain.dat index 2af385e9..2af385e9 100644 --- a/src/demos/terrain.dat +++ b/src/data/terrain.dat diff --git a/src/images/tile.rgb b/src/data/tile.rgb Binary files differindex 5c1c73b0..5c1c73b0 100644 --- a/src/images/tile.rgb +++ b/src/data/tile.rgb diff --git a/src/images/tree2.rgba b/src/data/tree2.rgba Binary files differindex 67b02799..67b02799 100644 --- a/src/images/tree2.rgba +++ b/src/data/tree2.rgba diff --git a/src/images/tree3.rgb b/src/data/tree3.rgb Binary files differindex ce2c44dd..ce2c44dd 100644 --- a/src/images/tree3.rgb +++ b/src/data/tree3.rgb diff --git a/src/images/wrs_logo.rgb b/src/data/wrs_logo.rgb Binary files differindex f1b92148..f1b92148 100644 --- a/src/images/wrs_logo.rgb +++ b/src/data/wrs_logo.rgb diff --git a/src/demos/CMakeLists.txt b/src/demos/CMakeLists.txt index 55e7bb3b..77c36d2c 100644 --- a/src/demos/CMakeLists.txt +++ b/src/demos/CMakeLists.txt @@ -84,7 +84,3 @@ endforeach (target) add_executable (rain rain.cxx particles.cxx) install (TARGETS rain DESTINATION demos) - -file (GLOB data *.dat) - -install (FILES ${data} DESTINATION demos) diff --git a/src/demos/Makefile.am b/src/demos/Makefile.am index c99dbd85..87517866 100644 --- a/src/demos/Makefile.am +++ b/src/demos/Makefile.am @@ -115,7 +115,4 @@ tunnel2_LDADD = ../util/libutil.la winpos_LDADD = ../util/libutil.la EXTRA_DIST = \ - README \ - geartrain.dat \ - isosurf.dat \ - terrain.dat + README diff --git a/src/demos/copypix.c b/src/demos/copypix.c index 98c835f4..4e96bd0d 100644 --- a/src/demos/copypix.c +++ b/src/demos/copypix.c @@ -14,7 +14,7 @@ #include "readtex.h" -#define IMAGE_FILE "../images/arch.rgb" +#define IMAGE_FILE DEMOS_DATA_DIR "arch.rgb" static int ImgWidth, ImgHeight; static GLenum ImgFormat; diff --git a/src/demos/dissolve.c b/src/demos/dissolve.c index 8ab5242d..b492b2b0 100644 --- a/src/demos/dissolve.c +++ b/src/demos/dissolve.c @@ -14,8 +14,8 @@ #include <GL/glut.h> #include "readtex.h" -#define FILE1 "../images/bw.rgb" -#define FILE2 "../images/arch.rgb" +#define FILE1 DEMOS_DATA_DIR "bw.rgb" +#define FILE2 DEMOS_DATA_DIR "arch.rgb" static int Win; diff --git a/src/demos/drawpix.c b/src/demos/drawpix.c index 9bc7086e..aeb1d366 100644 --- a/src/demos/drawpix.c +++ b/src/demos/drawpix.c @@ -13,7 +13,7 @@ #include "readtex.h" -#define IMAGE_FILE "../images/girl.rgb" +#define IMAGE_FILE DEMOS_DATA_DIR "girl.rgb" static int ImgWidth, ImgHeight; static GLenum ImgFormat; diff --git a/src/demos/engine.c b/src/demos/engine.c index ee7d5c15..f5fd90f0 100644 --- a/src/demos/engine.c +++ b/src/demos/engine.c @@ -21,7 +21,7 @@ #define DEG_TO_RAD(DEG) ((DEG) * M_PI / 180.0) -#define TEXTURE_FILE "../images/reflect.rgb" +#define TEXTURE_FILE DEMOS_DATA_DIR "reflect.rgb" /* Target engine speed: */ const int RPM = 100.0; diff --git a/src/demos/fbo_firecube.c b/src/demos/fbo_firecube.c index 3fd74131..fdeb93f8 100644 --- a/src/demos/fbo_firecube.c +++ b/src/demos/fbo_firecube.c @@ -675,7 +675,7 @@ inittextures(void) glBindTexture(GL_TEXTURE_2D, groundid); glPixelStorei(GL_UNPACK_ALIGNMENT, 4); - if (!LoadRGBMipmaps("../images/s128.rgb", GL_RGB)) { + if (!LoadRGBMipmaps(DEMOS_DATA_DIR "s128.rgb", GL_RGB)) { fprintf(stderr, "Error reading a texture.\n"); exit(-1); } @@ -697,7 +697,8 @@ inittextures(void) int w, h; GLenum format; int x, y; - GLubyte *image = LoadRGBImage("../images/tree3.rgb", &w, &h, &format); + GLubyte *image = LoadRGBImage(DEMOS_DATA_DIR "tree3.rgb", + &w, &h, &format); if (!image) { fprintf(stderr, "Error reading a texture.\n"); @@ -723,7 +724,7 @@ inittextures(void) } } else { - if (!LoadRGBMipmaps("../images/tree2.rgba", GL_RGBA)) { + if (!LoadRGBMipmaps(DEMOS_DATA_DIR "tree2.rgba", GL_RGBA)) { fprintf(stderr, "Error reading a texture.\n"); exit(-1); } diff --git a/src/demos/fire.c b/src/demos/fire.c index 2e159856..96c3e2ce 100644 --- a/src/demos/fire.c +++ b/src/demos/fire.c @@ -626,7 +626,7 @@ inittextures(void) glBindTexture(GL_TEXTURE_2D, groundid); glPixelStorei(GL_UNPACK_ALIGNMENT, 4); - if (!LoadRGBMipmaps("../images/s128.rgb", GL_RGB)) { + if (!LoadRGBMipmaps(DEMOS_DATA_DIR "s128.rgb", GL_RGB)) { fprintf(stderr, "Error reading a texture.\n"); exit(-1); } @@ -648,7 +648,8 @@ inittextures(void) int w, h; GLenum format; int x, y; - GLubyte *image = LoadRGBImage("../images/tree3.rgb", &w, &h, &format); + GLubyte *image = LoadRGBImage(DEMOS_DATA_DIR "tree3.rgb", + &w, &h, &format); if (!image) { fprintf(stderr, "Error reading a texture.\n"); @@ -674,7 +675,7 @@ inittextures(void) } } else { - if (!LoadRGBMipmaps("../images/tree2.rgba", GL_RGBA)) { + if (!LoadRGBMipmaps(DEMOS_DATA_DIR "tree2.rgba", GL_RGBA)) { fprintf(stderr, "Error reading a texture.\n"); exit(-1); } diff --git a/src/demos/geartrain.c b/src/demos/geartrain.c index 128687be..be82592f 100644 --- a/src/demos/geartrain.c +++ b/src/demos/geartrain.c @@ -1003,7 +1003,7 @@ main (int argc, char *argv[]) exit (1); if (argc < 2) - file = "geartrain.dat"; + file = DEMOS_DATA_DIR "geartrain.dat"; else file = argv[1]; diff --git a/src/demos/gloss.c b/src/demos/gloss.c index ddfd548b..04ba0d22 100644 --- a/src/demos/gloss.c +++ b/src/demos/gloss.c @@ -29,8 +29,8 @@ #include "trackball.h" -#define SPECULAR_TEXTURE_FILE "../images/reflect.rgb" -#define BASE_TEXTURE_FILE "../images/tile.rgb" +#define SPECULAR_TEXTURE_FILE DEMOS_DATA_DIR "reflect.rgb" +#define BASE_TEXTURE_FILE DEMOS_DATA_DIR "tile.rgb" /* Menu items */ #define DO_SPEC_TEXTURE 1 diff --git a/src/demos/ipers.c b/src/demos/ipers.c index d2f3a114..f8257bcf 100644 --- a/src/demos/ipers.c +++ b/src/demos/ipers.c @@ -151,7 +151,7 @@ inittextures(void) glGenTextures(1, &t1id); glBindTexture(GL_TEXTURE_2D, t1id); - if (!LoadRGBMipmaps("../images/bw.rgb", 3)) { + if (!LoadRGBMipmaps(DEMOS_DATA_DIR "bw.rgb", 3)) { fprintf(stderr, "Error reading a texture.\n"); exit(-1); } diff --git a/src/demos/isosurf.c b/src/demos/isosurf.c index c9601e96..903d1655 100644 --- a/src/demos/isosurf.c +++ b/src/demos/isosurf.c @@ -36,7 +36,7 @@ #include "GL/glut.h" #include "readtex.h" -#define TEXTURE_FILE "../images/reflect.rgb" +#define TEXTURE_FILE DEMOS_DATA_DIR "reflect.rgb" #define LIT 0x00000001 #define UNLIT 0x00000002 @@ -1060,7 +1060,7 @@ int main(int argc, char **argv) if (arg_mode & QUIT) exit(0); - read_surface( "isosurf.dat" ); + read_surface(DEMOS_DATA_DIR "isosurf.dat"); glutInitWindowSize(400, 400); glutInit( &argc, argv); diff --git a/src/demos/lodbias.c b/src/demos/lodbias.c index c1c6e3d1..1dc93903 100644 --- a/src/demos/lodbias.c +++ b/src/demos/lodbias.c @@ -36,7 +36,7 @@ #include "readtex.h" -#define TEXTURE_FILE "../images/girl.rgb" +#define TEXTURE_FILE DEMOS_DATA_DIR "girl.rgb" static GLfloat Xrot = 0, Yrot = -30, Zrot = 0; static GLboolean Anim = GL_TRUE; diff --git a/src/demos/multiarb.c b/src/demos/multiarb.c index 82796a0c..29b46f08 100644 --- a/src/demos/multiarb.c +++ b/src/demos/multiarb.c @@ -19,8 +19,8 @@ #include "readtex.h" -#define TEXTURE_1_FILE "../images/girl.rgb" -#define TEXTURE_2_FILE "../images/reflect.rgb" +#define TEXTURE_1_FILE DEMOS_DATA_DIR "girl.rgb" +#define TEXTURE_2_FILE DEMOS_DATA_DIR "reflect.rgb" #define TEX0 1 #define TEX7 8 diff --git a/src/demos/projtex.c b/src/demos/projtex.c index d162568b..fa25ea85 100644 --- a/src/demos/projtex.c +++ b/src/demos/projtex.c @@ -51,10 +51,10 @@ GLboolean showProjection = GL_TRUE; GLboolean linearFilter = GL_TRUE; char *texFilename[MAX_TEX] = { - "../images/girl.rgb", - "../images/tile.rgb", - "../images/bw.rgb", - "../images/reflect.rgb" + DEMOS_DATA_DIR "girl.rgb", + DEMOS_DATA_DIR "tile.rgb", + DEMOS_DATA_DIR "bw.rgb", + DEMOS_DATA_DIR "reflect.rgb" }; diff --git a/src/demos/rain.cxx b/src/demos/rain.cxx index 60fc4146..9be461d3 100644 --- a/src/demos/rain.cxx +++ b/src/demos/rain.cxx @@ -309,7 +309,8 @@ static void inittextures(void) glGenTextures(1,&groundid); glBindTexture(GL_TEXTURE_2D,groundid); - if(!(img=LoadRGBImage("../images/s128.rgb",&width,&height,&format))){ + if(!(img=LoadRGBImage(DEMOS_DATA_DIR "s128.rgb", + &width,&height,&format))){ fprintf(stderr,"Error reading a texture.\n"); exit(-1); } diff --git a/src/demos/readpix.c b/src/demos/readpix.c index cc4e4902..02a8d282 100644 --- a/src/demos/readpix.c +++ b/src/demos/readpix.c @@ -14,7 +14,7 @@ #include "readtex.h" -#define IMAGE_FILE "../images/girl.rgb" +#define IMAGE_FILE DEMOS_DATA_DIR "girl.rgb" static int ImgWidth, ImgHeight; static int WinWidth, WinHeight; diff --git a/src/demos/reflect.c b/src/demos/reflect.c index b72af128..2d4239aa 100644 --- a/src/demos/reflect.c +++ b/src/demos/reflect.c @@ -37,7 +37,7 @@ #define DEG2RAD (3.14159/180.0) -#define TABLE_TEXTURE "../images/tile.rgb" +#define TABLE_TEXTURE DEMOS_DATA_DIR "tile.rgb" #define MAX_OBJECTS 2 #define INIT_WIDTH 400 #define INIT_HEIGHT 300 diff --git a/src/demos/teapot.c b/src/demos/teapot.c index fb797089..08516ed8 100644 --- a/src/demos/teapot.c +++ b/src/demos/teapot.c @@ -503,7 +503,7 @@ static void inittextures(void) glBindTexture(GL_TEXTURE_2D,t1id); glPixelStorei(GL_UNPACK_ALIGNMENT,4); - if (!LoadRGBMipmaps("../images/tile.rgb", GL_RGB)) { + if (!LoadRGBMipmaps(DEMOS_DATA_DIR "tile.rgb", GL_RGB)) { fprintf(stderr,"Error reading a texture.\n"); exit(-1); } @@ -526,7 +526,7 @@ static void inittextures(void) glPixelTransferf(GL_BLUE_SCALE, 0.75); glPixelTransferf(GL_BLUE_BIAS, 0.25); - if (!LoadRGBMipmaps("../images/bw.rgb", GL_RGB)) { + if (!LoadRGBMipmaps(DEMOS_DATA_DIR "bw.rgb", GL_RGB)) { fprintf(stderr,"Error reading a texture.\n"); exit(-1); } diff --git a/src/demos/terrain.c b/src/demos/terrain.c index 97c4656e..9d94ca44 100644 --- a/src/demos/terrain.c +++ b/src/demos/terrain.c @@ -563,7 +563,7 @@ loadpic(void) GLenum gluerr; size_t result; - if ((FilePic = fopen("terrain.dat", "r")) == NULL) { + if ((FilePic = fopen(DEMOS_DATA_DIR "terrain.dat", "r")) == NULL) { fprintf(stderr, "Error loading terrain.dat\n"); exit(-1); } diff --git a/src/demos/texcyl.c b/src/demos/texcyl.c index 4df97ec4..428cc782 100644 --- a/src/demos/texcyl.c +++ b/src/demos/texcyl.c @@ -17,7 +17,7 @@ #include "readtex.h" -#define TEXTURE_FILE "../images/reflect.rgb" +#define TEXTURE_FILE DEMOS_DATA_DIR "reflect.rgb" #define LIT 1 #define TEXTURED 2 diff --git a/src/demos/textures.c b/src/demos/textures.c index ca72fc4a..7a0e46dc 100644 --- a/src/demos/textures.c +++ b/src/demos/textures.c @@ -32,10 +32,10 @@ static float TexPos[MAX_TEXTURES][3]; static float TexAspect[MAX_TEXTURES]; static const char *DefaultFiles[] = { - "../images/arch.rgb", - "../images/reflect.rgb", - "../images/tree2.rgba", - "../images/tile.rgb" + DEMOS_DATA_DIR "arch.rgb", + DEMOS_DATA_DIR "reflect.rgb", + DEMOS_DATA_DIR "tree2.rgba", + DEMOS_DATA_DIR "tile.rgb" }; diff --git a/src/demos/tunnel.c b/src/demos/tunnel.c index 6fe0f67b..c5601abe 100644 --- a/src/demos/tunnel.c +++ b/src/demos/tunnel.c @@ -75,7 +75,7 @@ inittextures(void) glGenTextures(1, &t1id); glBindTexture(GL_TEXTURE_2D, t1id); - if (!LoadRGBMipmaps("../images/tile.rgb", GL_RGB)) { + if (!LoadRGBMipmaps(DEMOS_DATA_DIR "tile.rgb", GL_RGB)) { fprintf(stderr, "Error reading a texture.\n"); exit(-1); } @@ -90,7 +90,7 @@ inittextures(void) glGenTextures(1, &t2id); glBindTexture(GL_TEXTURE_2D, t2id); - if (!LoadRGBMipmaps("../images/bw.rgb", GL_RGB)) { + if (!LoadRGBMipmaps(DEMOS_DATA_DIR "bw.rgb", GL_RGB)) { fprintf(stderr, "Error reading a texture.\n"); exit(-1); } diff --git a/src/demos/tunnel2.c b/src/demos/tunnel2.c index 90a9ef30..9b98c2e4 100644 --- a/src/demos/tunnel2.c +++ b/src/demos/tunnel2.c @@ -73,7 +73,7 @@ inittextures(void) glGenTextures(1, &t1id); glBindTexture(GL_TEXTURE_2D, t1id); - if (!LoadRGBMipmaps("../images/tile.rgb", GL_RGB)) { + if (!LoadRGBMipmaps(DEMOS_DATA_DIR "tile.rgb", GL_RGB)) { fprintf(stderr, "Error reading a texture.\n"); exit(-1); } @@ -88,7 +88,7 @@ inittextures(void) glGenTextures(1, &t2id); glBindTexture(GL_TEXTURE_2D, t2id); - if (!LoadRGBMipmaps("../images/bw.rgb", GL_RGB)) { + if (!LoadRGBMipmaps(DEMOS_DATA_DIR "bw.rgb", GL_RGB)) { fprintf(stderr, "Error reading a texture.\n"); exit(-1); } diff --git a/src/demos/winpos.c b/src/demos/winpos.c index f935f9be..fa88bd28 100644 --- a/src/demos/winpos.c +++ b/src/demos/winpos.c @@ -16,7 +16,7 @@ #include "readtex.h" -#define IMAGE_FILE "../images/girl.rgb" +#define IMAGE_FILE DEMOS_DATA_DIR "girl.rgb" #ifndef M_PI diff --git a/src/fp/fp-tri.c b/src/fp/fp-tri.c index e45a799a..03ce443a 100644 --- a/src/fp/fp-tri.c +++ b/src/fp/fp-tri.c @@ -14,7 +14,7 @@ #include "readtex.c" -#define TEXTURE_FILE "../images/bw.rgb" +#define TEXTURE_FILE DEMOS_DATA_DIR "bw.rgb" unsigned show_fps = 0; unsigned int frame_cnt = 0; diff --git a/src/fp/tri-tex.c b/src/fp/tri-tex.c index 64299e94..4e93aff1 100644 --- a/src/fp/tri-tex.c +++ b/src/fp/tri-tex.c @@ -9,7 +9,7 @@ #include "readtex.c" -#define TEXTURE_FILE "../images/girl.rgb" +#define TEXTURE_FILE DEMOS_DATA_DIR "girl.rgb" diff --git a/src/fpglsl/fp-tri.c b/src/fpglsl/fp-tri.c index 5a6692d0..45631246 100644 --- a/src/fpglsl/fp-tri.c +++ b/src/fpglsl/fp-tri.c @@ -14,7 +14,7 @@ #include "readtex.c" -#define TEXTURE_FILE "../images/bw.rgb" +#define TEXTURE_FILE DEMOS_DATA_DIR "bw.rgb" unsigned show_fps = 0; unsigned int frame_cnt = 0; diff --git a/src/glsl/bump.c b/src/glsl/bump.c index 78459644..d62a4a85 100644 --- a/src/glsl/bump.c +++ b/src/glsl/bump.c @@ -18,7 +18,7 @@ static char *FragProgFile = "CH11-bumpmap.frag"; static char *FragTexProgFile = "CH11-bumpmaptex.frag"; static char *VertProgFile = "CH11-bumpmap.vert"; -static char *TextureFile = "../images/tile.rgb"; +static char *TextureFile = DEMOS_DATA_DIR "tile.rgb"; /* program/shader objects */ static GLuint fragShader; diff --git a/src/glsl/convolutions.c b/src/glsl/convolutions.c index f88ec2eb..587159cd 100644 --- a/src/glsl/convolutions.c +++ b/src/glsl/convolutions.c @@ -40,7 +40,7 @@ struct Texture { GLenum format; }; -static const char *textureLocation = "../images/girl2.rgb"; +static const char *textureLocation = DEMOS_DATA_DIR "girl2.rgb"; static GLfloat viewRotx = 0.0, viewRoty = 0.0, viewRotz = 0.0; static struct BoundingBox box; diff --git a/src/glsl/multitex.c b/src/glsl/multitex.c index b1d278a6..74206d71 100644 --- a/src/glsl/multitex.c +++ b/src/glsl/multitex.c @@ -40,8 +40,8 @@ static const char *FragFile = "multitex.frag"; static const char *TexFiles[2] = { - "../images/tile.rgb", - "../images/tree2.rgba" + DEMOS_DATA_DIR "tile.rgb", + DEMOS_DATA_DIR "tree2.rgba" }; diff --git a/src/glsl/texdemo1.c b/src/glsl/texdemo1.c index 5220b5e6..0be84fa8 100644 --- a/src/glsl/texdemo1.c +++ b/src/glsl/texdemo1.c @@ -41,7 +41,7 @@ static const char *CubeFragFile = "cubemap.frag"; static const char *SimpleVertFile = "simple.vert"; static const char *SimpleTexFragFile = "shadowtex.frag"; -static const char *GroundImage = "../images/tile.rgb"; +static const char *GroundImage = DEMOS_DATA_DIR "tile.rgb"; static GLuint Program1, Program2; diff --git a/src/perf/glslstateschange.c b/src/perf/glslstateschange.c index 0ea8a7b7..1e64d07f 100644 --- a/src/perf/glslstateschange.c +++ b/src/perf/glslstateschange.c @@ -60,10 +60,10 @@ static GLint P2TexCoord0_attr = -1, P2TexCoord1_attr = -1; static const char *TexFiles[4] = { - "../images/tile.rgb", - "../images/tree2.rgba", - "../images/tile.rgb", - "../images/tree2.rgba" + DEMOS_DATA_DIR "tile.rgb", + DEMOS_DATA_DIR "tree2.rgba", + DEMOS_DATA_DIR "tile.rgb", + DEMOS_DATA_DIR "tree2.rgba" }; GLuint texObj[4]; diff --git a/src/samples/sphere.c b/src/samples/sphere.c index 23d4fe32..b6ae44a2 100644 --- a/src/samples/sphere.c +++ b/src/samples/sphere.c @@ -40,7 +40,7 @@ GLenum doubleBuffer; int W = 400, H = 400; -char *imageFileName = "../images/reflect.rgb"; +char *imageFileName = DEMOS_DATA_DIR "reflect.rgb"; float *minFilter, *magFilter, *sWrapMode, *tWrapMode; float decal[] = {GL_DECAL}; diff --git a/src/tests/afsmultiarb.c b/src/tests/afsmultiarb.c index ca25a4d7..46829f87 100644 --- a/src/tests/afsmultiarb.c +++ b/src/tests/afsmultiarb.c @@ -16,8 +16,8 @@ #include "readtex.h" -#define TEXTURE_1_FILE "../images/girl.rgb" -#define TEXTURE_2_FILE "../images/reflect.rgb" +#define TEXTURE_1_FILE DEMOS_DATA_DIR "girl.rgb" +#define TEXTURE_2_FILE DEMOS_DATA_DIR "reflect.rgb" #define TEX0 1 #define TEX7 8 diff --git a/src/tests/arbfptexture.c b/src/tests/arbfptexture.c index f66b060c..2db67fa7 100644 --- a/src/tests/arbfptexture.c +++ b/src/tests/arbfptexture.c @@ -11,7 +11,7 @@ #include "readtex.c" -#define TEXTURE_FILE "../images/girl.rgb" +#define TEXTURE_FILE DEMOS_DATA_DIR "girl.rgb" static GLfloat Xrot = 0.0, Yrot = 0.0, Zrot = 0.0; diff --git a/src/tests/arbfptrig.c b/src/tests/arbfptrig.c index 95f008a0..575a3510 100644 --- a/src/tests/arbfptrig.c +++ b/src/tests/arbfptrig.c @@ -11,7 +11,7 @@ #include "readtex.c" -#define TEXTURE_FILE "../images/girl.rgb" +#define TEXTURE_FILE DEMOS_DATA_DIR "girl.rgb" static GLfloat Xrot = 0.0, Yrot = 0.0, Zrot = 0.0; diff --git a/src/tests/arbnpot.c b/src/tests/arbnpot.c index c51a5416..de4d0b4b 100644 --- a/src/tests/arbnpot.c +++ b/src/tests/arbnpot.c @@ -12,7 +12,7 @@ #include <GL/glut.h> #include "../util/readtex.c" -#define IMAGE_FILE "../images/girl.rgb" +#define IMAGE_FILE DEMOS_DATA_DIR "girl.rgb" static GLfloat Zrot = 0; diff --git a/src/tests/arraytexture.c b/src/tests/arraytexture.c index 94adf478..4de39116 100644 --- a/src/tests/arraytexture.c +++ b/src/tests/arraytexture.c @@ -53,15 +53,15 @@ } while (0) static const char *const textures[] = { - "../images/girl.rgb", - "../images/girl2.rgb", - "../images/arch.rgb", - "../images/s128.rgb", - - "../images/tree3.rgb", - "../images/bw.rgb", - "../images/reflect.rgb", - "../images/wrs_logo.rgb", + DEMOS_DATA_DIR "girl.rgb", + DEMOS_DATA_DIR "girl2.rgb", + DEMOS_DATA_DIR "arch.rgb", + DEMOS_DATA_DIR "s128.rgb", + + DEMOS_DATA_DIR "tree3.rgb", + DEMOS_DATA_DIR "bw.rgb", + DEMOS_DATA_DIR "reflect.rgb", + DEMOS_DATA_DIR "wrs_logo.rgb", NULL }; diff --git a/src/tests/blendxor.c b/src/tests/blendxor.c index d6dcb8b8..1fd767f6 100644 --- a/src/tests/blendxor.c +++ b/src/tests/blendxor.c @@ -10,7 +10,7 @@ #include <GL/glut.h> #include "readtex.c" -#define IMAGE_FILE "../images/arch.rgb" +#define IMAGE_FILE DEMOS_DATA_DIR "arch.rgb" static int ImgWidth, ImgHeight; static GLenum ImgFormat; diff --git a/src/tests/bug_3195.c b/src/tests/bug_3195.c index 10481c22..a1db2adf 100644 --- a/src/tests/bug_3195.c +++ b/src/tests/bug_3195.c @@ -41,7 +41,7 @@ #include "readtex.h" -#define TEXTURE_FILE "../images/girl.rgb" +#define TEXTURE_FILE DEMOS_DATA_DIR "girl.rgb" static GLfloat Xrot = 0, Yrot = -30, Zrot = 0; static GLint Bias = 0, BiasStepSign = +1; /* ints avoid fp precision problem */ diff --git a/src/tests/bumpmap.c b/src/tests/bumpmap.c index c2b10c0a..24081d27 100644 --- a/src/tests/bumpmap.c +++ b/src/tests/bumpmap.c @@ -35,7 +35,7 @@ #include "readtex.h" -static const char *TexFile = "../images/arch.rgb"; +static const char *TexFile = DEMOS_DATA_DIR "arch.rgb"; static const GLfloat Near = 5.0, Far = 25.0; diff --git a/src/tests/ext422square.c b/src/tests/ext422square.c index 89e99f02..a6a7fdd9 100644 --- a/src/tests/ext422square.c +++ b/src/tests/ext422square.c @@ -18,7 +18,7 @@ #include "../util/readtex.c" /* I know, this is a hack. */ -#define TEXTURE_FILE "../images/tile.rgb" +#define TEXTURE_FILE DEMOS_DATA_DIR "tile.rgb" static GLfloat Xrot = 0, Yrot = 0, Zrot = 0; static GLint ImgWidth, ImgHeight; diff --git a/src/tests/fillrate.c b/src/tests/fillrate.c index 1e58df28..432b3a73 100644 --- a/src/tests/fillrate.c +++ b/src/tests/fillrate.c @@ -13,8 +13,8 @@ #include <GL/glut.h> #include "readtex.h" -#define TEXTURE_1_FILE "../images/tile.rgb" -#define TEXTURE_2_FILE "../images/reflect.rgb" +#define TEXTURE_1_FILE DEMOS_DATA_DIR "tile.rgb" +#define TEXTURE_2_FILE DEMOS_DATA_DIR "reflect.rgb" static int Win; static int Width = 1010, Height = 1010; diff --git a/src/tests/floattex.c b/src/tests/floattex.c index 46ceddb9..44628d58 100644 --- a/src/tests/floattex.c +++ b/src/tests/floattex.c @@ -13,7 +13,7 @@ #include "shaderutil.h" -static const char *TexFile = "../images/arch.rgb"; +static const char *TexFile = DEMOS_DATA_DIR "arch.rgb"; static const char *FragShaderText = "uniform sampler2D tex1; \n" diff --git a/src/tests/fptexture.c b/src/tests/fptexture.c index 332e0718..5c58ccf3 100644 --- a/src/tests/fptexture.c +++ b/src/tests/fptexture.c @@ -11,7 +11,7 @@ #include "../util/readtex.c" -#define TEXTURE_FILE "../images/girl.rgb" +#define TEXTURE_FILE DEMOS_DATA_DIR "girl.rgb" static GLfloat Xrot = 0.0, Yrot = 0.0, Zrot = 0.0; diff --git a/src/tests/invert.c b/src/tests/invert.c index be46659e..679a0bcf 100644 --- a/src/tests/invert.c +++ b/src/tests/invert.c @@ -40,7 +40,7 @@ #include "readtex.h" -#define IMAGE_FILE "../images/tree3.rgb" +#define IMAGE_FILE DEMOS_DATA_DIR "tree3.rgb" static int Width = 420; static int Height = 150; diff --git a/src/tests/mipmap_limits.c b/src/tests/mipmap_limits.c index 0274f2b7..1b65d752 100644 --- a/src/tests/mipmap_limits.c +++ b/src/tests/mipmap_limits.c @@ -56,7 +56,7 @@ #include "readtex.h" -#define TEXTURE_FILE "../images/girl.rgb" +#define TEXTURE_FILE DEMOS_DATA_DIR "girl.rgb" static GLint BaseLevel = 0, MaxLevel = 9; static GLfloat MinLod = -1, MaxLod = 9; diff --git a/src/tests/mipmap_view.c b/src/tests/mipmap_view.c index eb521970..babdbd39 100644 --- a/src/tests/mipmap_view.c +++ b/src/tests/mipmap_view.c @@ -15,7 +15,7 @@ #include "readtex.h" -#define TEXTURE_FILE "../images/arch.rgb" +#define TEXTURE_FILE DEMOS_DATA_DIR "arch.rgb" #define LEVELS 8 #define SIZE (1<<LEVELS) diff --git a/src/tests/multipal.c b/src/tests/multipal.c index 4a940169..172f6ae7 100644 --- a/src/tests/multipal.c +++ b/src/tests/multipal.c @@ -18,8 +18,8 @@ #include "../util/readtex.c" /* I know, this is a hack. */ -#define TEXTURE_1_FILE "../images/tile.rgb" -#define TEXTURE_2_FILE "../images/reflect.rgb" +#define TEXTURE_1_FILE DEMOS_DATA_DIR "tile.rgb" +#define TEXTURE_2_FILE DEMOS_DATA_DIR "reflect.rgb" #define TEX0 1 #define TEX1 2 diff --git a/src/tests/pbo.c b/src/tests/pbo.c index 9974486d..d40163e6 100644 --- a/src/tests/pbo.c +++ b/src/tests/pbo.c @@ -15,7 +15,7 @@ #include "../util/readtex.c" /* a hack, I know */ -#define IMAGE_FILE "../images/girl.rgb" +#define IMAGE_FILE DEMOS_DATA_DIR "girl.rgb" static int ImgWidth, ImgHeight; static GLenum ImgFormat; diff --git a/src/tests/rubberband.c b/src/tests/rubberband.c index 866a0f51..f45cd99a 100644 --- a/src/tests/rubberband.c +++ b/src/tests/rubberband.c @@ -9,7 +9,7 @@ #include <GL/glut.h> #include "readtex.c" -#define IMAGE_FILE "../images/arch.rgb" +#define IMAGE_FILE DEMOS_DATA_DIR "arch.rgb" static int ImgWidth, ImgHeight; static GLenum ImgFormat; diff --git a/src/tests/texcmp.c b/src/tests/texcmp.c index c5d352fd..b9601108 100644 --- a/src/tests/texcmp.c +++ b/src/tests/texcmp.c @@ -11,7 +11,7 @@ #include <GL/glut.h> #include "readtex.c" /* I know, this is a hack. */ -#define TEXTURE_FILE "../images/tree2.rgba" +#define TEXTURE_FILE DEMOS_DATA_DIR "tree2.rgba" static float Rot = 0.0; diff --git a/src/tests/texcompress2.c b/src/tests/texcompress2.c index b95aca9f..c828f9df 100644 --- a/src/tests/texcompress2.c +++ b/src/tests/texcompress2.c @@ -9,7 +9,7 @@ #include <GL/glut.h> #include "readtex.c" -#define IMAGE_FILE "../images/arch.rgb" +#define IMAGE_FILE DEMOS_DATA_DIR "arch.rgb" static int ImgWidth, ImgHeight; static GLenum ImgFormat; diff --git a/src/tests/texline.c b/src/tests/texline.c index 1803832b..5f29fc2e 100644 --- a/src/tests/texline.c +++ b/src/tests/texline.c @@ -13,7 +13,7 @@ #include <GL/glut.h> #include "../util/readtex.c" /* I know, this is a hack. */ -#define TEXTURE_FILE "../images/girl.rgb" +#define TEXTURE_FILE DEMOS_DATA_DIR "girl.rgb" static GLboolean Antialias = GL_FALSE; static GLboolean Animate = GL_FALSE; diff --git a/src/tests/texrect.c b/src/tests/texrect.c index 10061ee5..93ba4980 100644 --- a/src/tests/texrect.c +++ b/src/tests/texrect.c @@ -14,8 +14,8 @@ #include <GL/glut.h> #include "readtex.h" -#define TEXTURE_0_FILE "../images/girl.rgb" -#define TEXTURE_1_FILE "../images/reflect.rgb" +#define TEXTURE_0_FILE DEMOS_DATA_DIR "girl.rgb" +#define TEXTURE_1_FILE DEMOS_DATA_DIR "reflect.rgb" #define TEX0 1 #define TEX7 8 diff --git a/src/tests/vparray.c b/src/tests/vparray.c index 75160afd..fcdfae3e 100644 --- a/src/tests/vparray.c +++ b/src/tests/vparray.c @@ -208,7 +208,7 @@ static void init(void) glEnable( GL_DEPTH_TEST ); glEnable(GL_NORMALIZE); InitMaterials(); - read_surface( "../demos/isosurf.dat" ); + read_surface(DEMOS_DATA_DIR "isosurf.dat"); init_program(); } diff --git a/src/tests/yuvrect.c b/src/tests/yuvrect.c index aab2f80e..992828a7 100644 --- a/src/tests/yuvrect.c +++ b/src/tests/yuvrect.c @@ -14,7 +14,7 @@ #include "../util/readtex.c" /* I know, this is a hack. */ -#define TEXTURE_FILE "../images/girl.rgb" +#define TEXTURE_FILE DEMOS_DATA_DIR "girl.rgb" static GLfloat Xrot = 0, Yrot = 0, Zrot = 0; static GLint ImgWidth, ImgHeight; diff --git a/src/tests/yuvsquare.c b/src/tests/yuvsquare.c index 658528b7..f8df73db 100644 --- a/src/tests/yuvsquare.c +++ b/src/tests/yuvsquare.c @@ -14,7 +14,7 @@ #include "../util/readtex.c" /* I know, this is a hack. */ -#define TEXTURE_FILE "../images/tile.rgb" +#define TEXTURE_FILE DEMOS_DATA_DIR "tile.rgb" static GLfloat Xrot = 0, Yrot = 0, Zrot = 0; static GLint ImgWidth, ImgHeight; diff --git a/src/xdemos/yuvrect_client.c b/src/xdemos/yuvrect_client.c index 5289b43d..ccbd4790 100644 --- a/src/xdemos/yuvrect_client.c +++ b/src/xdemos/yuvrect_client.c @@ -16,7 +16,7 @@ #include "../util/readtex.c" /* I know, this is a hack. */ -#define TEXTURE_FILE "../images/girl2.rgb" +#define TEXTURE_FILE DEMOS_DATA_DIR "girl2.rgb" static GLfloat Xrot = 0, Yrot = 0, Zrot = 0; static GLint ImgWidth, ImgHeight; |