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
game.worlds
kernel
math
opengl
opengl.capabilities
opengl.demos.gl4
opengl.gl
opengl.shaders
sequences
specialized-arrays.instances.alien.c-types.float
;
M:
gl4demo-world
begin-game-world
"3.2"
require-gl-version
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
gen-vertex-array
>>vao
gen-gl-buffer
>>vbo
dup
vao>>
glBindVertexArray
dup
vbo>>
GL_ARRAY_BUFFER
swap
glBindBuffer
dup
[
vertices>>
length
4
*
]
[
vertices>>
]
bi
[
GL_ARRAY_BUFFER
]
2dip
GL_STATIC_DRAW
glBufferData
dup
testing-program>>
"aPos"
glGetAttribLocation
dup
glEnableVertexAttribArray
3
GL_FLOAT
GL_FALSE
0
f
glVertexAttribPointer
GL_ARRAY_BUFFER
0
glBindBuffer
0
glBindVertexArray
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
;