Skip to content

Commit

Permalink
Disable antialiasing when creating WebGL context from canvas. (#320)
Browse files Browse the repository at this point in the history
  • Loading branch information
zenoslin committed May 13, 2022
1 parent ac449c0 commit c8ef89f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion web/src/pag-view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,13 @@ export class PAGView {
this.module.globalCanvas.retain();
pagView.contextID = this.module.globalCanvas.contextID;
} else {
pagView.contextID = this.module.GL.createContext(canvasElement, { majorVersion: 1, minorVersion: 0 });
pagView.contextID = this.module.GL.createContext(canvasElement, {
majorVersion: 1,
minorVersion: 0,
depth: false,
stencil: false,
antialias: false,
});
}

if (pagView.contextID === 0) {
Expand Down
2 changes: 1 addition & 1 deletion web/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export interface EmscriptenGL {
textures: WebGLTexture[];
createContext: (
canvas: HTMLCanvasElement | OffscreenCanvas,
webGLContextAttributes: { majorVersion: number; minorVersion: number },
webGLContextAttributes: { majorVersion: number; minorVersion: number } & WebGLContextAttributes,
) => number;
registerContext: (gl: WebGLRenderingContext, options: { majorVersion: number; minorVersion: number }) => number;
makeContextCurrent: (contextId: number) => void;
Expand Down

0 comments on commit c8ef89f

Please sign in to comment.