snipe some bunny bugs

db4
U-VICTORIA\Administrator 2008-12-04 18:18:19 -08:00
parent 196e9d6884
commit a67de2289a
16 changed files with 9 additions and 7 deletions

View File

@ -1,5 +1,6 @@
USING: alien.c-types continuations destructors kernel USING: alien.c-types continuations destructors kernel
opengl opengl.gl bunny.model specialized-arrays.float ; opengl opengl.gl bunny.model specialized-arrays.float
accessors ;
IN: bunny.fixed-pipeline IN: bunny.fixed-pipeline
TUPLE: bunny-fixed-pipeline ; TUPLE: bunny-fixed-pipeline ;

View File

@ -3,7 +3,7 @@ http.client io io.encodings.ascii io.files kernel math
math.matrices math.parser math.vectors opengl math.matrices math.parser math.vectors opengl
opengl.capabilities opengl.gl opengl.demo-support sequences opengl.capabilities opengl.gl opengl.demo-support sequences
sequences.lib splitting vectors words sequences.lib splitting vectors words
specialized-arrays.double specialized-arrays.uint ; specialized-arrays.float specialized-arrays.uint ;
IN: bunny.model IN: bunny.model
: numbers ( str -- seq ) : numbers ( str -- seq )
@ -66,7 +66,7 @@ TUPLE: bunny-buffers array element-array nv ni ;
{ {
[ [
[ first concat ] [ second concat ] bi [ first concat ] [ second concat ] bi
append >double-array underlying>> append >float-array underlying>>
GL_ARRAY_BUFFER swap GL_STATIC_DRAW <gl-buffer> GL_ARRAY_BUFFER swap GL_STATIC_DRAW <gl-buffer>
] ]
[ [

View File

@ -2,7 +2,8 @@
! See http://factorcode.org/license.txt for BSD license. ! See http://factorcode.org/license.txt for BSD license.
USING: kernel opengl.gl alien.c-types continuations namespaces USING: kernel opengl.gl alien.c-types continuations namespaces
assocs alien alien.strings libc opengl math sequences combinators assocs alien alien.strings libc opengl math sequences combinators
combinators.lib macros arrays io.encodings.ascii fry ; combinators.lib macros arrays io.encodings.ascii fry
specialized-arrays.uint destructors accessors ;
IN: opengl.shaders IN: opengl.shaders
: with-gl-shader-source-ptr ( string quot -- ) : with-gl-shader-source-ptr ( string quot -- )
@ -93,9 +94,9 @@ PREDICATE: fragment-shader < gl-shader (fragment-shader?) ;
: gl-program-shaders ( program -- shaders ) : gl-program-shaders ( program -- shaders )
dup gl-program-shaders-length dup gl-program-shaders-length
dup <uint-array> 0 <int>
0 <int> swap over <uint-array>
[ underlying>> glGetAttachedShaders ] { 3 1 } multikeep ; [ underlying>> glGetAttachedShaders ] keep ;
: delete-gl-program-only ( program -- ) : delete-gl-program-only ( program -- )
glDeleteProgram ; inline glDeleteProgram ; inline