qvolray

diff src/volray.cc @ 33:437e1ba9cf39

fixed on osx
author John Tsiombikas <nuclear@member.fsf.org>
date Sat, 14 Apr 2012 23:31:17 +0300
parents 40df2cdc6323
children 6ca076bf5084
line diff
     1.1 --- a/src/volray.cc	Sat Apr 14 22:51:41 2012 +0300
     1.2 +++ b/src/volray.cc	Sat Apr 14 23:31:17 2012 +0300
     1.3 @@ -50,6 +50,8 @@
     1.4  
     1.5  static Volume *volume;
     1.6  
     1.7 +static bool dbg_noray;
     1.8 +
     1.9  
    1.10  bool volray_init()
    1.11  {
    1.12 @@ -134,10 +136,13 @@
    1.13  		create_transfer_map(xfer_mean, xfer_sdev);
    1.14  	}
    1.15  
    1.16 +	glClear(GL_COLOR_BUFFER_BIT);
    1.17 +
    1.18 +	if(dbg_noray)
    1.19 +		return;
    1.20 +
    1.21  	draw_demo();
    1.22  
    1.23 -	glClear(GL_COLOR_BUFFER_BIT);
    1.24 -
    1.25  	if(volume) {
    1.26  		render_volume();
    1.27  	}
    1.28 @@ -203,6 +208,8 @@
    1.29  
    1.30  void volray_draw_slice(void)
    1.31  {
    1.32 +	glClear(GL_COLOR_BUFFER_BIT);
    1.33 +
    1.34  	glActiveTexture(GL_TEXTURE0);
    1.35  	glBindTexture(GL_TEXTURE_3D, volume->get_texture());
    1.36  	glEnable(GL_TEXTURE_3D);
    1.37 @@ -231,6 +238,8 @@
    1.38  
    1.39  void volray_draw_xfer(void)
    1.40  {
    1.41 +	glClear(GL_COLOR_BUFFER_BIT);
    1.42 +
    1.43  	glMatrixMode(GL_MODELVIEW);
    1.44  	glPushMatrix();
    1.45  	glTranslatef(-1, -1, 0);
    1.46 @@ -424,6 +433,9 @@
    1.47  		}
    1.48  	}
    1.49  
    1.50 +	if(getenv("DBG_NORAY")) {
    1.51 +		dbg_noray = true;
    1.52 +	}
    1.53  	return 0;
    1.54  }
    1.55