comparison src/gl-render.cc @ 7914:e998e81224b5

Various compilation fixes for MSVC.
author John W. Eaton <jwe@octave.org>
date Thu, 10 Jul 2008 08:59:18 -0400
parents c350329da645
children 4976f66d469b
comparison
equal deleted inserted replaced
7913:f46e73bcb85b 7914:e998e81224b5
377 return *this; 377 return *this;
378 } 378 }
379 379
380 vertex_data_rep *get_rep (void) const { return rep; } 380 vertex_data_rep *get_rep (void) const { return rep; }
381 }; 381 };
382
383 #include <Array.cc>
384 382
385 class 383 class
386 opengl_renderer::patch_tesselator : public opengl_tesselator 384 opengl_renderer::patch_tesselator : public opengl_tesselator
387 { 385 {
388 public: 386 public:
2298 // FIXME: retrieve alpha data from patch object 2296 // FIXME: retrieve alpha data from patch object
2299 //a = props.get_alpha_data (); 2297 //a = props.get_alpha_data ();
2300 has_facealpha = ((a.numel () > 0) && (a.rows () == f.rows ())); 2298 has_facealpha = ((a.numel () > 0) && (a.rows () == f.rows ()));
2301 } 2299 }
2302 2300
2303 Array2<vertex_data> vdata (f.dims ()); 2301 octave_idx_type fr = f.rows (), fc = f.columns ();
2302 std::vector<vertex_data> vdata (f.numel ());
2304 2303
2305 for (int i = 0; i < nf; i++) 2304 for (int i = 0; i < nf; i++)
2306 for (int j = 0; j < count_f(i); j++) 2305 for (int j = 0; j < count_f(i); j++)
2307 { 2306 {
2308 int idx = int (f(i,j) - 1); 2307 int idx = int (f(i,j) - 1);
2331 aa = a(i); 2330 aa = a(i);
2332 else 2331 else
2333 aa = a(idx); 2332 aa = a(idx);
2334 } 2333 }
2335 2334
2336 vdata(i,j) = 2335 vdata[i+j*fr] =
2337 vertex_data (vv, cc, nn, aa, as, ds, ss, se); 2336 vertex_data (vv, cc, nn, aa, as, ds, ss, se);
2338 } 2337 }
2339 2338
2340 if (fl_mode > 0 || el_mode > 0) 2339 if (fl_mode > 0 || el_mode > 0)
2341 { 2340 {
2381 tess.begin_polygon (true); 2380 tess.begin_polygon (true);
2382 tess.begin_contour (); 2381 tess.begin_contour ();
2383 2382
2384 for (int j = 0; j < count_f(i); j++) 2383 for (int j = 0; j < count_f(i); j++)
2385 { 2384 {
2386 vertex_data::vertex_data_rep *vv = vdata(i,j).get_rep (); 2385 vertex_data::vertex_data_rep *vv = vdata[i+j*fr].get_rep ();
2387 2386
2388 tess.add_vertex (vv->coords.fortran_vec (), vv); 2387 tess.add_vertex (vv->coords.fortran_vec (), vv);
2389 } 2388 }
2390 2389
2391 tess.end_contour (); 2390 tess.end_contour ();
2441 tess.begin_polygon (false); 2440 tess.begin_polygon (false);
2442 tess.begin_contour (); 2441 tess.begin_contour ();
2443 2442
2444 for (int j = 0; j < count_f(i); j++) 2443 for (int j = 0; j < count_f(i); j++)
2445 { 2444 {
2446 vertex_data::vertex_data_rep *vv = vdata(i,j).get_rep (); 2445 vertex_data::vertex_data_rep *vv = vdata[i+j*fr].get_rep ();
2447 2446
2448 tess.add_vertex (vv->coords.fortran_vec (), vv); 2447 tess.add_vertex (vv->coords.fortran_vec (), vv);
2449 } 2448 }
2450 2449
2451 tess.end_contour (); 2450 tess.end_contour ();
2496 2495
2497 if (clip(idx)) 2496 if (clip(idx))
2498 continue; 2497 continue;
2499 2498
2500 Matrix lc = (do_edge ? (mecolor.numel () == 0 ? 2499 Matrix lc = (do_edge ? (mecolor.numel () == 0 ?
2501 vdata(i,j).get_rep ()->color : mecolor) 2500 vdata[i+j*fr].get_rep ()->color : mecolor)
2502 : Matrix ()); 2501 : Matrix ());
2503 Matrix fc = (do_face ? (mfcolor.numel () == 0 ? 2502 Matrix fc = (do_face ? (mfcolor.numel () == 0 ?
2504 vdata(i,j).get_rep ()->color : mfcolor) 2503 vdata[i+j*fr].get_rep ()->color : mfcolor)
2505 : Matrix ()); 2504 : Matrix ());
2506 2505
2507 draw_marker (v(idx,0), v(idx,1), (has_z ? v(idx,2) : 0), lc, fc); 2506 draw_marker (v(idx,0), v(idx,1), (has_z ? v(idx,2) : 0), lc, fc);
2508 } 2507 }
2509 2508