pex-context
pex-context copied to clipboard
Add programmatic width,height,pixelRatio getters
ctx.gl.drawingBufferWidth -> ctx.width
Having ctx.width will help with situations where we use different values for different things. It's better if ctx is the source of truth.
var W = 100
var H = 100
var ctx = createContext({ width:W, height: H, pixelRatio: 2 })
ctx.width //200
H //100