Sign in to follow this  
cachopixi

WEBGL_draw_buffers compilation error

Recommended Posts

Hi there,

 

When tying to compile pixi.js 5 with typescript I get

 

node_modules/pixi.js/pixi.js.d.ts(3848,30): error TS2304: Cannot find name 'WEBGL_draw_buffers'.

3848                 drawBuffers: WEBGL_draw_buffers;
                                  ~~~~~~~~~~~~~~~~~~


node_modules/pixi.js/pixi.js.d.ts(3851,30): error TS2304: Cannot find name 'WEBGL_lose_context'.

3851                 loseContext: WEBGL_lose_context;
                                  ~~~~~~~~~~~~~~~~~~


node_modules/pixi.js/pixi.js.d.ts(3852,36): error TS2304: Cannot find name 'OES_vertex_array_object'.

3852                 vertexArrayObject: OES_vertex_array_object;
                                        ~~~~~~~~~~~~~~~~~~~~~~~

the definitions of those symbols are on lib.dom.d.ts so I'm not sure what should I do

Thanks!

Share this post


Link to post
Share on other sites

Need ES6 or something like that in the libs., I dont remember exactly.

Workaround: If you dont use webpack and other things you can just copy that file to your libRoot or somewhere in your project and remove those lines.

Maybe we'll remove them from typings so people dont have that problem.

Share this post


Link to post
Share on other sites

Dude, you're amazing. You always reply right away!

> Need ES6 or something like that in the libs., I dont remember exactly.

I trid that, no luck

> Workaround: If you dont use webpack and other things you can just copy that file to your libRoot or somewhere in your project and remove those lines.

Unfortunatelly I do use webpack

> That's how pixi-spine works: https://github.com/pixijs/pixi-spine/blob/master/tsconfig.json#L13

I tried the different parameters in that tsconfig.json without sucess. So I'm likely missing something.

Anyway, I solved it by removing those 3 lines out of pixi.js.d.ts

Now I'll spend some time porting the existing code

Very excited to finally try 5.0!

Cheers

Share this post


Link to post
Share on other sites

This can also happen depending on the typescript version you are using, especially if it's the latest one. Start with lower version and see if that fix that problem then increase until you get those errors again. Also an easy fix is to supply those missing types your self with an empty class or interface.

Share this post


Link to post
Share on other sites

;) Can we get a WebGLRenderingContext and a WebGL2RenderingContext in one type? Sure np!

export interface GPURenderingContext extends WebGLRenderingContext
{
createVertexArray():WebGLVertexArrayObjectOES;
drawArraysInstanced(mode:number, first:number, count:number, instanceCount:number):void;
drawElementsInstanced(mode:number, count:number, type:number, offset:number, instanceCount:number):void;
vertexAttribDivisor(index:number, divisor:number):void;
deleteVertexArray(vertexArray:WebGLVertexArrayObjectOES):void;
bindVertexArray(vertexArray:WebGLVertexArrayObjectOES):void;
pixelStorei(pname:number, param:number|boolean):void;
drawBuffers(buffers:number[]):void;
}

 

Share this post


Link to post
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.