Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Initializing the Generic Rendering Context to QT Widgets for OpenGL based application
Forum Updated to NodeBB v4.3 + New Features

Initializing the Generic Rendering Context to QT Widgets for OpenGL based application

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 482 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Sonya
    wrote on last edited by
    #1

    Dear All,

    I want to initialize the OpenCascade application (which is OpenGL based) in QT widget application. Normally the generic path to solve those type of issues is only swapping (equalizing) the handles of rendering windows (I presume that this should be QMainWindow) with OpenGL rendering context, from that point on they are known to each other and each knows what to with double buffering technique, where the windows/qwidget copy only the resulting pixels in OpenGL RC to rendering windows.

    I've Desktop_Qt_5_4_1_MSVC2010_OpenGL_32bit, OCCT 6.8.0 version,

    So :
    #1 - The rendering windows in my case must be Mainwidnow: QMainWindow or centralWidget :QWidget based ?
    #2 - Below is the sample code which initializes the OpenCascade with WNT window, crucial code portion is MyView->SetWindow(hWnd) which only takes and understands Handle_WNT_Window type argument, how am I supposed to typecast the handle obtained from QWidget, Handle_WNT_Window hWnd = (Handle_WNT_Window) QWidget->GetWindowHandle() ?

    Your guidance will be appreciated,

    HWND winID = (HWND) (winId());
    Handle_WNT_Window hWnd = new WNT_Window(winID);
    mView->SetWindow(hWnd);
    if (!hWnd->IsMapped())
    {
    hWnd->Map();
    }

    mView->SetBackgroundColor(Quantity_NOC_BLACK);
    mView->MustBeResized();
    mView->TriedronDisplay(Aspect_TOTP_LEFT_LOWER, Quantity_NOC_GOLD, 0.08, V3d_ZBUFFER);

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved