: error>string ( n -- string )
H{
- { HEX: 0 "No error" }
- { HEX: 0501 "Invalid value" }
- { HEX: 0500 "Invalid enumerant" }
- { HEX: 0502 "Invalid operation" }
- { HEX: 0503 "Stack overflow" }
- { HEX: 0504 "Stack underflow" }
- { HEX: 0505 "Out of memory" }
- { HEX: 0506 "Invalid framebuffer operation" }
+ { 0x0 "No error" }
+ { 0x0501 "Invalid value" }
+ { 0x0500 "Invalid enumerant" }
+ { 0x0502 "Invalid operation" }
+ { 0x0503 "Stack overflow" }
+ { 0x0504 "Stack underflow" }
+ { 0x0505 "Out of memory" }
+ { 0x0506 "Invalid framebuffer operation" }
} at "Unknown error" or ;
TUPLE: gl-error function code string ;
swap glPushAttrib call glPopAttrib ; inline
: (gen-gl-object) ( quot -- id )
- [ 1 { uint } ] dip [ ] with-out-parameters ; inline
+ [ 1 { uint } ] dip with-out-parameters ; inline
: (delete-gl-object) ( id quot -- )
- [ 1 swap <uint> ] dip call ; inline
+ [ 1 swap uint <ref> ] dip call ; inline
: gen-gl-buffer ( -- id )
[ glGenBuffers ] (gen-gl-object) ;
glActiveTexture swap glBindTexture gl-error ;
: (set-draw-buffers) ( buffers -- )
- [ length ] [ >uint-array ] bi glDrawBuffers ;
+ [ length ] [ uint >c-array ] bi glDrawBuffers ;
MACRO: set-draw-buffers ( buffers -- )
words>values '[ _ (set-draw-buffers) ] ;
: with-translation ( loc quot -- )
[ [ gl-translate ] dip call ] do-matrix ; inline
-: fix-coordinates ( point1 point2 -- x1 y2 x2 y2 )
+: fix-coordinates ( point1 point2 -- x1 y1 x2 y2 )
[ first2 [ >fixnum ] bi@ ] bi@ ;
: gl-set-clip ( loc dim -- )