return !hasErrors;
}
+
+// =======================================================================
+// function : EstimatedDataSize
+// purpose :
+// =======================================================================
+Standard_Size OpenGl_FrameBuffer::EstimatedDataSize() const
+{
+ if (!IsValid())
+ {
+ return 0;
+ }
+
+ Standard_Size aSize = 0;
+ for (OpenGl_TextureArray::Iterator aTextureIt (myColorTextures); aTextureIt.More(); aTextureIt.Next())
+ {
+ aSize += aTextureIt.Value()->EstimatedDataSize();
+ }
+ if (!myDepthStencilTexture.IsNull())
+ {
+ aSize += myDepthStencilTexture->EstimatedDataSize();
+ }
+ if (myGlColorRBufferId != NO_RENDERBUFFER
+ && !myColorFormats.IsEmpty())
+ {
+ aSize += OpenGl_Texture::PixelSizeOfPixelFormat (myColorFormats.First()) * myInitVPSizeX * myInitVPSizeY;
+ }
+ if (myGlDepthRBufferId != NO_RENDERBUFFER)
+ {
+ aSize += OpenGl_Texture::PixelSizeOfPixelFormat (myDepthFormat) * myInitVPSizeX * myInitVPSizeY;
+ }
+ return aSize;
+}