Created
August 7, 2014 13:52
-
-
Save oguna/d83a5a6df5eeb9b178d8 to your computer and use it in GitHub Desktop.
QtでDirectXなどの描画をする際は、winId()のハンドラを使う。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| QD3D11Widget::QD3D11Widget(QWidget *parent) : | |
| QWidget(parent) | |
| { | |
| // バッファリングをしないようにする | |
| setAttribute(Qt::WA_PaintOnScreen, true); | |
| // ハンドラの再利用を禁止する | |
| setAttribute(Qt::WA_NativeWindow, true); | |
| m_hWnd = (HWND)winId(); | |
| HRESULT hr = InitDevice(); | |
| } | |
| void D3DRenderWidget::paintEvent(QPaintEvent* evt) { | |
| render(); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment