Paste: how do I run this

Author: typemore
Mode: factor
Date: Mon, 16 Aug 2010 04:18:01
Plain Text |
! Copyright (C) 2010 Your name.
! See http://factorcode.org/license.txt for BSD license.
USING: colors game.loop game.worlds literals method-chains
       ui.gadgets.worlds arrays multiline prettyprint kernel
       math opengl opengl.gl opengl.glu opengl.demo-support
       ui ui.gadgets ui.render ui.pixel-formats accessors ;

IN: gfx

TUPLE: min-world < game-world ;

M: min-world draw-world* ( gadget -- ) drop
    1.0 0.3 0.72 1.0 <rgba> gl-clear ;

M: min-world begin-world ( gadget -- ) drop ;
M: min-world end-world ( gadget -- ) drop ;

AFTER: min-world resize-world drop ;

GAME: min-game {
  { world-class min-world }
  { title "Minimal" }
  { pixel-format-attributes
    {
      windowed
      double-buffered
      T{ depth-bits { value 24 } }
    }
  }
  { pref-dim { 640 480 } }
  { tick-interval-nanos $[ 60 fps ] }
} ;

New Annotation

Summary:
Author:
Mode:
Body: