! See http://factorcode.org/license.txt for BSD license.
USING: accessors alien alien.c-types alien.data alien.strings
arrays assocs byte-arrays classes.mixin classes.parser
-classes.singleton classes.struct combinators combinators.short-circuit
-definitions destructors fry generic.parser gpu gpu.buffers gpu.private
-gpu.state hashtables images io.encodings.ascii io.files io.pathnames
-kernel lexer literals locals math math.parser memoize multiline namespaces
+classes.singleton classes.struct combinators
+combinators.short-circuit definitions destructors generic.parser
+gpu gpu.buffers gpu.private gpu.state hashtables images
+io.encodings.ascii io.files io.pathnames kernel lexer literals
+math math.floats.half math.parser memoize multiline namespaces
opengl opengl.gl opengl.shaders parser quotations sequences
-specialized-arrays splitting strings tr ui.gadgets.worlds
-variants vectors vocabs vocabs.loader vocabs.parser words
-words.constant math.floats.half typed ;
+specialized-arrays splitting strings tr typed ui.gadgets.worlds
+variants vocabs.loader words words.constant ;
QUALIFIED-WITH: alien.c-types c
SPECIALIZED-ARRAY: int
SPECIALIZED-ARRAY: void*
] [ nip ] if ":" join ;
: replace-log-line-numbers ( object log -- log' )
- "\n" split harvest
+ split-lines harvest
[ replace-log-line-number ] with map
- "\n" join ;
+ join-lines ;
: gl-shader-kind ( shader-kind -- shader-kind )
{
TUPLE: link-program-error program log ;
: throw-compile-shader-error ( shader instance -- * )
- [ dup ] dip [ gl-shader-info-log ] [ delete-gl-shader ] bi
+ [ dup ] dip [ gl-shader-info-log ] [ glDeleteShader ] bi
replace-log-line-numbers compile-shader-error boa throw ;
: throw-link-program-error ( program instance -- * )
pick word-directory prepend-path ;
: become-shader-instance ( shader-instance new-shader-instance -- )
- handle>> [ swap delete-gl-shader ] curry change-handle drop ;
+ handle>> [ swap glDeleteShader ] curry change-handle drop ;
: refresh-shader-source ( shader -- )
dup filename>>
[ drop ] if* ;
: become-program-instance ( program-instance new-program-instance -- )
- handle>> [ swap delete-gl-program-only ] curry change-handle drop ;
+ handle>> [ swap glDeleteProgram ] curry change-handle drop ;
: reset-memos ( -- )
\ uniform-index reset-memoized
define-constant ;
M: shader-instance dispose
- [ dup valid-handle? [ delete-gl-shader ] [ drop ] if f ] change-handle
+ [ dup valid-handle? [ glDeleteShader ] [ drop ] if f ] change-handle
[ world>> ] [ shader>> instances>> ] [ ] tri ?delete-at ;
M: program-instance dispose
- [ dup valid-handle? [ delete-gl-program-only ] [ drop ] if f ] change-handle
+ [ dup valid-handle? [ glDeleteProgram ] [ drop ] if f ] change-handle
[ world>> ] [ program>> instances>> ] [ ] tri ?delete-at
reset-memos ;