Re: [PyOpenGL-Users] Building on OSMesa
Brought to you by:
mcfletch
From: Mike C. F. <mcf...@vr...> - 2012-01-15 03:47:18
|
On 12-01-10 09:05 PM, Yuan Xu wrote: ... (Copying list so others know what is going on...) > For switching platform, I think using environment varaiable is a good > idea. Now implemented in bzr head. Variable is PYOPENGL_PLATFORM as proposed. > I improved the code a little by using Constant and adding all OSMesa API. > The patch for bzr is attached. Integrated. > However, I don't know how to create an array (which may be numpy or > numeric) from the ctype pointer, > please take a look at the OSMesaGetDepthBuffer and > OSMesaGetColorBuffer, if we can return a python array it would be nicer. This isn't actually something we do anywhere. When we return arrays/pointers we generally are either asking GL to fill in our array, or we copy the results out. For these OSMesa operations, the GL is returning the actual internal buffers. I've added a TODO regarding supporting such functionality, but in the meantime, if you need to convert the buffers, the numpy.ctypeslib.as_array() function should allow you to do the conversions yourself if you want numpy arrays pointing to the buffers instead of the ctypes pointers. Thanks, Mike > > On Mon, Jan 9, 2012 at 3:33 PM, Mike C. Fletcher > <mcf...@vr... <mailto:mcf...@vr...>> wrote: > > On 12-01-07 04:20 AM, Yuan Xu wrote: > > Hi Alejandro, > > > > Thank you very much for your suggestion. I am using PyQt, > > but I have digged into PyOpenGL, and find a solution: create a > > platform plugin for osmesa. > > I put my patch in github (https://github.com/xuyuan/PyOSMesa), maybe > > others are interested in it. > > > > I will also take a look at QGLPixelBuffer if I have time. > > Hi Yuan, > > I've added your OSMesa platform to OpenGL-ctypes bzr head. The patch > was trivially modified so that the changes that would make OSMesa the > only platform were removed, but I don't yet have anything written to > make it easy to choose a platform to use for a given program. I'm > thinking of using something on the order of os.environ.get( > "PYOPENGL_PLATFORM") where that value being set to a platform key > would > override the default choice. > > Thanks, > Mike > > -- > ________________________________________________ > Mike C. Fletcher > Designer, VR Plumber, Coder > http://www.vrplumber.com > http://blog.vrplumber.com > > > ------------------------------------------------------------------------------ > Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a > complex > infrastructure or vast IT resources to deliver seamless, secure > access to > virtual desktops. With this all-in-one solution, easily deploy virtual > desktops for less than the cost of PCs and save 60% on VDI > infrastructure > costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox > _______________________________________________ > PyOpenGL Homepage > http://pyopengl.sourceforge.net > _______________________________________________ > PyOpenGL-Users mailing list > PyO...@li... > <mailto:PyO...@li...> > https://lists.sourceforge.net/lists/listinfo/pyopengl-users > > > > > -- > Best Regards, > > Xu, Yuan -- ________________________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://www.vrplumber.com http://blog.vrplumber.com |