Skip to content

Commit

Permalink
Update OpenGLRenderer.hx
Browse files Browse the repository at this point in the history
  • Loading branch information
mcagabe19 authored Nov 18, 2024
1 parent f5b8c06 commit 1409237
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/openfl/display/OpenGLRenderer.hx
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@ class OpenGLRenderer extends DisplayObjectRenderer
@SuppressWarnings("checkstyle:Dynamic")
public var gl:#if lime WebGLRenderContext #else Dynamic #end;

@:noCompletion private static var __staticDefaultDisplayShader:DisplayObjectShader;
@:noCompletion private static var __staticDefaultGraphicsShader:GraphicsShader;
@:noCompletion private static var __staticMaskShader:Context3DMaskShader;

@:noCompletion private var __context3D:Context3D;
@:noCompletion private var __clipRects:Array<Rectangle>;
@:noCompletion private var __currentDisplayShader:Shader;
Expand Down Expand Up @@ -159,14 +163,18 @@ class OpenGLRenderer extends DisplayObjectRenderer
__stencilReference = 0;
__tempRect = new Rectangle();

__defaultDisplayShader = new DisplayObjectShader();
__defaultGraphicsShader = new GraphicsShader();
if (__staticDefaultDisplayShader == null) __staticDefaultDisplayShader = new DisplayObjectShader();
if (__staticDefaultGraphicsShader == null) __staticDefaultGraphicsShader = new GraphicsShader();
if (__staticMaskShader == null) __staticMaskShader = new Context3DMaskShader();

__defaultDisplayShader = __staticDefaultDisplayShader;
__defaultGraphicsShader = __staticDefaultGraphicsShader;
__defaultShader = __defaultDisplayShader;

__initShader(__defaultShader);

__scrollRectMasks = new ObjectPool<Shape>(function() return new Shape());
__maskShader = new Context3DMaskShader();
__maskShader = __staticMaskShader;
}

/**
Expand Down

0 comments on commit 1409237

Please sign in to comment.