Handbook
Glossary
pad-texture-edges ( image -- )
Vocabulary
opengl
.
textures
.
private
Inputs
image
an
object
Outputs
None
Definition
USING:
accessors
arrays
continuations
kernel
math
opengl.gl
sequences
;
IN:
opengl.textures.private
::
pad-texture-edges
( image -- )
image
dim>>
first2
:>
( w h ) image
dim>>
adjust-texture-dim
first2
:>
( tw th )
GL_CLIENT_PIXEL_STORE_BIT
glPushClientAttrib
[
GL_UNPACK_ALIGNMENT
1
glPixelStorei
GL_UNPACK_ROW_LENGTH
w
glPixelStorei
w tw
<
[
image w 1
-
0
2array
w 0
2array
1 h
2array
copy-texture-edge
]
when
h th
<
[
image 0 h 1
-
2array
0 h
2array
w 1
2array
copy-texture-edge
]
when
w tw
<
h th
<
and
[
image w 1
-
h 1
-
2array
w h
2array
{
1 1
}
copy-texture-edge
]
when
]
[
glPopClientAttrib
]
finally
;