Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to force Firemonkey to use a DirectX 9 context in Delphi XE3?

The main TForm3D window of Firemonkey application in Delphi X3 has a Context:TContext3D which gives me access to the current device used.
In my case with Windows7 64, it always shows a TDX10Context object from FMX.Context.DX10.pas.

I have not visibility to create new instance from TDX9Context class from FMX.Context.DX9.pas just to see the ancestor TCustomDX9Context.

I found the TContextManager class that collect the registerd 3D contexts in a strict private TList :( , this is the only class that can call the constructor...

{ Don't call contructor directly from TContext - only using TContextManager class }
constructor CreateFromWindow(const AParent: TFmxHandle; const AWidth, AHeight: Integer;`

They call TContextManager to get a context when creating new forms, then a readonly property TContextManager.DefaultContextClass is used.

There is no way I can find access to contexts other than DefaultContextClass.

like image 758
piXelicidio Avatar asked Dec 19 '12 04:12

piXelicidio


1 Answers

For the record:

Put the following line in your project file:

GlobalUseDX10 := False;  <<-- add this.
Application.Initialize;  <<-- just before this line.
like image 131
Johan Avatar answered Sep 29 '22 22:09

Johan