PSPGL news

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
jsgf
Posts: 254
Joined: Tue Jul 12, 2005 11:02 am
Contact:

PSPGL news

Post by jsgf »

I've been adding more stuff to PSPGL. The big addition is render to texture:
Image

This is implemented in terms of EGL Pbuffers, which turned out to be pretty simple and quick to do. The API is simple:

Code: Select all

    pbuffer = eglCreatePbufferSurface(dpy, pbuffer_config, texture_attrib);

...
   // make pbuffer the render target
   eglMakeCurrent(dpy, pbuffer, pbuffer, ctx);
   // render into pbuffer

   // make screen the render target again
   eglMakeCurrent(dpy, screen, screen, ctx);
   glBindTexture(GL_TEXTURE_2D, texid)
   eglBindTexImage(dpy, pbuffer, EGL_BACK_BUFFER);

   // render using pbuffer texture
See pspgl/tests/eglpbuffers.c for a full example.

This is pretty similar to the standard EGL pbuffer API, but it imposes fewer restrictions; for example, you can use a surface for rendering, even if it is bound to a texture (though obviously you get pretty undefined results if you render from a texture into itself - though it might be worth trying). Other GL features, such as automatic mipmap generation, work with pbuffer-derived textures.

I'm still planning on implementing Pixel Buffer Objects and Frame Buffer Objects. These extensions also allow render-to-texture, but in a more standard and flexible way (though perhaps more complex to use and implement).
patpsp
Posts: 31
Joined: Tue Oct 25, 2005 5:24 pm

Post by patpsp »

Very good news ! Thanks for your work !
Post Reply