Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Game Development
  4. Qt + OpenGL multithreading
Forum Updated to NodeBB v4.3 + New Features

Qt + OpenGL multithreading

Scheduled Pinned Locked Moved Unsolved Game Development
2 Posts 2 Posters 1.5k Views
  • 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.
  • E Offline
    E Offline
    erlog
    wrote on 21 Mar 2016, 00:58 last edited by
    #1

    Hello,

    I am new to this forum and I have a question.
    I am making a very simple Qt application with OpenGL, with the QOpenGLWidget promoted to a class that I made, let's call it MainWindowOGL that inherits the QOpenGLWidget, I want to run the OpenGL context/rendering in a separate thread from the GUI, I am trying to call std::thread t1(&MainWindowOGL::paintGL, this); from the function initializeGL inside my own class. It compiles just fine but I am still experimenting on how to do this properly and when I run the program i get The program has unexpectedly finished. Even when adding t1.join(); at the end of the initializeGL member function (probably incorrect way of doing it) I get the same issue. My goal is to create a thread where all the OpenGL will run inside a while loop for the life cycle of the application.
    I am using the latest version of Qt and I created the application in designer mode, which means I haven't touched the main.cpp file.
    I am running Ubuntu 14.04 + Nvidia proprietary drivers 361.28.

    Please help!
    Thank you in advanced!

    1 Reply Last reply
    0
    • N Offline
      N Offline
      njbrown
      wrote on 16 May 2016, 22:55 last edited by
      #2

      Have you tried using Qt3D? It's pretty good for making simple 3d applications with qt.

      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