greggman / twgl.js

A Tiny WebGL helper Library
http://twgljs.org
MIT License
2.61k stars 258 forks source link

`opt_locations` of createProgramInfo is missing from typescript bindings #231

Open Deamon87 opened 4 months ago

Deamon87 commented 4 months ago

Hi.

As of now there is no possible way to pass opt_locations from typescript for createProgramInfo and other similar functions.

At the moment of writing, createProgramInfo is defined as

export function createProgramInfo(gl: WebGLRenderingContext, shaderSources: string[], opt_attribs?: ProgramOptions | string[] | ErrorCallback, opt_errorCallback?: ErrorCallback): ProgramInfo;

Thus it has 4 parameters: gl, shaderSources, opt_attribs, opt_errorCallback

While in reality, the js function takes 5 parameters: gl, shaderSources, opt_attribs, opt_locations, opt_errorCallback

function createProgramInfo(gl, shaderSources, opt_attribs, opt_locations, opt_errorCallback) {
greggman commented 4 months ago

thanks for the bug report. Fixed in v5.5.4 I think

greggman commented 4 months ago

https://github.com/greggman/twgl.js/commit/b4899666d5cd9632d3d82269236539a3ac2a9c97