fix(addon-webgl): keep VAO WebGL types non-nullable
Co-authored-by: Daniel Imms <Tyriar@users.noreply.github.com>
This commit is contained in:
co-authored by
Daniel Imms
parent
c06c3025f2
commit
f757c965ee
@@ -136,9 +136,9 @@ export class GlyphRenderer extends Disposable {
|
|||||||
this._textureLocation = throwIfFalsy(gl.getUniformLocation(this._program, 'u_texture'));
|
this._textureLocation = throwIfFalsy(gl.getUniformLocation(this._program, 'u_texture'));
|
||||||
|
|
||||||
// Create and set the vertex array object
|
// Create and set the vertex array object
|
||||||
this._vertexArrayObject = gl.createVertexArray();
|
const vertexArrayObject = this._vertexArrayObject = gl.createVertexArray();
|
||||||
this._register(toDisposable(() => gl.deleteVertexArray(this._vertexArrayObject)));
|
this._register(toDisposable(() => gl.deleteVertexArray(vertexArrayObject)));
|
||||||
gl.bindVertexArray(this._vertexArrayObject);
|
gl.bindVertexArray(vertexArrayObject);
|
||||||
|
|
||||||
// Setup a_unitquad, this defines the 4 vertices of a rectangle
|
// Setup a_unitquad, this defines the 4 vertices of a rectangle
|
||||||
const unitQuadVertices = new Float32Array([0, 0, 1, 0, 0, 1, 1, 1]);
|
const unitQuadVertices = new Float32Array([0, 0, 1, 0, 0, 1, 1, 1]);
|
||||||
|
|||||||
@@ -102,9 +102,9 @@ export class RectangleRenderer extends Disposable {
|
|||||||
this._projectionLocation = throwIfFalsy(gl.getUniformLocation(this._program, 'u_projection'));
|
this._projectionLocation = throwIfFalsy(gl.getUniformLocation(this._program, 'u_projection'));
|
||||||
|
|
||||||
// Create and set the vertex array object
|
// Create and set the vertex array object
|
||||||
this._vertexArrayObject = gl.createVertexArray();
|
const vertexArrayObject = this._vertexArrayObject = gl.createVertexArray();
|
||||||
this._register(toDisposable(() => gl.deleteVertexArray(this._vertexArrayObject)));
|
this._register(toDisposable(() => gl.deleteVertexArray(vertexArrayObject)));
|
||||||
gl.bindVertexArray(this._vertexArrayObject);
|
gl.bindVertexArray(vertexArrayObject);
|
||||||
|
|
||||||
// Setup a_unitquad, this defines the 4 vertices of a rectangle
|
// Setup a_unitquad, this defines the 4 vertices of a rectangle
|
||||||
const unitQuadVertices = new Float32Array([0, 0, 1, 0, 0, 1, 1, 1]);
|
const unitQuadVertices = new Float32Array([0, 0, 1, 0, 0, 1, 1, 1]);
|
||||||
|
|||||||
@@ -28,8 +28,8 @@ export interface ICursorRenderModel {
|
|||||||
export interface IWebGL2RenderingContext extends WebGLRenderingContext {
|
export interface IWebGL2RenderingContext extends WebGLRenderingContext {
|
||||||
vertexAttribDivisor(index: number, divisor: number): void;
|
vertexAttribDivisor(index: number, divisor: number): void;
|
||||||
createVertexArray(): IWebGLVertexArrayObject;
|
createVertexArray(): IWebGLVertexArrayObject;
|
||||||
deleteVertexArray(vao: IWebGLVertexArrayObject | null): void;
|
deleteVertexArray(vao: IWebGLVertexArrayObject): void;
|
||||||
bindVertexArray(vao: IWebGLVertexArrayObject | null): void;
|
bindVertexArray(vao: IWebGLVertexArrayObject): void;
|
||||||
drawElementsInstanced(mode: number, count: number, type: number, offset: number, instanceCount: number): void;
|
drawElementsInstanced(mode: number, count: number, type: number, offset: number, instanceCount: number): void;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user