Hi all. So far I've used wxPython for simple stuff. I'm now thinking about
moving some more involved projects of mine over to wxPython completely. This
requires I have OpenGL up and running. I'm having a real hard time getting
PyOpenGL to build on my SuSe Linux box. Which led me to think about whether I
actually require it. All of my OpenGL calls come from C++ code in a Python
extension module created with Boost.Python.
Assuming I do not use wxGLCanvas and don't try to make any OpenGL calls from
Python, can I just create a normal wxFrame and handle the OpenGL stuff in my
C++ code? Or is wxGLCanvas required?
-jim
James Mastro wrote:
Hi all. So far I've used wxPython for simple stuff. I'm now thinking about moving some more involved projects of mine over to wxPython completely. This requires I have OpenGL up and running. I'm having a real hard time getting PyOpenGL to build on my SuSe Linux box.
Out of curiousity, what problems? Version 2.0.1.08 should build out-of-box on most Linux systems AFAIK. Please forward any error reports to me so I can look into fixing the problem.
Which led me to think about whether I actually require it. All of my OpenGL calls come from C++ code in a Python extension module created with Boost.Python.
Assuming I do not use wxGLCanvas and don't try to make any OpenGL calls from Python, can I just create a normal wxFrame and handle the OpenGL stuff in my C++ code? Or is wxGLCanvas required?
If your only problem is building PyOpenGL, then you can continue to use wxGLCanvas. You will require the rough equivalent of wxGLCanvas regardless (i.e. something to reserve the screen area/context and translate the GUI events into OpenGL calls), so may as well use the existing code. A GLCanvas widget isn't a *huge* project by any stretch of the imagination, but it does require quite a lot of testing to make it work well.
Once you have the canvas (particularly with a SetCurrent() or equivalent method, you can simply call SetCurrent() on your canvas and do your rendering from C++. OpenGL will direct your commands to the active context. Do make sure that your C++ code isn't doing anything silly like SetCurrent-ing to some other context, of course.
Have fun,
Mike
ยทยทยท
________________________________________________
Mike C. Fletcher
Designer, VR Plumber, Coder
http://www.vrplumber.com
http://blog.vrplumber.com