diff --git a/extra/gtk-samples/opengl/opengl.factor b/extra/gtk-samples/opengl/opengl.factor index 6e2a090fec..66653a05ea 100644 --- a/extra/gtk-samples/opengl/opengl.factor +++ b/extra/gtk-samples/opengl/opengl.factor @@ -1,7 +1,7 @@ ! Copyright (C) 2010 Anton Gorenko. ! See http://factorcode.org/license.txt for BSD license. USING: alien.strings gdk.gl.ffi gobject.ffi gtk.ffi gtk.gl.ffi -io.encodings.utf8 kernel locals opengl.gl ; +io.encodings.utf8 kernel locals opengl.demo-support opengl.gl ; IN: gtk-samples.opengl ! This sample is based on @@ -25,14 +25,14 @@ IN: gtk-samples.opengl [ GL_COLOR_BUFFER_BIT glClear - GL_TRIANGLES glBegin - 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 - glEnd + 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 ] diff --git a/extra/math/splines/viewer/viewer.factor b/extra/math/splines/viewer/viewer.factor index 59c347d740..1084510f2b 100644 --- a/extra/math/splines/viewer/viewer.factor +++ b/extra/math/splines/viewer/viewer.factor @@ -1,8 +1,8 @@ ! Copyright (C) 2010 Erik Charlebois. ! See http://factorcode.org/license.txt for BSD license. USING: accessors kernel locals math math.order math.polynomials -math.splines opengl.gl sequences ui.gadgets ui.gadgets.panes ui.render -arrays ; +math.splines opengl.demo-support opengl.gl sequences ui.gadgets +ui.gadgets.panes ui.render arrays ; IN: math.splines.viewer > second * ] bi 2array ] map :> pts - GL_LINE_STRIP glBegin - pts [ - first2 neg gadget spline-dim>> second + glVertex2f - ] each - glEnd ; + GL_LINE_STRIP [ + pts [ + first2 neg gadget spline-dim>> second + glVertex2f + ] each ] + do-state ; :: ( polynomials dim steps -- gadget ) spline-gadget new diff --git a/extra/maze/maze.factor b/extra/maze/maze.factor index 0e4af964d3..f682d4600d 100644 --- a/extra/maze/maze.factor +++ b/extra/maze/maze.factor @@ -1,7 +1,7 @@ ! From http://www.ffconsultancy.com/ocaml/maze/index.html USING: accessors arrays fry kernel math math.order math.vectors -namespaces opengl.gl random sequences ui ui.gadgets -ui.gadgets.canvas ui.render ; +namespaces opengl.demo-support opengl.gl random sequences ui +ui.gadgets ui.gadgets.canvas ui.render ; IN: maze CONSTANT: line-width 8 @@ -25,7 +25,7 @@ SYMBOL: visited : (draw-maze) ( cell -- ) dup vertex glEnd - GL_POINTS glBegin dup vertex glEnd + GL_POINTS [ dup vertex ] do-state GL_LINE_STRIP glBegin dup vertex dup visit @@ -42,9 +42,9 @@ SYMBOL: visited line-width 2 - glPointSize 1.0 1.0 1.0 1.0 glColor4d dup '[ _ t ] replicate visited set - GL_LINE_STRIP glBegin - { 0 0 } dup vertex (draw-maze) - glEnd ; + GL_LINE_STRIP [ + { 0 0 } dup vertex (draw-maze) + ] do-state ; TUPLE: maze < canvas ; diff --git a/extra/processing/shapes/shapes.factor b/extra/processing/shapes/shapes.factor index e4e1dd44b8..e11871e5e2 100644 --- a/extra/processing/shapes/shapes.factor +++ b/extra/processing/shapes/shapes.factor @@ -1,10 +1,8 @@ USING: alien.c-types alien.data arrays colors.constants grouping -kernel locals math math.vectors namespaces opengl opengl.gl -opengl.glu sequences sequences.generalizations shuffle ; +kernel locals math math.vectors namespaces opengl opengl.demo-support +opengl.gl opengl.glu sequences sequences.generalizations shuffle ; IN: processing.shapes -: do-state ( mode quot -- ) swap glBegin call glEnd ; inline - SYMBOL: fill-color SYMBOL: stroke-color