<PRIVATE
: unscale ( m -- n )
- retina? get-global [ 2.0 / ] when ; inline
+ retina? get-global [ 2 /i ] when ; inline
: scale ( m -- n )
- retina? get-global [ 2.0 * ] when ; inline
+ retina? get-global [ 2 * ] when ; inline
: scale-dim ( dim -- dim' )
- retina? get-global [ [ 2.0 / ] map ] when ; inline
+ retina? get-global [ [ 2 /i ] map ] when ; inline
: scale-metrics ( metrics -- metrics' )
retina? get-global [
GENERIC: set-gpu-state* ( state -- )
M: viewport-state set-gpu-state*
- rect>> [ loc>> first2 ] [ dim>> first2 ] bi glViewport ;
+ rect>> [ loc>> ] [ dim>> ] bi gl-viewport ;
M: triangle-cull-state set-gpu-state*
{
M:: texture-3d-data-target texture-dim ( tdt level -- dim )
tdt bind-tdt :> texture
- tdt texture-data-gl-target level
+ tdt texture-data-gl-target level
[ GL_TEXTURE_WIDTH get-texture-int ]
[ GL_TEXTURE_HEIGHT get-texture-int ]
[ GL_TEXTURE_DEPTH get-texture-int ] 2tri
[ texture-dim ]
[ drop texture-object [ component-order>> ] [ component-type>> ] bi f f ]
[ read-texture ] 2tri
- image boa ; inline
+ f image boa ; inline
<PRIVATE
: bind-texture ( texture -- gl-target )
M: demo-world resize-world
GL_PROJECTION glMatrixMode
glLoadIdentity
- [ [ 0 0 ] dip dim>> first2 glViewport ]
+ [ [ { 0 0 } ] dip dim>> gl-viewport ]
[ demo-world-frustum glFrustum ] bi ;
: demo-world-set-matrix ( gadget -- )
: (draw-reflection-texture) ( gadget -- )
dup reflection-framebuffer>> [ {
- [ drop 0 0 (reflection-dim) glViewport ]
+ [ drop { 0 0 } (reflection-dim) 2array gl-viewport ]
[
GL_PROJECTION glMatrixMode
glPushMatrix glLoadIdentity
glPopMatrix 90.0 1.0 0.0 0.0 glRotatef ]
[ sphere-scene ]
[
- [ 0 0 ] dip dim>> first2 glViewport
+ [ { 0 0 } ] dip dim>> gl-viewport
GL_PROJECTION glMatrixMode
glPopMatrix
]
M: terrain-world resize-world
GL_PROJECTION glMatrixMode
glLoadIdentity
- dim>> [ [ 0 0 ] dip first2 glViewport ]
+ dim>> [ [ { 0 0 } ] dip gl-viewport ]
[ frustum glFrustum ] bi ;
M: terrain-world draw-world*