Handbook
Glossary
spheres-world
Vocabulary
spheres
Definition
USING:
opengl.demo-support
;
IN:
spheres
TUPLE:
spheres-world
<
demo-world
plane-program solid-sphere-program texture-sphere-program
reflection-framebuffer reflection-depthbuffer
reflection-texture
;
Methods
USING:
accessors
kernel
opengl.capabilities
opengl.demo-support
opengl.gl
spheres
ui.gadgets.worlds
;
M:
spheres-world
begin-world
"2.0"
{
"GL_ARB_shader_objects"
}
require-gl-version-or-extensions
{
"GL_EXT_framebuffer_object"
}
require-gl-extensions
GL_DEPTH_TEST
glEnable
GL_VERTEX_ARRAY
glEnableClientState
0.15 0.15 1.0 1.0
glClearColor
20.0 10.0 20.0
set-demo-orientation
(plane-program)
>>plane-program
(solid-sphere-program)
>>solid-sphere-program
(texture-sphere-program)
>>texture-sphere-program
(make-reflection-texture)
>>reflection-texture
(make-reflection-depthbuffer)
[
>>reflection-depthbuffer
]
keep
(make-reflection-framebuffer)
>>reflection-framebuffer
drop
;
USING:
kernel
opengl.demo-support
spheres
;
M:
spheres-world
distance-step
drop
0.5
;
USING:
accessors
combinators
kernel
opengl
opengl.demo-support
opengl.gl
opengl.shaders
spheres
ui.gadgets.worlds
;
M:
spheres-world
draw-world*
{
[
(draw-reflection-texture)
]
[
demo-world-set-matrix
]
[
sphere-scene
]
[
reflection-texture>>
GL_TEXTURE_CUBE_MAP
GL_TEXTURE0
bind-texture-unit
]
[
texture-sphere-program>>
[
[
"surface_texture"
glGetUniformLocation
0
glUniform1i
]
[
{
0.0 0.0 0.0
}
4.0
(draw-sphere)
]
bi
]
with-gl-program
]
}
cleave
;
USING:
accessors
combinators
kernel
opengl.framebuffers
opengl.shaders
opengl.textures
spheres
ui.gadgets.worlds
;
M:
spheres-world
end-world
{
[
reflection-framebuffer>>
[
delete-framebuffer
]
when*
]
[
reflection-depthbuffer>>
[
delete-renderbuffer
]
when*
]
[
reflection-texture>>
[
delete-texture
]
when*
]
[
solid-sphere-program>>
[
delete-gl-program
]
when*
]
[
texture-sphere-program>>
[
delete-gl-program
]
when*
]
[
plane-program>>
[
delete-gl-program
]
when*
]
}
cleave
;
USING:
kernel
opengl.demo-support
spheres
;
M:
spheres-world
far-plane
drop
512.0
;
USING:
kernel
opengl.demo-support
spheres
;
M:
spheres-world
near-plane
drop
1.0
;