metasurf

changeset 5:dedd153d2ceb

- fixed makefile to produce non-broken shared objects - removed glutGetModifiers from the motion callback and placed it in the mouse callback as apparently it's not supposed to be called from there. - added MacOSX include paths in the examples
author John Tsiombikas <nuclear@member.fsf.org>
date Tue, 25 Oct 2011 23:38:39 +0300
parents 2c575855f707
children c1a60ab45bf7
files Makefile.in examples/metaballs/Makefile examples/metaballs/src/metaballs.c examples/volume/Makefile
diffstat 4 files changed, 10 insertions(+), 6 deletions(-) [+]
line diff
     1.1 --- a/Makefile.in	Tue Oct 25 23:21:32 2011 +0300
     1.2 +++ b/Makefile.in	Tue Oct 25 23:38:39 2011 +0300
     1.3 @@ -28,7 +28,7 @@
     1.4  all: $(lib_so) $(lib_a)
     1.5  
     1.6  $(lib_so): $(obj)
     1.7 -	$(CC) -o $@ $(shared) $(LDFLAGS)
     1.8 +	$(CC) -o $@ $(shared) $(obj) $(LDFLAGS)
     1.9  
    1.10  $(lib_a): $(obj)
    1.11  	$(AR) rcs $@ $(obj)
     2.1 --- a/examples/metaballs/Makefile	Tue Oct 25 23:21:32 2011 +0300
     2.2 +++ b/examples/metaballs/Makefile	Tue Oct 25 23:38:39 2011 +0300
     2.3 @@ -7,11 +7,12 @@
     2.4  #nosdr = -DNO_SHADERS
     2.5  
     2.6  CC = gcc
     2.7 -CFLAGS = -pedantic -Wall -g -I../../src $(nosdr)
     2.8 +CFLAGS = -pedantic -Wall -g -I../../src $(inc) $(nosdr)
     2.9  LDFLAGS = -L../.. -lmetasurf $(libgl)
    2.10  
    2.11  ifeq ($(shell uname -s), Darwin)
    2.12 -	libgl = -framework OpenGL -framework GLUT -lGLEW
    2.13 +	inc = -I/opt/local/include
    2.14 +	libgl = -L/opt/local/lib -framework OpenGL -framework GLUT -lGLEW
    2.15  else
    2.16  	libgl = -lGL -lGLU -lglut -lGLEW
    2.17  endif
     3.1 --- a/examples/metaballs/src/metaballs.c	Tue Oct 25 23:21:32 2011 +0300
     3.2 +++ b/examples/metaballs/src/metaballs.c	Tue Oct 25 23:38:39 2011 +0300
     3.3 @@ -262,12 +262,14 @@
     3.4  
     3.5  int bnstate[32];
     3.6  int prev_x, prev_y;
     3.7 +int mod;
     3.8  
     3.9  void mouse(int bn, int state, int x, int y)
    3.10  {
    3.11  	bnstate[bn] = state == GLUT_DOWN;
    3.12  	prev_x = x;
    3.13  	prev_y = y;
    3.14 +	mod = glutGetModifiers();
    3.15  }
    3.16  
    3.17  void motion(int x, int y)
    3.18 @@ -279,7 +281,7 @@
    3.19  	prev_x = x;
    3.20  	prev_y = y;
    3.21  
    3.22 -	if(glutGetModifiers()) {
    3.23 +	if(mod) {
    3.24  		if(bnstate[GLUT_LEFT_BUTTON]) {
    3.25  			cam_inp_rotate(dx, dy);
    3.26  		}
     4.1 --- a/examples/volume/Makefile	Tue Oct 25 23:21:32 2011 +0300
     4.2 +++ b/examples/volume/Makefile	Tue Oct 25 23:38:39 2011 +0300
     4.3 @@ -7,11 +7,12 @@
     4.4  #nosdr = -DNO_SHADERS
     4.5  
     4.6  CC = gcc
     4.7 -CFLAGS = -pedantic -Wall -g -I../../src $(nosdr)
     4.8 +CFLAGS = -pedantic -Wall -g -I../../src $(inc) $(nosdr)
     4.9  LDFLAGS = -L../.. -lmetasurf $(libgl) -limago
    4.10  
    4.11  ifeq ($(shell uname -s), Darwin)
    4.12 -	libgl = -framework OpenGL -framework GLUT -lGLEW
    4.13 +	inc = -I/opt/local/include
    4.14 +	libgl = -L/opt/local/lib -framework OpenGL -framework GLUT -lGLEW
    4.15  else
    4.16  	libgl = -lGL -lGLU -lglut -lGLEW
    4.17  endif