Handbook
Glossary
on-expose ( sender event user-data -- result )
Vocabulary
gtk-samples
.
opengl
Inputs
sender
an
object
event
an
object
user-data
an
object
Outputs
result
an
object
Definition
USING:
gdk2.gl.ffi
gtk2.gl.ffi
kernel
opengl.demo-support
opengl.gl
;
IN:
gtk-samples.opengl
::
on-expose
( sender event user-data -- result )
sender
gtk_widget_get_gl_context
:>
gl-context sender
gtk_widget_get_gl_window
:>
gl-drawable gl-drawable
gl-context
gdk_gl_drawable_gl_begin
dup
[
GL_COLOR_BUFFER_BIT
glClear
GL_TRIANGLES
[
1.0 0.0 0.0
glColor3f
0 1
glVertex2i
0.0 1.0 0.0
glColor3f
-1 -1
glVertex2i
0.0 0.0 1.0
glColor3f
1 -1
glVertex2i
]
do-state
gl-drawable
gdk_gl_drawable_is_double_buffered
1
=
[
gl-drawable
gdk_gl_drawable_swap_buffers
]
[
glFlush
]
if
gl-drawable
gdk_gl_drawable_gl_end
]
when
;