I have one Windows PC that, apparently, rescpects all requirements of FMX platform (Windows 7 SP1, DirectX 11.0, and so on). In this PC my last FMX application doesn't want to start (ECannotCreateTexture exception , with message "Cannot create texture for TCanvasD2D").

I have one Windows PC that, apparently, rescpects all requirements of FMX platform (Windows 7 SP1, DirectX 11.0, and so on). In this PC my last FMX application doesn't want to start (ECannotCreateTexture exception , with message "Cannot create texture for TCanvasD2D").

Ok, let's try with a blank project, one form with only one button on the center (no code at all). This minimal application starts (now I see the main form on the screen) but immediately after it crashes (I think when it tries to render the button on the form's canvas): now the exception is "Cannot create a swap chain for TCanvasD2D".

After having searched the net for a solution (thank you David Millington ) I've put a FMX.Types.GlobalUseDirect2D := FALSE just before Application.Initialize. With this trick both the blank FMX project and my complex application run without problems and with good speed (despite the use of GDI+).

My question is: how can I let my application tests, when it starts, if the use of TCanvasD2D is OK, and if not, scale down gracefully to TCanvasGDIPlus (I wouldn't' use, if possible, a test application to run during the first installation or the first run of my applications)?

Comments