File tree Expand file tree Collapse file tree 2 files changed +10
-6
lines changed Expand file tree Collapse file tree 2 files changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -334,6 +334,12 @@ class FlxGame extends Sprite
334
334
addChild (postProcessLayer );
335
335
#end
336
336
337
+ // We have to call this after a stage is created
338
+ // otherwise it will fail and cause a crash
339
+ #if FLX_OPENGL_AVAILABLE
340
+ FlxG .bitmap .setMaxTextureSize ();
341
+ #end
342
+
337
343
// Creating the debugger overlay
338
344
#if FLX_DEBUG
339
345
debugger = new FlxDebugger (FlxG .stage .stageWidth , FlxG .stage .stageHeight );
Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ class BitmapFrontEnd
27
27
*
28
28
* @see https://opengl.gpuinfo.org/displaycapability.php?name=GL_MAX_TEXTURE_SIZE
29
29
*/
30
- public var maxTextureSize (get , never ): Int ;
30
+ public var maxTextureSize (default , null ): Int ;
31
31
#end
32
32
33
33
/**
@@ -393,12 +393,10 @@ class BitmapFrontEnd
393
393
}
394
394
395
395
#if FLX_OPENGL_AVAILABLE
396
- function get_maxTextureSize (): Int
396
+ @:allow (flixel. FlxGame )
397
+ function setMaxTextureSize (): Void
397
398
{
398
- if (FlxG .stage .window .context .attributes .hardware )
399
- return cast GL .getParameter (GL .MAX_TEXTURE_SIZE );
400
-
401
- return - 1 ;
399
+ maxTextureSize = FlxG .stage .window .context .attributes .hardware ? cast GL .getParameter (GL .MAX_TEXTURE_SIZE ) : - 1 ;
402
400
}
403
401
#end
404
402
You can’t perform that action at this time.
0 commit comments