Handbook
Glossary
reset-gpu ( -- )
GPU-accelerated rendering
ยป
Graphics context management
Prev:
finish-gpu ( -- )
Vocabulary
gpu
Word description
Clears all framebuffer, GPU buffer, shader, and vertex array bindings. Call this before directly calling OpenGL functions after using
gpu
functions.
Definition
USING:
kernel
opengl.capabilities
opengl.gl
;
IN:
gpu
:
reset-gpu
( -- )
"3.0"
{
{
"GL_APPLE_vertex_array_object"
"GL_ARB_vertex_array_object"
}
}
has-gl-version-or-extensions?
[
0
glBindVertexArray
]
when
"3.0"
{
{
"GL_EXT_framebuffer_object"
"GL_ARB_framebuffer_object"
}
}
has-gl-version-or-extensions?
[
GL_DRAW_FRAMEBUFFER
0
glBindFramebuffer
GL_READ_FRAMEBUFFER
0
glBindFramebuffer
GL_RENDERBUFFER
0
glBindRenderbuffer
]
when
"1.5"
{
"GL_ARB_vertex_buffer_object"
}
has-gl-version-or-extensions?
[
GL_ARRAY_BUFFER
0
glBindBuffer
GL_ELEMENT_ARRAY_BUFFER
0
glBindBuffer
]
when
"2.1"
{
"GL_ARB_pixel_buffer_object"
}
has-gl-version-or-extensions?
[
GL_PIXEL_PACK_BUFFER
0
glBindBuffer
GL_PIXEL_UNPACK_BUFFER
0
glBindBuffer
]
when
"2.0"
{
"GL_ARB_shader_objects"
}
has-gl-version-or-extensions?
[
0
glUseProgram
]
when
;