Skip to content

pass WebGL context to functions rather than relying on var gl #2

Description

@Jonplussed

I noticed the generated code relies upon a required global var gl to supply the WebGL context to the generated functions. What do you think about a change to the parser than instead adds an initial argument allowing gl to be passed as an argument?

While this would be cumbersome initially, this could allow the higher-level functions that rely on the generated code to operate in some sort of WebGL monad that could supply the context automatically, keeping a similar same interface while retaining functional purity.

If this is a direction you see your library going, I'd be happy to attempt a patch.

Thanks!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions