Skip to content

Commit

Permalink
finally, a way to keep the dang colors
Browse files Browse the repository at this point in the history
Why was this so hard to find???
  • Loading branch information
hiddenist committed Nov 25, 2023
1 parent 4004daa commit df49142
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
2 changes: 1 addition & 1 deletion libs/webgl/src/engine/BaseDrawingEngine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export abstract class BaseDrawingEngine<
private programs: Programs

constructor(canvas: HTMLCanvasElement, programs: (gl: WebGLRenderingContext) => Programs) {
const gl = canvas.getContext("webgl")
const gl = canvas.getContext("webgl", { preserveDrawingBuffer: true })
if (!gl) {
throw new Error("WebGL not supported")
}
Expand Down
3 changes: 0 additions & 3 deletions libs/webgl/src/engine/DrawingEngine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@ export class DrawingEngine extends BaseDrawingEngine<AvailablePrograms> {
}

public updateDrawing() {
for (const { path, color } of this.context.pathHistory) {
this.drawLine(path, { drawType: DrawType.STATIC_DRAW, color })
}
if (this.context.currentPath.points.length > 0) {
this.drawLine(this.context.currentPath.points, { drawType: DrawType.DYNAMIC_DRAW })
}
Expand Down

0 comments on commit df49142

Please sign in to comment.