Changeset 19939

Show
Ignore:
Timestamp:
04/10/07 10:28:57 (1 year ago)
Author:
patrick
Message:

MFT [rev 19933]: Updated for the change in how multisampling is configured.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • juggler/branches/2.0/modules/vrjuggler/vrj/Draw/Pf/PfDrawManager.cpp

    r19032 r19939  
    926926   // auxiliary buffers that meets or exceeds the requested count. 
    927927   int num_aux_bufs(0); 
    928    bool want_fsaa(false); 
     928   bool enable_multisamp(false); 
     929   int num_sample_bufs(1); 
     930   int num_samples(2); 
    929931 
    930932   jccl::ConfigElementPtr fb_element = disp->getGlFrameBufferConfig(); 
     
    932934   if ( fb_element.get() != NULL ) 
    933935   { 
    934       if ( fb_element->getVersion() < 2
     936      if ( fb_element->getVersion() < 3
    935937      { 
    936938         vprDEBUG(vrjDBG_DRAW_MGR, vprDBG_WARNING_LVL) 
    937             << clrOutBOLD(clrYELLOW, "WARNING:") << " Display window '" 
     939            << clrOutBOLD(clrYELLOW, "WARNING") << ": Display window '" 
    938940            << disp->getName() << "'" << std::endl; 
    939941         vprDEBUG_NEXTnl(vrjDBG_DRAW_MGR, vprDBG_WARNING_LVL) 
     
    959961      accum_blue_size  = fb_element->getProperty<int>("accum_blue_size"); 
    960962      accum_alpha_size = fb_element->getProperty<int>("accum_alpha_size"); 
    961       want_fsaa        = fb_element->getProperty<bool>("fsaa_enable"); 
     963      num_sample_bufs  = fb_element->getProperty<int>("num_sample_buffers"); 
     964      num_samples      = fb_element->getProperty<int>("num_samples"); 
     965 
     966      enable_multisamp = num_sample_bufs > 0; 
    962967 
    963968      if ( red_size < 0 ) 
     
    10581063            << accum_alpha_size << ").  Setting to 1.\n" << vprDEBUG_FLUSH; 
    10591064         accum_alpha_size = 1; 
     1065      } 
     1066 
     1067      if ( num_sample_bufs < 0 ) 
     1068      { 
     1069         vprDEBUG(vrjDBG_DRAW_MGR, vprDBG_WARNING_LVL) 
     1070            << clrOutBOLD(clrYELLOW, "WARNING") 
     1071            << ": Number of multisampling buffers was negative (" 
     1072            << num_sample_bufs << ").  Setting to 1.\n" << vprDEBUG_FLUSH; 
     1073         num_sample_bufs = 1; 
     1074      } 
     1075 
     1076      if ( num_samples < 0 ) 
     1077      { 
     1078         vprDEBUG(vrjDBG_DRAW_MGR, vprDBG_WARNING_LVL) 
     1079            << clrOutBOLD(clrYELLOW, "WARNING") 
     1080            << ": Number of samples for multisampling was negative (" 
     1081            << num_samples << ").  Setting to 2.\n" << vprDEBUG_FLUSH; 
     1082         num_samples = 2; 
    10601083      } 
    10611084   } 
     
    11181141      << std::setiosflags(std::ios::left) << std::setfill('.') 
    11191142      << indent_text << std::setw(pad_width_dot) 
    1120       << "Full-screen anti-aliasing " << " " << std::boolalpha << want_fsaa 
     1143      << "Number of multisample buffers " << " " << num_sample_bufs 
     1144      << std::endl; 
     1145   vprDEBUG_NEXTnl(vrjDBG_DRAW_MGR, vprDBG_CONFIG_LVL) 
     1146      << std::setiosflags(std::ios::left) << std::setfill('.') 
     1147      << indent_text << std::setw(pad_width_dot) 
     1148      << "Number of samples per buffer " << " " << num_samples 
    11211149      << std::endl; 
    11221150   vprDEBUG_CONTnl(vrjDBG_DRAW_MGR, vprDBG_CONFIG_LVL) 
     
    11341162   attrs.push_back(PFFB_ACCUM_BLUE_SIZE);  attrs.push_back(accum_blue_size); 
    11351163   attrs.push_back(PFFB_ACCUM_ALPHA_SIZE); attrs.push_back(accum_alpha_size); 
    1136    if (want_fsaa) 
    1137    { 
    1138       attrs.push_back(PFFB_SAMPLE_BUFFER); attrs.push_back(1); 
    1139       attrs.push_back(PFFB_SAMPLES); attrs.push_back(1); 
     1164 
     1165   if ( enable_multisamp ) 
     1166   { 
     1167      attrs.push_back(PFFB_SAMPLE_BUFFER); attrs.push_back(num_sample_bufs); 
     1168      attrs.push_back(PFFB_SAMPLES);       attrs.push_back(num_samples); 
    11401169   } 
    11411170}