0

I'm new in Qt and I'm making an app that generates a 3D object with some points the user provides in GUI. The user defines the points and then, in the same window, a QOpenGLWidget paints the final object. But then, the QOpenGLWindow doesn't draw the model (only the GlCLearColor). I've tried the same functions but called before app.exec() in main and it works fine.

I don't know what's happening. I've tried calling makeCurrent() before working with vao and vbo but it doesn't work.

I haven't created any thread neither fbo.

When I tried makeCurrent before working with vao and vbo I got: "QOpenGLBuffer::bind: buffer is not valid in the current context" "QOpenGLShaderProgram::bind: program is not valid in the current context."

EDIT I retried making current before vao, vbo and shader binding and that messages dissapeared but the widget isn't painting the object.

I've also tried QOPenGLWidget::update() after drawing. It doesn't draw with resizing. I'm using OpenGL 4.1 Core Profile and Qt 5.12.3

mpb
  • 1
  • 1

1 Answers1

0

I've already solved it! I just forgot to make current before setting uniform values in shaders.

mpb
  • 1
  • 1