anOffset.x() = 0;
for (; anOffset.x() < aTargetSize.x(); anOffset.x() += aFBOVPSize.x())
{
- Graphic3d_CameraTile aTile;
- aTile.Offset = anOffset;
- aTile.TotalSize = aTargetSize;
- aTile.TileSize = aFBOVPSize;
- if (!aFBOPtr.IsNull())
- {
- // crop corners in case of FBO
- // (no API to resize viewport of on-screen buffer - keep uncropped in this case)
- aTile = aTile.Cropped();
- }
+ Graphic3d_CameraTile aTileUncropped;
+ aTileUncropped.Offset = anOffset;
+ aTileUncropped.TotalSize = aTargetSize;
+ aTileUncropped.TileSize = aFBOVPSize;
+ const Graphic3d_CameraTile aTile = aTileUncropped.Cropped();
if (aTile.TileSize.x() < 1
|| aTile.TileSize.y() < 1)
{
aTile.TileSize.x(), aTile.TileSize.y(),
theImage.SizeRowBytes());
- aCamera->SetTile (aTile);
if (!aFBOPtr.IsNull())
{
+ aCamera->SetTile (aTile);
myView->FBOChangeViewport (aFBOPtr, aTile.TileSize.x(), aTile.TileSize.y());
}
+ else
+ {
+ // no API to resize viewport of on-screen buffer - render uncropped
+ aCamera->SetTile (aTileUncropped);
+ }
Redraw();
isSuccess = isSuccess && myView->BufferDump (aTilePixMap, theParams.BufferType);
if (!isSuccess)
--- /dev/null
+puts "============"
+puts "0029127: Visualization - V3d_View::ToPixMap() crashes on tiled rendering without FBO"
+puts "============"
+puts ""
+
+pload MODELING VISUALIZATION
+box b 1 2 3
+# request software OpenGL implementation - which is OpenGL 1.1 in case of Windows
+# (test case is useless for other systems)
+vcaps -softMode 1
+vclear
+vinit View1
+vsetdispmode 1
+vdisplay b
+vfit
+vdump $::imagedir/${::casename}_409.png -buffer rgb -width 409 -height 409
+vdump $::imagedir/${::casename}_412.png -buffer rgb -width 412 -height 412 -tileSize 409
+vdump $::imagedir/${::casename}_500.png -buffer rgb -width 500 -height 500 -tileSize 300