Handbook
Glossary
gml-viewer-world
Vocabulary
gml
.
viewer
Definition
USING:
euler.b-rep
gpu.util.wasd
;
IN:
gml.viewer
TUPLE:
gml-viewer-world
<
wasd-world
{
b-rep
b-rep
initial:
T{
b-rep
}
}
selected program
vertex-array face-indices edge-indices point-indices
view-faces? view-edges? drag?
;
Methods
USING:
accessors
game.worlds
gml.viewer
gpu
gpu.shaders
gpu.state
kernel
;
M:
gml-viewer-world
begin-game-world
init-gpu
t
>>view-faces?
t
>>view-edges?
T{
point-state
{
size 5.0
}
}
set-gpu-state
dup
reset-view
gml-viewer-program
<program-instance>
>>program
dup
init-viewer-model
refresh-b-rep-view
;
USING:
accessors
gml.viewer
gpu.framebuffers
gpu.render
gpu.state
gpu.util.wasd
kernel
ui.gadgets.worlds
;
M:
gml-viewer-world
draw-world*
system-framebuffer
{
{
default-attachment
{
0.0 0.0 0.0 1.0
}
}
{
depth-attachment
1.0
}
}
clear-framebuffer
[
dup
view-faces?>>
[
T{
depth-state
{
comparison
cmp-less
}
}
set-gpu-state
{
{
"primitive-mode"
[
drop
triangles-mode
]
}
{
"indexes"
[
face-indices>>
]
}
{
"uniforms"
[
<mvp-uniforms>
]
}
{
"vertex-array"
[
vertex-array>>
]
}
}
<render-set>
render
T{
depth-state
}
set-gpu-state
]
[
drop
]
if
]
[
dup
view-edges?>>
[
{
{
"primitive-mode"
[
drop
lines-mode
]
}
{
"indexes"
[
edge-indices>>
]
}
{
"uniforms"
[
<mvp-uniforms>
]
}
{
"vertex-array"
[
vertex-array>>
]
}
}
<render-set>
render
]
[
drop
]
if
]
[
{
{
"primitive-mode"
[
drop
points-mode
]
}
{
"indexes"
[
point-indices>>
]
}
{
"uniforms"
[
<mvp-uniforms>
]
}
{
"vertex-array"
[
vertex-array>>
]
}
}
<render-set>
render
]
tri
;
USING:
accessors
game.worlds
gml.viewer
kernel
models
;
M:
gml-viewer-world
end-game-world
[
dup
selected>>
remove-connection
]
[
dup
model>>
remove-connection
]
bi
;
USING:
accessors
gml.viewer
kernel
models
ui.gadgets
;
M:
gml-viewer-world
model-changed
nip
[
control-value
]
[
b-rep<<
]
[
dup
viewable?
[
refresh-b-rep-view
]
[
drop
]
if
]
tri
;
USING:
accessors
game.input
game.worlds
generic
gml.viewer
kernel
math
sequences
;
M:
gml-viewer-world
tick-game-world
[
M\
gml-viewer-world
tick-game-world
(call-next-method)
]
[
dup
drag?>>
[
read-mouse
buttons>>
dup
integer?
[
0
bit?
]
[
first
]
if
>>drag?
]
when
drop
]
bi
;
USING:
accessors
gml.viewer
gpu.util.wasd
kernel
;
M:
gml-viewer-world
wasd-mouse-scale
drag?>>
-1.6666666666666668e-3 0.0
?
;