From: Chia-I Wu <ol...@gm...> - 2009-08-18 02:29:42
|
On Mon, Aug 17, 2009 at 05:51:14AM -0700, Nicholas Lowell wrote: > Off-screen rendering means a PBuffer but I can only bind a VGImage to a > Pbuffer. So what about VGPaths? I can render a blue triangle on-screen and > now I'm trying to render ultimately to a ppm file. Therefore I need to know > the location of the data, but all I have is the EGLDisplay, EGLSurface (a > Pbuffer, right?) and EGLContext. There's no opportunity for me to malloc > some memory and use it. The binding apis are usually used for cross-api rendering. E.g., have opengl render into a VGImage. > The only thing I can think to maybe try is draw my VGPath to presumably the > surface, then call either vgReadPixels to add it to memory and then create a > ppm file. Does that make sense? You can create a pbuffer (eglCreatePbufferSurface) and make it current. You then start drawing as usual, and read the result using vgReadPixels. The only difference is that the pbuffer surface will not be shown on the screen. Note that not all drivers support pbuffer. It is egl_softpipe.so that I am using. -- Regards, olv |