snipe some bunny bugs
parent
196e9d6884
commit
a67de2289a
3
unmaintained/bunny/fixed-pipeline/fixed-pipeline.factor → extra/bunny/fixed-pipeline/fixed-pipeline.factor
Normal file → Executable file
3
unmaintained/bunny/fixed-pipeline/fixed-pipeline.factor → extra/bunny/fixed-pipeline/fixed-pipeline.factor
Normal file → Executable file
|
@ -1,5 +1,6 @@
|
|||
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
|
||||
|
||||
TUPLE: bunny-fixed-pipeline ;
|
|
@ -3,7 +3,7 @@ http.client io io.encodings.ascii io.files kernel math
|
|||
math.matrices math.parser math.vectors opengl
|
||||
opengl.capabilities opengl.gl opengl.demo-support sequences
|
||||
sequences.lib splitting vectors words
|
||||
specialized-arrays.double specialized-arrays.uint ;
|
||||
specialized-arrays.float specialized-arrays.uint ;
|
||||
IN: bunny.model
|
||||
|
||||
: numbers ( str -- seq )
|
||||
|
@ -66,7 +66,7 @@ TUPLE: bunny-buffers array element-array nv ni ;
|
|||
{
|
||||
[
|
||||
[ first concat ] [ second concat ] bi
|
||||
append >double-array underlying>>
|
||||
append >float-array underlying>>
|
||||
GL_ARRAY_BUFFER swap GL_STATIC_DRAW <gl-buffer>
|
||||
]
|
||||
[
|
|
@ -2,7 +2,8 @@
|
|||
! See http://factorcode.org/license.txt for BSD license.
|
||||
USING: kernel opengl.gl alien.c-types continuations namespaces
|
||||
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
|
||||
|
||||
: with-gl-shader-source-ptr ( string quot -- )
|
||||
|
@ -93,9 +94,9 @@ PREDICATE: fragment-shader < gl-shader (fragment-shader?) ;
|
|||
|
||||
: gl-program-shaders ( program -- shaders )
|
||||
dup gl-program-shaders-length
|
||||
dup <uint-array>
|
||||
0 <int> swap
|
||||
[ underlying>> glGetAttachedShaders ] { 3 1 } multikeep ;
|
||||
0 <int>
|
||||
over <uint-array>
|
||||
[ underlying>> glGetAttachedShaders ] keep ;
|
||||
|
||||
: delete-gl-program-only ( program -- )
|
||||
glDeleteProgram ; inline
|
||||
|
|
Loading…
Reference in New Issue