Handbook
Glossary
frame-buffer
Vocabulary
ui
.
gadgets
.
frame-buffer
Definition
USING:
ui.gadgets
;
IN:
ui.gadgets.frame-buffer
TUPLE:
frame-buffer
<
gadget
pixels last-dim
;
Methods
USING:
accessors
math.vectors
opengl.gl
sequences
ui.gadgets.frame-buffer
ui.render
;
M::
frame-buffer
draw-gadget*
( FRAME-BUFFER -- )
FRAME-BUFFER
dim>>
{
0 1
}
v*
first2
glRasterPos2i
FRAME-BUFFER
draw-pixels
FRAME-BUFFER
update-frame-buffer
glFlush
FRAME-BUFFER
read-pixels
;
USING:
accessors
kernel
math
opengl
sequences
ui.gadgets
ui.gadgets.frame-buffer
;
M::
frame-buffer
layout*
( FRAME-BUFFER -- )
FRAME-BUFFER
last-dim>>
[
FRAME-BUFFER
dim>>
=
[
FRAME-BUFFER
pixels>>
:>
OLD-PIXELS FRAME-BUFFER
last-dim>>
first
gl-scale
>fixnum
:>
OLD-WIDTH
FRAME-BUFFER
init-frame-buffer-pixels
FRAME-BUFFER
[
dim>>
]
[
last-dim<<
]
bi
FRAME-BUFFER
pixels>>
:>
NEW-PIXELS FRAME-BUFFER
last-dim>>
first
gl-scale
>fixnum
:>
NEW-WIDTH
OLD-PIXELS OLD-WIDTH NEW-PIXELS NEW-WIDTH
copy-pixels
]
unless
]
[
FRAME-BUFFER
init-frame-buffer-pixels
FRAME-BUFFER
[
dim>>
]
[
last-dim<<
]
bi
]
if*
;