# File window.rb, line 11
  def initialize(w=640, h=480, fullscreen=true, u=20, stateObj=BlankState)
    super(w, h, fullscreen, u)
    $window=self #pre initialize global var to allow win initialization
    @background_image = Gosu::Image.new(self, File.expand_path(File.dirname(__FILE__))+"/null.png", true)
    @cursor = Cursor.new(File.expand_path(File.dirname(__FILE__))+"/media/cursor.bmp", false)
    @framedrawn=false
    @timer=0
    @camera=Camera.new
    @images = CArray.new
    @mapimages = CArray.new
    @guiWidgets = CArray.new
    @state=stateObj
    @focused=nil
    @stickfocused=nil
    @leftdrag = MouseDragEvent.new
    @rightdrag = MouseDragEvent.new
    @state.start
    $window=self
    $theme_init_hook.call
  end