Delphi XE2:firemonkey和IDirect3DDevice9

时间:2011-11-17 21:49:46

标签: delphi delphi-xe firemonkey

如何直接访问firemonkey 3D表单中的全局IDirect3DDevice9对象?有可能吗?

1 个答案:

答案 0 :(得分:1)

是的,您可以使用以下属性访问DirectX接口:

TCustomDX9Context.SharedDevice: IDirect3DDevice9; | TCustomDX9Context.Direct3D9Obj: IDirect3D9 ;

要访问应用程序的当前上下文,请使用:“Form.Context :TContext3D”。 TCustomDX9Context是TContext3D的后代,您必须首先测试您的应用程序当前使用的上下文设备。它可能是这些类中的一个:

  1. TCustomDX9Context // Windows
  2. TCustomDX10Context // Windows
  3. TCustomContextOpenGL // Mac
  4. 祝你好运!