~ubuntu-branches/ubuntu/lucid/pdl/lucid

« back to all changes in this revision

Viewing changes to debian/patches/80_stolen-from-head_TriD.dpatch

  • Committer: Bazaar Package Importer
  • Author(s): Barry deFreese
  • Date: 2006-07-22 21:24:33 UTC
  • Revision ID: james.westby@ubuntu.com-20060722212433-iymufwb3fet4kth8
Tags: 1:2.4.2-6ubuntu1
Re-sync with Debian

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#! /bin/sh /usr/share/dpatch/dpatch-run
 
2
## 80_stolen-from-head_TriD.dpatch by Henning Glawe <glaweh@physik.fu-berlin.de>
 
3
##
 
4
## All lines beginning with `## DP:' are a description of the patch.
 
5
## DP: No description.
 
6
 
 
7
@DPATCH@
 
8
diff -urNad pdl-2.4.2/Graphics/Makefile.PL /tmp/dpep.IxNtli/pdl-2.4.2/Graphics/Makefile.PL
 
9
--- pdl-2.4.2/Graphics/Makefile.PL      2004-12-27 18:29:51.000000000 +0100
 
10
+++ /tmp/dpep.IxNtli/pdl-2.4.2/Graphics/Makefile.PL     2006-06-03 22:41:02.261045250 +0200
 
11
@@ -78,15 +78,15 @@
 
12
   if (trylink( 'libGL',
 
13
                '', 'char glBegin(); glBegin();',
 
14
                libs('-lGL'), $mmpre)) {
 
15
-        $libs = '-lGLU -lGL';
 
16
+        $libs = libs('-lGLU -lGL');
 
17
   } elsif (trylink ('libMesaGL',
 
18
                          '', 'char glBegin(); glBegin();',
 
19
                          libs('-lMesaGL'), $mmpre)) {
 
20
-        $libs = '-lMesaGLU -lMesaGL';
 
21
+        $libs = libs('-lMesaGLU -lMesaGL');
 
22
   } elsif (trylink ('libMesaGL with pthread',
 
23
                          '', 'char glBegin(); glBegin();',
 
24
                          libs('-lMesaGL -lpthread'), $mmpre)) {
 
25
-        $libs = '-lMesaGLU -lMesaGL -lpthread';
 
26
+        $libs = libs('-lMesaGLU -lMesaGL -lpthread');
 
27
   }
 
28
 
 
29
   # Add -lm to libs (Seems to be needed on Linux and Solaris, and shouldn't hurt for others)
 
30
@@ -101,5 +101,5 @@
 
31
   my ($libs) = @_;
 
32
   my $lpath = '-L/usr/X11R6/lib -L/usr/lib/mesa';
 
33
   my $extra = '-lXext -lX11 -lm';
 
34
-  return "$lpath $libs $extra";
 
35
+  return ${[ExtUtils::Liblist->ext("$lpath $libs $extra")]}[0];
 
36
 }
 
37
diff -urNad pdl-2.4.2/Graphics/TriD/Makefile.PL /tmp/dpep.IxNtli/pdl-2.4.2/Graphics/TriD/Makefile.PL
 
38
--- pdl-2.4.2/Graphics/TriD/Makefile.PL 2004-08-19 08:27:38.000000000 +0200
 
39
+++ /tmp/dpep.IxNtli/pdl-2.4.2/Graphics/TriD/Makefile.PL        2006-06-03 22:39:19.794641500 +0200
 
40
@@ -30,7 +30,7 @@
 
41
         ) if defined $PDL::Config{OPENGL_LIBS};
 
42
 
 
43
     my $lib = ""; # Gets the first lib found...
 
44
-    my @patterns = qw( GL.a GL.so MesaGL.a MesaGL.so );
 
45
+    my @patterns = qw( GL.a GL.so GL.dll.a MesaGL.a MesaGL.so Mesa.dll.a );
 
46
 
 
47
     my %Ldirs = ();
 
48
     foreach my $dir (@check_dirs) {
 
49
diff -urNad pdl-2.4.2/Graphics/TriD/OpenGL/opengl.pd /tmp/dpep.IxNtli/pdl-2.4.2/Graphics/TriD/OpenGL/opengl.pd
 
50
--- pdl-2.4.2/Graphics/TriD/OpenGL/opengl.pd    2004-12-27 18:30:24.000000000 +0100
 
51
+++ /tmp/dpep.IxNtli/pdl-2.4.2/Graphics/TriD/OpenGL/opengl.pd   2006-06-03 22:39:19.794641500 +0200
 
52
@@ -27,10 +27,22 @@
 
53
 # undefined function calls in "demo 3d", you've probably come to the right
 
54
 # place.
 
55
 #
 
56
+##############################
 
57
+# Notes 6-March-2006 CED - preparing for 2.4.3
 
58
+#
 
59
+# Fuck.  This is even worse than I thought.  The latest is that it stopped compiling
 
60
+# under recent (2005) Fedora releases.  The problem is that gl.h (and other headers)
 
61
+# now contain #ifdefs that make it practically impossible to parse them before
 
62
+# compile time.  So now we spend a great deal of time assembling all the precursor
 
63
+# .h's for each .h, so that they are preprocessed in context.  That means we need 
 
64
+# a fence in the source files we feed to the preprocessor, so that we don't detect and
 
65
+# declare definitions that are already included from other .h files, or that are irrelevant
 
66
+# to GL (e.g. printf()).  The previous solution was to simply ignore all #includes but there
 
67
+# is now enough compile-time switching that we have to preprocess the whole batch.
 
68
+#
 
69
 # TO DO: ensure that at least a particular subset of functions are found,
 
70
 # or else barf the compile.
 
71
 #
 
72
-#
 
73
 
 
74
 use Getopt::Long;
 
75
 use strict;
 
76
@@ -70,6 +82,12 @@
 
77
   $_ = "-D$_";
 
78
 }
 
79
 
 
80
+# This next seems to be important to keep some extraneous mesa debugging definitions
 
81
+# from being caught.  Blech.
 
82
+push(@defines,"-DGL_MESA_program_debug=0");
 
83
+
 
84
+
 
85
+
 
86
 # The '/usr/X11R6/include' path is where GL/glx.h etc are found
 
87
 # on my OS-X 10.3 machine. It seems to me that the Makefile.PL's should
 
88
 # have set the paths up by now, rather than having the logic in the *pd
 
89
@@ -85,81 +103,132 @@
 
90
 my @subnames;  # filled by sub getfuncs
 
91
 
 
92
 my %t=(
 
93
-       'int'    => 'INT',
 
94
-       'float'  => 'FLOAT',
 
95
-       'double' => 'DOUBLE',
 
96
-       'short'  => 'SHORT',
 
97
-       'long'   => 'LONG',
 
98
-       'char'   => 'CHAR',
 
99
-       'XID'    => 'U_LONG',
 
100
-       'GLenum'    => 'U_LONG',
 
101
-       'void *' => 'PTR',
 
102
-       'GLXFBConfig' => 'PTR',
 
103
-       'Display *' => 'PTR',
 
104
-       'Bool'    => 'U_CHAR'
 
105
+       'unsigned long'  => 'T_U_LONG',
 
106
+       'signed long'    => 'T_LONG',
 
107
+       'long'           => 'T_LONG',
 
108
+
 
109
+       'unsigned int' => 'T_U_INT',
 
110
+       'signed int'   => 'T_INT',
 
111
+       'int'          => 'T_INT',
 
112
+
 
113
+       'unsigned short'=> 'T_U_SHORT',
 
114
+       'signed short'  => 'T_SHORT',
 
115
+       'short'         => 'T_SHORT',
 
116
+       
 
117
+       'unsigned char'=> 'T_U_CHAR',
 
118
+       'signed char'  => 'T_CHAR',
 
119
+       'char'         => 'T_CHAR',
 
120
+       
 
121
+       'void'         => 'T_VOID',
 
122
+       
 
123
+       'float'  => 'T_FLOAT',
 
124
+       'double' => 'T_DOUBLE',
 
125
+
 
126
+       'XID'    => 'T_U_LONG',
 
127
+       'void *' => 'T_PTR',
 
128
+       'GLXFBConfig' => 'T_PTR',
 
129
+       'Display *' => 'T_PTR',
 
130
+       'Bool'    => 'T_U_CHAR',
 
131
       );
 
132
 
 
133
+my @prefile;
 
134
+
 
135
+my @pre_includes = ();
 
136
+my @gl_includes;
 
137
+my @post_includes = ("stdio.h");
 
138
+
 
139
 open(TYPEMAP,">typemap") or die "Can not write typemap\n";;
 
140
-select TYPEMAP;
 
141
+
 
142
+
 
143
+print STDERR "\nPDL::Graphics::TriD::OpenGL : Detecting GL API from system headers...\n";
 
144
 
 
145
 foreach my $file (@types){
 
146
   my @file;
 
147
 
 
148
-  print STDERR "\n******PROCESSING FILE $file.....";
 
149
+  print STDERR "\nPDL::Graphics::TriD::OpenGL: PROCESSING FILE $file.....";
 
150
 
 
151
-  if($file=~/^gl/){
 
152
-        my $found;
 
153
-        glpath: foreach my $path (@path){
 
154
-               if(-e "$path/GL/$file"){
 
155
-                 &getconsts("$path/GL/$file");
 
156
-                 @file = &cpp("$path/GL/$file");
 
157
-                 $found=1;
 
158
-                 last glpath;
 
159
-               }
 
160
-        }
 
161
-        unless($found){
 
162
-               print STDERR "WARNING: could not find file $file in $0 (may be okay)\n";
 
163
-        }
 
164
-  }elsif($file=~/^X/){
 
165
-        my $found;
 
166
-        xpath: foreach my $path (@path){
 
167
-               if(-e "$path/X11/$file"){
 
168
-                 &getconsts("$path/X11/$file");
 
169
-                 @file = &cpp("$path/X11/$file");
 
170
-                 $found=1;
 
171
-                 last xpath;
 
172
-               }elsif(-e "/usr/include/X11/$file"){
 
173
-                 &getconsts("/usr/include/X11/$file");
 
174
-                 @file = &cpp("/usr/include/X11/$file");
 
175
-                 $found=1;
 
176
-                 last xpath;
 
177
-               }
 
178
-        }
 
179
-        unless($found){
 
180
-               die "ERROR: Could not find $file in @path";
 
181
+  my $found;
 
182
+ glpath: foreach my $path (@path){
 
183
+     foreach my $subdir("GL/","X11/","") {
 
184
+        if(-e "$path/$subdir$file"){
 
185
+            &getconsts("$path/$subdir$file");
 
186
+            push(@gl_includes,"$subdir$file");
 
187
+
 
188
+            @prefile = ();
 
189
+            @file = &cpp("$path/$subdir$file",[@pre_includes,@gl_includes]);
 
190
+#           print STDERR "Got back from cpp - file has ".(0+@file)." lines...\n";
 
191
+
 
192
+            
 
193
+            # Hack to identify XID-equivalent types and add them to the TYPEMAP.
 
194
+            # This generates typemap lines of the form "Window\tXID", because some perl
 
195
+            # versions (e.g. 5.8.6) don't ship with typemap entries for the X types.
 
196
+            #   -CED 7-Mar-2006
 
197
+            hack:for(  @prefile,@file  ) {
 
198
+                next hack unless(m/^\s*typedef\s+XID\s+(\w+)\;/);
 
199
+                my $k = $1;
 
200
+                $t{$k} = $t{'XID'};
 
201
+#               print STDERR "TYPEMAP ENTRY FOR $file: $k->XID\n";
 
202
+            }
 
203
+
 
204
+            # Hack to identify simple GL types and add them to the TYPEMAP.
 
205
+
 
206
+          hack2: for( @prefile,@file ) {
 
207
+#             print STDERR "\t-$_";
 
208
+              next hack2 unless( m/^\s*typedef\s(.*)\s(GL\w+)\s*\;\s*$/);
 
209
+#             print STDERR "\t-$_";
 
210
+              my($ctype,$gltype) = ($1,$2);
 
211
+              map { s/^\s*//; s/\s*$//; s/\s+/ /g; } ($ctype,$gltype);
 
212
+#             print "\nTypedef sorting: $gltype is a $ctype\n";
 
213
+              
 
214
+              unless($t{$ctype}) {
 
215
+                  print STDERR "(Probably harmless): Sorting typedefs, but my little mind is blown! (ctype was '$ctype')\n";
 
216
+                  next hack2;
 
217
+              }
 
218
+              $t{$gltype} = $t{$ctype};
 
219
+          }
 
220
+            
 
221
+          hack3: for( @prefile,@file ) {
 
222
+#             print STDERR "\t-$_";
 
223
+              next hack3 unless( m/^\s*typedef\s.*\*(_*GL\w+).*\;\s*$/);
 
224
+#             print STDERR "\t:$_";
 
225
+              my($gltype) = ($1);
 
226
+              map { s/^\s*//; s/\s*$//; s/\s+/ /g; } ($gltype);
 
227
+#             print "\nTypedef sorting: $gltype is a ptr\n";
 
228
+              
 
229
+              $t{$gltype} = "T_PTR";
 
230
+          }
 
231
+            
 
232
+            
 
233
+            $found=1;
 
234
+            last glpath;
 
235
         }
 
236
+     }
 
237
+ }
 
238
+  unless($found){
 
239
+      print STDERR "WARNING: could not find file $file in path '".join(":",@path)."'. (may be okay)\n";
 
240
   }
 
241
-
 
242
-  print STDERR ":::::::::::::::::::::::::::::::::\n";
 
243
-  print STDERR "Calling gettypes for $file ",$#file,"\n" if($verbose);
 
244
-  gettypes(@file);
 
245
-  print "GLXContext T_PTR\n";
 
246
-  print "GLXFBConfigSGIX T_PTR\n";
 
247
+  
 
248
+  
 
249
+#  print STDERR ":::::::::::::::::::::::::::::::::\n";
 
250
+#  print STDERR "PDL::Graphics::TriD::OpenGL: Calling gettypes for $file (",$#file,")\n" ;
 
251
+#  gettypes(@file);
 
252
 
 
253
 }
 
254
 
 
255
+print (STDERR "\n\n\n\n\n\n\n\n\n\n\n\n\n\n************************************\n***********************************\n*****************************\nPre-processed files.  gl_includes is now ",join(",",@gl_includes),"...\n\n\n\n\n\n\n\n");
 
256
+
 
257
+
 
258
 while ( my ($key, $val) = each %t ) {
 
259
-  print "$key T_$val\n" 
 
260
+    print TYPEMAP "$key $val\n" ;
 
261
 };
 
262
 close TYPEMAP;
 
263
 select STDOUT;
 
264
 
 
265
-pp_addhdr('
 
266
-#include <X11/X.h>
 
267
-#include <GL/gl.h>
 
268
-#include <GL/glx.h>
 
269
-#include <GL/glu.h>
 
270
-#include <stdio.h>
 
271
+my @typemap_lines = map { "$_\t$t{$_}\n" } keys %t;
 
272
+
 
273
+pp_addhdr(
 
274
+join("\n",map {"#include <$_>"} (@pre_includes,@gl_includes,@post_includes)) . 
 
275
+'
 
276
 
 
277
 #define NUM_ARG 6
 
278
 static int debug=0;
 
279
@@ -169,13 +238,16 @@
 
280
     return (e->type == MapNotify) && (e->xmap.window == (Window)arg);
 
281
 }
 
282
 
 
283
-');
 
284
+'
 
285
+);
 
286
 
 
287
 
 
288
 #
 
289
 # generate the xs code
 
290
 #
 
291
+#
 
292
 my $ppcode = "pp_addxs('','\n";
 
293
+
 
294
 $ppcode .= glpcopenwindow();
 
295
 $ppcode .= "\n');\n\n";
 
296
 
 
297
@@ -223,48 +295,117 @@
 
298
 
 
299
 
 
300
 sub cpp {
 
301
-  my ($file) = @_;
 
302
+  my ($file) = shift;
 
303
+  my ($include_list) = shift || [];
 
304
+
 
305
+  my @includes = map { "\n#include <$_>\n" } @$include_list;
 
306
+
 
307
+  my $open_fencestr =  "11HdyTbIVg6s"; # some gibberish output by DES
 
308
+  my $close_fencestr = "23Cnba1nbf31"; # some gibberish I type
 
309
 
 
310
   print STDERR "Running cpp on $file\n"if($verbose);
 
311
   open(FILE,"$file") || die "Could not open file $file";
 
312
-  my @file = <FILE>;
 
313
+  my @rawfile = (@includes, "Start of $file ($close_fencestr)....\n", <FILE>);
 
314
   close(FILE);
 
315
 
 
316
   my $nfile = $file;
 
317
   $nfile =~ s/.*\//tmp_/;
 
318
 
 
319
   open(TFILE,">$nfile")  || die "Could not write $nfile";
 
320
+
 
321
+  ##############################
 
322
+  # Walk through the file and mark the last instance of #include with a fence
 
323
+  my @file;
 
324
+  
 
325
+
 
326
+  while(@rawfile) {
 
327
+      my $line = shift @rawfile;
 
328
+      if($line =~ m/\s*\#include\s/) {
 
329
+       $line =~ s/\n(.)/\\n$1/g;
 
330
+       chomp $line;
 
331
+         push(@file,"\nFENCE ($open_fencestr): Ignore stuff till the next fence ($line)\n\n");
 
332
+         push(@file,$line."\n");
 
333
+         push(@file,"\nFENCE ($close_fencestr): Stop ignoring stuff\n\n");
 
334
+      } else {
 
335
+         push(@file,$line);
 
336
+      }
 
337
+  }
 
338
+
 
339
+  ##############################
 
340
+  # Now dump the processed array to a temp file for cpp to crunch on
 
341
   foreach(@file){
 
342
-#  print STDERR "from $file:  ",$_ ;
 
343
-        next if(/^\s*\#include\s+/);  # this is dangerous
 
344
-               # as a consequence APIENTRY is undefined and glu routines are ignored
 
345
+#      print STDERR "from $file:  ",$_ ;
 
346
         print TFILE $_;
 
347
   }
 
348
   close(TFILE);
 
349
+
 
350
 #
 
351
 # Put together a preprocessor command  
 
352
 #
 
353
+
 
354
   my $com="$Config{cpprun} -P @defines";
 
355
-  foreach(split ' ', $Config{cppflags}){
 
356
-        $com .= " $_" if(/-D/);
 
357
+  foreach(split ' ', $Config{cppflags}.' '.$Config{cflags} . ' ' . $Config{ccflags}){
 
358
+        $com .= " $_" if(1 || /-D/);
 
359
   }
 
360
   $com .= " -D_LANGUAGE_C -DAPIENTRY=''";  # forces prototypes of SGI GL 
 
361
 
 
362
   print STDERR "*** CPP command: $com $nfile |\n";
 
363
 
 
364
-  open(FILE,"$com $nfile |") || die "cant open $com $nfile|\n";
 
365
-  @file = <FILE>;
 
366
-  close(FILE);
 
367
+  ##############################
 
368
+  # Execute cpp and snarf up its output
 
369
+  open(CPP_PIPE,"$com $nfile |") || die "cant open $com $nfile|\n";
 
370
+  @rawfile = <CPP_PIPE>;
 
371
+  close CPP_PIPE;
 
372
+
 
373
+#  print STDERR "CPP call returned ".(0+@rawfile)." lines...\n";
 
374
+
 
375
   if ($verbose) {
 
376
        use File::Basename;
 
377
        my $out = basename($file).".cpp";
 
378
        open FI, ">$out" ||
 
379
             die "can't open temp output file $out";
 
380
-       print "outputting to $out...\n";
 
381
+#      print STDERR "outputting to $out...\n";
 
382
        print FI "/* command: $com */\n";
 
383
-       print FI join('',@file);
 
384
+       print FI join('',@rawfile);
 
385
        close FI;
 
386
   }
 
387
+
 
388
+  ##############################
 
389
+  # Edit out the sections to be ignored...
 
390
+  my @file;
 
391
+  my $ignoring=0;
 
392
+       print STDERR "open_fencestr = '$open_fencestr'; close_fencestr = '$close_fencestr'\n";
 
393
+       print STDERR "rawfile has ".(0+@rawfile)." lines...\n";
 
394
+       my $lineno = 0;
 
395
+  for my $line(@rawfile) {
 
396
+       $lineno++;
 
397
+      if($line =~ m/$open_fencestr/o) {
 
398
+#      print "Starting to ignore - trigger line was '$line' (line $lineno)\n";
 
399
+         $ignoring = 1;
 
400
+         next;
 
401
+      }
 
402
+      if($line =~ m/$close_fencestr/o) {
 
403
+#      print "Ending ignorance   - trigger line was '$line (line $lineno);'\n";
 
404
+         $ignoring = 0;
 
405
+         next;
 
406
+      }
 
407
+       chomp $line;
 
408
+       unless($ignoring) {
 
409
+               push (@file,"$line\n"); 
 
410
+#              print STDERR "Keeping: $line\n";
 
411
+       }
 
412
+#      if($ignoring) {
 
413
+#              print STDERR "*******: $line\n";
 
414
+#      }
 
415
+  }
 
416
+
 
417
+       my $str = join("\n",@file);
 
418
+       @file = split /\n/,$str;
 
419
+
 
420
+       open(FILE,">${nfile}-out");
 
421
+       print FILE @file;
 
422
+       close FILE;
 
423
+       print STDERR "SUB CPP: Returning ".(0+@file)." lines...\n";
 
424
   return @file;
 
425
 
 
426
 }
 
427
@@ -300,9 +441,10 @@
 
428
 
 
429
 sub getfuncs {
 
430
   my(@file) = @_;
 
431
-
 
432
   my $outstr;
 
433
   my $str = join ' ',@file;
 
434
+
 
435
+
 
436
   #  while($str =~ /extern\s+(\S[^\;]*)\s+(\w+)\s*\(([^\(\)]*)\)\s*\;/gs){
 
437
   #  my @vfuncs;
 
438
   while($str =~ /(extern\s)?\s*(\w+)\s+(\w+)\s*\(([^\(\)]*)\)\s*\;/gs){
 
439
@@ -315,7 +457,7 @@
 
440
     if($args =~ /GLvoid\s*\*\s*\*/) { next }
 
441
 
 
442
         push @subnames,$name;
 
443
-        print "Gen: $rt $name $args\n" if $verbose;
 
444
+#       print "Gen: $rt $name $args\n" if $verbose;
 
445
         #    push @vfuncs,"$rt,$name,V_$name,($args)";
 
446
         #
 
447
         # Ignore Display * when looking for pointers
 
448
diff -urNad pdl-2.4.2/Graphics/TriD/Rout/rout.pd /tmp/dpep.IxNtli/pdl-2.4.2/Graphics/TriD/Rout/rout.pd
 
449
--- pdl-2.4.2/Graphics/TriD/Rout/rout.pd        2002-06-01 05:31:58.000000000 +0200
 
450
+++ /tmp/dpep.IxNtli/pdl-2.4.2/Graphics/TriD/Rout/rout.pd       2006-06-03 22:39:19.794641500 +0200
 
451
@@ -216,7 +216,7 @@
 
452
                        formchar,formchar,formchar);
 
453
 
 
454
                threadloop %{
 
455
-                       PerlIO_fprint(fp,formatstr,@.trid(vertices,n).');
 
456
+                       PerlIO_printf(fp,formatstr,@.trid(vertices,n).');
 
457
                %}'
 
458
 );
 
459
 
 
460
diff -urNad pdl-2.4.2/Graphics/TriD/TriD/GL.pm /tmp/dpep.IxNtli/pdl-2.4.2/Graphics/TriD/TriD/GL.pm
 
461
--- pdl-2.4.2/Graphics/TriD/TriD/GL.pm  2002-06-27 03:07:51.000000000 +0200
 
462
+++ /tmp/dpep.IxNtli/pdl-2.4.2/Graphics/TriD/TriD/GL.pm 2006-06-03 22:39:19.798641750 +0200
 
463
@@ -574,6 +574,8 @@
 
464
 
 
465
 sub gdriver {
 
466
   my($this, $options) = @_;
 
467
+  
 
468
+  print "GL gdriver...\n" if($PDL::debug_trid);
 
469
 
 
470
   if(defined $this->{_GLObject}){
 
471
         print "WARNING: Graphics Driver already defined for this window \n";
 
472
@@ -598,12 +600,17 @@
 
473
 
 
474
 
 
475
   print "STARTING OPENGL $options->{width} $options->{height}\n" if($PDL::Graphics::TriD::verbose);
 
476
-  
 
477
+
 
478
+  print "gdriver: Calling OpengGL::OO($options)...\n" if($PDL::debug_trid);
 
479
+
 
480
   $this->{_GLObject}= new PDL::Graphics::OpenGL::OO($options);
 
481
 
 
482
 #glpOpenWindow(%$options);
 
483
   
 
484
+  print "gdriver: Calling glClearColor...\n" if($PDL::debug_trid);
 
485
   glClearColor(0,0,0,1);
 
486
+
 
487
+  print "gdriver: Calling glpRasterFont...\n" if($PDL::debug_trid);
 
488
   my $lb =  $this->{_GLObject}->glpRasterFont(
 
489
                                                ($ENV{PDL_3D_FONT} or "5x8"),0,256);
 
490
   $PDL::Graphics::TriD::GL::fontbase = $lb;
 
491
diff -urNad pdl-2.4.2/Graphics/TriD/TriD/Objects.pm /tmp/dpep.IxNtli/pdl-2.4.2/Graphics/TriD/TriD/Objects.pm
 
492
--- pdl-2.4.2/Graphics/TriD/TriD/Objects.pm     2000-08-08 13:18:48.000000000 +0200
 
493
+++ /tmp/dpep.IxNtli/pdl-2.4.2/Graphics/TriD/TriD/Objects.pm    2006-06-03 22:39:19.798641750 +0200
 
494
@@ -29,15 +29,19 @@
 
495
 
 
496
 sub new {
 
497
        my($type,$points,$colors,$options) = @_;
 
498
-       
 
499
+
 
500
+       print "GObject new.. calling SUPER::new...\n" if($PDL::debug_trid);
 
501
        my $this = $type->SUPER::new();
 
502
+       print "GObject new - back (SUPER::new returned $this)\n" if($PDL::debug_trid);
 
503
 
 
504
        if(!defined $options and ref $colors eq "HASH") {
 
505
                $options = $colors;
 
506
                undef $colors;
 
507
        }
 
508
 
 
509
+       print "GObject new - calling realcoords\n" if($PDL::debug_trid);
 
510
        $points = PDL::Graphics::TriD::realcoords($type->r_type,$points);
 
511
+       print "GObject new - back from  realcoords\n" if($PDL::debug_trid);
 
512
 
 
513
        if(!defined $colors) {$colors = PDL->pdl(1,1,1);
 
514
                $colors = $type->cdummies($colors,$points);
 
515
@@ -51,6 +55,8 @@
 
516
        $this->{Colors}  = $colors;
 
517
 
 
518
        $this->check_options();
 
519
+       
 
520
+       print "GObject new - returning\n" if($PDL::debug_trid);
 
521
        return $this;
 
522
 }
 
523
 
 
524
diff -urNad pdl-2.4.2/Graphics/TriD/TriD/Window.pm /tmp/dpep.IxNtli/pdl-2.4.2/Graphics/TriD/TriD/Window.pm
 
525
--- pdl-2.4.2/Graphics/TriD/TriD/Window.pm      2000-10-09 12:01:00.000000000 +0200
 
526
+++ /tmp/dpep.IxNtli/pdl-2.4.2/Graphics/TriD/TriD/Window.pm     2006-06-03 22:39:19.798641750 +0200
 
527
@@ -11,23 +11,30 @@
 
528
 sub new {
 
529
   my($arg,$options) = @_;
 
530
 
 
531
+  print "PDL::Graphics::TriD::Window - calling SUPER::new...\n" if($PDL::debug_trid);
 
532
   my $this = $arg->SUPER::new();
 
533
 
 
534
+  print "PDL::Graphics::TriD::Window - got back $this\n" if($PDL::debug_trid);
 
535
   # Make sure the Graphics has been initialized
 
536
   $options->{width} =  300 unless defined $options->{width};
 
537
   $options->{height} =         300 unless defined $options->{height};
 
538
   $this->{Width} = $options->{width};
 
539
   $this->{Height} = $options->{height};
 
540
 
 
541
+  print "PDL::Graphics::TriD::Window: calling gdriver....\n" if($PDL::debug_trid);
 
542
   $this->{Interactive} = $this->gdriver($options);
 
543
+  print "PDL::Graphics::TriD::Window: gdriver gave back $this->{Interactive}....\n" if($PDL::debug_trid);
 
544
 
 
545
   # set default values
 
546
   if($this->{Interactive}){
 
547
+      print "\tIt's interactive... calling ev_defaults...\n" if($PDL::debug_trid);
 
548
         $this->{Ev} = $this->ev_defaults(); 
 
549
+      print "\tcalling new_viewport...\n" if($PDL::debug_trid);
 
550
         $this->new_viewport(0,0,$this->{Width},$this->{Height});  
 
551
   }else{
 
552
         $this->new_viewport(0,0,1,1);  
 
553
   }
 
554
+
 
555
   $this->current_viewport(0);
 
556
 
 
557
   return($this);
 
558
@@ -217,6 +224,8 @@
 
559
   print "AUTOLOAD: $sub at ",__FILE__," line ", __LINE__  ,".\n" 
 
560
         if($PDL::Graphics::TriD::verbose);
 
561
 
 
562
+  print "Window AUTOLOADing '$sub': self=$self, args='".join("','",@args),"'\n" if($PDL::debug_trid);
 
563
+
 
564
   if($sub =~ /^gl/ && defined  $self->{_GLObject}){
 
565
         return  $self->{_GLObject}->$sub(@args);
 
566
   }
 
567
diff -urNad pdl-2.4.2/Graphics/TriD/TriD.pm /tmp/dpep.IxNtli/pdl-2.4.2/Graphics/TriD/TriD.pm
 
568
--- pdl-2.4.2/Graphics/TriD/TriD.pm     2000-08-25 22:24:09.000000000 +0200
 
569
+++ /tmp/dpep.IxNtli/pdl-2.4.2/Graphics/TriD/TriD.pm    2006-06-03 22:39:19.798641750 +0200
 
570
@@ -638,7 +638,10 @@
 
571
        if(!defined $obj or !ref $obj) {
 
572
                barf("Invalid object to TriD::graph_object");
 
573
        }
 
574
+       print "graph_object: calling get_new_graph\n" if($PDL::debug_trid);
 
575
        my $g = get_new_graph();
 
576
+       print "graph_object: back from get_new_graph\n" if($PDL::debug_trid);
 
577
+
 
578
        my $name = $g->add_dataseries($obj);
 
579
        $g->bind_default($name);
 
580
        $g->scalethings();
 
581
@@ -677,8 +680,11 @@
 
582
 
 
583
 # Call: line3d([$x,$y,$z],[$color]);
 
584
 *line3d=\&PDL::line3d;
 
585
-sub PDL::line3d { &checkargs;
 
586
-       &graph_object(new PDL::Graphics::TriD::LineStrip(@_));
 
587
+sub PDL::line3d { 
 
588
+    &checkargs;
 
589
+    my $obj = new PDL::Graphics::TriD::LineStrip(@_);
 
590
+    print "line3d: object is $obj\n" if($PDL::debug_trid);
 
591
+    &graph_object($obj);
 
592
 }
 
593
 
 
594
 *contour3d=\&PDL::contour3d;
 
595
@@ -735,9 +741,12 @@
 
596
 *release3d=\&PDL::release3d;
 
597
 
 
598
 sub get_new_graph {
 
599
+    print "get_new_graph: calling PDL::Graphics::TriD::get_current_window...\n" if($PDL::debug_trid);
 
600
        my $win = PDL::Graphics::TriD::get_current_window();
 
601
 
 
602
+    print "get_new_graph: calling get_current_graph...\n" if($PDL::debug_trid);
 
603
        my $g = get_current_graph($win);
 
604
+    print "get_new_graph: back get_current_graph returned $g...\n" if($PDL::debug_trid);
 
605
 
 
606
        if(!$PDL::Graphics::TriD::hold_on) {
 
607
                $g->clear_data();
 
608
@@ -772,8 +781,10 @@
 
609
         if(!$PDL::Graphics::TriD::create_window_sub) {
 
610
                barf("PDL::Graphics::TriD must be used with a display mechanism: for example PDL::Graphics::TriD::GL!\n");
 
611
         }
 
612
+        print "get_current_window - creating window...\n" if($PDL::debug_trid);
 
613
         $win = new PDL::Graphics::TriD::Window($opts);
 
614
 
 
615
+        print "get_current_window - calling set_material...\n" if($PDL::debug_trid);
 
616
         $win->set_material(new PDL::Graphics::TriD::Material);
 
617
         $PDL::Graphics::TriD::current_window = $win;
 
618
         $PDL::Graphics::TriD::cur = $win