title: Horde3D Particle System not rendering in Qt OpenGL
body: <p>Horde3d come with 2 samples, compiled with GLFW. One of them, Knight, shows a particle emitter. I've ported the samples to Qt, with a thin layer I wrote that leave <strong>unchanged</strong> the applicative code (i.e. scene setup, rendering and events handling).</p>
  <p>Indeed, the functionality is ok, except the particle emitter doesn't show. I can't see anything specific in GLFW initialization, and I tried some setting I found in Qt, without success. Horde3d takes care of OpenGL interface, and expose a higher level, clean C interface. Any clue?</p>
  <p><strong>EDIT : Most Rilevant Sources of qtKnight.pro</strong></p>
  <p>here (cleaned :) main.cpp</p>
  <pre><code>#include &quot;glwidget.h&quot;
  #include &lt;QApplication&gt;
  
  int main(int argc, char* argv[]) {
      QApplication app(argc, argv);
      GLWidget glw;
      glw.show();
      return app.exec();
  }
  </code></pre>
  <p>here glWidget.h</p>
  <pre><code>#ifndef GL_WIDGET_H
  #define GL_WIDGET_H
  
  #include &lt;QtOpenGL&gt;
  #include &lt;QTimer&gt;
  #include &lt;QKeyEvent&gt;
  #include &lt;Horde3D.h&gt;
  #include &lt;Horde3DUtils.h&gt;
  #include &lt;sstream&gt;
  #include &lt;app.h&gt;
  
  class GLWidget : public QGLWidget, Application {
      Q_OBJECT
  
  public:
  
      GLWidget();
      ~GLWidget();
  
      QSize minimumSizeHint() const { return sizeHint(); }
      QSize sizeHint() const { return QSize(640, 480); }
  
  protected:
  
      void initializeGL();
      void paintGL();
      void resizeGL(int width, int height);
  
      void mousePressEvent(QMouseEvent *event);
      void mouseMoveEvent(QMouseEvent *event);
      void mouseReleaseEvent(QMouseEvent *event);
  
      void keyPressEvent(QKeyEvent *e) { keyEvent(e, true); QGLWidget::keyPressEvent(e); }
      void keyReleaseEvent(QKeyEvent *e) { keyEvent(e, false); QGLWidget::keyReleaseEvent(e); }
      void keyEvent(QKeyEvent *, bool);
  
  public slots:
  
      void appLoop() { updateGL(); }
  
  private:
  
      QPoint lastPos;
      QTimer evloop;
  };
  
  #endif
  </code></pre>
  <p>and here glWidget.cpp</p>
  <pre><code>#include &quot;glwidget.h&quot;
  #include &lt;stdexcept&gt;
  #include &lt;QtDebug&gt;
  #include &lt;QTextStream&gt;
  #include &lt;QGLFormat&gt;
  
  GLWidget::GLWidget() :
      QGLWidget(QGLFormat(QGL::AlphaChannel | QGL::SampleBuffers)),
      Application(&quot;/home/carlo/horde3d/SDK_1.0.0_Beta5/Horde3D/Binaries/Content&quot;)
  {
      connect(&amp;evloop, SIGNAL(timeout()), this, SLOT(appLoop()));
      evloop.start(0);
  }
  
  GLWidget::~GLWidget()
  {
      h3dutDumpMessages();
      h3dRelease();
  }
  
  void GLWidget::initializeGL()
  {
      if (!init())
          throw std::runtime_error(&quot;Could not initialize renderer&quot;);
  }
  
  void GLWidget::paintGL()
  {
      keyStateHandler();
      mainLoop(30);
  }
  
  void GLWidget::resizeGL(int width, int height)
  {
      Application::resize(width, height);
  }
  
  void GLWidget::mousePressEvent(QMouseEvent *event)
  {
      lastPos = event-&gt;pos();
  }
  
  void GLWidget::mouseMoveEvent(QMouseEvent *event)
  {
      QPoint cPos = event-&gt;pos();
      float dX = cPos.x() - lastPos.x(); //event-&gt;x() - lastPos.x();
      float dY = cPos.y() - lastPos.y(); //event-&gt;y() - lastPos.y();
      Application::mouseMoveEvent(dX, dY);
      lastPos = cPos;
  }
  
  void GLWidget::mouseReleaseEvent(QMouseEvent * /* event */)
  {
  }
  
  void GLWidget::keyEvent(QKeyEvent *k, bool on_off)
  {
  #define setK(X,Y)   case Qt::X: setKeyState(Y, on_off); break;
  #define setF(X)     case Qt::Key_##X: setKeyState(X, on_off); break;
  #define R(X, Y)     (v &gt;= #X[0] &amp;&amp; v &lt;= #Y[0])
  
      int v = k-&gt;key();
      switch (v) {
      case Qt::Key_F1: if (on_off) showFullScreen(); break;
      case Qt::Key_F2: if (on_off) showNormal(); break;
      setF(F3)
      setF(F6)
      setF(F7)
      setF(F8)
      setK(Key_Space, SP)
      default:
       if (R(A, Z) || R(0, 9))
        setKeyState(v, on_off);
      }
  }
  </code></pre>