pex-gl / pex-context

Modern WebGL state wrapper for PEX: allocate GPU resources (textures, buffers), setup state pipelines and passes, and combine them into commands.
http://pex-gl.github.io/pex-context/
MIT License
160 stars 12 forks source link

Add width/height getters #66

Closed dmnsgn closed 4 months ago

dmnsgn commented 5 years ago

Fix #38

dmnsgn commented 5 years ago

Do you prefer getters or function return? Eg.:

Object.assign(ctx, {
  ...rest
  get width() {
    return gl.drawingBufferWidth
  },
  // or
  width: function() {
    return gl.drawingBufferWidth
  },
})
ctx.width()
// or
ctx.width
vorg commented 5 years ago

Getters for constituency with eg tex.width

vorg commented 5 years ago

This PR should include docs

dmnsgn commented 5 years ago

@vorg Updated the PR