Minor adjustments to spheres demo

db4
Joe Groff 2008-04-21 21:50:35 -07:00
parent 07b91613e4
commit 03c4b6ee85
1 changed files with 4 additions and 5 deletions

View File

@ -105,7 +105,7 @@ TUPLE: spheres-gadget
reflection-texture ; reflection-texture ;
: <spheres-gadget> ( -- gadget ) : <spheres-gadget> ( -- gadget )
0.0 0.0 20.0 <demo-gadget> 20.0 10.0 20.0 <demo-gadget>
{ set-delegate } spheres-gadget construct ; { set-delegate } spheres-gadget construct ;
M: spheres-gadget near-plane ( gadget -- z ) M: spheres-gadget near-plane ( gadget -- z )
@ -116,7 +116,7 @@ M: spheres-gadget distance-step ( gadget -- dz )
drop 0.5 ; drop 0.5 ;
: (reflection-dim) ( -- w h ) : (reflection-dim) ( -- w h )
1024 1024 ; 512 512 ;
: (make-reflection-texture) ( -- texture ) : (make-reflection-texture) ( -- texture )
gen-texture [ gen-texture [
@ -268,10 +268,9 @@ M: spheres-gadget draw-gadget* ( gadget -- )
[ (draw-reflection-texture) ] [ (draw-reflection-texture) ]
[ demo-gadget-set-matrices ] [ demo-gadget-set-matrices ]
[ sphere-scene ] [ sphere-scene ]
[ reflection-texture>> GL_TEXTURE_CUBE_MAP GL_TEXTURE0 bind-texture-unit ]
[ [
{ texture-sphere-program>> reflection-texture>> } get-slots texture-sphere-program>> dup {
GL_TEXTURE_CUBE_MAP GL_TEXTURE0 bind-texture-unit
dup {
{ "surface_texture" [ 0 glUniform1i ] } { "surface_texture" [ 0 glUniform1i ] }
} [ } [
{ 0.0 0.0 0.0 } 4.0 { 1.0 0.0 0.0 1.0 } (draw-sphere) { 0.0 0.0 0.0 } 4.0 { 1.0 0.0 0.0 1.0 } (draw-sphere)