From 1fe15b322d4811d8323c9333d7c7dcdb12fc2c1a Mon Sep 17 00:00:00 2001 From: Chris Double Date: Fri, 21 Dec 2007 11:38:25 +1300 Subject: [PATCH 01/65] Fix number/sequence error in match-replace --- extra/match/match.factor | 1 + 1 file changed, 1 insertion(+) diff --git a/extra/match/match.factor b/extra/match/match.factor index 527d7f2465..a80001e724 100755 --- a/extra/match/match.factor +++ b/extra/match/match.factor @@ -54,6 +54,7 @@ MACRO: match-cond ( assoc -- ) : replace-patterns ( object -- result ) { + { [ dup number? ] [ ] } { [ dup match-var? ] [ get ] } { [ dup sequence? ] [ [ replace-patterns ] map ] } { [ dup tuple? ] [ tuple>array replace-patterns >tuple ] } From e7cf83a57a16ae4bb34be7c04b0f26a8c1672561 Mon Sep 17 00:00:00 2001 From: Chris Double Date: Fri, 21 Dec 2007 13:16:14 +1300 Subject: [PATCH 02/65] First attempt at compiling peg parsers to quotations --- extra/peg/peg.factor | 266 +++++++++++++++++++++++++++---------------- 1 file changed, 169 insertions(+), 97 deletions(-) diff --git a/extra/peg/peg.factor b/extra/peg/peg.factor index 411a47b9bd..3d9128fec9 100644 --- a/extra/peg/peg.factor +++ b/extra/peg/peg.factor @@ -1,12 +1,16 @@ ! Copyright (C) 2007 Chris Double. ! See http://factorcode.org/license.txt for BSD license. USING: kernel sequences strings namespaces math assocs shuffle - vectors arrays combinators.lib memoize math.parser ; + vectors arrays combinators.lib memoize math.parser match ; IN: peg TUPLE: parse-result remaining ast ; -GENERIC: (parse) ( state parser -- result ) +GENERIC: compile ( parser -- quot ) + +: (parse) ( state parser -- result ) + compile call ; + TUPLE: token-parser symbol ; -M: token-parser (parse) ( input parser -- result ) - token-parser-symbol 2dup head? [ - dup >r length tail-slice r> - ] [ - 2drop f - ] if ; - -TUPLE: satisfy-parser quot ; +MATCH-VARS: ?token ; -M: satisfy-parser (parse) ( state parser -- result ) - over empty? [ - 2drop f - ] [ - satisfy-parser-quot [ unclip-slice dup ] dip call [ - +: token-pattern ( -- quot ) + [ + ?token 2dup head? [ + dup >r length tail-slice r> ] [ 2drop f - ] if - ] if ; + ] if + ] ; + +M: token-parser compile ( parser -- quot ) + token-parser-symbol \ ?token token-pattern match-replace ; + +TUPLE: satisfy-parser quot ; + +MATCH-VARS: ?quot ; + +: satisfy-pattern ( -- quot ) + [ + dup empty? [ + drop f + ] [ + unclip-slice dup ?quot call [ + + ] [ + 2drop f + ] if + ] if + ] ; + +M: satisfy-parser compile ( parser -- quot ) + satisfy-parser-quot \ ?quot satisfy-pattern match-replace ; TUPLE: range-parser min max ; -M: range-parser (parse) ( state parser -- result ) - over empty? [ - 2drop f - ] [ - 0 pick nth dup rot - { range-parser-min range-parser-max } get-slots between? [ - [ 1 tail-slice ] dip +MATCH-VARS: ?min ?max ; + +: range-pattern ( -- quot ) + [ + dup empty? [ + drop f ] [ - 2drop f - ] if - ] if ; + 0 over nth dup + ?min ?max between? [ + [ 1 tail-slice ] dip + ] [ + 2drop f + ] if + ] if + ] ; + +M: range-parser compile ( parser -- quot ) + T{ range-parser _ ?min ?max } range-pattern match-replace ; TUPLE: seq-parser parsers ; -: do-seq-parser ( result parser -- result ) - [ dup parse-result-remaining ] dip parse [ - [ parse-result-remaining swap set-parse-result-remaining ] 2keep - parse-result-ast dup ignore = [ drop ] [ swap [ parse-result-ast push ] keep ] if - ] [ - drop f - ] if* ; +: seq-pattern ( -- quot ) + [ + dup [ + dup parse-result-remaining ?quot call [ + [ parse-result-remaining swap set-parse-result-remaining ] 2keep + parse-result-ast dup ignore = [ + drop + ] [ + swap [ parse-result-ast push ] keep + ] if + ] [ + drop f + ] if* + ] [ + drop f + ] if + ] ; -: (seq-parser) ( result parsers -- result ) - dup empty? not pick and [ - unclip swap [ do-seq-parser ] dip (seq-parser) - ] [ - drop - ] if ; - -M: seq-parser (parse) ( state parser -- result ) - seq-parser-parsers [ V{ } clone ] dip (seq-parser) ; +M: seq-parser compile ( parser -- quot ) + [ + [ V{ } clone ] % + seq-parser-parsers [ compile \ ?quot seq-pattern match-replace % ] each + ] [ ] make ; TUPLE: choice-parser parsers ; - -: (choice-parser) ( state parsers -- result ) - dup empty? [ - 2drop f - ] [ - unclip pick swap parse [ - 2nip - ] [ - (choice-parser) - ] if* - ] if ; -M: choice-parser (parse) ( state parser -- result ) - choice-parser-parsers (choice-parser) ; +: choice-pattern ( -- quot ) + [ + dup [ + + ] [ + drop dup ?quot call + ] if + ] ; + +M: choice-parser compile ( parser -- quot ) + [ + f , + choice-parser-parsers [ compile \ ?quot choice-pattern match-replace % ] each + \ nip , + ] [ ] make ; TUPLE: repeat0-parser p1 ; -: (repeat-parser) ( parser result -- result ) - 2dup parse-result-remaining swap parse [ +: (repeat0) ( quot result -- result ) + 2dup parse-result-remaining swap call [ [ parse-result-remaining swap set-parse-result-remaining ] 2keep parse-result-ast swap [ parse-result-ast push ] keep - (repeat-parser) + (repeat0) ] [ nip - ] if* ; + ] if* ; inline -: clone-result ( result -- result ) - { parse-result-remaining parse-result-ast } - get-slots 1vector ; +: repeat0-pattern ( -- quot ) + [ + ?quot swap (repeat0) + ] ; -M: repeat0-parser (parse) ( state parser -- result ) - repeat0-parser-p1 2dup parse [ - nipd clone-result (repeat-parser) - ] [ - drop V{ } clone - ] if* ; +M: repeat0-parser compile ( parser -- quot ) + [ + [ V{ } clone ] % + repeat0-parser-p1 compile \ ?quot repeat0-pattern match-replace % + ] [ ] make ; TUPLE: repeat1-parser p1 ; -M: repeat1-parser (parse) ( state parser -- result ) - repeat1-parser-p1 tuck parse dup [ clone-result (repeat-parser) ] [ nip ] if ; +: repeat1-pattern ( -- quot ) + [ + ?quot swap (repeat0) [ + dup parse-result-ast empty? [ + drop f + ] when + ] [ + f + ] if* + ] ; + +M: repeat1-parser compile ( parser -- quot ) + [ + [ V{ } clone ] % + repeat1-parser-p1 compile \ ?quot repeat1-pattern match-replace % + ] [ ] make ; TUPLE: optional-parser p1 ; -M: optional-parser (parse) ( state parser -- result ) - dupd optional-parser-p1 parse swap f or ; +: optional-pattern ( -- quot ) + [ + dup ?quot call swap f or + ] ; + +M: optional-parser compile ( parser -- quot ) + optional-parser-p1 compile \ ?quot optional-pattern match-replace ; TUPLE: ensure-parser p1 ; -M: ensure-parser (parse) ( state parser -- result ) - dupd ensure-parser-p1 parse [ - ignore - ] [ - drop f - ] if ; +: ensure-pattern ( -- quot ) + [ + dup ?quot call [ + ignore + ] [ + drop f + ] if + ] ; + +M: ensure-parser compile ( parser -- quot ) + ensure-parser-p1 compile \ ?quot ensure-pattern match-replace ; TUPLE: ensure-not-parser p1 ; -M: ensure-not-parser (parse) ( state parser -- result ) - dupd ensure-not-parser-p1 parse [ - drop f - ] [ - ignore - ] if ; +: ensure-not-pattern ( -- quot ) + [ + dup ?quot call [ + drop f + ] [ + ignore + ] if + ] ; + +M: ensure-not-parser compile ( parser -- quot ) + ensure-not-parser-p1 compile \ ?quot ensure-not-pattern match-replace ; TUPLE: action-parser p1 quot ; -M: action-parser (parse) ( state parser -- result ) - tuck action-parser-p1 parse dup [ - dup parse-result-ast rot action-parser-quot call - swap [ set-parse-result-ast ] keep - ] [ - nip - ] if ; +MATCH-VARS: ?action ; + +: action-pattern ( -- quot ) + [ + ?quot call dup [ + dup parse-result-ast ?action call + swap [ set-parse-result-ast ] keep + ] when + ] ; + +M: action-parser compile ( parser -- quot ) + { action-parser-p1 action-parser-quot } get-slots [ compile ] dip + 2array { ?quot ?action } action-pattern match-replace ; : left-trim-slice ( string -- string ) #! Return a new string without any leading whitespace @@ -211,13 +279,17 @@ M: action-parser (parse) ( state parser -- result ) TUPLE: sp-parser p1 ; -M: sp-parser (parse) ( state parser -- result ) - [ left-trim-slice ] dip sp-parser-p1 parse ; +M: sp-parser compile ( parser -- quot ) + [ + \ left-trim-slice , sp-parser-p1 compile % + ] [ ] make ; TUPLE: delay-parser quot ; -M: delay-parser (parse) ( state parser -- result ) - delay-parser-quot call parse ; +M: delay-parser compile ( parser -- quot ) + [ + delay-parser-quot % \ compile , \ call , + ] [ ] make ; PRIVATE> From ffd25ce5a81628c9a0f012188dc87c9c78aee261 Mon Sep 17 00:00:00 2001 From: Chris Double Date: Fri, 21 Dec 2007 13:24:14 +1300 Subject: [PATCH 03/65] Fix missing vocab in match --- extra/match/match.factor | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extra/match/match.factor b/extra/match/match.factor index a80001e724..421aa926f9 100755 --- a/extra/match/match.factor +++ b/extra/match/match.factor @@ -3,7 +3,7 @@ ! ! Based on pattern matching code from Paul Graham's book 'On Lisp'. USING: parser kernel words namespaces sequences tuples -combinators macros assocs ; +combinators macros assocs math ; IN: match SYMBOL: _ From e0caf654e6c56de827cf6ae98565873909cc2409 Mon Sep 17 00:00:00 2001 From: Joe Groff Date: Sat, 12 Jan 2008 22:58:56 -0800 Subject: [PATCH 04/65] OpenGL 2.1 support --- core/alien/syntax/syntax.factor | 9 + extra/opengl/gl/gl.factor | 858 +++++++++++++++++++------ extra/opengl/gl/unix/unix.factor | 5 + extra/opengl/gl/windows/windows.factor | 18 + extra/opengl/opengl.factor | 101 ++- 5 files changed, 809 insertions(+), 182 deletions(-) create mode 100644 extra/opengl/gl/unix/unix.factor create mode 100644 extra/opengl/gl/windows/windows.factor diff --git a/core/alien/syntax/syntax.factor b/core/alien/syntax/syntax.factor index 99275d02bf..bc3bc911ef 100755 --- a/core/alien/syntax/syntax.factor +++ b/core/alien/syntax/syntax.factor @@ -23,6 +23,15 @@ IN: alien.syntax PRIVATE> +: indirect-quot ( function-ptr-quot return types abi -- quot ) + [ alien-indirect ] 3curry compose ; + +: define-indirect ( abi return function-ptr-quot function-name parameters -- ) + >r pick r> parse-arglist + rot create-in dup reset-generic + >r >r swapd roll indirect-quot r> r> + -rot define-declared ; + : DLL" skip-blank parse-string dlopen parsed ; parsing : ALIEN: scan string>number parsed ; parsing diff --git a/extra/opengl/gl/gl.factor b/extra/opengl/gl/gl.factor index 40ead55ddd..c7ce176aca 100644 --- a/extra/opengl/gl/gl.factor +++ b/extra/opengl/gl/gl.factor @@ -3,7 +3,10 @@ ! This file is based on the gl.h that comes with xorg-x11 6.8.2 -USING: alien alien.syntax kernel sequences words ; +USING: alien alien.syntax kernel sequences system words ; +USE-IF: windows? opengl.gl.windows +USE-IF: unix? opengl.gl.unix + IN: opengl.gl TYPEDEF: uint GLenum @@ -1118,195 +1121,690 @@ FUNCTION: void glPushName ( GLuint name ) ; FUNCTION: void glPopName ( ) ; +! OpenGL extension functions + + + + + ! OpenGL 1.2 -: GL_PACK_SKIP_IMAGES HEX: 806B ; inline -: GL_PACK_IMAGE_HEIGHT HEX: 806C ; inline -: GL_UNPACK_SKIP_IMAGES HEX: 806D ; inline -: GL_UNPACK_IMAGE_HEIGHT HEX: 806E ; inline -: GL_TEXTURE_3D HEX: 806F ; inline -: GL_PROXY_TEXTURE_3D HEX: 8070 ; inline -: GL_TEXTURE_DEPTH HEX: 8071 ; inline -: GL_TEXTURE_WRAP_R HEX: 8072 ; inline -: GL_MAX_3D_TEXTURE_SIZE HEX: 8073 ; inline -: GL_BGR HEX: 80E0 ; inline -: GL_BGRA HEX: 80E1 ; inline -: GL_UNSIGNED_BYTE_3_3_2 HEX: 8032 ; inline -: GL_UNSIGNED_BYTE_2_3_3_REV HEX: 8362 ; inline -: GL_UNSIGNED_SHORT_5_6_5 HEX: 8363 ; inline -: GL_UNSIGNED_SHORT_5_6_5_REV HEX: 8364 ; inline -: GL_UNSIGNED_SHORT_4_4_4_4 HEX: 8033 ; inline -: GL_UNSIGNED_SHORT_4_4_4_4_REV HEX: 8365 ; inline -: GL_UNSIGNED_SHORT_5_5_5_1 HEX: 8034 ; inline -: GL_UNSIGNED_SHORT_1_5_5_5_REV HEX: 8366 ; inline -: GL_UNSIGNED_INT_8_8_8_8 HEX: 8035 ; inline -: GL_UNSIGNED_INT_8_8_8_8_REV HEX: 8367 ; inline -: GL_UNSIGNED_INT_10_10_10_2 HEX: 8036 ; inline -: GL_UNSIGNED_INT_2_10_10_10_REV HEX: 8368 ; inline -: GL_RESCALE_NORMAL HEX: 803A ; inline -: GL_LIGHT_MODEL_COLOR_CONTROL HEX: 81F8 ; inline -: GL_SINGLE_COLOR HEX: 81F9 ; inline -: GL_SEPARATE_SPECULAR_COLOR HEX: 81FA ; inline -: GL_CLAMP_TO_EDGE HEX: 812F ; inline -: GL_TEXTURE_MIN_LOD HEX: 813A ; inline -: GL_TEXTURE_MAX_LOD HEX: 813B ; inline -: GL_TEXTURE_BASE_LEVEL HEX: 813C ; inline -: GL_TEXTURE_MAX_LEVEL HEX: 813D ; inline -: GL_MAX_ELEMENTS_VERTICES HEX: 80E8 ; inline -: GL_MAX_ELEMENTS_INDICES HEX: 80E9 ; inline -: GL_ALIASED_POINT_SIZE_RANGE HEX: 846D ; inline -: GL_ALIASED_LINE_WIDTH_RANGE HEX: 846E ; inline +: GL_SMOOTH_POINT_SIZE_RANGE HEX: 0B12 ; inline +: GL_SMOOTH_POINT_SIZE_GRANULARITY HEX: 0B13 ; inline +: GL_SMOOTH_LINE_WIDTH_RANGE HEX: 0B22 ; inline +: GL_SMOOTH_LINE_WIDTH_GRANULARITY HEX: 0B23 ; inline +: GL_UNSIGNED_BYTE_3_3_2 HEX: 8032 ; inline +: GL_UNSIGNED_SHORT_4_4_4_4 HEX: 8033 ; inline +: GL_UNSIGNED_SHORT_5_5_5_1 HEX: 8034 ; inline +: GL_UNSIGNED_INT_8_8_8_8 HEX: 8035 ; inline +: GL_UNSIGNED_INT_10_10_10_2 HEX: 8036 ; inline +: GL_RESCALE_NORMAL HEX: 803A ; inline +: GL_TEXTURE_BINDING_3D HEX: 806A ; inline +: GL_PACK_SKIP_IMAGES HEX: 806B ; inline +: GL_PACK_IMAGE_HEIGHT HEX: 806C ; inline +: GL_UNPACK_SKIP_IMAGES HEX: 806D ; inline +: GL_UNPACK_IMAGE_HEIGHT HEX: 806E ; inline +: GL_TEXTURE_3D HEX: 806F ; inline +: GL_PROXY_TEXTURE_3D HEX: 8070 ; inline +: GL_TEXTURE_DEPTH HEX: 8071 ; inline +: GL_TEXTURE_WRAP_R HEX: 8072 ; inline +: GL_MAX_3D_TEXTURE_SIZE HEX: 8073 ; inline +: GL_BGR HEX: 80E0 ; inline +: GL_BGRA HEX: 80E1 ; inline +: GL_MAX_ELEMENTS_VERTICES HEX: 80E8 ; inline +: GL_MAX_ELEMENTS_INDICES HEX: 80E9 ; inline +: GL_CLAMP_TO_EDGE HEX: 812F ; inline +: GL_TEXTURE_MIN_LOD HEX: 813A ; inline +: GL_TEXTURE_MAX_LOD HEX: 813B ; inline +: GL_TEXTURE_BASE_LEVEL HEX: 813C ; inline +: GL_TEXTURE_MAX_LEVEL HEX: 813D ; inline +: GL_LIGHT_MODEL_COLOR_CONTROL HEX: 81F8 ; inline +: GL_SINGLE_COLOR HEX: 81F9 ; inline +: GL_SEPARATE_SPECULAR_COLOR HEX: 81FA ; inline +: GL_UNSIGNED_BYTE_2_3_3_REV HEX: 8362 ; inline +: GL_UNSIGNED_SHORT_5_6_5 HEX: 8363 ; inline +: GL_UNSIGNED_SHORT_5_6_5_REV HEX: 8364 ; inline +: GL_UNSIGNED_SHORT_4_4_4_4_REV HEX: 8365 ; inline +: GL_UNSIGNED_SHORT_1_5_5_5_REV HEX: 8366 ; inline +: GL_UNSIGNED_INT_8_8_8_8_REV HEX: 8367 ; inline +: GL_UNSIGNED_INT_2_10_10_10_REV HEX: 8368 ; inline +: GL_ALIASED_POINT_SIZE_RANGE HEX: 846D ; inline +: GL_ALIASED_LINE_WIDTH_RANGE HEX: 846E ; inline -! Not present on Windows -! FUNCTION: void glDrawRangeElements ( GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, GLvoid* indices ) ; +GL-FUNCTION: void glCopyTexSubImage3D ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height ) ; +GL-FUNCTION: void glDrawRangeElements ( GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, GLvoid* indices ) ; +GL-FUNCTION: void glTexImage3D ( GLenum target, GLint level, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, GLvoid* pixels ) ; +GL-FUNCTION: void glTexSubImage3D ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLvoid* pixels ) ; -! FUNCTION: void glTexImage3D ( GLenum target, GLint level, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, GLvoid* pixels ) ; - -! FUNCTION: void glTexSubImage3D ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLvoid* pixels ) ; - -! FUNCTION: void glCopyTexSubImage3D ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height ) ; - -! TODO: the rest. looks fiddly ! OpenGL 1.3 -: GL_ACTIVE_TEXTURE HEX: 84E0 ; inline -: GL_CLIENT_ACTIVE_TEXTURE HEX: 84E1 ; inline -: GL_MAX_TEXTURE_UNITS HEX: 84E2 ; inline -: GL_TEXTURE0 HEX: 84C0 ; inline -: GL_TEXTURE1 HEX: 84C1 ; inline -: GL_TEXTURE2 HEX: 84C2 ; inline -: GL_TEXTURE3 HEX: 84C3 ; inline -: GL_TEXTURE4 HEX: 84C4 ; inline -: GL_TEXTURE5 HEX: 84C5 ; inline -: GL_TEXTURE6 HEX: 84C6 ; inline -: GL_TEXTURE7 HEX: 84C7 ; inline -: GL_TEXTURE8 HEX: 84C8 ; inline -: GL_TEXTURE9 HEX: 84C9 ; inline -: GL_TEXTURE10 HEX: 84CA ; inline -: GL_TEXTURE11 HEX: 84CB ; inline -: GL_TEXTURE12 HEX: 84CC ; inline -: GL_TEXTURE13 HEX: 84CD ; inline -: GL_TEXTURE14 HEX: 84CE ; inline -: GL_TEXTURE15 HEX: 84CF ; inline -: GL_TEXTURE16 HEX: 84D0 ; inline -: GL_TEXTURE17 HEX: 84D1 ; inline -: GL_TEXTURE18 HEX: 84D2 ; inline -: GL_TEXTURE19 HEX: 84D3 ; inline -: GL_TEXTURE20 HEX: 84D4 ; inline -: GL_TEXTURE21 HEX: 84D5 ; inline -: GL_TEXTURE22 HEX: 84D6 ; inline -: GL_TEXTURE23 HEX: 84D7 ; inline -: GL_TEXTURE24 HEX: 84D8 ; inline -: GL_TEXTURE25 HEX: 84D9 ; inline -: GL_TEXTURE26 HEX: 84DA ; inline -: GL_TEXTURE27 HEX: 84DB ; inline -: GL_TEXTURE28 HEX: 84DC ; inline -: GL_TEXTURE29 HEX: 84DD ; inline -: GL_TEXTURE30 HEX: 84DE ; inline -: GL_TEXTURE31 HEX: 84DF ; inline -: GL_NORMAL_MAP HEX: 8511 ; inline -: GL_REFLECTION_MAP HEX: 8512 ; inline -: GL_TEXTURE_CUBE_MAP HEX: 8513 ; inline -: GL_TEXTURE_BINDING_CUBE_MAP HEX: 8514 ; inline -: GL_TEXTURE_CUBE_MAP_POSITIVE_X HEX: 8515 ; inline -: GL_TEXTURE_CUBE_MAP_NEGATIVE_X HEX: 8516 ; inline -: GL_TEXTURE_CUBE_MAP_POSITIVE_Y HEX: 8517 ; inline -: GL_TEXTURE_CUBE_MAP_NEGATIVE_Y HEX: 8518 ; inline -: GL_TEXTURE_CUBE_MAP_POSITIVE_Z HEX: 8519 ; inline -: GL_TEXTURE_CUBE_MAP_NEGATIVE_Z HEX: 851A ; inline -: GL_PROXY_TEXTURE_CUBE_MAP HEX: 851B ; inline -: GL_MAX_CUBE_MAP_TEXTURE_SIZE HEX: 851C ; inline -: GL_COMBINE HEX: 8570 ; inline -: GL_COMBINE_RGB HEX: 8571 ; inline -: GL_COMBINE_ALPHA HEX: 8572 ; inline -: GL_RGB_SCALE HEX: 8573 ; inline -: GL_ADD_SIGNED HEX: 8574 ; inline -: GL_INTERPOLATE HEX: 8575 ; inline -: GL_CONSTANT HEX: 8576 ; inline -: GL_PRIMARY_COLOR HEX: 8577 ; inline -: GL_PREVIOUS HEX: 8578 ; inline -: GL_SOURCE0_RGB HEX: 8580 ; inline -: GL_SOURCE1_RGB HEX: 8581 ; inline -: GL_SOURCE2_RGB HEX: 8582 ; inline -: GL_SOURCE0_ALPHA HEX: 8588 ; inline -: GL_SOURCE1_ALPHA HEX: 8589 ; inline -: GL_SOURCE2_ALPHA HEX: 858A ; inline -: GL_OPERAND0_RGB HEX: 8590 ; inline -: GL_OPERAND1_RGB HEX: 8591 ; inline -: GL_OPERAND2_RGB HEX: 8592 ; inline -: GL_OPERAND0_ALPHA HEX: 8598 ; inline -: GL_OPERAND1_ALPHA HEX: 8599 ; inline -: GL_OPERAND2_ALPHA HEX: 859A ; inline -: GL_SUBTRACT HEX: 84E7 ; inline -: GL_TRANSPOSE_MODELVIEW_MATRIX HEX: 84E3 ; inline -: GL_TRANSPOSE_PROJECTION_MATRIX HEX: 84E4 ; inline -: GL_TRANSPOSE_TEXTURE_MATRIX HEX: 84E5 ; inline -: GL_TRANSPOSE_COLOR_MATRIX HEX: 84E6 ; inline -: GL_COMPRESSED_ALPHA HEX: 84E9 ; inline -: GL_COMPRESSED_LUMINANCE HEX: 84EA ; inline -: GL_COMPRESSED_LUMINANCE_ALPHA HEX: 84EB ; inline -: GL_COMPRESSED_INTENSITY HEX: 84EC ; inline -: GL_COMPRESSED_RGB HEX: 84ED ; inline -: GL_COMPRESSED_RGBA HEX: 84EE ; inline -: GL_TEXTURE_COMPRESSION_HINT HEX: 84EF ; inline -: GL_TEXTURE_COMPRESSED_IMAGE_SIZE HEX: 86A0 ; inline -: GL_TEXTURE_COMPRESSED HEX: 86A1 ; inline + +: GL_MULTISAMPLE HEX: 809D ; inline +: GL_SAMPLE_ALPHA_TO_COVERAGE HEX: 809E ; inline +: GL_SAMPLE_ALPHA_TO_ONE HEX: 809F ; inline +: GL_SAMPLE_COVERAGE HEX: 80A0 ; inline +: GL_SAMPLE_BUFFERS HEX: 80A8 ; inline +: GL_SAMPLES HEX: 80A9 ; inline +: GL_SAMPLE_COVERAGE_VALUE HEX: 80AA ; inline +: GL_SAMPLE_COVERAGE_INVERT HEX: 80AB ; inline +: GL_CLAMP_TO_BORDER HEX: 812D ; inline +: GL_TEXTURE0 HEX: 84C0 ; inline +: GL_TEXTURE1 HEX: 84C1 ; inline +: GL_TEXTURE2 HEX: 84C2 ; inline +: GL_TEXTURE3 HEX: 84C3 ; inline +: GL_TEXTURE4 HEX: 84C4 ; inline +: GL_TEXTURE5 HEX: 84C5 ; inline +: GL_TEXTURE6 HEX: 84C6 ; inline +: GL_TEXTURE7 HEX: 84C7 ; inline +: GL_TEXTURE8 HEX: 84C8 ; inline +: GL_TEXTURE9 HEX: 84C9 ; inline +: GL_TEXTURE10 HEX: 84CA ; inline +: GL_TEXTURE11 HEX: 84CB ; inline +: GL_TEXTURE12 HEX: 84CC ; inline +: GL_TEXTURE13 HEX: 84CD ; inline +: GL_TEXTURE14 HEX: 84CE ; inline +: GL_TEXTURE15 HEX: 84CF ; inline +: GL_TEXTURE16 HEX: 84D0 ; inline +: GL_TEXTURE17 HEX: 84D1 ; inline +: GL_TEXTURE18 HEX: 84D2 ; inline +: GL_TEXTURE19 HEX: 84D3 ; inline +: GL_TEXTURE20 HEX: 84D4 ; inline +: GL_TEXTURE21 HEX: 84D5 ; inline +: GL_TEXTURE22 HEX: 84D6 ; inline +: GL_TEXTURE23 HEX: 84D7 ; inline +: GL_TEXTURE24 HEX: 84D8 ; inline +: GL_TEXTURE25 HEX: 84D9 ; inline +: GL_TEXTURE26 HEX: 84DA ; inline +: GL_TEXTURE27 HEX: 84DB ; inline +: GL_TEXTURE28 HEX: 84DC ; inline +: GL_TEXTURE29 HEX: 84DD ; inline +: GL_TEXTURE30 HEX: 84DE ; inline +: GL_TEXTURE31 HEX: 84DF ; inline +: GL_ACTIVE_TEXTURE HEX: 84E0 ; inline +: GL_CLIENT_ACTIVE_TEXTURE HEX: 84E1 ; inline +: GL_MAX_TEXTURE_UNITS HEX: 84E2 ; inline +: GL_TRANSPOSE_MODELVIEW_MATRIX HEX: 84E3 ; inline +: GL_TRANSPOSE_PROJECTION_MATRIX HEX: 84E4 ; inline +: GL_TRANSPOSE_TEXTURE_MATRIX HEX: 84E5 ; inline +: GL_TRANSPOSE_COLOR_MATRIX HEX: 84E6 ; inline +: GL_SUBTRACT HEX: 84E7 ; inline +: GL_COMPRESSED_ALPHA HEX: 84E9 ; inline +: GL_COMPRESSED_LUMINANCE HEX: 84EA ; inline +: GL_COMPRESSED_LUMINANCE_ALPHA HEX: 84EB ; inline +: GL_COMPRESSED_INTENSITY HEX: 84EC ; inline +: GL_COMPRESSED_RGB HEX: 84ED ; inline +: GL_COMPRESSED_RGBA HEX: 84EE ; inline +: GL_TEXTURE_COMPRESSION_HINT HEX: 84EF ; inline +: GL_NORMAL_MAP HEX: 8511 ; inline +: GL_REFLECTION_MAP HEX: 8512 ; inline +: GL_TEXTURE_CUBE_MAP HEX: 8513 ; inline +: GL_TEXTURE_BINDING_CUBE_MAP HEX: 8514 ; inline +: GL_TEXTURE_CUBE_MAP_POSITIVE_X HEX: 8515 ; inline +: GL_TEXTURE_CUBE_MAP_NEGATIVE_X HEX: 8516 ; inline +: GL_TEXTURE_CUBE_MAP_POSITIVE_Y HEX: 8517 ; inline +: GL_TEXTURE_CUBE_MAP_NEGATIVE_Y HEX: 8518 ; inline +: GL_TEXTURE_CUBE_MAP_POSITIVE_Z HEX: 8519 ; inline +: GL_TEXTURE_CUBE_MAP_NEGATIVE_Z HEX: 851A ; inline +: GL_PROXY_TEXTURE_CUBE_MAP HEX: 851B ; inline +: GL_MAX_CUBE_MAP_TEXTURE_SIZE HEX: 851C ; inline +: GL_COMBINE HEX: 8570 ; inline +: GL_COMBINE_RGB HEX: 8571 ; inline +: GL_COMBINE_ALPHA HEX: 8572 ; inline +: GL_RGB_SCALE HEX: 8573 ; inline +: GL_ADD_SIGNED HEX: 8574 ; inline +: GL_INTERPOLATE HEX: 8575 ; inline +: GL_CONSTANT HEX: 8576 ; inline +: GL_PRIMARY_COLOR HEX: 8577 ; inline +: GL_PREVIOUS HEX: 8578 ; inline +: GL_SOURCE0_RGB HEX: 8580 ; inline +: GL_SOURCE1_RGB HEX: 8581 ; inline +: GL_SOURCE2_RGB HEX: 8582 ; inline +: GL_SOURCE0_ALPHA HEX: 8588 ; inline +: GL_SOURCE1_ALPHA HEX: 8589 ; inline +: GL_SOURCE2_ALPHA HEX: 858A ; inline +: GL_OPERAND0_RGB HEX: 8590 ; inline +: GL_OPERAND1_RGB HEX: 8591 ; inline +: GL_OPERAND2_RGB HEX: 8592 ; inline +: GL_OPERAND0_ALPHA HEX: 8598 ; inline +: GL_OPERAND1_ALPHA HEX: 8599 ; inline +: GL_OPERAND2_ALPHA HEX: 859A ; inline +: GL_TEXTURE_COMPRESSED_IMAGE_SIZE HEX: 86A0 ; inline +: GL_TEXTURE_COMPRESSED HEX: 86A1 ; inline : GL_NUM_COMPRESSED_TEXTURE_FORMATS HEX: 86A2 ; inline -: GL_COMPRESSED_TEXTURE_FORMATS HEX: 86A3 ; inline -: GL_DOT3_RGB HEX: 86AE ; inline -: GL_DOT3_RGBA HEX: 86AF ; inline -: GL_CLAMP_TO_BORDER HEX: 812D ; inline -: GL_MULTISAMPLE HEX: 809D ; inline -: GL_SAMPLE_ALPHA_TO_COVERAGE HEX: 809E ; inline -: GL_SAMPLE_ALPHA_TO_ONE HEX: 809F ; inline -: GL_SAMPLE_COVERAGE HEX: 80A0 ; inline -: GL_SAMPLE_BUFFERS HEX: 80A8 ; inline -: GL_SAMPLES HEX: 80A9 ; inline -: GL_SAMPLE_COVERAGE_VALUE HEX: 80AA ; inline -: GL_SAMPLE_COVERAGE_INVERT HEX: 80AB ; inline -: GL_MULTISAMPLE_BIT HEX: 20000000 ; inline +: GL_COMPRESSED_TEXTURE_FORMATS HEX: 86A3 ; inline +: GL_DOT3_RGB HEX: 86AE ; inline +: GL_DOT3_RGBA HEX: 86AF ; inline +: GL_MULTISAMPLE_BIT HEX: 20000000 ; inline + +GL-FUNCTION: void glActiveTexture ( GLenum texture ) ; +GL-FUNCTION: void glClientActiveTexture ( GLenum texture ) ; +GL-FUNCTION: void glCompressedTexImage1D ( GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, GLvoid* data ) ; +GL-FUNCTION: void glCompressedTexImage2D ( GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, GLvoid* data ) ; +GL-FUNCTION: void glCompressedTexImage3D ( GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, GLvoid* data ) ; +GL-FUNCTION: void glCompressedTexSubImage1D ( GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, GLvoid* data ) ; +GL-FUNCTION: void glCompressedTexSubImage2D ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, GLvoid* data ) ; +GL-FUNCTION: void glCompressedTexSubImage3D ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, GLvoid* data ) ; +GL-FUNCTION: void glGetCompressedTexImage ( GLenum target, GLint lod, GLvoid* img ) ; +GL-FUNCTION: void glLoadTransposeMatrixd ( GLdouble m[16] ) ; +GL-FUNCTION: void glLoadTransposeMatrixf ( GLfloat m[16] ) ; +GL-FUNCTION: void glMultTransposeMatrixd ( GLdouble m[16] ) ; +GL-FUNCTION: void glMultTransposeMatrixf ( GLfloat m[16] ) ; +GL-FUNCTION: void glMultiTexCoord1d ( GLenum target, GLdouble s ) ; +GL-FUNCTION: void glMultiTexCoord1dv ( GLenum target, GLdouble* v ) ; +GL-FUNCTION: void glMultiTexCoord1f ( GLenum target, GLfloat s ) ; +GL-FUNCTION: void glMultiTexCoord1fv ( GLenum target, GLfloat* v ) ; +GL-FUNCTION: void glMultiTexCoord1i ( GLenum target, GLint s ) ; +GL-FUNCTION: void glMultiTexCoord1iv ( GLenum target, GLint* v ) ; +GL-FUNCTION: void glMultiTexCoord1s ( GLenum target, GLshort s ) ; +GL-FUNCTION: void glMultiTexCoord1sv ( GLenum target, GLshort* v ) ; +GL-FUNCTION: void glMultiTexCoord2d ( GLenum target, GLdouble s, GLdouble t ) ; +GL-FUNCTION: void glMultiTexCoord2dv ( GLenum target, GLdouble* v ) ; +GL-FUNCTION: void glMultiTexCoord2f ( GLenum target, GLfloat s, GLfloat t ) ; +GL-FUNCTION: void glMultiTexCoord2fv ( GLenum target, GLfloat* v ) ; +GL-FUNCTION: void glMultiTexCoord2i ( GLenum target, GLint s, GLint t ) ; +GL-FUNCTION: void glMultiTexCoord2iv ( GLenum target, GLint* v ) ; +GL-FUNCTION: void glMultiTexCoord2s ( GLenum target, GLshort s, GLshort t ) ; +GL-FUNCTION: void glMultiTexCoord2sv ( GLenum target, GLshort* v ) ; +GL-FUNCTION: void glMultiTexCoord3d ( GLenum target, GLdouble s, GLdouble t, GLdouble r ) ; +GL-FUNCTION: void glMultiTexCoord3dv ( GLenum target, GLdouble* v ) ; +GL-FUNCTION: void glMultiTexCoord3f ( GLenum target, GLfloat s, GLfloat t, GLfloat r ) ; +GL-FUNCTION: void glMultiTexCoord3fv ( GLenum target, GLfloat* v ) ; +GL-FUNCTION: void glMultiTexCoord3i ( GLenum target, GLint s, GLint t, GLint r ) ; +GL-FUNCTION: void glMultiTexCoord3iv ( GLenum target, GLint* v ) ; +GL-FUNCTION: void glMultiTexCoord3s ( GLenum target, GLshort s, GLshort t, GLshort r ) ; +GL-FUNCTION: void glMultiTexCoord3sv ( GLenum target, GLshort* v ) ; +GL-FUNCTION: void glMultiTexCoord4d ( GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q ) ; +GL-FUNCTION: void glMultiTexCoord4dv ( GLenum target, GLdouble* v ) ; +GL-FUNCTION: void glMultiTexCoord4f ( GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q ) ; +GL-FUNCTION: void glMultiTexCoord4fv ( GLenum target, GLfloat* v ) ; +GL-FUNCTION: void glMultiTexCoord4i ( GLenum target, GLint s, GLint t, GLint r, GLint q ) ; +GL-FUNCTION: void glMultiTexCoord4iv ( GLenum target, GLint* v ) ; +GL-FUNCTION: void glMultiTexCoord4s ( GLenum target, GLshort s, GLshort t, GLshort r, GLshort q ) ; +GL-FUNCTION: void glMultiTexCoord4sv ( GLenum target, GLshort* v ) ; +GL-FUNCTION: void glSampleCoverage ( GLclampf value, GLboolean invert ) ; ! OpenGL 1.4 -: GL_POINT_SIZE_MIN HEX: 8126 ; inline -: GL_POINT_SIZE_MAX HEX: 8127 ; inline -: GL_POINT_FADE_THRESHOLD_SIZE HEX: 8128 ; inline -: GL_POINT_DISTANCE_ATTENUATION HEX: 8129 ; inline -: GL_FOG_COORDINATE_SOURCE HEX: 8450 ; inline -: GL_FOG_COORDINATE HEX: 8451 ; inline -: GL_FRAGMENT_DEPTH HEX: 8452 ; inline -: GL_CURRENT_FOG_COORDINATE HEX: 8453 ; inline -: GL_FOG_COORDINATE_ARRAY_TYPE HEX: 8454 ; inline -: GL_FOG_COORDINATE_ARRAY_STRIDE HEX: 8455 ; inline -: GL_FOG_COORDINATE_ARRAY_POINTER HEX: 8456 ; inline -: GL_FOG_COORDINATE_ARRAY HEX: 8457 ; inline -: GL_COLOR_SUM HEX: 8458 ; inline -: GL_CURRENT_SECONDARY_COLOR HEX: 8459 ; inline -: GL_SECONDARY_COLOR_ARRAY_SIZE HEX: 845A ; inline -: GL_SECONDARY_COLOR_ARRAY_TYPE HEX: 845B ; inline -: GL_SECONDARY_COLOR_ARRAY_STRIDE HEX: 845C ; inline -: GL_SECONDARY_COLOR_ARRAY_POINTER HEX: 845D ; inline -: GL_SECONDARY_COLOR_ARRAY HEX: 845E ; inline -: GL_INCR_WRAP HEX: 8507 ; inline -: GL_DECR_WRAP HEX: 8508 ; inline -: GL_MAX_TEXTURE_LOD_BIAS HEX: 84FD ; inline -: GL_TEXTURE_FILTER_CONTROL HEX: 8500 ; inline -: GL_TEXTURE_LOD_BIAS HEX: 8501 ; inline -: GL_GENERATE_MIPMAP HEX: 8191 ; inline -: GL_GENERATE_MIPMAP_HINT HEX: 8192 ; inline -: GL_BLEND_DST_RGB HEX: 80C8 ; inline -: GL_BLEND_SRC_RGB HEX: 80C9 ; inline -: GL_BLEND_DST_ALPHA HEX: 80CA ; inline -: GL_BLEND_SRC_ALPHA HEX: 80CB ; inline -: GL_MIRRORED_REPEAT HEX: 8370 ; inline -: GL_DEPTH_COMPONENT16 HEX: 81A5 ; inline -: GL_DEPTH_COMPONENT24 HEX: 81A6 ; inline -: GL_DEPTH_COMPONENT32 HEX: 81A7 ; inline -: GL_TEXTURE_DEPTH_SIZE HEX: 884A ; inline -: GL_DEPTH_TEXTURE_MODE HEX: 884B ; inline -: GL_TEXTURE_COMPARE_MODE HEX: 884C ; inline -: GL_TEXTURE_COMPARE_FUNC HEX: 884D ; inline -: GL_COMPARE_R_TO_TEXTURE HEX: 884E ; inline + +: GL_BLEND_DST_RGB HEX: 80C8 ; inline +: GL_BLEND_SRC_RGB HEX: 80C9 ; inline +: GL_BLEND_DST_ALPHA HEX: 80CA ; inline +: GL_BLEND_SRC_ALPHA HEX: 80CB ; inline +: GL_POINT_SIZE_MIN HEX: 8126 ; inline +: GL_POINT_SIZE_MAX HEX: 8127 ; inline +: GL_POINT_FADE_THRESHOLD_SIZE HEX: 8128 ; inline +: GL_POINT_DISTANCE_ATTENUATION HEX: 8129 ; inline +: GL_GENERATE_MIPMAP HEX: 8191 ; inline +: GL_GENERATE_MIPMAP_HINT HEX: 8192 ; inline +: GL_DEPTH_COMPONENT16 HEX: 81A5 ; inline +: GL_DEPTH_COMPONENT24 HEX: 81A6 ; inline +: GL_DEPTH_COMPONENT32 HEX: 81A7 ; inline +: GL_MIRRORED_REPEAT HEX: 8370 ; inline +: GL_FOG_COORDINATE_SOURCE HEX: 8450 ; inline +: GL_FOG_COORDINATE HEX: 8451 ; inline +: GL_FRAGMENT_DEPTH HEX: 8452 ; inline +: GL_CURRENT_FOG_COORDINATE HEX: 8453 ; inline +: GL_FOG_COORDINATE_ARRAY_TYPE HEX: 8454 ; inline +: GL_FOG_COORDINATE_ARRAY_STRIDE HEX: 8455 ; inline +: GL_FOG_COORDINATE_ARRAY_POINTER HEX: 8456 ; inline +: GL_FOG_COORDINATE_ARRAY HEX: 8457 ; inline +: GL_COLOR_SUM HEX: 8458 ; inline +: GL_CURRENT_SECONDARY_COLOR HEX: 8459 ; inline +: GL_SECONDARY_COLOR_ARRAY_SIZE HEX: 845A ; inline +: GL_SECONDARY_COLOR_ARRAY_TYPE HEX: 845B ; inline +: GL_SECONDARY_COLOR_ARRAY_STRIDE HEX: 845C ; inline +: GL_SECONDARY_COLOR_ARRAY_POINTER HEX: 845D ; inline +: GL_SECONDARY_COLOR_ARRAY HEX: 845E ; inline +: GL_MAX_TEXTURE_LOD_BIAS HEX: 84FD ; inline +: GL_TEXTURE_FILTER_CONTROL HEX: 8500 ; inline +: GL_TEXTURE_LOD_BIAS HEX: 8501 ; inline +: GL_INCR_WRAP HEX: 8507 ; inline +: GL_DECR_WRAP HEX: 8508 ; inline +: GL_TEXTURE_DEPTH_SIZE HEX: 884A ; inline +: GL_DEPTH_TEXTURE_MODE HEX: 884B ; inline +: GL_TEXTURE_COMPARE_MODE HEX: 884C ; inline +: GL_TEXTURE_COMPARE_FUNC HEX: 884D ; inline +: GL_COMPARE_R_TO_TEXTURE HEX: 884E ; inline + +GL-FUNCTION: void glBlendColor ( GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha ) ; +GL-FUNCTION: void glBlendEquation ( GLenum mode ) ; +GL-FUNCTION: void glBlendFuncSeparate ( GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha ) ; +GL-FUNCTION: void glFogCoordPointer ( GLenum type, GLsizei stride, GLvoid* pointer ) ; +GL-FUNCTION: void glFogCoordd ( GLdouble coord ) ; +GL-FUNCTION: void glFogCoorddv ( GLdouble* coord ) ; +GL-FUNCTION: void glFogCoordf ( GLfloat coord ) ; +GL-FUNCTION: void glFogCoordfv ( GLfloat* coord ) ; +GL-FUNCTION: void glMultiDrawArrays ( GLenum mode, GLint* first, GLsizei* count, GLsizei primcount ) ; +GL-FUNCTION: void glMultiDrawElements ( GLenum mode, GLsizei* count, GLenum type, GLvoid** indices, GLsizei primcount ) ; +GL-FUNCTION: void glPointParameterf ( GLenum pname, GLfloat param ) ; +GL-FUNCTION: void glPointParameterfv ( GLenum pname, GLfloat* params ) ; +GL-FUNCTION: void glSecondaryColor3b ( GLbyte red, GLbyte green, GLbyte blue ) ; +GL-FUNCTION: void glSecondaryColor3bv ( GLbyte* v ) ; +GL-FUNCTION: void glSecondaryColor3d ( GLdouble red, GLdouble green, GLdouble blue ) ; +GL-FUNCTION: void glSecondaryColor3dv ( GLdouble* v ) ; +GL-FUNCTION: void glSecondaryColor3f ( GLfloat red, GLfloat green, GLfloat blue ) ; +GL-FUNCTION: void glSecondaryColor3fv ( GLfloat* v ) ; +GL-FUNCTION: void glSecondaryColor3i ( GLint red, GLint green, GLint blue ) ; +GL-FUNCTION: void glSecondaryColor3iv ( GLint* v ) ; +GL-FUNCTION: void glSecondaryColor3s ( GLshort red, GLshort green, GLshort blue ) ; +GL-FUNCTION: void glSecondaryColor3sv ( GLshort* v ) ; +GL-FUNCTION: void glSecondaryColor3ub ( GLubyte red, GLubyte green, GLubyte blue ) ; +GL-FUNCTION: void glSecondaryColor3ubv ( GLubyte* v ) ; +GL-FUNCTION: void glSecondaryColor3ui ( GLuint red, GLuint green, GLuint blue ) ; +GL-FUNCTION: void glSecondaryColor3uiv ( GLuint* v ) ; +GL-FUNCTION: void glSecondaryColor3us ( GLushort red, GLushort green, GLushort blue ) ; +GL-FUNCTION: void glSecondaryColor3usv ( GLushort* v ) ; +GL-FUNCTION: void glSecondaryColorPointer ( GLint size, GLenum type, GLsizei stride, GLvoid* pointer ) ; +GL-FUNCTION: void glWindowPos2d ( GLdouble x, GLdouble y ) ; +GL-FUNCTION: void glWindowPos2dv ( GLdouble* p ) ; +GL-FUNCTION: void glWindowPos2f ( GLfloat x, GLfloat y ) ; +GL-FUNCTION: void glWindowPos2fv ( GLfloat* p ) ; +GL-FUNCTION: void glWindowPos2i ( GLint x, GLint y ) ; +GL-FUNCTION: void glWindowPos2iv ( GLint* p ) ; +GL-FUNCTION: void glWindowPos2s ( GLshort x, GLshort y ) ; +GL-FUNCTION: void glWindowPos2sv ( GLshort* p ) ; +GL-FUNCTION: void glWindowPos3d ( GLdouble x, GLdouble y, GLdouble z ) ; +GL-FUNCTION: void glWindowPos3dv ( GLdouble* p ) ; +GL-FUNCTION: void glWindowPos3f ( GLfloat x, GLfloat y, GLfloat z ) ; +GL-FUNCTION: void glWindowPos3fv ( GLfloat* p ) ; +GL-FUNCTION: void glWindowPos3i ( GLint x, GLint y, GLint z ) ; +GL-FUNCTION: void glWindowPos3iv ( GLint* p ) ; +GL-FUNCTION: void glWindowPos3s ( GLshort x, GLshort y, GLshort z ) ; +GL-FUNCTION: void glWindowPos3sv ( GLshort* p ) ; + + +! OpenGL 1.5 + +: GL_BUFFER_SIZE HEX: 8764 ; inline +: GL_BUFFER_USAGE HEX: 8765 ; inline +: GL_QUERY_COUNTER_BITS HEX: 8864 ; inline +: GL_CURRENT_QUERY HEX: 8865 ; inline +: GL_QUERY_RESULT HEX: 8866 ; inline +: GL_QUERY_RESULT_AVAILABLE HEX: 8867 ; inline +: GL_ARRAY_BUFFER HEX: 8892 ; inline +: GL_ELEMENT_ARRAY_BUFFER HEX: 8893 ; inline +: GL_ARRAY_BUFFER_BINDING HEX: 8894 ; inline +: GL_ELEMENT_ARRAY_BUFFER_BINDING HEX: 8895 ; inline +: GL_VERTEX_ARRAY_BUFFER_BINDING HEX: 8896 ; inline +: GL_NORMAL_ARRAY_BUFFER_BINDING HEX: 8897 ; inline +: GL_COLOR_ARRAY_BUFFER_BINDING HEX: 8898 ; inline +: GL_INDEX_ARRAY_BUFFER_BINDING HEX: 8899 ; inline +: GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING HEX: 889A ; inline +: GL_EDGE_FLAG_ARRAY_BUFFER_BINDING HEX: 889B ; inline +: GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING HEX: 889C ; inline +: GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING HEX: 889D ; inline +: GL_WEIGHT_ARRAY_BUFFER_BINDING HEX: 889E ; inline +: GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING HEX: 889F ; inline +: GL_READ_ONLY HEX: 88B8 ; inline +: GL_WRITE_ONLY HEX: 88B9 ; inline +: GL_READ_WRITE HEX: 88BA ; inline +: GL_BUFFER_ACCESS HEX: 88BB ; inline +: GL_BUFFER_MAPPED HEX: 88BC ; inline +: GL_BUFFER_MAP_POINTER HEX: 88BD ; inline +: GL_STREAM_DRAW HEX: 88E0 ; inline +: GL_STREAM_READ HEX: 88E1 ; inline +: GL_STREAM_COPY HEX: 88E2 ; inline +: GL_STATIC_DRAW HEX: 88E4 ; inline +: GL_STATIC_READ HEX: 88E5 ; inline +: GL_STATIC_COPY HEX: 88E6 ; inline +: GL_DYNAMIC_DRAW HEX: 88E8 ; inline +: GL_DYNAMIC_READ HEX: 88E9 ; inline +: GL_DYNAMIC_COPY HEX: 88EA ; inline +: GL_SAMPLES_PASSED HEX: 8914 ; inline +: GL_FOG_COORD_SRC GL_FOG_COORDINATE_SOURCE ; inline +: GL_FOG_COORD GL_FOG_COORDINATE ; inline +: GL_FOG_COORD_ARRAY GL_FOG_COORDINATE_ARRAY ; inline +: GL_SRC0_RGB GL_SOURCE0_RGB ; inline +: GL_FOG_COORD_ARRAY_POINTER GL_FOG_COORDINATE_ARRAY_POINTER ; inline +: GL_FOG_COORD_ARRAY_TYPE GL_FOG_COORDINATE_ARRAY_TYPE ; inline +: GL_SRC1_ALPHA GL_SOURCE1_ALPHA ; inline +: GL_CURRENT_FOG_COORD GL_CURRENT_FOG_COORDINATE ; inline +: GL_FOG_COORD_ARRAY_STRIDE GL_FOG_COORDINATE_ARRAY_STRIDE ; inline +: GL_SRC0_ALPHA GL_SOURCE0_ALPHA ; inline +: GL_SRC1_RGB GL_SOURCE1_RGB ; inline +: GL_FOG_COORD_ARRAY_BUFFER_BINDING GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING ; inline +: GL_SRC2_ALPHA GL_SOURCE2_ALPHA ; inline +: GL_SRC2_RGB GL_SOURCE2_RGB ; inline + +TYPEDEF: long ptrdiff_t + +TYPEDEF: ptrdiff_t GLsizeiptr +TYPEDEF: ptrdiff_t GLintptr + +GL-FUNCTION: void glBeginQuery ( GLenum target, GLuint id ) ; +GL-FUNCTION: void glBindBuffer ( GLenum target, GLuint buffer ) ; +GL-FUNCTION: void glBufferData ( GLenum target, GLsizeiptr size, GLvoid* data, GLenum usage ) ; +GL-FUNCTION: void glBufferSubData ( GLenum target, GLintptr offset, GLsizeiptr size, GLvoid* data ) ; +GL-FUNCTION: void glDeleteBuffers ( GLsizei n, GLuint* buffers ) ; +GL-FUNCTION: void glDeleteQueries ( GLsizei n, GLuint* ids ) ; +GL-FUNCTION: void glEndQuery ( GLenum target ) ; +GL-FUNCTION: void glGenBuffers ( GLsizei n, GLuint* buffers ) ; +GL-FUNCTION: void glGenQueries ( GLsizei n, GLuint* ids ) ; +GL-FUNCTION: void glGetBufferParameteriv ( GLenum target, GLenum pname, GLint* params ) ; +GL-FUNCTION: void glGetBufferPointerv ( GLenum target, GLenum pname, GLvoid** params ) ; +GL-FUNCTION: void glGetBufferSubData ( GLenum target, GLintptr offset, GLsizeiptr size, GLvoid* data ) ; +GL-FUNCTION: void glGetQueryObjectiv ( GLuint id, GLenum pname, GLint* params ) ; +GL-FUNCTION: void glGetQueryObjectuiv ( GLuint id, GLenum pname, GLuint* params ) ; +GL-FUNCTION: void glGetQueryiv ( GLenum target, GLenum pname, GLint* params ) ; +GL-FUNCTION: GLboolean glIsBuffer ( GLuint buffer ) ; +GL-FUNCTION: GLboolean glIsQuery ( GLuint id ) ; +GL-FUNCTION: GLvoid* glMapBuffer ( GLenum target, GLenum access ) ; +GL-FUNCTION: GLboolean glUnmapBuffer ( GLenum target ) ; + + +! OpenGL 2.0 + + +: GL_VERTEX_ATTRIB_ARRAY_ENABLED HEX: 8622 ; inline +: GL_VERTEX_ATTRIB_ARRAY_SIZE HEX: 8623 ; inline +: GL_VERTEX_ATTRIB_ARRAY_STRIDE HEX: 8624 ; inline +: GL_VERTEX_ATTRIB_ARRAY_TYPE HEX: 8625 ; inline +: GL_CURRENT_VERTEX_ATTRIB HEX: 8626 ; inline +: GL_VERTEX_PROGRAM_POINT_SIZE HEX: 8642 ; inline +: GL_VERTEX_PROGRAM_TWO_SIDE HEX: 8643 ; inline +: GL_VERTEX_ATTRIB_ARRAY_POINTER HEX: 8645 ; inline +: GL_STENCIL_BACK_FUNC HEX: 8800 ; inline +: GL_STENCIL_BACK_FAIL HEX: 8801 ; inline +: GL_STENCIL_BACK_PASS_DEPTH_FAIL HEX: 8802 ; inline +: GL_STENCIL_BACK_PASS_DEPTH_PASS HEX: 8803 ; inline +: GL_MAX_DRAW_BUFFERS HEX: 8824 ; inline +: GL_DRAW_BUFFER0 HEX: 8825 ; inline +: GL_DRAW_BUFFER1 HEX: 8826 ; inline +: GL_DRAW_BUFFER2 HEX: 8827 ; inline +: GL_DRAW_BUFFER3 HEX: 8828 ; inline +: GL_DRAW_BUFFER4 HEX: 8829 ; inline +: GL_DRAW_BUFFER5 HEX: 882A ; inline +: GL_DRAW_BUFFER6 HEX: 882B ; inline +: GL_DRAW_BUFFER7 HEX: 882C ; inline +: GL_DRAW_BUFFER8 HEX: 882D ; inline +: GL_DRAW_BUFFER9 HEX: 882E ; inline +: GL_DRAW_BUFFER10 HEX: 882F ; inline +: GL_DRAW_BUFFER11 HEX: 8830 ; inline +: GL_DRAW_BUFFER12 HEX: 8831 ; inline +: GL_DRAW_BUFFER13 HEX: 8832 ; inline +: GL_DRAW_BUFFER14 HEX: 8833 ; inline +: GL_DRAW_BUFFER15 HEX: 8834 ; inline +: GL_BLEND_EQUATION_ALPHA HEX: 883D ; inline +: GL_POINT_SPRITE HEX: 8861 ; inline +: GL_COORD_REPLACE HEX: 8862 ; inline +: GL_MAX_VERTEX_ATTRIBS HEX: 8869 ; inline +: GL_VERTEX_ATTRIB_ARRAY_NORMALIZED HEX: 886A ; inline +: GL_MAX_TEXTURE_COORDS HEX: 8871 ; inline +: GL_MAX_TEXTURE_IMAGE_UNITS HEX: 8872 ; inline +: GL_FRAGMENT_SHADER HEX: 8B30 ; inline +: GL_VERTEX_SHADER HEX: 8B31 ; inline +: GL_MAX_FRAGMENT_UNIFORM_COMPONENTS HEX: 8B49 ; inline +: GL_MAX_VERTEX_UNIFORM_COMPONENTS HEX: 8B4A ; inline +: GL_MAX_VARYING_FLOATS HEX: 8B4B ; inline +: GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS HEX: 8B4C ; inline +: GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS HEX: 8B4D ; inline +: GL_SHADER_TYPE HEX: 8B4F ; inline +: GL_FLOAT_VEC2 HEX: 8B50 ; inline +: GL_FLOAT_VEC3 HEX: 8B51 ; inline +: GL_FLOAT_VEC4 HEX: 8B52 ; inline +: GL_INT_VEC2 HEX: 8B53 ; inline +: GL_INT_VEC3 HEX: 8B54 ; inline +: GL_INT_VEC4 HEX: 8B55 ; inline +: GL_BOOL HEX: 8B56 ; inline +: GL_BOOL_VEC2 HEX: 8B57 ; inline +: GL_BOOL_VEC3 HEX: 8B58 ; inline +: GL_BOOL_VEC4 HEX: 8B59 ; inline +: GL_FLOAT_MAT2 HEX: 8B5A ; inline +: GL_FLOAT_MAT3 HEX: 8B5B ; inline +: GL_FLOAT_MAT4 HEX: 8B5C ; inline +: GL_SAMPLER_1D HEX: 8B5D ; inline +: GL_SAMPLER_2D HEX: 8B5E ; inline +: GL_SAMPLER_3D HEX: 8B5F ; inline +: GL_SAMPLER_CUBE HEX: 8B60 ; inline +: GL_SAMPLER_1D_SHADOW HEX: 8B61 ; inline +: GL_SAMPLER_2D_SHADOW HEX: 8B62 ; inline +: GL_DELETE_STATUS HEX: 8B80 ; inline +: GL_COMPILE_STATUS HEX: 8B81 ; inline +: GL_LINK_STATUS HEX: 8B82 ; inline +: GL_VALIDATE_STATUS HEX: 8B83 ; inline +: GL_INFO_LOG_LENGTH HEX: 8B84 ; inline +: GL_ATTACHED_SHADERS HEX: 8B85 ; inline +: GL_ACTIVE_UNIFORMS HEX: 8B86 ; inline +: GL_ACTIVE_UNIFORM_MAX_LENGTH HEX: 8B87 ; inline +: GL_SHADER_SOURCE_LENGTH HEX: 8B88 ; inline +: GL_ACTIVE_ATTRIBUTES HEX: 8B89 ; inline +: GL_ACTIVE_ATTRIBUTE_MAX_LENGTH HEX: 8B8A ; inline +: GL_FRAGMENT_SHADER_DERIVATIVE_HINT HEX: 8B8B ; inline +: GL_SHADING_LANGUAGE_VERSION HEX: 8B8C ; inline +: GL_CURRENT_PROGRAM HEX: 8B8D ; inline +: GL_POINT_SPRITE_COORD_ORIGIN HEX: 8CA0 ; inline +: GL_LOWER_LEFT HEX: 8CA1 ; inline +: GL_UPPER_LEFT HEX: 8CA2 ; inline +: GL_STENCIL_BACK_REF HEX: 8CA3 ; inline +: GL_STENCIL_BACK_VALUE_MASK HEX: 8CA4 ; inline +: GL_STENCIL_BACK_WRITEMASK HEX: 8CA5 ; inline +: GL_BLEND_EQUATION HEX: 8009 ; inline +: GL_BLEND_EQUATION_RGB GL_BLEND_EQUATION ; inline + +TYPEDEF: char GLchar + +GL-FUNCTION: void glAttachShader ( GLuint program, GLuint shader ) ; +GL-FUNCTION: void glBindAttribLocation ( GLuint program, GLuint index, GLchar* name ) ; +GL-FUNCTION: void glBlendEquationSeparate ( GLenum modeRGB, GLenum modeAlpha ) ; +GL-FUNCTION: void glCompileShader ( GLuint shader ) ; +GL-FUNCTION: GLuint glCreateProgram ( ) ; +GL-FUNCTION: GLuint glCreateShader ( GLenum type ) ; +GL-FUNCTION: void glDeleteProgram ( GLuint program ) ; +GL-FUNCTION: void glDeleteShader ( GLuint shader ) ; +GL-FUNCTION: void glDetachShader ( GLuint program, GLuint shader ) ; +GL-FUNCTION: void glDisableVertexAttribArray ( GLuint index ) ; +GL-FUNCTION: void glDrawBuffers ( GLsizei n, GLenum* bufs ) ; +GL-FUNCTION: void glEnableVertexAttribArray ( GLuint index ) ; +GL-FUNCTION: void glGetActiveAttrib ( GLuint program, GLuint index, GLsizei maxLength, GLsizei* length, GLint* size, GLenum* type, GLchar* name ) ; +GL-FUNCTION: void glGetActiveUniform ( GLuint program, GLuint index, GLsizei maxLength, GLsizei* length, GLint* size, GLenum* type, GLchar* name ) ; +GL-FUNCTION: void glGetAttachedShaders ( GLuint program, GLsizei maxCount, GLsizei* count, GLuint* shaders ) ; +GL-FUNCTION: GLint glGetAttribLocation ( GLuint program, GLchar* name ) ; +GL-FUNCTION: void glGetProgramInfoLog ( GLuint program, GLsizei bufSize, GLsizei* length, GLchar* infoLog ) ; +GL-FUNCTION: void glGetProgramiv ( GLuint program, GLenum pname, GLint* param ) ; +GL-FUNCTION: void glGetShaderInfoLog ( GLuint shader, GLsizei bufSize, GLsizei* length, GLchar* infoLog ) ; +GL-FUNCTION: void glGetShaderSource ( GLint obj, GLsizei maxLength, GLsizei* length, GLchar* source ) ; +GL-FUNCTION: void glGetShaderiv ( GLuint shader, GLenum pname, GLint* param ) ; +GL-FUNCTION: GLint glGetUniformLocation ( GLint programObj, GLchar* name ) ; +GL-FUNCTION: void glGetUniformfv ( GLuint program, GLint location, GLfloat* params ) ; +GL-FUNCTION: void glGetUniformiv ( GLuint program, GLint location, GLint* params ) ; +GL-FUNCTION: void glGetVertexAttribPointerv ( GLuint index, GLenum pname, GLvoid** pointer ) ; +GL-FUNCTION: void glGetVertexAttribdv ( GLuint index, GLenum pname, GLdouble* params ) ; +GL-FUNCTION: void glGetVertexAttribfv ( GLuint index, GLenum pname, GLfloat* params ) ; +GL-FUNCTION: void glGetVertexAttribiv ( GLuint index, GLenum pname, GLint* params ) ; +GL-FUNCTION: GLboolean glIsProgram ( GLuint program ) ; +GL-FUNCTION: GLboolean glIsShader ( GLuint shader ) ; +GL-FUNCTION: void glLinkProgram ( GLuint program ) ; +GL-FUNCTION: void glShaderSource ( GLuint shader, GLsizei count, GLchar** strings, GLint* lengths ) ; +GL-FUNCTION: void glStencilFuncSeparate ( GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask ) ; +GL-FUNCTION: void glStencilMaskSeparate ( GLenum face, GLuint mask ) ; +GL-FUNCTION: void glStencilOpSeparate ( GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass ) ; +GL-FUNCTION: void glUniform1f ( GLint location, GLfloat v0 ) ; +GL-FUNCTION: void glUniform1fv ( GLint location, GLsizei count, GLfloat* value ) ; +GL-FUNCTION: void glUniform1i ( GLint location, GLint v0 ) ; +GL-FUNCTION: void glUniform1iv ( GLint location, GLsizei count, GLint* value ) ; +GL-FUNCTION: void glUniform2f ( GLint location, GLfloat v0, GLfloat v1 ) ; +GL-FUNCTION: void glUniform2fv ( GLint location, GLsizei count, GLfloat* value ) ; +GL-FUNCTION: void glUniform2i ( GLint location, GLint v0, GLint v1 ) ; +GL-FUNCTION: void glUniform2iv ( GLint location, GLsizei count, GLint* value ) ; +GL-FUNCTION: void glUniform3f ( GLint location, GLfloat v0, GLfloat v1, GLfloat v2 ) ; +GL-FUNCTION: void glUniform3fv ( GLint location, GLsizei count, GLfloat* value ) ; +GL-FUNCTION: void glUniform3i ( GLint location, GLint v0, GLint v1, GLint v2 ) ; +GL-FUNCTION: void glUniform3iv ( GLint location, GLsizei count, GLint* value ) ; +GL-FUNCTION: void glUniform4f ( GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3 ) ; +GL-FUNCTION: void glUniform4fv ( GLint location, GLsizei count, GLfloat* value ) ; +GL-FUNCTION: void glUniform4i ( GLint location, GLint v0, GLint v1, GLint v2, GLint v3 ) ; +GL-FUNCTION: void glUniform4iv ( GLint location, GLsizei count, GLint* value ) ; +GL-FUNCTION: void glUniformMatrix2fv ( GLint location, GLsizei count, GLboolean transpose, GLfloat* value ) ; +GL-FUNCTION: void glUniformMatrix3fv ( GLint location, GLsizei count, GLboolean transpose, GLfloat* value ) ; +GL-FUNCTION: void glUniformMatrix4fv ( GLint location, GLsizei count, GLboolean transpose, GLfloat* value ) ; +GL-FUNCTION: void glUseProgram ( GLuint program ) ; +GL-FUNCTION: void glValidateProgram ( GLuint program ) ; +GL-FUNCTION: void glVertexAttrib1d ( GLuint index, GLdouble x ) ; +GL-FUNCTION: void glVertexAttrib1dv ( GLuint index, GLdouble* v ) ; +GL-FUNCTION: void glVertexAttrib1f ( GLuint index, GLfloat x ) ; +GL-FUNCTION: void glVertexAttrib1fv ( GLuint index, GLfloat* v ) ; +GL-FUNCTION: void glVertexAttrib1s ( GLuint index, GLshort x ) ; +GL-FUNCTION: void glVertexAttrib1sv ( GLuint index, GLshort* v ) ; +GL-FUNCTION: void glVertexAttrib2d ( GLuint index, GLdouble x, GLdouble y ) ; +GL-FUNCTION: void glVertexAttrib2dv ( GLuint index, GLdouble* v ) ; +GL-FUNCTION: void glVertexAttrib2f ( GLuint index, GLfloat x, GLfloat y ) ; +GL-FUNCTION: void glVertexAttrib2fv ( GLuint index, GLfloat* v ) ; +GL-FUNCTION: void glVertexAttrib2s ( GLuint index, GLshort x, GLshort y ) ; +GL-FUNCTION: void glVertexAttrib2sv ( GLuint index, GLshort* v ) ; +GL-FUNCTION: void glVertexAttrib3d ( GLuint index, GLdouble x, GLdouble y, GLdouble z ) ; +GL-FUNCTION: void glVertexAttrib3dv ( GLuint index, GLdouble* v ) ; +GL-FUNCTION: void glVertexAttrib3f ( GLuint index, GLfloat x, GLfloat y, GLfloat z ) ; +GL-FUNCTION: void glVertexAttrib3fv ( GLuint index, GLfloat* v ) ; +GL-FUNCTION: void glVertexAttrib3s ( GLuint index, GLshort x, GLshort y, GLshort z ) ; +GL-FUNCTION: void glVertexAttrib3sv ( GLuint index, GLshort* v ) ; +GL-FUNCTION: void glVertexAttrib4Nbv ( GLuint index, GLbyte* v ) ; +GL-FUNCTION: void glVertexAttrib4Niv ( GLuint index, GLint* v ) ; +GL-FUNCTION: void glVertexAttrib4Nsv ( GLuint index, GLshort* v ) ; +GL-FUNCTION: void glVertexAttrib4Nub ( GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w ) ; +GL-FUNCTION: void glVertexAttrib4Nubv ( GLuint index, GLubyte* v ) ; +GL-FUNCTION: void glVertexAttrib4Nuiv ( GLuint index, GLuint* v ) ; +GL-FUNCTION: void glVertexAttrib4Nusv ( GLuint index, GLushort* v ) ; +GL-FUNCTION: void glVertexAttrib4bv ( GLuint index, GLbyte* v ) ; +GL-FUNCTION: void glVertexAttrib4d ( GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w ) ; +GL-FUNCTION: void glVertexAttrib4dv ( GLuint index, GLdouble* v ) ; +GL-FUNCTION: void glVertexAttrib4f ( GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w ) ; +GL-FUNCTION: void glVertexAttrib4fv ( GLuint index, GLfloat* v ) ; +GL-FUNCTION: void glVertexAttrib4iv ( GLuint index, GLint* v ) ; +GL-FUNCTION: void glVertexAttrib4s ( GLuint index, GLshort x, GLshort y, GLshort z, GLshort w ) ; +GL-FUNCTION: void glVertexAttrib4sv ( GLuint index, GLshort* v ) ; +GL-FUNCTION: void glVertexAttrib4ubv ( GLuint index, GLubyte* v ) ; +GL-FUNCTION: void glVertexAttrib4uiv ( GLuint index, GLuint* v ) ; +GL-FUNCTION: void glVertexAttrib4usv ( GLuint index, GLushort* v ) ; +GL-FUNCTION: void glVertexAttribPointer ( GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLvoid* pointer ) ; + + +! OpenGL 2.1 + + +: GL_CURRENT_RASTER_SECONDARY_COLOR HEX: 845F ; inline +: GL_PIXEL_PACK_BUFFER HEX: 88EB ; inline +: GL_PIXEL_UNPACK_BUFFER HEX: 88EC ; inline +: GL_PIXEL_PACK_BUFFER_BINDING HEX: 88ED ; inline +: GL_PIXEL_UNPACK_BUFFER_BINDING HEX: 88EF ; inline +: GL_SRGB HEX: 8C40 ; inline +: GL_SRGB8 HEX: 8C41 ; inline +: GL_SRGB_ALPHA HEX: 8C42 ; inline +: GL_SRGB8_ALPHA8 HEX: 8C43 ; inline +: GL_SLUMINANCE_ALPHA HEX: 8C44 ; inline +: GL_SLUMINANCE8_ALPHA8 HEX: 8C45 ; inline +: GL_SLUMINANCE HEX: 8C46 ; inline +: GL_SLUMINANCE8 HEX: 8C47 ; inline +: GL_COMPRESSED_SRGB HEX: 8C48 ; inline +: GL_COMPRESSED_SRGB_ALPHA HEX: 8C49 ; inline +: GL_COMPRESSED_SLUMINANCE HEX: 8C4A ; inline +: GL_COMPRESSED_SLUMINANCE_ALPHA HEX: 8C4B ; inline + +GL-FUNCTION: void glUniformMatrix2x3fv ( GLint location, GLsizei count, GLboolean transpose, GLfloat* value ) ; +GL-FUNCTION: void glUniformMatrix2x4fv ( GLint location, GLsizei count, GLboolean transpose, GLfloat* value ) ; +GL-FUNCTION: void glUniformMatrix3x2fv ( GLint location, GLsizei count, GLboolean transpose, GLfloat* value ) ; +GL-FUNCTION: void glUniformMatrix3x4fv ( GLint location, GLsizei count, GLboolean transpose, GLfloat* value ) ; +GL-FUNCTION: void glUniformMatrix4x2fv ( GLint location, GLsizei count, GLboolean transpose, GLfloat* value ) ; +GL-FUNCTION: void glUniformMatrix4x3fv ( GLint location, GLsizei count, GLboolean transpose, GLfloat* value ) ; + + +! GL_EXT_framebuffer_object + + +: GL_INVALID_FRAMEBUFFER_OPERATION_EXT HEX: 0506 ; inline +: GL_MAX_RENDERBUFFER_SIZE_EXT HEX: 84E8 ; inline +: GL_FRAMEBUFFER_BINDING_EXT HEX: 8CA6 ; inline +: GL_RENDERBUFFER_BINDING_EXT HEX: 8CA7 ; inline +: GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT HEX: 8CD0 ; inline +: GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT HEX: 8CD1 ; inline +: GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT HEX: 8CD2 ; inline +: GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT HEX: 8CD3 ; inline +: GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT HEX: 8CD4 ; inline +: GL_FRAMEBUFFER_COMPLETE_EXT HEX: 8CD5 ; inline +: GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT HEX: 8CD6 ; inline +: GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT HEX: 8CD7 ; inline +: GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT HEX: 8CD9 ; inline +: GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT HEX: 8CDA ; inline +: GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT HEX: 8CDB ; inline +: GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT HEX: 8CDC ; inline +: GL_FRAMEBUFFER_UNSUPPORTED_EXT HEX: 8CDD ; inline +: GL_MAX_COLOR_ATTACHMENTS_EXT HEX: 8CDF ; inline +: GL_COLOR_ATTACHMENT0_EXT HEX: 8CE0 ; inline +: GL_COLOR_ATTACHMENT1_EXT HEX: 8CE1 ; inline +: GL_COLOR_ATTACHMENT2_EXT HEX: 8CE2 ; inline +: GL_COLOR_ATTACHMENT3_EXT HEX: 8CE3 ; inline +: GL_COLOR_ATTACHMENT4_EXT HEX: 8CE4 ; inline +: GL_COLOR_ATTACHMENT5_EXT HEX: 8CE5 ; inline +: GL_COLOR_ATTACHMENT6_EXT HEX: 8CE6 ; inline +: GL_COLOR_ATTACHMENT7_EXT HEX: 8CE7 ; inline +: GL_COLOR_ATTACHMENT8_EXT HEX: 8CE8 ; inline +: GL_COLOR_ATTACHMENT9_EXT HEX: 8CE9 ; inline +: GL_COLOR_ATTACHMENT10_EXT HEX: 8CEA ; inline +: GL_COLOR_ATTACHMENT11_EXT HEX: 8CEB ; inline +: GL_COLOR_ATTACHMENT12_EXT HEX: 8CEC ; inline +: GL_COLOR_ATTACHMENT13_EXT HEX: 8CED ; inline +: GL_COLOR_ATTACHMENT14_EXT HEX: 8CEE ; inline +: GL_COLOR_ATTACHMENT15_EXT HEX: 8CEF ; inline +: GL_DEPTH_ATTACHMENT_EXT HEX: 8D00 ; inline +: GL_STENCIL_ATTACHMENT_EXT HEX: 8D20 ; inline +: GL_FRAMEBUFFER_EXT HEX: 8D40 ; inline +: GL_RENDERBUFFER_EXT HEX: 8D41 ; inline +: GL_RENDERBUFFER_WIDTH_EXT HEX: 8D42 ; inline +: GL_RENDERBUFFER_HEIGHT_EXT HEX: 8D43 ; inline +: GL_RENDERBUFFER_INTERNAL_FORMAT_EXT HEX: 8D44 ; inline +: GL_STENCIL_INDEX1_EXT HEX: 8D46 ; inline +: GL_STENCIL_INDEX4_EXT HEX: 8D47 ; inline +: GL_STENCIL_INDEX8_EXT HEX: 8D48 ; inline +: GL_STENCIL_INDEX16_EXT HEX: 8D49 ; inline +: GL_RENDERBUFFER_RED_SIZE_EXT HEX: 8D50 ; inline +: GL_RENDERBUFFER_GREEN_SIZE_EXT HEX: 8D51 ; inline +: GL_RENDERBUFFER_BLUE_SIZE_EXT HEX: 8D52 ; inline +: GL_RENDERBUFFER_ALPHA_SIZE_EXT HEX: 8D53 ; inline +: GL_RENDERBUFFER_DEPTH_SIZE_EXT HEX: 8D54 ; inline +: GL_RENDERBUFFER_STENCIL_SIZE_EXT HEX: 8D55 ; inline + +GL-FUNCTION: void glBindFramebufferEXT ( GLenum target, GLuint framebuffer ) ; +GL-FUNCTION: void glBindRenderbufferEXT ( GLenum target, GLuint renderbuffer ) ; +GL-FUNCTION: GLenum glCheckFramebufferStatusEXT ( GLenum target ) ; +GL-FUNCTION: void glDeleteFramebuffersEXT ( GLsizei n, GLuint* framebuffers ) ; +GL-FUNCTION: void glDeleteRenderbuffersEXT ( GLsizei n, GLuint* renderbuffers ) ; +GL-FUNCTION: void glFramebufferRenderbufferEXT ( GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer ) ; +GL-FUNCTION: void glFramebufferTexture1DEXT ( GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level ) ; +GL-FUNCTION: void glFramebufferTexture2DEXT ( GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level ) ; +GL-FUNCTION: void glFramebufferTexture3DEXT ( GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset ) ; +GL-FUNCTION: void glGenFramebuffersEXT ( GLsizei n, GLuint* framebuffers ) ; +GL-FUNCTION: void glGenRenderbuffersEXT ( GLsizei n, GLuint* renderbuffers ) ; +GL-FUNCTION: void glGenerateMipmapEXT ( GLenum target ) ; +GL-FUNCTION: void glGetFramebufferAttachmentParameterivEXT ( GLenum target, GLenum attachment, GLenum pname, GLint* params ) ; +GL-FUNCTION: void glGetRenderbufferParameterivEXT ( GLenum target, GLenum pname, GLint* params ) ; +GL-FUNCTION: GLboolean glIsFramebufferEXT ( GLuint framebuffer ) ; +GL-FUNCTION: GLboolean glIsRenderbufferEXT ( GLuint renderbuffer ) ; +GL-FUNCTION: void glRenderbufferStorageEXT ( GLenum target, GLenum internalformat, GLsizei width, GLsizei height ) ; + + +! GL_ARB_texture_float + + +: GL_RGBA32F_ARB HEX: 8814 ; inline +: GL_RGB32F_ARB HEX: 8815 ; inline +: GL_ALPHA32F_ARB HEX: 8816 ; inline +: GL_INTENSITY32F_ARB HEX: 8817 ; inline +: GL_LUMINANCE32F_ARB HEX: 8818 ; inline +: GL_LUMINANCE_ALPHA32F_ARB HEX: 8819 ; inline +: GL_RGBA16F_ARB HEX: 881A ; inline +: GL_RGB16F_ARB HEX: 881B ; inline +: GL_ALPHA16F_ARB HEX: 881C ; inline +: GL_INTENSITY16F_ARB HEX: 881D ; inline +: GL_LUMINANCE16F_ARB HEX: 881E ; inline +: GL_LUMINANCE_ALPHA16F_ARB HEX: 881F ; inline +: GL_TEXTURE_RED_TYPE_ARB HEX: 8C10 ; inline +: GL_TEXTURE_GREEN_TYPE_ARB HEX: 8C11 ; inline +: GL_TEXTURE_BLUE_TYPE_ARB HEX: 8C12 ; inline +: GL_TEXTURE_ALPHA_TYPE_ARB HEX: 8C13 ; inline +: GL_TEXTURE_LUMINANCE_TYPE_ARB HEX: 8C14 ; inline +: GL_TEXTURE_INTENSITY_TYPE_ARB HEX: 8C15 ; inline +: GL_TEXTURE_DEPTH_TYPE_ARB HEX: 8C16 ; inline +: GL_UNSIGNED_NORMALIZED_ARB HEX: 8C17 ; inline + diff --git a/extra/opengl/gl/unix/unix.factor b/extra/opengl/gl/unix/unix.factor new file mode 100644 index 0000000000..08141ad81d --- /dev/null +++ b/extra/opengl/gl/unix/unix.factor @@ -0,0 +1,5 @@ +USING: alien.syntax kernel syntax words ; + +IN: opengl.gl.unix + +: GL-FUNCTION: \ FUNCTION: word-def call ; parsing diff --git a/extra/opengl/gl/windows/windows.factor b/extra/opengl/gl/windows/windows.factor new file mode 100644 index 0000000000..96fb91793d --- /dev/null +++ b/extra/opengl/gl/windows/windows.factor @@ -0,0 +1,18 @@ +USING: alien alien.syntax kernel libc namespaces parser + sequences syntax system vectors ; + +IN: opengl.gl.windows + +SYMBOL: gl-function-pointers + +LIBRARY: gl +FUNCTION: void* wglGetProcAddress ( char* name ) ; + +: GL-FUNCTION: + "stdcall" + scan + scan + dup [ wglGetProcAddress check-ptr ] curry swap + ";" parse-tokens [ "()" subseq? not ] subset + define-indirect + ; parsing diff --git a/extra/opengl/opengl.factor b/extra/opengl/opengl.factor index aabdccd1fb..dd9d6b8ccd 100644 --- a/extra/opengl/opengl.factor +++ b/extra/opengl/opengl.factor @@ -1,7 +1,7 @@ ! Copyright (C) 2005, 2007 Slava Pestov. ! Portions copyright (C) 2007 Eduardo Cavazos. ! See http://factorcode.org/license.txt for BSD license. -USING: alien alien.c-types kernel math namespaces sequences +USING: alien alien.c-types kernel libc math namespaces sequences math.vectors math.constants math.functions opengl.gl opengl.glu combinators arrays ; IN: opengl @@ -20,7 +20,7 @@ IN: opengl : gl-error ( -- ) glGetError dup zero? [ - "GL error: " dup gluErrorString append throw + "GL error: " over gluErrorString append throw ] unless drop ; : do-state ( what quot -- ) @@ -185,3 +185,100 @@ TUPLE: sprite loc dim dim2 dlist texture ; glLoadIdentity GL_MODELVIEW glMatrixMode glLoadIdentity ; + +! Shaders + +: c-true? ( int -- ? ) zero? not ; inline + +: with-gl-shader-source-ptr ( string quot -- ) + swap dup length 1+ [ tuck string>memory swap call ] with-malloc ; inline + +: ( source kind -- shader ) + glCreateShader dup rot [ 1 swap f glShaderSource ] with-gl-shader-source-ptr + [ glCompileShader ] keep + gl-error ; + +: (gl-shader?) ( object -- ? ) + dup integer? [ glIsShader c-true? ] [ drop f ] if ; + +: gl-shader-get-int ( shader enum -- value ) + 0 [ glGetShaderiv ] keep *int ; + +: gl-shader-ok? ( shader -- ? ) + GL_COMPILE_STATUS gl-shader-get-int c-true? ; + +: ( source -- vertex-shader ) + GL_VERTEX_SHADER ; inline + +: (vertex-shader?) ( object -- ? ) + dup (gl-shader?) [ GL_SHADER_TYPE gl-shader-get-int GL_VERTEX_SHADER = ] [ drop f ] if ; + +: ( source -- fragment-shader ) + GL_FRAGMENT_SHADER ; inline + +: (fragment-shader?) ( object -- ? ) + dup (gl-shader?) [ GL_SHADER_TYPE gl-shader-get-int GL_FRAGMENT_SHADER = ] [ drop f ] if ; + +: gl-shader-info-log-length ( shader -- log-length ) + GL_INFO_LOG_LENGTH gl-shader-get-int ; inline + +: gl-shader-info-log ( shader -- log ) + dup gl-shader-info-log-length dup [ [ 0 swap glGetShaderInfoLog ] keep alien>char-string ] with-malloc ; + +: check-gl-shader ( shader -- shader* ) + dup gl-shader-ok? [ dup gl-shader-info-log throw ] unless ; + +: delete-gl-shader ( shader -- ) glDeleteShader ; inline + +PREDICATE: integer gl-shader (gl-shader?) ; +PREDICATE: gl-shader vertex-shader (vertex-shader?) ; +PREDICATE: gl-shader fragment-shader (fragment-shader?) ; + +! Programs + +: ( shaders -- program ) + glCreateProgram swap + [ dupd glAttachShader ] each + [ glLinkProgram ] keep + gl-error ; + +: (gl-program?) ( object -- ? ) + dup integer? [ glIsProgram c-true? ] [ drop f ] if ; + +: gl-program-get-int ( program enum -- value ) + 0 [ glGetProgramiv ] keep *int ; + +: gl-program-ok? ( program -- ? ) + GL_LINK_STATUS gl-program-get-int c-true? ; + +: gl-program-info-log-length ( program -- log-length ) + GL_INFO_LOG_LENGTH gl-program-get-int ; inline + +: gl-program-info-log ( program -- log ) + dup gl-program-info-log-length + dup [ [ 0 swap glGetProgramInfoLog ] keep + alien>char-string ] with-malloc ; + +: check-gl-program ( program -- program* ) + dup gl-program-ok? [ dup gl-program-info-log throw ] unless ; + +: gl-program-shaders-length ( program -- shaders-length ) + GL_ATTACHED_SHADERS gl-program-get-int ; inline + +: gl-program-shaders ( program -- shaders ) + dup gl-program-shaders-length + [ dup "GLuint" [ 0 swap glGetAttachedShaders ] keep ] keep + c-uint-array> ; + +: delete-gl-program-only ( program -- ) glDeleteProgram ; inline + +: detach-gl-program-shader ( program shader -- ) glDetachShader ; inline + +: delete-gl-program ( program -- ) + dup gl-program-shaders [ 2dup detach-gl-program-shader delete-gl-shader ] each + delete-gl-program-only ; + +: with-gl-program ( program quot -- ) + swap glUseProgram call 0 glUseProgram ; inline + +PREDICATE: integer gl-program (gl-program?) ; From 606b0be95b7d9e3b46ab0430022af48c21efee9b Mon Sep 17 00:00:00 2001 From: Joe Groff Date: Sat, 12 Jan 2008 23:00:52 -0800 Subject: [PATCH 05/65] TextMate bundle commands: Eval, Help, Infer, Run, See --- .../Commands/Eval Selection:Line.tmCommand | 27 +++++++++++++ .../Commands/Help for Word.tmCommand | 30 +++++++++++++++ .../Infer Effect of Selection.tmCommand | 27 +++++++++++++ .../Commands/Run File in Listener.tmCommand | 25 ++++++++++++ .../Run Selection:Line in Listener.tmCommand | 27 +++++++++++++ .../Commands/See Word.tmCommand | 30 +++++++++++++++ misc/Factor.tmbundle/Support/lib/tm_factor.rb | 38 +++++++++++++++++++ .../Syntaxes/Factor.tmLanguage | 6 +-- .../Syntaxes/HTML (Factor).tmLanguage | 2 +- misc/Factor.tmbundle/info.plist | 13 ++++++- 10 files changed, 220 insertions(+), 5 deletions(-) create mode 100644 misc/Factor.tmbundle/Commands/Eval Selection:Line.tmCommand create mode 100644 misc/Factor.tmbundle/Commands/Help for Word.tmCommand create mode 100644 misc/Factor.tmbundle/Commands/Infer Effect of Selection.tmCommand create mode 100644 misc/Factor.tmbundle/Commands/Run File in Listener.tmCommand create mode 100644 misc/Factor.tmbundle/Commands/Run Selection:Line in Listener.tmCommand create mode 100644 misc/Factor.tmbundle/Commands/See Word.tmCommand create mode 100644 misc/Factor.tmbundle/Support/lib/tm_factor.rb diff --git a/misc/Factor.tmbundle/Commands/Eval Selection:Line.tmCommand b/misc/Factor.tmbundle/Commands/Eval Selection:Line.tmCommand new file mode 100644 index 0000000000..37867a2737 --- /dev/null +++ b/misc/Factor.tmbundle/Commands/Eval Selection:Line.tmCommand @@ -0,0 +1,27 @@ + + + + + beforeRunningCommand + nop + command + #!/usr/bin/env ruby + +require "#{ENV["TM_BUNDLE_SUPPORT"]}/lib/tm_factor" +puts factor_eval(STDIN.read) + fallbackInput + line + input + selection + keyEquivalent + ^E + name + Eval Selection/Line + output + replaceSelectedText + scope + source.factor + uuid + 8E01DDAF-959B-4237-ADB9-C133A4ACCE90 + + diff --git a/misc/Factor.tmbundle/Commands/Help for Word.tmCommand b/misc/Factor.tmbundle/Commands/Help for Word.tmCommand new file mode 100644 index 0000000000..a3d77d2f0c --- /dev/null +++ b/misc/Factor.tmbundle/Commands/Help for Word.tmCommand @@ -0,0 +1,30 @@ + + + + + beforeRunningCommand + nop + command + #!/usr/bin/env ruby + +require "#{ENV["TM_BUNDLE_SUPPORT"]}/lib/tm_factor" + +doc = STDIN.read +word = line_current_word(ENV["TM_CURRENT_LINE"], ENV["TM_LINE_INDEX"].to_i) +factor_run(%Q(#{doc_using_statements(doc)} \\ #{word} help)) + fallbackInput + word + input + document + keyEquivalent + ^H + name + Help for Word + output + showAsTooltip + scope + source.factor + uuid + BC5BE120-734B-40DF-8B6B-5D3243614B27 + + diff --git a/misc/Factor.tmbundle/Commands/Infer Effect of Selection.tmCommand b/misc/Factor.tmbundle/Commands/Infer Effect of Selection.tmCommand new file mode 100644 index 0000000000..378294e6c1 --- /dev/null +++ b/misc/Factor.tmbundle/Commands/Infer Effect of Selection.tmCommand @@ -0,0 +1,27 @@ + + + + + beforeRunningCommand + nop + command + #!/usr/bin/env ruby + +require "#{ENV["TM_BUNDLE_SUPPORT"]}/lib/tm_factor" + +doc = STDIN.read +puts factor_eval(%Q(#{doc_using_statements(doc)} USE: inference\n [ #{ENV["TM_SELECTED_TEXT"]} ] infer.)) + fallbackInput + word + input + document + name + Infer Effect of Selection + output + showAsTooltip + scope + source.factor + uuid + B619FCC0-2DF2-4657-82A8-0E5676A10254 + + diff --git a/misc/Factor.tmbundle/Commands/Run File in Listener.tmCommand b/misc/Factor.tmbundle/Commands/Run File in Listener.tmCommand new file mode 100644 index 0000000000..bc8c84ec13 --- /dev/null +++ b/misc/Factor.tmbundle/Commands/Run File in Listener.tmCommand @@ -0,0 +1,25 @@ + + + + + beforeRunningCommand + nop + command + #!/usr/bin/env ruby + +require "#{ENV["TM_BUNDLE_SUPPORT"]}/lib/tm_factor" +factor_run(%Q("#{ENV["TM_FILEPATH"]}" run-file)) + input + none + keyEquivalent + @r + name + Run File in Listener + output + discard + scope + source.factor + uuid + CAD3BB10-C480-4C0E-9518-94D61F7A0C0B + + diff --git a/misc/Factor.tmbundle/Commands/Run Selection:Line in Listener.tmCommand b/misc/Factor.tmbundle/Commands/Run Selection:Line in Listener.tmCommand new file mode 100644 index 0000000000..5028bd8db3 --- /dev/null +++ b/misc/Factor.tmbundle/Commands/Run Selection:Line in Listener.tmCommand @@ -0,0 +1,27 @@ + + + + + beforeRunningCommand + nop + command + #!/usr/bin/env ruby + +require "#{ENV["TM_BUNDLE_SUPPORT"]}/lib/tm_factor" +factor_run(STDIN.read) + fallbackInput + line + input + selection + keyEquivalent + ^~e + name + Run Selection/Line in Listener + output + discard + scope + source.factor + uuid + 15A984BD-BC65-43E8-878A-267788C8DA70 + + diff --git a/misc/Factor.tmbundle/Commands/See Word.tmCommand b/misc/Factor.tmbundle/Commands/See Word.tmCommand new file mode 100644 index 0000000000..b9dd2e5e90 --- /dev/null +++ b/misc/Factor.tmbundle/Commands/See Word.tmCommand @@ -0,0 +1,30 @@ + + + + + beforeRunningCommand + nop + command + #!/usr/bin/env ruby + +require "#{ENV["TM_BUNDLE_SUPPORT"]}/lib/tm_factor" + +doc = STDIN.read +word = line_current_word(ENV["TM_CURRENT_LINE"], ENV["TM_LINE_INDEX"].to_i) +puts factor_eval(%Q(#{doc_using_statements(doc)} \\ #{word} see)) + fallbackInput + word + input + document + keyEquivalent + ^h + name + See Word + output + showAsTooltip + scope + source.factor + uuid + 35484754-DBF9-4381-BB25-00CAB64DF4A1 + + diff --git a/misc/Factor.tmbundle/Support/lib/tm_factor.rb b/misc/Factor.tmbundle/Support/lib/tm_factor.rb new file mode 100644 index 0000000000..54272e5e36 --- /dev/null +++ b/misc/Factor.tmbundle/Support/lib/tm_factor.rb @@ -0,0 +1,38 @@ +require 'osx/cocoa' + +def _wait_for_return_value(pb) + origCount = pb.changeCount + sleep 0.125 while pb.changeCount == origCount +end + +def perform_service(service, in_string, wait_for_return_value=false) + p = OSX::NSPasteboard.pasteboardWithUniqueName + p.declareTypes_owner([OSX::NSStringPboardType], nil) + p.setString_forType(in_string, OSX::NSStringPboardType) + raise "Unable to call service #{service}" unless OSX::NSPerformService(service, p) + _wait_for_return_value(p) if wait_for_return_value + p.stringForType(OSX::NSStringPboardType) +end + +def textmate_front() + system %Q{osascript -e 'tell app "TextMate" to activate'}; +end + +def factor_run(code) + perform_service("Factor/Evaluate in Listener", code) +end + +def factor_eval(code) + r = perform_service("Factor/Evaluate Selection", code, true) + textmate_front + r +end + +def doc_using_statements(document) + document.scan(/\b(USING:\s[^;]*\s;|USE:\s+\S+|IN:\s\S+)/).join("\n") << "\n" +end + +def line_current_word(line, point) + left = line.rindex(/\s|^/, point - 1) + 1; right = line.index(/\s|$/, point) - 1 + line[left..right] +end diff --git a/misc/Factor.tmbundle/Syntaxes/Factor.tmLanguage b/misc/Factor.tmbundle/Syntaxes/Factor.tmLanguage index ec4961f312..304af129ce 100644 --- a/misc/Factor.tmbundle/Syntaxes/Factor.tmLanguage +++ b/misc/Factor.tmbundle/Syntaxes/Factor.tmLanguage @@ -1,5 +1,5 @@ - + fileTypes @@ -254,9 +254,9 @@ begin - \(\s + \((?=\s) end - \s\) + (^|(?<=\s))\) name comment.parens.factor diff --git a/misc/Factor.tmbundle/Syntaxes/HTML (Factor).tmLanguage b/misc/Factor.tmbundle/Syntaxes/HTML (Factor).tmLanguage index 89c0f191b9..03394b933c 100644 --- a/misc/Factor.tmbundle/Syntaxes/HTML (Factor).tmLanguage +++ b/misc/Factor.tmbundle/Syntaxes/HTML (Factor).tmLanguage @@ -1,5 +1,5 @@ - + fileTypes diff --git a/misc/Factor.tmbundle/info.plist b/misc/Factor.tmbundle/info.plist index 8def3807d7..1ea756a1a5 100644 --- a/misc/Factor.tmbundle/info.plist +++ b/misc/Factor.tmbundle/info.plist @@ -1,9 +1,20 @@ - + name Factor + ordering + + 3C9C9C2A-314A-475B-A4E4-A68BAAF3F36E + 141517D7-73E0-4475-A481-71102575A175 + CAD3BB10-C480-4C0E-9518-94D61F7A0C0B + 15A984BD-BC65-43E8-878A-267788C8DA70 + 8E01DDAF-959B-4237-ADB9-C133A4ACCE90 + 35484754-DBF9-4381-BB25-00CAB64DF4A1 + BC5BE120-734B-40DF-8B6B-5D3243614B27 + B619FCC0-2DF2-4657-82A8-0E5676A10254 + uuid 8061D2F3-B603-411D-AFFE-61784A07906D From 4044cd293a66877d3c6c41cf7cf61d2aba60fc87 Mon Sep 17 00:00:00 2001 From: Joe Groff Date: Sun, 13 Jan 2008 00:09:08 -0800 Subject: [PATCH 06/65] TYPEDEF-IF: and USE-IF: words; ptrdiff_t C type moved to alien.c-types and special-cased for win64 --- core/alien/c-types/c-types.factor | 3 +++ core/alien/syntax/syntax-docs.factor | 10 ++++++++-- core/alien/syntax/syntax.factor | 3 +++ core/syntax/syntax-docs.factor | 6 ++++++ core/syntax/syntax.factor | 1 + extra/opengl/gl/gl.factor | 2 -- extra/opengl/gl/unix/unix.factor | 2 +- 7 files changed, 22 insertions(+), 5 deletions(-) diff --git a/core/alien/c-types/c-types.factor b/core/alien/c-types/c-types.factor index b665300bee..6d9c2cec14 100755 --- a/core/alien/c-types/c-types.factor +++ b/core/alien/c-types/c-types.factor @@ -358,4 +358,7 @@ M: long-long-type box-return ( type -- ) "ushort*" define-primitive-type [ string>u16-alien ] "ushort*" c-type set-c-type-prep + + win64? "longlong" "long" ? "ptrdiff_t" typedef + ] with-compilation-unit diff --git a/core/alien/syntax/syntax-docs.factor b/core/alien/syntax/syntax-docs.factor index d87b67eb59..00ee6345dc 100755 --- a/core/alien/syntax/syntax-docs.factor +++ b/core/alien/syntax/syntax-docs.factor @@ -49,8 +49,14 @@ $nl HELP: TYPEDEF: { $syntax "TYPEDEF: old new" } -{ $values { "old" "a C type" } { "new" "a C type" } } -{ $description "Alises the C type " { $snippet "old" } " under the name " { $snippet "new" } "." } +{ $values { "word" "a word with stack effect " { $snippet "( -- ? )" } } { "old" "a C type" } { "new" "a C type" } } +{ $description "Alises the C type " { $snippet "old" } " under the name " { $snippet "new" } " if ." } +{ $notes "This word differs from " { $link typedef } " in that it runs at parse time, to ensure correct ordering of operations when loading source files. Words defined in source files are compiled before top-level forms are run, so if a source file defines C binding words and uses " { $link typedef } ", the type alias won't be available at compile time." } ; + +HELP: TYPEDEF-IF: +{ $syntax "TYPEDEF-IF: word old new" } +{ $values { "word" "a word with stack effect " { $snippet "( -- ? )" } } { "old" "a C type" } { "new" "a C type" } } +{ $description "Alises the C type " { $snippet "old" } " under the name " { $snippet "new" } " if " { $snippet "word" } " evaluates to a true value." } { $notes "This word differs from " { $link typedef } " in that it runs at parse time, to ensure correct ordering of operations when loading source files. Words defined in source files are compiled before top-level forms are run, so if a source file defines C binding words and uses " { $link typedef } ", the type alias won't be available at compile time." } ; HELP: C-STRUCT: diff --git a/core/alien/syntax/syntax.factor b/core/alien/syntax/syntax.factor index bc3bc911ef..b81a91efcb 100755 --- a/core/alien/syntax/syntax.factor +++ b/core/alien/syntax/syntax.factor @@ -46,6 +46,9 @@ PRIVATE> : TYPEDEF: scan scan typedef ; parsing +: TYPEDEF-IF: + scan-word execute scan scan rot [ typedef ] [ 2drop ] if ; parsing + : C-STRUCT: scan in get parse-definition diff --git a/core/syntax/syntax-docs.factor b/core/syntax/syntax-docs.factor index 9cf9647e41..f4efc3b6bb 100755 --- a/core/syntax/syntax-docs.factor +++ b/core/syntax/syntax-docs.factor @@ -363,6 +363,12 @@ HELP: USE: { $description "Adds a new vocabulary at the front of the search path. Subsequent word lookups by the parser will search this vocabulary first." } { $errors "Throws an error if the vocabulary does not exist." } ; +HELP: USE-IF: +{ $syntax "USE-IF: word vocabulary" } +{ $values { "word" "a word with stack effect " { $snippet "( -- ? )" } } { "vocabulary" "a vocabulary name" } } +{ $description "Adds " { $snippet "vocabulary" } " at the front of the search path if " { $snippet "word" } " evaluates to a true value." } +{ $errors "Throws an error if the vocabulary does not exist." } ; + HELP: USING: { $syntax "USING: vocabularies... ;" } { $values { "vocabularies" "a list of vocabulary names" } } diff --git a/core/syntax/syntax.factor b/core/syntax/syntax.factor index b0a7ea19bd..cd97aea9eb 100755 --- a/core/syntax/syntax.factor +++ b/core/syntax/syntax.factor @@ -46,6 +46,7 @@ IN: bootstrap.syntax ] define-syntax "USE:" [ scan use+ ] define-syntax + "USE-IF:" [ scan-word execute scan swap [ use+ ] [ drop ] if ] define-syntax "USING:" [ ";" parse-tokens add-use ] define-syntax diff --git a/extra/opengl/gl/gl.factor b/extra/opengl/gl/gl.factor index c7ce176aca..4a9d9c84d5 100644 --- a/extra/opengl/gl/gl.factor +++ b/extra/opengl/gl/gl.factor @@ -1469,8 +1469,6 @@ GL-FUNCTION: void glWindowPos3sv ( GLshort* p ) ; : GL_SRC2_ALPHA GL_SOURCE2_ALPHA ; inline : GL_SRC2_RGB GL_SOURCE2_RGB ; inline -TYPEDEF: long ptrdiff_t - TYPEDEF: ptrdiff_t GLsizeiptr TYPEDEF: ptrdiff_t GLintptr diff --git a/extra/opengl/gl/unix/unix.factor b/extra/opengl/gl/unix/unix.factor index 08141ad81d..16cd38f92f 100644 --- a/extra/opengl/gl/unix/unix.factor +++ b/extra/opengl/gl/unix/unix.factor @@ -2,4 +2,4 @@ USING: alien.syntax kernel syntax words ; IN: opengl.gl.unix -: GL-FUNCTION: \ FUNCTION: word-def call ; parsing +: GL-FUNCTION: POSTPONE: FUNCTION: ; parsing From c27d17e1ec7e15672ece8e258c7b82ee0d0e54f2 Mon Sep 17 00:00:00 2001 From: Doug Coleman Date: Sun, 13 Jan 2008 10:33:36 -1000 Subject: [PATCH 07/65] unbreak singleton? --- extra/sequences/lib/lib.factor | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extra/sequences/lib/lib.factor b/extra/sequences/lib/lib.factor index 37b00042d2..e46ce3b107 100755 --- a/extra/sequences/lib/lib.factor +++ b/extra/sequences/lib/lib.factor @@ -59,7 +59,7 @@ IN: sequences.lib ] { } make ; : singleton? ( seq -- ? ) - length 1 = ; foldable + length 1 = ; : delete-random ( seq -- value ) [ length random ] keep [ nth ] 2keep delete-nth ; From 952c559b52a52e92a299fcec1bd769a4d9128698 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Sun, 13 Jan 2008 17:07:59 -0500 Subject: [PATCH 08/65] Faster compilation of dispatch primitive --- core/compiler/test/simple.factor | 6 ++ core/cpu/architecture/architecture.factor | 15 ++++- core/cpu/ppc/architecture/architecture.factor | 55 +++++++++++++------ core/cpu/ppc/intrinsics/intrinsics.factor | 38 ++++++------- core/generator/fixup/fixup.factor | 7 +++ core/generator/generator.factor | 47 +++++++++------- core/inference/class/class-tests.factor | 21 ++++--- core/optimizer/known-words/known-words.factor | 6 +- vm/code_heap.c | 2 + vm/code_heap.h | 4 +- 10 files changed, 129 insertions(+), 72 deletions(-) diff --git a/core/compiler/test/simple.factor b/core/compiler/test/simple.factor index 7ce82c9a1f..9f831bb1f8 100755 --- a/core/compiler/test/simple.factor +++ b/core/compiler/test/simple.factor @@ -63,3 +63,9 @@ IN: temporary ! Regression [ ] [ [ callstack ] compile-call drop ] unit-test + +! Regression + +: empty ; + +[ "b" ] [ 1 [ empty { [ "a" ] [ "b" ] } dispatch ] compile-call ] unit-test diff --git a/core/cpu/architecture/architecture.factor b/core/cpu/architecture/architecture.factor index 3550dcadc0..2409eafaf0 100755 --- a/core/cpu/architecture/architecture.factor +++ b/core/cpu/architecture/architecture.factor @@ -51,19 +51,28 @@ HOOK: %save-dispatch-xt compiler-backend ( -- ) M: object %save-dispatch-xt %save-word-xt ; +! Call C primitive +HOOK: %call-primitive compiler-backend ( label -- ) + ! Call another label HOOK: %call-label compiler-backend ( label -- ) +! Far jump to C primitive +HOOK: %jump-primitive compiler-backend ( label -- ) + ! Local jump for branches HOOK: %jump-label compiler-backend ( label -- ) ! Test if vreg is 'f' or not HOOK: %jump-t compiler-backend ( label -- ) -! We pass the offset of the jump table start in the world table -HOOK: %call-dispatch compiler-backend ( word-table# -- ) +HOOK: %call-dispatch compiler-backend ( -- label ) -HOOK: %jump-dispatch compiler-backend ( word-table# -- ) +HOOK: %jump-dispatch compiler-backend ( -- ) + +HOOK: %dispatch-label compiler-backend ( word -- ) + +HOOK: %end-dispatch compiler-backend ( label -- ) ! Return to caller HOOK: %return compiler-backend ( -- ) diff --git a/core/cpu/ppc/architecture/architecture.factor b/core/cpu/ppc/architecture/architecture.factor index e93d092b10..a156c173a1 100755 --- a/core/cpu/ppc/architecture/architecture.factor +++ b/core/cpu/ppc/architecture/architecture.factor @@ -97,6 +97,22 @@ M: ppc-backend %epilogue ( n -- ) 1 1 rot ADDI 0 MTLR ; +: %prepare-primitive ( word -- ) + #! Save stack pointer to stack_chain->callstack_top, load XT + 4 1 MR + 0 11 LOAD32 + rc-absolute-ppc-2/2 rel-primitive ; + +: (%call) 11 MTLR BLRL ; + +M: ppc-backend %call-primitive ( word -- ) + %prepare-primitive (%call) ; + +: (%jump) 11 MTCTR BCTR ; + +M: ppc-backend %jump-primitive ( word -- ) + %prepare-primitive (%jump) ; + : %load-dlsym ( symbol dll register -- ) 0 swap LOAD32 rc-absolute-ppc-2/2 rel-dlsym ; @@ -107,26 +123,29 @@ M: ppc-backend %jump-label ( label -- ) B ; M: ppc-backend %jump-t ( label -- ) 0 "flag" operand f v>operand CMPI BNE ; -: (%call) 11 MTLR BLRL ; - -: dispatch-template ( word-table# quot -- ) - [ - >r - "offset" operand "n" operand 1 SRAWI - 0 11 LOAD32 rc-absolute-ppc-2/2 rel-dispatch - 11 dup "offset" operand LWZX - 11 dup word-xt-offset LWZ - r> call - ] H{ - { +input+ { { f "n" } } } - { +scratch+ { { f "offset" } } } - } with-template ; inline +: (%dispatch) ( len -- ) + 0 11 LOAD32 rc-absolute-ppc-2/2 rel-here + "offset" operand "n" operand 1 SRAWI + 11 11 "offset" operand ADD + 11 dup rot cells LWZ ; M: ppc-backend %call-dispatch ( word-table# -- ) - [ (%call) ] dispatch-template ; + [ 7 (%dispatch) (%call) + + begin + <" + end + "> + name + string.quoted.double.multiline.factor + patterns + + + include + #escaped_characters + + + + + begin + (^|(?<=\s))(STRING:)\s+(\S+) + captures + + 2 + + name + keyword.colon.factor + + 3 + + name + entity.name.heredoc.factor + + + contentName + string.unquoted.heredoc.factor + end + ^;$ + name + definition.word.heredoc.factor + match inline|foldable From ce92275c8e50ea4347a17749b196e15ea9f9dd2a Mon Sep 17 00:00:00 2001 From: Joe Groff Date: Sun, 13 Jan 2008 22:58:11 -0800 Subject: [PATCH 18/65] Documentation for the GLSL-related utility words in opengl --- extra/opengl/opengl-docs.factor | 96 ++++++++++++++++++++++++++++++++- 1 file changed, 95 insertions(+), 1 deletion(-) diff --git a/extra/opengl/opengl-docs.factor b/extra/opengl/opengl-docs.factor index f9a491aba6..58b86f09b3 100644 --- a/extra/opengl/opengl-docs.factor +++ b/extra/opengl/opengl-docs.factor @@ -92,6 +92,96 @@ HELP: with-translation { $values { "loc" "a pair of integers" } { "quot" quotation } } { $description "Calls the quotation with a translation by " { $snippet "loc" } " pixels applied to the current " { $link GL_MODELVIEW } " matrix, restoring the matrix when the quotation is done." } ; +HELP: gl-shader +{ $class-description { $snippet "gl-shader" } " is a predicate class comprising values returned by OpenGL to represent shader objects. The following words are provided for creating and manipulating these objects:" + { $list + { { $link } " - Compile GLSL code into a shader object" } + { { $link gl-shader-ok? } " - Check whether a shader object compiled successfully" } + { { $link check-gl-shader } " - Throw an error unless a shader object compiled successfully" } + { { $link gl-shader-info-log } " - Retrieve the info log of messages generated by the GLSL compiler" } + { { $link delete-gl-shader } " - Invalidate a shader object" } + } + "The derived predicate classes " { $link vertex-shader } " and " { $link fragment-shader } " are also defined for the two standard kinds of shader defined by the OpenGL specification." } ; + +HELP: vertex-shader +{ $class-description { $snippet "vertex-shader" } " is the predicate class of " { $link gl-shader } " objects that refer to shaders of type " { $snippet "GL_VERTEX_SHADER" } ". In addition to the " { $snippet "gl-shader" } " words, the following vertex shader-specific functions are defined:" + { $list + { { $link } " - Compile GLSL code into a vertex shader object "} + } +} ; + +HELP: fragment-shader +{ $class-description { $snippet "fragment-shader" } " is the predicate class of " { $link gl-shader } " objects that refer to shaders of type " { $snippet "GL_FRAGMENT_SHADER" } ". In addition to the " { $snippet "gl-shader" } " words, the following fragment shader-specific functions are defined:" + { $list + { { $link } " - Compile GLSL code into a fragment shader object "} + } +} ; + +HELP: +{ $values { "source" "The GLSL source code to compile" } { "kind" "The kind of shader to compile, such as " { $snippet "GL_VERTEX_SHADER" } " or " { $snippet "GL_FRAGMENT_SHADER" } } } +{ $description "Tries to compile the given GLSL source into a shader object. The returned object can be checked for validity by " { $link check-gl-shader } " or " { $link gl-shader-ok? } ". Errors and warnings generated by the GLSL compiler will be collected in the info log, available from " { $link gl-shader-info-log } ".\n\nWhen the shader object is no longer needed, it should be deleted using " { $link delete-gl-shader } " or else be attached to a " { $link gl-program } " object deleted using " { $link delete-gl-program } "." } ; + +HELP: +{ $values { "source" "The GLSL source code to compile" } } +{ $description "Tries to compile the given GLSL source into a vertex shader object. Equivalent to " { $snippet "GL_VERTEX_SHADER " } "." } ; + +HELP: +{ $values { "source" "The GLSL source code to compile" } } +{ $description "Tries to compile the given GLSL source into a fragment shader object. Equivalent to " { $snippet "GL_FRAGMENT_SHADER " } "." } ; + +HELP: gl-shader-ok? +{ $values { "shader" "A " { $link gl-shader } " object" } } +{ $description "Returns a boolean value indicating whether the given shader object compiled successfully. Compilation errors and warnings are available in the shader's info log, which can be gotten using " { $link gl-shader-info-log } "." } ; + +HELP: check-gl-shader +{ $values { "shader" "A " { $link gl-shader } " object" } } +{ $description "Throws an error containing the " { $link gl-shader-info-log } " for the shader object if it failed to compile. Otherwise, the shader object is left on the stack." } ; + +HELP: delete-gl-shader +{ $values { "shader" "A " { $link gl-shader } " object" } } +{ $description "Deletes the shader object, invalidating it and releasing any resources allocated for it by the OpenGL implementation." } ; + +HELP: gl-shader-info-log +{ $values { "shader" "A " { $link gl-shader } " object" } } +{ $description "Retrieves the info log for " { $snippet "shader" } ", including any errors or warnings generated in compiling the shader object." } ; + +HELP: gl-program +{ $class-description { $snippet "gl-program" } " is a predicate class comprising values returned by OpenGL to represent proram objects. The following words are provided for creating and manipulating these objects:" + { $list + { { $link } " - Link a set of shaders into a GLSL program" } + { { $link gl-program-ok? } " - Check whether a program object linked successfully" } + { { $link check-gl-program } " - Throw an error unless a program object linked successfully" } + { { $link gl-program-info-log } " - Retrieve the info log of messages generated by the GLSL linker" } + { { $link gl-program-shaders } " - Retrieve the set of shader objects composing the GLSL linker" } + { { $link delete-gl-program } " - Invalidate a program object and all its attached shaders" } + { { $link with-gl-program } " - Use a program object" } + } +} ; + +HELP: +{ $values { "shaders" "A sequence of " { $link gl-shader } " objects." } } +{ $description "Creates a new GLSL program object, attaches all the shader objects in the " { $snippet "shaders" } " sequence, and attempts to link them. The returned object can be checked for validity by " { $link check-gl-program } " or " { $link gl-program-ok? } ". Errors and warnings generated by the GLSL linker will be collected in the info log, available from " { $link gl-program-info-log } ".\n\nWhen the program object and its attached shaders are no longer needed, it should be deleted using " { $link delete-gl-program } "." } ; + +HELP: gl-program-ok? +{ $values { "program" "A " { $link gl-program } " object" } } +{ $description "Returns a boolean value indicating whether the given program object linked successfully. Link errors and warnings are available in the program's info log, which can be gotten using " { $link gl-program-info-log } "." } ; + +HELP: check-gl-program +{ $values { "program" "A " { $link gl-program } " object" } } +{ $description "Throws an error containing the " { $link gl-program-info-log } " for the program object if it failed to link. Otherwise, the program object is left on the stack." } ; + +HELP: gl-program-info-log +{ $values { "program" "A " { $link gl-program } " object" } } +{ $description "Retrieves the info log for " { $snippet "program" } ", including any errors or warnings generated in linking the program object." } ; + +HELP: delete-gl-program +{ $values { "program" "A " { $link gl-program } " object" } } +{ $description "Deletes the program object, invalidating it and releasing any resources allocated for it by the OpenGL implementation. Any attached " { $link gl-shader } "s are also deleted.\n\nIf the shader objects should be preserved, they should each be detached using " { $link detach-gl-program-shader } ". The program object can then be destroyed alone using " { $link delete-gl-program-only } "." } ; + +HELP: with-gl-program +{ $values { "program" "A " { $link gl-program } " object" } { "quot" "A quotation" } } +{ $description "Enables " { $snippet "program" } " for all OpenGL calls made in " { $snippet "quot" } ". The fixed-function pipeline is restored at the end of " { $snippet "quot" } "." } ; + ARTICLE: "gl-utilities" "OpenGL utility words" "In addition to the full OpenGL API, the " { $vocab-link "opengl" } " vocabulary includes some utility words to give OpenGL a more Factor-like feel." $nl @@ -112,6 +202,10 @@ $nl { $subsection gl-rect } { $subsection gl-fill-poly } { $subsection gl-poly } -{ $subsection gl-gradient } ; +{ $subsection gl-gradient } +"Compiling, linking, and using GLSL programs:" +{ $subsection gl-shader } +{ $subsection gl-program } +; ABOUT: "gl-utilities" From 15e9575cb69af8c9213ee5094df8fdebefb33277 Mon Sep 17 00:00:00 2001 From: Eduardo Cavazos Date: Mon, 14 Jan 2008 05:19:00 -0600 Subject: [PATCH 19/65] Mortar defined and used parsing words. Refactor this. --- extra/factory/factory-menus | 2 +- extra/factory/factory.factor | 2 +- extra/mortar/mortar.factor | 15 +++++++++++---- extra/mortar/sugar/sugar.factor | 6 ++++++ extra/x/gc/gc.factor | 3 ++- extra/x/pen/pen.factor | 2 +- extra/x/widgets/button/button.factor | 4 ++-- extra/x/widgets/keymenu/keymenu.factor | 2 +- extra/x/widgets/label/label.factor | 2 +- extra/x/widgets/wm/frame/drag/move/move.factor | 2 +- extra/x/widgets/wm/frame/drag/size/size.factor | 2 +- extra/x/widgets/wm/frame/frame.factor | 2 +- extra/x/widgets/wm/menu/menu.factor | 2 +- 13 files changed, 30 insertions(+), 16 deletions(-) create mode 100644 extra/mortar/sugar/sugar.factor diff --git a/extra/factory/factory-menus b/extra/factory/factory-menus index dd5dc29378..fa72fa6c9a 100644 --- a/extra/factory/factory-menus +++ b/extra/factory/factory-menus @@ -1,6 +1,6 @@ ! -*-factor-*- -USING: kernel unix vars mortar slot-accessors +USING: kernel unix vars mortar mortar.sugar slot-accessors x.widgets.wm.menu x.widgets.wm.unmapped-frames-menu factory.commands factory.load ; diff --git a/extra/factory/factory.factor b/extra/factory/factory.factor index a5755c2a67..ca534f12c1 100644 --- a/extra/factory/factory.factor +++ b/extra/factory/factory.factor @@ -1,6 +1,6 @@ USING: kernel parser io io.files namespaces sequences editors threads vars - mortar slot-accessors + mortar mortar.sugar slot-accessors x x.widgets.wm.root x.widgets.wm.frame diff --git a/extra/mortar/mortar.factor b/extra/mortar/mortar.factor index c7522e1db6..b7862af7ac 100644 --- a/extra/mortar/mortar.factor +++ b/extra/mortar/mortar.factor @@ -128,7 +128,7 @@ over object-class class-methods 1 head* assoc-stack call ; ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -: new* ( class -- object ) <<- create ; +! : new* ( class -- object ) <<- create ; ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! @@ -136,13 +136,20 @@ IN: slot-accessors IN: mortar +! : generate-slot-getter ( name -- ) +! "$" over append "slot-accessors" create swap [ slot-value ] curry +! define-compound ; + : generate-slot-getter ( name -- ) -"$" over append "slot-accessors" create swap [ slot-value ] curry -define-compound ; +"$" over append "slot-accessors" create swap [ slot-value ] curry define ; + +! : generate-slot-setter ( name -- ) +! ">>" over append "slot-accessors" create swap [ swap set-slot-value ] curry +! define-compound ; : generate-slot-setter ( name -- ) ">>" over append "slot-accessors" create swap [ swap set-slot-value ] curry -define-compound ; +define ; : generate-slot-accessors ( name -- ) dup diff --git a/extra/mortar/sugar/sugar.factor b/extra/mortar/sugar/sugar.factor new file mode 100644 index 0000000000..04d2f6f651 --- /dev/null +++ b/extra/mortar/sugar/sugar.factor @@ -0,0 +1,6 @@ + +USING: mortar ; + +IN: mortar.sugar + +: new* ( class -- object ) <<- create ; \ No newline at end of file diff --git a/extra/x/gc/gc.factor b/extra/x/gc/gc.factor index 77e5313d00..8db610a1ac 100644 --- a/extra/x/gc/gc.factor +++ b/extra/x/gc/gc.factor @@ -1,5 +1,6 @@ -USING: kernel namespaces arrays x11.xlib mortar slot-accessors x x.font ; +USING: kernel namespaces arrays x11.xlib mortar mortar.sugar + slot-accessors x x.font ; IN: x.gc diff --git a/extra/x/pen/pen.factor b/extra/x/pen/pen.factor index c4fc6cfa9f..59b8aeea44 100644 --- a/extra/x/pen/pen.factor +++ b/extra/x/pen/pen.factor @@ -1,5 +1,5 @@ -USING: kernel arrays math.vectors mortar x.gc slot-accessors geom.pos ; +USING: kernel arrays math.vectors mortar mortar.sugar x.gc slot-accessors geom.pos ; IN: x.pen diff --git a/extra/x/widgets/button/button.factor b/extra/x/widgets/button/button.factor index b26431c4c2..ea46b62a69 100644 --- a/extra/x/widgets/button/button.factor +++ b/extra/x/widgets/button/button.factor @@ -1,6 +1,6 @@ USING: kernel combinators math x11.xlib - mortar slot-accessors x.gc x.widgets.label ; + mortar mortar.sugar slot-accessors x.gc x.widgets.label ; IN: x.widgets.button @@ -11,7 +11,7 @@ SYMBOL: