How to access the buffer of a GLSurface?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

How to access the buffer of a GLSurface?

Dario
Is there a way to directly acces the frame buffer of a surface... and I'd like it to be cross platform.
Reply | Threaded
Open this post in threaded view
|

Re: How to access the buffer of a GLSurface?

Sven Gothel
Administrator
On Sunday, September 25, 2011 12:54:36 PM Dario [via jogamp] wrote:
>
> Is there a way to directly acces the frame buffer of a surface... and I'd
> like it to be cross platform.
>

GLReadBufferUtil
  http://jogamp.org/git/?p=jogl.git;a=blob;f=src/jogl/classes/com/jogamp/opengl/util/GLReadBufferUtil.java;hb=HEAD

A convenient utility to read the pixels our of the FB, see it's usage in the unit tests:

  http://jogamp.org/git/?p=jogl.git;a=blob;f=src/test/com/jogamp/opengl/test/junit/graph/demos/ui/UIListenerBase01.java;hb=HEAD#l88

It currently lacks of async DMA streaming via PBO,
but well .. we haven't had the video streaming use case ourselves.

Note: You cannotdirectly access the front or back buffer in OpenGL.

~Sven
Reply | Threaded
Open this post in threaded view
|

Re: How to access the buffer of a GLSurface?

Dario
So there is no way to direct access the surface buffer (I mean get a byte/int array that is the "actual" memory part that opengl can draw too)?

I was wondering if it is possible to do just like you do with a bufferedimage that can expose a WritableBuffer (through getRaster).

Is there other ways to perform direct access othen than on a texture? And is it possible to have OpenGl draw on a surface (on video memory or system ram?).

Reply | Threaded
Open this post in threaded view
|

Re: How to access the buffer of a GLSurface?

gouessej
Administrator
Hi

Aren't glReadPixels and glDrawPixels not enough for your needs?
Julien Gouesse | Personal blog | Website