 {MeshFactory} = require './mesh_factory.coffee'
 
 class Myou
-    constructor: (root, MYOU_PARAMS)->
+    constructor: (root, options)->
+        if not root?
+            throw "Missing root DOM element, got null or undefined"
+        if not options?
+            throw "Missing options"
         @scenes = {}
         @loaded_scenes = []
         @active_sprites = []

        @SHADER_LIB = ''
        @active_animations = []
        @root = root
        @MYOU_PARAMS = MYOU_PARAMS
        @use_physics = not MYOU_PARAMS.disable_physics
        @hash = Math.random()
        @initial_scene_loaded = false
        @mesh_lod_min_length_px = 13


        window.addEventListener 'resize', resize_canvas

        data_dir = options.data_dir or './data'
        data_dir = options.data_dir = data_dir.replace(/\/$/g, '')

        @events = new Events root, options.event_options
        @mesh_factory = new MeshFactory @
        @main_loop.run()

