Sha256: 6c995bca26fc3d90a4eae94c55c9d7886d217f1be6a516f197802b837bb923d7

Contents?: true

Size: 820 Bytes

Versions: 1

Compression:

Stored size: 820 Bytes

Contents

module Joybox
  module Configuration

    module_function

    def setup(&block)

      instance_eval(&block) if block_given?
      configure

      Director.sharedDirector
    end


    def configure

      director unless @is_director_configured
      opengl_view unless @is_opengl_view_configured
      debug unless @is_debug_configured
    end


    def director(*hash)

      hash = hash.pop

      Director.configure(hash)

      @is_director_configured = true
    end


    def opengl_view(*hash)

      hash = hash.pop

      opengl_view = GLView.new(hash)

      director = Director.sharedDirector

      director.view = opengl_view

      @is_opengl_view_configured = true
    end


    def debug(*hash)

      hash = hash.pop

      Debug.configure(hash)

      @is_debug_configured = true
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
joybox-1.0.0 motion/joybox-osx/configuration/configuration.rb