Handbook
Glossary
read-framebuffer-to ( framebuffer-rect: framebuffer-rect gpu-data-ptr -- )
GPU-accelerated rendering
ยป
Framebuffer objects
Prev:
read-framebuffer ( framebuffer-rect -- byte-array )
Next:
read-framebuffer-image ( framebuffer-rect: framebuffer-rect -- image )
Vocabulary
gpu
.
framebuffers
Inputs
framebuffer-rect
a
framebuffer-rect
gpu-data-ptr
a
gpu-data-ptr
Outputs
None
Word description
Reads the rectangular region
framebuffer-rect
into
gpu-data-ptr
, which can reference either CPU memory (a
byte-array
or
alien
) or a GPU
buffer-ptr
. The format of the written data is determined by the
component-order
and
component-type
of the associated
framebuffer-attachment
.
Notes
User-created framebuffer objects require OpenGL 3.0 or one of the
GL_ARB_framebuffer_object
or
GL_EXT_framebuffer_object
extensions. Reading into a
buffer-ptr
requires OpenGL 2.1 or the
GL_ARB_pixel_buffer_object
extension.
See also
read-framebuffer
,
read-framebuffer-image
Definition
USING:
accessors
gpu.buffers
gpu.framebuffers.private
kernel
opengl.gl
opengl.textures
sequences
typed
;
IN:
gpu.framebuffers
TYPED::
read-framebuffer-to
( framebuffer-rect: framebuffer-rect gpu-data-ptr -- )
GL_READ_FRAMEBUFFER
framebuffer-rect
framebuffer>>
framebuffer-handle
glBindFramebuffer
framebuffer-rect
[
framebuffer>>
]
[
attachment>>
]
bi
gl-attachment
glReadBuffer
framebuffer-rect
rect>>
[
loc>>
first2
]
[
dim>>
first2
]
bi
framebuffer-rect
framebuffer-rect-image-type
image-data-format
gpu-data-ptr
pixel-pack-buffer
[
glReadPixels
]
with-gpu-data-ptr
;