user14416
user14416

Reputation: 3032

OpenGL with PyFace

How I can write an OpenGl application using Enthought Framework? I created a TasksApplication and I am stuck on this tutorial, I don't know what I can use instead PythonEditor there. I need to create something where I will be able to render.

UPDATE:

I changed the code to

def create(self, parent):
    widget = GLWidget(parent)
    self.control = widget

Where GlWidget is implemented like in this example. And I have a runtime crash. But I am able to run the GL script from the example above.

UPDATE2:

Log file

UPDATE4: Code was updated according to @Robert Kern suggestions. Now it works.

Min Example

MinExample 7z

Upvotes: 1

Views: 189

Answers (1)

Robert Kern
Robert Kern

Reputation: 13430

The control trait of a TaskPane is just the Qt widget object that you are using. In the example that you link, we happen to be getting it from another PyFace widget that wraps a Qt widget in a similar fashion, so we just grab the control attribute from it. You should just directly use a QGLWidget as the control of your pane. Please consult the Qt documentation for how to use it. You can use PyOpenGL in the paintGL(), etc. methods to do the actual rendering.

Upvotes: 2

Related Questions