double buffer does not work after change active layout.
double buffer does not work after change active layout.
hi all!
i have a problem with double buffering when change active layout. at the first time, double buffer work fine. after change active layout, it seem that double buffer does not work any more. my steps is below:
- change active layout: pdb->setcurrentlayout((odstring)szspace);
- release all device
- create device again (enablegsmodel(true))
- call onviewzoomextents: if the layout is paper space, set active view is overall view (to make model space and paper space zooming at the same time)
after change active layout, it redraw slowly, it have no double buffer anymore. the problem occurs with odamfcapp sample too. you can test with attached file.
code:
code:
void cdwgviewer:

nviewzoomextents()
{
oddbcommandcontextptr pdbcmdctx(getdocument()->cmdctx());
oddbdatabaseptr pdb = pdbcmdctx->database();
oddblayoutptr playout = pdb->currentlayoutid().safeopenobject(oddb::kforwrite);
odstring layout = playout->getlayoutname();
if (layout != l"model")
{ // paper space
execmd( dd_t("zoom e ") );
oddbobjectid overallvpid = playout->overallvportid();
oddbviewportptr pactivevp = overallvpid.safeopenobject(oddb::kforwrite);
odrxobjectptr playoutview = pactivevp;
odgsviewptr poverallview = overallview(m_pdevice);
odgsviewptr pactiveview = m_pdevice->activeview();
m_pdevice->makeviewactive(poverallview.detach());
}
else execmd( dd_t("zoom e ") );do anybody know this problem? what can i do to have double buffer again?
please help...
attached files
please answer me!
do any body know how to fix this problem, please answer me. odamfcapp sample have this problem, but i know that many people know how to fix this. please help me soon...!!!
thank you!
trang
hi,
use:
code:
m_pdevice->makeviewactive(poverallview.get());, instead of:
code:
m_pdevice->makeviewactive(poverallview.detach());you corrupt smart pointer to overall view. problem with geometry cache goes from here.