 
     @_frameScheduled = false
 
+    if @_contextLost
+      return
+
     if @_contextRequiresSetup
       @_setupContext()
       @_contextRequiresSetup = false
+      @_vertexShaderIsDirty = @_fragmentShaderIsDirty = @_geometryIsDirty = true
 
     if @_geometryIsDirty
       @_updateGeometry()

    unless browserSupportsRequiredFeatures()
      throw new Error "This browser does not support WebGL"

    @_contextRequiresSetup = true
    @_fragmentShaderIsDirty = false
    @_vertexShaderIsDirty = false
    @_geometryIsDirty = false
    @_renderIsDirty = false

    # The number of vertices drawn
    @vertexCount = 4


    gl.drawArrays @_drawingMode, 0, @vertexCount


  _handleContextLost: (e) ->
    @trace.log "WebGL context lost, suspending all GL calls"
    @_contextLost = true
    (e || window.event).preventDefault()

  _handleContextRestored: (e) ->
    @trace.log "WebGL context restored, resuming rendering"
    @_contextLost = false
    @_contextRequiresSetup = true
    @_scheduleFrame()



