Browse Source

Remove direct access to engine._gl

Popov72 5 years ago
parent
commit
4e659fde8a
2 changed files with 6 additions and 1 deletions
  1. 5 0
      src/Engines/thinEngine.ts
  2. 1 1
      src/Materials/effect.ts

+ 5 - 0
src/Engines/thinEngine.ts

@@ -2081,6 +2081,11 @@ export class ThinEngine {
         return shader;
     }
 
+    /** @hidden */
+    public _getShaderSource(shader: WebGLShader): Nullable<string> {
+        return this._gl.getShaderSource(shader);
+    }
+
     /**
      * Directly creates a webGL program
      * @param pipelineContext  defines the pipeline context to attach to

+ 1 - 1
src/Materials/effect.ts

@@ -619,7 +619,7 @@ export class Effect implements IDisposable {
 
     private _getShaderCodeAndErrorLine(shader: WebGLShader, error: Nullable<string>, isFragment: boolean): [Nullable<string>, Nullable<string>] {
         const regexp = isFragment ? /FRAGMENT SHADER ERROR: 0:(\d+?):/ : /VERTEX SHADER ERROR: 0:(\d+?):/;
-        const code = this._engine?._gl?.getShaderSource(shader) ?? null;
+        const code = this._engine._getShaderSource(shader);
 
         let errorLine = null;