Handbook
Glossary
gl4demo-world
Vocabulary
opengl
.
demos
.
gl4
Definition
USING:
game.worlds
;
IN:
opengl.demos.gl4
TUPLE:
gl4demo-world
<
game-world
testing-program vertices vbo vao
;
Methods
USING:
accessors
alien.c-types
game.worlds
kernel
math
opengl.demos.gl4
opengl.gl
opengl.shaders
sequences
specialized-arrays.instances.alien.c-types.float
;
M:
gl4demo-world
begin-game-world
testing-vertex-shader
testing-fragment-shader
<simple-gl-program>
>>testing-program
float-array{
-0.5 -0.5 0.0 0.5 -0.5 0.0 0.0 0.5 0.0
}
>>vertices
1 0
uint
[
glCreateVertexArrays
]
ref
>>vao
1 0
uint
[
glCreateBuffers
]
ref
>>vbo
dup
[
vbo>>
]
[
vertices>>
length
4
*
]
[
vertices>>
]
tri
GL_STATIC_DRAW
glNamedBufferData
dup
[
vao>>
0
]
[
vbo>>
]
bi
0 3 4
*
glVertexArrayVertexBuffer
dup
vao>>
0
glEnableVertexArrayAttrib
dup
vao>>
0 3
GL_FLOAT
GL_FALSE
0
glVertexArrayAttribFormat
dup
vao>>
0 0
glVertexArrayAttribBinding
drop
;
USING:
accessors
colors
kernel
opengl
opengl.demos.gl4
opengl.gl
opengl.shaders
ui.gadgets.worlds
;
M:
gl4demo-world
draw-world*
COLOR:
aqua
gl-clear
dup
testing-program>>
[
over
vao>>
glBindVertexArray
GL_TRIANGLES
0 3
glDrawArrays
drop
]
with-gl-program
drop
;
USING:
accessors
game.worlds
kernel
opengl
opengl.demos.gl4
opengl.shaders
;
M:
gl4demo-world
end-game-world
dup
testing-program>>
delete-gl-program
dup
vbo>>
delete-gl-buffer
dup
vao>>
delete-vertex-array
drop
;
USING:
game.worlds
opengl.demos.gl4
;
M:
gl4demo-world
tick-game-world
handle-input
;