[Jahshaka-cvs] jah/jahwidgets/src/qt3/widgets histogram.cpp, 1.21, 1.22 player.cpp, 1.65, 1.66 text
Status: Beta
Brought to you by:
jahshaka
From: Goncalo N. M. de C. <gl...@us...> - 2006-09-18 22:00:42
|
Update of /cvsroot/jahshaka/jah/jahwidgets/src/qt3/widgets In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv9862/jahwidgets/src/qt3/widgets Modified Files: histogram.cpp player.cpp texture.h Log Message: + GL2 histograms mods to match Cg behaviour Index: player.cpp =================================================================== RCS file: /cvsroot/jahshaka/jah/jahwidgets/src/qt3/widgets/player.cpp,v retrieving revision 1.65 retrieving revision 1.66 diff -u -d -r1.65 -r1.66 --- player.cpp 16 Sep 2006 13:39:57 -0000 1.65 +++ player.cpp 18 Sep 2006 22:00:38 -0000 1.66 @@ -765,7 +765,7 @@ glTexParameteri( target, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE ); glTexParameteri( target, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE ); glTexImage2D( target, 0, glformat.first, phy_w, phy_h, 0, glformat.second, type, data ); - media->init_offscreen_buffer( phy_w, phy_h ); + media->init_offscreen_buffer( phy_w, phy_h, env_GL_2_0_targets_ ); if ( media->phy_tex_w( ) == 0 ) media->init_histogram( ); media->phy_w( ) = phy_w; @@ -838,52 +838,38 @@ if( shader_valid( s_id, target ) ) enable_shader( s_id, target, media->texture( ), media->t( ), phy_h / tex_h, get_channels( ) ); - if( target == GL_TEXTURE_2D || env_GL_2_0_targets_ ) - { + if( target == GL_TEXTURE_2D ) draw_screen_quad_inverted( phy_w, phy_h, tex_w, tex_h, media->offset_w, media->usage_w ); - } else - { draw_screen_quad( phy_w, phy_h, tex_w, tex_h, media->offset_w, media->usage_w ); - } if( shader_valid( s_id, target ) ) disable_shader( s_id ); - media->set_histogram_channels( hist_channels_[ 0 ], hist_channels_[ 1 ], hist_channels_[ 2 ], hist_channels_[ 3 ] ); - media->compute_histogram_gpu( ); - media->end_render_to_offscreen( ); - - glEnable( GL_BLEND ); - + glViewport( 0, 0, width( ), height( ) ); - media->bind_offscreen_as_texture( env_GL_2_0_targets_ ); - - // Goncalo - WEIRD! - if( target == GL_TEXTURE_2D || env_GL_2_0_targets_ ) - { - s_id = media->get_shader( ); - if( shader_valid( s_id, target ) ) - enable_shader( s_id, target, media->texture( ), media->t( ), phy_h / tex_h, get_channels( ) ); + if( target == GL_TEXTURE_2D ) + media->bind_offscreen_as_texture( env_GL_2_0_targets_ ); + + media->set_histogram_channels( hist_channels_[ 0 ], hist_channels_[ 1 ], hist_channels_[ 2 ], hist_channels_[ 3 ] ); + media->compute_histogram_gpu( ); + if( target != GL_TEXTURE_2D ) + media->bind_offscreen_as_texture( env_GL_2_0_targets_ ); + + if( target == GL_TEXTURE_2D ) draw_screen_quad( phy_w, phy_h, tex_w, tex_h, media->offset_w, media->usage_w ); - - if( shader_valid( s_id, target ) ) - disable_shader( s_id ); - } else - { draw_screen_quad_inverted( phy_w, phy_h, tex_w, tex_h, media->offset_w, media->usage_w ); - } media->unbind_offscreen_as_texture( env_GL_2_0_targets_ ); glMatrixMode( GL_MODELVIEW ); glPushMatrix( ); glLoadIdentity( ); - + media->histogram_display( ); glPopMatrix( ); Index: histogram.cpp =================================================================== RCS file: /cvsroot/jahshaka/jah/jahwidgets/src/qt3/widgets/histogram.cpp,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- histogram.cpp 18 Sep 2006 16:00:35 -0000 1.21 +++ histogram.cpp 18 Sep 2006 22:00:38 -0000 1.22 @@ -190,7 +190,7 @@ { return GLEW_ARB_occlusion_query && #ifdef HAVE_CG_RUNTIME - Cg_.is_valid( ) && + Cg_.is_valid( ) || #endif ( GLSL_.is_valid( ) && ( target == GL_TEXTURE_2D || env_GL_2_0_targets ) ); } Index: texture.h =================================================================== RCS file: /cvsroot/jahshaka/jah/jahwidgets/src/qt3/widgets/texture.h,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- texture.h 16 Sep 2006 13:39:57 -0000 1.20 +++ texture.h 18 Sep 2006 22:00:38 -0000 1.21 @@ -154,8 +154,8 @@ bool contains( int x, int y ) { return visible_ && t_ > 0.0 && x >= gx_ && x < ( gx_ + gw_ ) && y >= gy_ && y < ( gy_ + gh_ ); } - bool init_offscreen_buffer( int w, int h ) - { return rb_.init( "", w, h ); } + bool init_offscreen_buffer( int w, int h, bool env_GL_2_0_targets ) + { return rb_.init( "", w, h, env_GL_2_0_targets ); } void init_histogram( ) { hist_.init( ); } |