Table of Contents

@related : DirectX OpenGL ATI nvidia gl

[[Action]]

QT

QT & Direct3D ( DirectX ) http://lists.trolltech.com/qt-interest/2003-03/thread01272-0.html

  class CDirectXWidget : public QWidget
  {
     Q_OBJECT

   public:
     CDirectXWidget(QWidget* pParent, QSize size);
     virtual ~CDirectXWidget();

   protected:
     IDirect3DDevice8* m_pD3DDevice;
  };

  in the ctor you've to do somelike that:

  {
   IDirect3D8* pD3D = Direct3DCreate8(D3D_SDK_VERSION);

   D3DDISPLAYMODE d3ddm;
   pD3D->GetAdapterDisplayMode(D3DADAPTER_DEFAULT, &d3ddm)

   D3DPRESENT_PARAMETERS d3dpp;
   ZeroMemory(&d3dpp, sizeof(d3dpp));
   d3dpp.BackBufferWidth = size.width();
   d3dpp.BackBufferHeight = size.height();
   d3dpp.BackBufferFormat = d3ddm.Format;
   d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD;
   d3dpp.hDeviceWindow = winId();
   d3dpp.Windowed = TRUE;
   d3dpp.Flags = D3DPRESENTFLAG_LOCKABLE_BACKBUFFER;

   pD3D->CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL,
this->topLevelWidget()->winId(), D3DCREATE_SOFTWARE_VERTEXPROCESSING,
&d3dpp, &m_pD3DDevice);
  }

http://prog.qt.free.fr/docs.php?lng=fr&pg=624

MISC

direct3d.txt · Last modified: 2020/04/20 18:23 (external edit)
 
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki