Skip to content

Commit

Permalink
I tried to use es6 import but could not get it to work. Added dummy m…
Browse files Browse the repository at this point in the history
…ethod info() to test that require twgl actually got it imported.
  • Loading branch information
Sami Badawi committed Sep 14, 2017
1 parent df13416 commit d0503f6
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import * as sc from './shader-code'
import * as m from 'mithril'
import * as mh from './mithril-helper'
import * as _ from 'lodash'
// import * as twgl from '../node_modules/twgl.js/dist/3.x/twgl-full.js'
const twgl = require('../node_modules/twgl.js/dist/3.x/twgl-full')

const verboseLogging = false

Expand Down Expand Up @@ -35,7 +37,13 @@ let imageSources = [
"baby-ball.jpg",
"shapelogicsmalltransparent.png"]

function info() {
const twglCreateProgramInfoType = typeof twgl.createProgramInfo;
console.log(`twglCreateProgramInfoType: ${twglCreateProgramInfoType}`)
}

function getShaderCodeFromInput(input: string): string {
info()
switch(input) {
case 'inverse': return sc.fragmentShaderColorInverse;
case 'edge': return sc.fragmentShaderEdge1;
Expand Down

0 comments on commit d0503f6

Please sign in to comment.