summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaulo Zanoni <pzanoni@mandriva.com>2011-01-28 17:34:24 -0200
committerBrian Paul <brianp@vmware.com>2011-02-02 16:45:38 -0700
commit2ec1a249ddb1fe18fd01cc9147f7f5600c613ed7 (patch)
tree9140b072fa262683df7e6ecdcc8feef3b990eccf
parent0838d8038f2a53341a492c62a6368c9d33390521 (diff)
downloadmesa-demos-2ec1a249ddb1fe18fd01cc9147f7f5600c613ed7.zip
mesa-demos-2ec1a249ddb1fe18fd01cc9147f7f5600c613ed7.tar.xz
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--.gitignore5
-rw-r--r--CMakeLists.txt2
-rw-r--r--Makefile.am3
-rw-r--r--configure.ac18
-rw-r--r--index.html2
-rw-r--r--m4/ac_define_dir.m449
-rw-r--r--src/CMakeLists.txt2
-rw-r--r--src/Makefile.am2
-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)bin793398 -> 793398 bytes
-rw-r--r--src/data/bw.rgb (renamed from src/images/bw.rgb)bin206452 -> 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)bin117075 -> 117075 bytes
-rw-r--r--src/data/girl2.rgb (renamed from src/images/girl2.rgb)bin117139 -> 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)bin39632 -> 39632 bytes
-rw-r--r--src/data/s128.rgb (renamed from src/images/s128.rgb)bin54258 -> 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)bin206534 -> 206534 bytes
-rw-r--r--src/data/tree2.rgba (renamed from src/images/tree2.rgba)bin66048 -> 66048 bytes
-rw-r--r--src/data/tree3.rgb (renamed from src/images/tree3.rgb)bin24816 -> 24816 bytes
-rw-r--r--src/data/wrs_logo.rgb (renamed from src/images/wrs_logo.rgb)bin37574 -> 37574 bytes
-rw-r--r--src/demos/CMakeLists.txt4
-rw-r--r--src/demos/Makefile.am5
-rw-r--r--src/demos/copypix.c2
-rw-r--r--src/demos/dissolve.c4
-rw-r--r--src/demos/drawpix.c2
-rw-r--r--src/demos/engine.c2
-rw-r--r--src/demos/fbo_firecube.c7
-rw-r--r--src/demos/fire.c7
-rw-r--r--src/demos/geartrain.c2
-rw-r--r--src/demos/gloss.c4
-rw-r--r--src/demos/ipers.c2
-rw-r--r--src/demos/isosurf.c4
-rw-r--r--src/demos/lodbias.c2
-rw-r--r--src/demos/multiarb.c4
-rw-r--r--src/demos/projtex.c8
-rw-r--r--src/demos/rain.cxx3
-rw-r--r--src/demos/readpix.c2
-rw-r--r--src/demos/reflect.c2
-rw-r--r--src/demos/teapot.c4
-rw-r--r--src/demos/terrain.c2
-rw-r--r--src/demos/texcyl.c2
-rw-r--r--src/demos/textures.c8
-rw-r--r--src/demos/tunnel.c4
-rw-r--r--src/demos/tunnel2.c4
-rw-r--r--src/demos/winpos.c2
-rw-r--r--src/fp/fp-tri.c2
-rw-r--r--src/fp/tri-tex.c2
-rw-r--r--src/fpglsl/fp-tri.c2
-rw-r--r--src/glsl/bump.c2
-rw-r--r--src/glsl/convolutions.c2
-rw-r--r--src/glsl/multitex.c4
-rw-r--r--src/glsl/texdemo1.c2
-rw-r--r--src/perf/glslstateschange.c8
-rw-r--r--src/samples/sphere.c2
-rw-r--r--src/tests/afsmultiarb.c4
-rw-r--r--src/tests/arbfptexture.c2
-rw-r--r--src/tests/arbfptrig.c2
-rw-r--r--src/tests/arbnpot.c2
-rw-r--r--src/tests/arraytexture.c18
-rw-r--r--src/tests/blendxor.c2
-rw-r--r--src/tests/bug_3195.c2
-rw-r--r--src/tests/bumpmap.c2
-rw-r--r--src/tests/ext422square.c2
-rw-r--r--src/tests/fillrate.c4
-rw-r--r--src/tests/floattex.c2
-rw-r--r--src/tests/fptexture.c2
-rw-r--r--src/tests/invert.c2
-rw-r--r--src/tests/mipmap_limits.c2
-rw-r--r--src/tests/mipmap_view.c2
-rw-r--r--src/tests/multipal.c4
-rw-r--r--src/tests/pbo.c2
-rw-r--r--src/tests/rubberband.c2
-rw-r--r--src/tests/texcmp.c2
-rw-r--r--src/tests/texcompress2.c2
-rw-r--r--src/tests/texline.c2
-rw-r--r--src/tests/texrect.c4
-rw-r--r--src/tests/vparray.c2
-rw-r--r--src/tests/yuvrect.c2
-rw-r--r--src/tests/yuvsquare.c2
-rw-r--r--src/xdemos/yuvrect_client.c2
83 files changed, 181 insertions, 107 deletions
diff --git a/.gitignore b/.gitignore
index 281ca72..8fd26e4 100644
--- a/.gitignore
+++ b/.gitignore
@@ -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 7b5dcf9..3f8fc9f 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 63ca19e..024bff3 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 49cd80f..e17fbcf 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
diff --git a/index.html b/index.html
index 0e0342c..b086a8f 100644
--- a/index.html
+++ b/index.html
@@ -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 0000000..db42d3e
--- /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 ac745f0..a7f3733 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 a9f0452..1647d64 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 5bcd4f2..a21cc0b 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 b08c4cb..28022c9 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
index 5f35bbd..5f35bbd 100644
--- a/src/images/arch.rgb
+++ b/src/data/arch.rgb
Binary files differ
diff --git a/src/images/bw.rgb b/src/data/bw.rgb
index f5de0f1..f5de0f1 100644
--- a/src/images/bw.rgb
+++ b/src/data/bw.rgb
Binary files differ
diff --git a/src/demos/geartrain.dat b/src/data/geartrain.dat
index 09fe4c6..09fe4c6 100644
--- a/src/demos/geartrain.dat
+++ b/src/data/geartrain.dat
diff --git a/src/images/girl.rgb b/src/data/girl.rgb
index ed5459c..ed5459c 100644
--- a/src/images/girl.rgb
+++ b/src/data/girl.rgb
Binary files differ
diff --git a/src/images/girl2.rgb b/src/data/girl2.rgb
index d5e557d..d5e557d 100644
--- a/src/images/girl2.rgb
+++ b/src/data/girl2.rgb
Binary files differ
diff --git a/src/demos/isosurf.dat b/src/data/isosurf.dat
index 5cadecd..5cadecd 100644
--- a/src/demos/isosurf.dat
+++ b/src/data/isosurf.dat
diff --git a/src/images/reflect.rgb b/src/data/reflect.rgb
index 45319e9..45319e9 100644
--- a/src/images/reflect.rgb
+++ b/src/data/reflect.rgb
Binary files differ
diff --git a/src/images/s128.rgb b/src/data/s128.rgb
index 79f5c1d..79f5c1d 100644
--- a/src/images/s128.rgb
+++ b/src/data/s128.rgb
Binary files differ
diff --git a/src/demos/terrain.dat b/src/data/terrain.dat
index 2af385e..2af385e 100644
--- a/src/demos/terrain.dat
+++ b/src/data/terrain.dat
diff --git a/src/images/tile.rgb b/src/data/tile.rgb
index 5c1c73b..5c1c73b 100644
--- a/src/images/tile.rgb
+++ b/src/data/tile.rgb
Binary files differ
diff --git a/src/images/tree2.rgba b/src/data/tree2.rgba
index 67b0279..67b0279 100644
--- a/src/images/tree2.rgba
+++ b/src/data/tree2.rgba
Binary files differ
diff --git a/src/images/tree3.rgb b/src/data/tree3.rgb
index ce2c44d..ce2c44d 100644
--- a/src/images/tree3.rgb
+++ b/src/data/tree3.rgb
Binary files differ
diff --git a/src/images/wrs_logo.rgb b/src/data/wrs_logo.rgb
index f1b9214..f1b9214 100644
--- a/src/images/wrs_logo.rgb
+++ b/src/data/wrs_logo.rgb
Binary files differ
diff --git a/src/demos/CMakeLists.txt b/src/demos/CMakeLists.txt
index 55e7bb3..77c36d2 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 c99dbd8..8751786 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 98c835f..4e96bd0 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 8ab5242..b492b2b 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 9bc7086..aeb1d36 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 ee7d5c1..f5fd90f 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 3fd7413..fdeb93f 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 2e15985..96c3e2c 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 128687b..be82592 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 ddfd548..04ba0d2 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 d2f3a11..f8257bc 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 c9601e9..903d165 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 c1c6e3d..1dc9390 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 82796a0..29b46f0 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 d162568..fa25ea8 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 60fc414..9be461d 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 cc4e490..02a8d28 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 b72af12..2d4239a 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 fb79708..08516ed 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 97c4656..9d94ca4 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 4df97ec..428cc78 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 ca72fc4..7a0e46d 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 6fe0f67..c5601ab 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 90a9ef3..9b98c2e 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 f935f9b..fa88bd2 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 e45a799..03ce443 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 64299e9..4e93aff 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 5a6692d..4563124 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 7845964..d62a4a8 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 f88ec2e..587159c 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 b1d278a..74206d7 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 5220b5e..0be84fa 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 0ea8a7b..1e64d07 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 23d4fe3..b6ae44a 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 ca25a4d..46829f8 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 f66b060..2db67fa 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 95f008a..575a351 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 c51a541..de4d0b4 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 94adf47..4de3911 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 d6dcb8b..1fd767f 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 10481c2..a1db2ad 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 c2b10c0..24081d2 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 89e99f0..a6a7fdd 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 1e58df2..432b3a7 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 46ceddb..44628d5 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 332e071..5c58ccf 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 be46659..679a0bc 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 0274f2b..1b65d75 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 eb52197..babdbd3 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 4a94016..172f6ae 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 9974486..d40163e 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 866a0f5..f45cd99 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 c5d352f..b960110 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 b95aca9..c828f9d 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 1803832..5f29fc2 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 10061ee..93ba498 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 75160af..fcdfae3 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 aab2f80..992828a 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 658528b..f8df73d 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 5289b43..ccbd479 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;