tasks a-s
This commit is contained in:
parent
47bf37c096
commit
b83f433714
12433 changed files with 156208 additions and 123 deletions
2
Task/OpenGL/Forth/opengl-1.fth
Normal file
2
Task/OpenGL/Forth/opengl-1.fth
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
import glconst import float
|
||||
glconst also float also opengl also
|
||||
54
Task/OpenGL/Forth/opengl-2.fth
Normal file
54
Task/OpenGL/Forth/opengl-2.fth
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
#! xbigforth
|
||||
\ automatic generated code
|
||||
\ do not edit
|
||||
|
||||
also editor also minos also forth
|
||||
|
||||
include triangle.fs
|
||||
component class triangle
|
||||
public:
|
||||
early widget
|
||||
early open
|
||||
early dialog
|
||||
early open-app
|
||||
( [varstart] ) ( [varend] )
|
||||
how:
|
||||
: open new DF[ 0 ]DF s" Triangle" open-component ;
|
||||
: dialog new DF[ 0 ]DF s" Triangle" open-dialog ;
|
||||
: open-app new DF[ 0 ]DF s" Triangle" open-application ;
|
||||
class;
|
||||
|
||||
triangle implements
|
||||
( [methodstart] ) ( [methodend] )
|
||||
: widget ( [dumpstart] )
|
||||
GL[ ^ glcanvas with
|
||||
0 0 w @ h @ glViewport
|
||||
GL_PROJECTION glMatrixMode
|
||||
glLoadIdentity
|
||||
-30e 30e -30e 30e -30e 30e glOrtho
|
||||
GL_MODELVIEW glMatrixMode
|
||||
0.3e 0.3e 0.3e 0.0e glClearColor
|
||||
GL_COLOR_BUFFER_BIT GL_DEPTH_BUFFER_BIT or glClear
|
||||
GL_SMOOTH glShadeModel
|
||||
glLoadIdentity
|
||||
-15e -15e 0e glTranslatef
|
||||
GL_TRIANGLES glBegin
|
||||
1e 0e 0e glColor3f
|
||||
0e 0e glVertex2f
|
||||
0e 1e 0e glColor3f
|
||||
30e 0e glVertex2f
|
||||
0e 0e 1e glColor3f
|
||||
0e 30e glVertex2f
|
||||
glEnd
|
||||
glFlush
|
||||
endwith ]GL ( MINOS ) ^^ CK[ ( x y b n -- ) 2drop 2drop ]CK ( MINOS ) $280 $1 *hfil $1E0 $1 *vfil glcanvas new
|
||||
&1 vabox new
|
||||
( [dumpend] ) ;
|
||||
: init ^>^^ assign widget 1 :: init ;
|
||||
class;
|
||||
|
||||
: main
|
||||
triangle open-app
|
||||
$1 0 ?DO stop LOOP bye ;
|
||||
script? [IF] main [THEN]
|
||||
previous previous previous
|
||||
Loading…
Add table
Add a link
Reference in a new issue