danrostron Posted January 4, 2017 Share Posted January 4, 2017 Hi I'm trying to use the WebGLPrepare class to upload textures to the GPU before starting my game, however I'm unsure how to use this class. https://github.com/pixijs/pixi.js/blob/58ccf3381566c009c418aa305924539f372281f3/src/prepare/webgl/WebGLPrepare.js When I try: let prep:WebGLPrepare = new PIXI.prepare.WebGLPrepare(this.renderer as WebGLRenderer); I get an error - PixiMediator.ts:118Uncaught TypeError: PIXI.prepare.WebGLPrepare is not a constructor Any ideas would be greatly appreciated? Thanks Dan Quote Link to comment Share on other sites More sharing options...
themoonrat Posted January 4, 2017 Share Posted January 4, 2017 Hiya This prepare class is already automatically created for you. You can access it via renderer.plugins.prepare So, you could do renderer.plugins.prepare.upload( container ); danrostron 1 Quote Link to comment Share on other sites More sharing options...
danrostron Posted January 5, 2017 Author Share Posted January 5, 2017 That's great, thanks @themoonrat. It's a shame the documentation isn't more detailed and mentions this. Quote Link to comment Share on other sites More sharing options...
themoonrat Posted January 5, 2017 Share Posted January 5, 2017 I'll do a PR for adding this into the documentation. Documentation is tough cover all explanations for peoples usage, and tough to get enthusiastic to look through, so any PR contributions are greatly appreciated from the community! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.