I am currently 'discussing' a more efficient way to resize a TViewport3D. Compare FMX.Forms3D to FMX.Viewport3D. The main difference is in Paint. TViewport3D, after rendering the scene, continues to draw 2D stuff. This is great, and this is why I want the FMX deskop app.

I am currently 'discussing' a more efficient way to resize a TViewport3D. Compare FMX.Forms3D to FMX.Viewport3D. The main difference is in Paint. TViewport3D, after rendering the scene, continues to draw 2D stuff. This is great, and this is why I want the FMX deskop app.

in Paint:
Context.CopyToBitmap(FBitmap, FBitmap.Bounds);
inherited Canvas.DrawBitmap(FBitmap, ...);

The other major difference, not well known, is in the way Size changes are handled. See TCustomForm3D.ResizeHandle versus TViewport3D.Resize.

TViewport3D sets the Context to nil every time the Vieport is resized, TForm3D does not. Yes, the render target needs to be changed and more, so this is an expensive operation in both cases. But recreating the context itself is causing trouble and should be avoided in the future. Also, an OnResizeEnd or OnResizeFinished event would be useful.

Are you able to debug the 3D Context of a Delphi application and find out what really happens to the 'leaked' resources, when the context is recreated?

https://plus.google.com/u/0/+GustavSchubert/posts/PZr2xGdcVd9

Comments