math.matrices math.vectors.simd math.parser math.vectors
method-chains namespaces sequences splitting threads ui ui.gadgets
ui.gadgets.worlds ui.pixel-formats specialized-arrays
-specialized-vectors literals fry
-sequences.deep destructors math.bitwise opengl.gl
+specialized-vectors fry sequences.deep destructors math.bitwise opengl.gl
game.models game.models.obj game.models.loader game.models.collada
-prettyprint images.tga ;
+prettyprint images.tga literals ;
FROM: alien.c-types => float ;
SPECIALIZED-ARRAY: float
SPECIALIZED-VECTOR: uint
index-buffer index-count vertex-format texture bump ka ;
: white-image ( -- image )
- { 1 1 } BGR ubyte-components f
- B{ 255 255 255 } image boa ;
+ <image>
+ { 1 1 } >>dim
+ BGR >>component-order
+ ubyte-components >>component-type
+ B{ 255 255 255 } >>bitmap ;
: up-image ( -- image )
- { 1 1 } BGR ubyte-components f
- B{ 0 0 0 } image boa ;
+ <image>
+ { 1 1 } >>dim
+ BGR >>component-order
+ ubyte-components >>component-type
+ B{ 0 0 0 } >>bitmap ;
: make-texture ( pathname alt -- texture )
swap [ nip load-image ] [ ] if*
[
[
[ vertex-buffer>> obj-program <program-instance> ]
- [ vertex-format>> ] bi buffer>vertex-array
+ [ vertex-format>> ] bi <vertex-array*>
] map >>vertex-arrays drop
]
[
: clear-screen ( -- )
0 0 0 0 glClearColor
1 glClearDepth
- HEX: ffffffff glClearStencil
- { GL_COLOR_BUFFER_BIT
+ 0xffffffff glClearStencil
+ flags{ GL_COLOR_BUFFER_BIT
GL_DEPTH_BUFFER_BIT
- GL_STENCIL_BUFFER_BIT } flags glClear ;
+ GL_STENCIL_BUFFER_BIT } glClear ;
: draw-model ( world -- )
clear-screen
M: model-world begin-game-world
init-gpu
{ 0.0 0.0 2.0 } 0 0 set-wasd-view
- [ <model-state> [ fill-model-state ] keep ] [ (>>model-state) ] bi ;
+ [ <model-state> [ fill-model-state ] keep ] [ model-state<< ] bi ;
M: model-world apply-world-attributes
{
[ model-path>> >>model-path ]
{ windowed double-buffered }
}
{ pref-dim { 1024 768 } }
- { tick-interval-micros 16666 }
+ { tick-interval-nanos $[ 60 fps ] }
{ use-game-input? t }
{ model-path model-path }
}