Skip to content

Commit

Permalink
basic android compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
pyalot committed Jun 8, 2013
1 parent 14624d2 commit 6bd04dc
Show file tree
Hide file tree
Showing 21 changed files with 1,508 additions and 69 deletions.
8 changes: 4 additions & 4 deletions extra/loader.coffee
Expand Up @@ -11,8 +11,8 @@ makeBlob = (data, type) ->
blob = new Blob([data], type:type)
return blob

window.getURL = (data) ->
blob = makeBlob data
window.getURL = (data, mime) ->
blob = makeBlob data, mime
return makeURL blob

resolvePath = (base, path) ->
Expand Down Expand Up @@ -179,7 +179,7 @@ window.loader =
for matcher, decode of hooks
if name.match(matcher)
decoding += 1
decode dst, (result) ->
decode name, dst, (result) ->
decoded += 1
files[name] = result
if progress then progress(0.5+(decoded/decoding)*0.5, 'decode')
Expand All @@ -190,7 +190,7 @@ window.loader =
if hooks
for matcher, decode of hooks
if name.match(matcher)
decode info, (result) ->
decode name, info, (result) ->
files[name] = result
return
files[name] = info
Expand Down
8 changes: 4 additions & 4 deletions extra/loader.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

34 changes: 34 additions & 0 deletions lib/webgl-nuke-vendor-prefix.coffee
@@ -0,0 +1,34 @@
if window.WebGLRenderingContext?
vendors = ['WEBKIT', 'MOZ', 'MS', 'O']
vendorRe = /^WEBKIT_(.*)|MOZ_(.*)|MS_(.*)|O_(.*)/

getExtension = WebGLRenderingContext.prototype.getExtension
WebGLRenderingContext.prototype.getExtension = (name) ->
match = name.match vendorRe
if match != null
name = match[1]

extobj = getExtension.call @, name
if extobj == null
for vendor in vendors
extobj = getExtension.call @, vendor + '_' + name
if extobj != null
return extobj
return null
else
return extobj

getSupportedExtensions = WebGLRenderingContext.prototype.getSupportedExtensions
WebGLRenderingContext.prototype.getSupportedExtensions = ->
supported = getSupportedExtensions.call @
result = []

for extension in supported
match = extension.match vendorRe
if match != null
extension = match[1]

if extension not in result
result.push extension

return result
46 changes: 46 additions & 0 deletions lib/webgl-nuke-vendor-prefix.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 6bd04dc

Please sign in to comment.