diff options
author | Tom Schouten <doelie@users.sourceforge.net> | 2006-09-01 13:45:31 +0000 |
---|---|---|
committer | Tom Schouten <doelie@users.sourceforge.net> | 2006-09-01 13:45:31 +0000 |
commit | 7591a024f184bd385d35583d19d86c1d5f2531ba (patch) | |
tree | 77aa0c44ccb700eb9a2b16e1b246e3c8026c40ed /opengl | |
parent | 91dd6b68f0f209ad015a303095bb1df018dca71e (diff) |
pdp current darcs merge
svn path=/trunk/externals/pdp/; revision=5816
Diffstat (limited to 'opengl')
-rw-r--r-- | opengl/Makefile | 19 | ||||
-rw-r--r-- | opengl/Makefile.config | 15 | ||||
-rw-r--r-- | opengl/modules/pdp_3d_draw.c | 48 | ||||
-rw-r--r-- | opengl/system/pdp_3Dcontext_common.c | 2 | ||||
-rw-r--r-- | opengl/system/pdp_3Dcontext_glx.c | 1 | ||||
-rw-r--r-- | opengl/system/pdp_opengl.c | 2 | ||||
-rw-r--r-- | opengl/system/setup.c | 7 |
7 files changed, 65 insertions, 29 deletions
diff --git a/opengl/Makefile b/opengl/Makefile index d62358e..b0b3027 100644 --- a/opengl/Makefile +++ b/opengl/Makefile @@ -24,4 +24,21 @@ pdp_opengl.pd_linux: subdirs pdp_opengl.pd_darwin: subdirs rm -f pdp_opengl.pd_linux - $(CC) -o pdp_opengl.pd_pd_darwin modules/*.o system/*.o $(LDFLAGS) -g -bundle -bundle_loader $(PD_EXECUTABLE) + $(CC) -o pdp_opengl.pd_pd_darwin ../modules/*/*.o ../system/pdp.o ../system/*/*.o ../puredata/*.o modules/*.o system/*.o $(PDP_LIBS) -bundle -undefined error -twolevel_namespace -bundle_loader $(PD_EXECUTABLE) + + +# $(CC) -o pdp_opengl.pd_pd_darwin modules/*.o system/*.o $(LDFLAGS) -g -dynamic -bundle -flat_namespace -undefined suppress +# $(CC) -o pdp_opengl.pd_pd_darwin modules/*.o system/*.o $(LDFLAGS) -g -bundle -bundle_loader $(PD_EXECUTABLE) + +install: all + test -d $(prefix)/lib/pd #check if pd is installed. if this fails make install will stop here. + install -d $(prefix)/lib/pd/extra + install -m 755 $(PDP_OPENGL_LIBRARY_NAME) $(prefix)/lib/pd/extra + install -m 644 abstractions/*.pd $(prefix)/lib/pd/extra + install -m 644 doc/objects/*.pd $(prefix)/lib/pd/doc/5.reference + install -m 755 -d $(prefix)/lib/pd/doc/pdp + install -m 755 -d $(prefix)/lib/pd/doc/pdp/introduction + install -m 755 -d $(prefix)/lib/pd/doc/pdp/examples_opengl + install -m 644 doc/reference_opengl.txt $(prefix)/lib/pd/doc/pdp + install -m 644 doc/examples/*.pd $(prefix)/lib/pd/doc/pdp/examples_opengl + diff --git a/opengl/Makefile.config b/opengl/Makefile.config index 4e59a4c..203420c 100644 --- a/opengl/Makefile.config +++ b/opengl/Makefile.config @@ -1,18 +1,25 @@ -PD_DIR = /home/tom/pd/distro/pd/src -PDP_DIR = /home/tom/pd/packet/include -PDP_OGL_DIR = /home/tom/pd/packet/opengl/include +prefix = /usr/local + +PDP_VERSION=0.12.5-darcs +PDP_DIR = ../../include +PDP_OGL_DIR = ../include CFLAGS = -DPD -O2 -funroll-loops -fomit-frame-pointer -ffast-math \ -Wall -W -Wstrict-prototypes -Werror \ -Wno-unused -Wno-parentheses -Wno-switch -g -CPPFLAGS = -I$(PD_DIR) -I$(PDP_DIR) -I$(PDP_OGL_DIR) -I/usr/X11R6/include + +CPPFLAGS = -I$(PDP_DIR) -I$(PDP_OGL_DIR) -I/usr/X11R6/include -DPDP_VERSION=\"$(PDP_VERSION)\" +# CPPFLAGS = -I$(PD_DIR) -I$(PDP_DIR) -I$(PDP_OGL_DIR) -I/usr/X11R6/include + LDFLAGS = -lGL -lglut TARGET=linux +PDP_OPENGL_LIBRARY_NAME=pdp_opengl.pd_$(TARGET) + #uncomment these for darwin: #TARGET=darwin #CPPFLAGS+=-I/sw/include diff --git a/opengl/modules/pdp_3d_draw.c b/opengl/modules/pdp_3d_draw.c index 39434cb..a47db71 100644 --- a/opengl/modules/pdp_3d_draw.c +++ b/opengl/modules/pdp_3d_draw.c @@ -20,7 +20,8 @@ //#include "GL/gl.h" -#include <GL/glut.h> +//#include <GL/glut.h> +#include <GL/glu.h> #include <math.h> #include "pdp_opengl.h" @@ -162,16 +163,23 @@ static void draw_wtriangle(t_drawcommand *x) static void draw_wcube(t_drawcommand *x) { - glutWireCube(x->x_p0); + x->x_p1 = x->x_p0; // set square z coord; + glPushMatrix(); + draw_wsquare(x); + glRotatef(90, 0,1,0); + draw_wsquare(x); + glRotatef(90, 0,1,0); + draw_wsquare(x); + glRotatef(90, 0,1,0); + draw_wsquare(x); + glPopMatrix(); + } static void draw_cube(t_drawcommand *x) { x->x_p1 = x->x_p0; // set square z coord; - //glutSolidCube(x->x_p0); - - //glMatrixMode(GL_MODELVIEW); glPushMatrix(); draw_square(x); glRotatef(90, 0,1,0); @@ -201,7 +209,7 @@ static void draw_wtorus(t_drawcommand *x) if (n < 1) n = 20; if (m < 1) m = n; - glutWireTorus(ri, ro, n, m); + // glutWireTorus(ri, ro, n, m); } @@ -215,7 +223,7 @@ static void draw_torus(t_drawcommand *x) if (n < 1) n = 20; if (m < 1) m = n; - glutSolidTorus(ri, ro, n, m); + // glutSolidTorus(ri, ro, n, m); } @@ -229,7 +237,7 @@ static void draw_cone(t_drawcommand *x) if (n < 1) n = 20; if (m < 1) m = n; - glutSolidCone(base, height, n, m); + // glutSolidCone(base, height, n, m); } @@ -243,21 +251,21 @@ static void draw_wcone(t_drawcommand *x) if (n < 1) n = 20; if (m < 1) m = n; - glutWireCone(base, height, n, m); + // glutWireCone(base, height, n, m); } static void draw_wteapot(t_drawcommand *x) { float f = x->x_p0; - glutWireTeapot(f); + // glutWireTeapot(f); } static void draw_teapot(t_drawcommand *x) { float f = x->x_p0; - glutSolidTeapot(f); + // glutSolidTeapot(f); } @@ -270,7 +278,7 @@ static void draw_wsphere(t_drawcommand *x) if (n < 1) n = 20; if (m < 1) m = n; - glutWireSphere(f, n, m); + // glutWireSphere(f, n, m); } @@ -289,15 +297,15 @@ static void draw_sphere(t_drawcommand *x) } -static void draw_dodeca(t_drawcommand *x){glutSolidDodecahedron();} -static void draw_octa(t_drawcommand *x) {glutSolidOctahedron();} -static void draw_tetra(t_drawcommand *x) {glutSolidTetrahedron();} -static void draw_icosa(t_drawcommand *x) {glutSolidIcosahedron();} +static void draw_dodeca(t_drawcommand *x){ /* glutSolidDodecahedron(); */ } +static void draw_octa(t_drawcommand *x) { /* glutSolidOctahedron(); */ } +static void draw_tetra(t_drawcommand *x) { /* glutSolidTetrahedron(); */ } +static void draw_icosa(t_drawcommand *x) { /* glutSolidIcosahedron(); */ } -static void draw_wdodeca(t_drawcommand *x){glutWireDodecahedron();} -static void draw_wocta(t_drawcommand *x) {glutWireOctahedron();} -static void draw_wtetra(t_drawcommand *x) {glutWireTetrahedron();} -static void draw_wicosa(t_drawcommand *x) {glutWireIcosahedron();} +static void draw_wdodeca(t_drawcommand *x){ /* glutWireDodecahedron(); */ } +static void draw_wocta(t_drawcommand *x) { /* glutWireOctahedron(); */ } +static void draw_wtetra(t_drawcommand *x) { /* glutWireTetrahedron(); */ } +static void draw_wicosa(t_drawcommand *x) { /* glutWireIcosahedron(); */ } diff --git a/opengl/system/pdp_3Dcontext_common.c b/opengl/system/pdp_3Dcontext_common.c index 185e2be..86f5657 100644 --- a/opengl/system/pdp_3Dcontext_common.c +++ b/opengl/system/pdp_3Dcontext_common.c @@ -28,9 +28,7 @@ #include "pdp_3Dcontext.h" #include <GL/gl.h> -//#include <GL/glx.h> #include <GL/glu.h> -//#include <GL/glut.h> #define D if (0) diff --git a/opengl/system/pdp_3Dcontext_glx.c b/opengl/system/pdp_3Dcontext_glx.c index ac25a13..f124686 100644 --- a/opengl/system/pdp_3Dcontext_glx.c +++ b/opengl/system/pdp_3Dcontext_glx.c @@ -28,7 +28,6 @@ #include <GL/gl.h> #include <GL/glx.h> #include <GL/glu.h> -//#include <GL/glut.h> /* all symbols are C-style */ #ifdef __cplusplus diff --git a/opengl/system/pdp_opengl.c b/opengl/system/pdp_opengl.c index 541af75..c8ede29 100644 --- a/opengl/system/pdp_opengl.c +++ b/opengl/system/pdp_opengl.c @@ -56,6 +56,7 @@ static void pdp_control_thread(void *x, t_symbol *s, int argc, t_atom *argv) } + /* kernel setup */ void pdp_opengl_system_setup(void) { @@ -68,6 +69,7 @@ void pdp_opengl_system_setup(void) /* add pdp_control method for thread */ pdp_control_addmethod((t_method)pdp_control_thread, gensym("3dthread")); + } t_pdp_procqueue* pdp_opengl_get_queue(void){return (&_3dp_queue);} diff --git a/opengl/system/setup.c b/opengl/system/setup.c index 18d267a..5b40c1b 100644 --- a/opengl/system/setup.c +++ b/opengl/system/setup.c @@ -46,10 +46,15 @@ void pdp_3d_subcontext_setup(void); //#define D(x) { pdp_post_n( #x ".." ); x; pdp_post("done"); } #define D(x) x + +void pdp_setup(void); void pdp_opengl_setup(void) { int i; - post("PDP: pdp_opengl extension library"); + + pdp_setup(); + + post("PDP: opengl extensions version " PDP_VERSION); /* setup system */ D(pdp_opengl_system_setup()); |