I want to integrate a particle system in my app on QOpenGLWIdget. I have one thing - Magic Particle by Astralax. I integrate functions of this framework in my app, but I don't see anything on the screen. I don't understand what the problem is. I try to change any params of QOpenGLContext, but nothing work. paintDevice->paint() is calling glDrawElements. What could reason of this problem?

You can all code on GitHub.

mainwidget.cpp

Qt Code:
  1. void MainWidget::initializeGL()
  2. {
  3. makeCurrent();
  4. initializeOpenGLFunctions();
  5. glClearColor(0, 0, 0, 1);
  6.  
  7. m_paintDevice = new PaintDevice(this->width(), this->height());
  8. timer.start(12, this);
  9. }
  10.  
  11. void MainWidget::timerEvent(QTimerEvent *e)
  12. {
  13. m_paintDevice->update();
  14. update();
  15. }
  16.  
  17. void MainWidget::paintGL()
  18. {
  19. glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
  20. glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
  21. m_paintDevice->paint();
  22. QCoreApplication::postEvent(this, new QEvent(QEvent::UpdateRequest));
  23. }
To copy to clipboard, switch view to plain text mode 
mp_wrap.cpp

Qt Code:
  1. void MP_Device_WRAP::DrawVertices(int starting_index, int indexes_count, int max_vertices)
  2. {
  3. MP_BUFFER_RAM *index_buffer_ram = (MP_BUFFER_RAM *)index_buffer;
  4.  
  5. #ifdef INDEX_BUFFER_32_WRAP
  6. glDrawElements(GL_TRIANGLES, indexes_count, GL_UNSIGNED_INT, &(index_buffer_ram->buffer[starting_index * 4]));
  7. #else
  8. glDrawElements(GL_TRIANGLES, indexes_count, GL_UNSIGNED_SHORT, &(index_buffer_ram->buffer[starting_index * 2]));
  9. #endif
  10. }
To copy to clipboard, switch view to plain text mode