PDA

View Full Version : Can I only Create a Pbuffer without create a window surface



sunim
12-29-2011, 11:50 PM
I want to create a pbuffer surface to draw something but do not want to show it, just want to copy the color buffer to the native memory.
Creating a Pbuffer Surface can create a window Surface first and bind it to a context, then create a pbuffer surface, just like this

eglChooseConfig(display,...) //for the window surface
eglCreateWindowSurface(display,...)
eglCreateContext(...)
eglMakeCurrent(display,...)

eglChooseConfig(display,...) //for the pbuffer surface
eglCreatePbufferSurface(display,...)

But I do not want to show anything on screen ,so I do not want to create a window surface .
If I do this and only create a pbuffer ,it get a error and return EGL_BAD_ALLOC.
Does it has to create a window surface and bind it to a context first ?

sunim
12-30-2011, 02:25 AM
Just like the problem here http://www.imgtec.com/forum/forum_posts.asp?TID=854
why I have to create a window surface before I am allowed to create a PBuffer surface with the GLES 1.1 sdk.

jpilon
01-06-2012, 08:53 PM
The spec doesn't require a window surface to render to a pbuffer surface. Are you making the pbuffer surface current?

StonesThrow
02-04-2012, 12:14 PM
Also use attribute EGL_PBUFFER_BIT in your attributes to eglChooseConfig.