Skip to content

Commit affab3a

Browse files
GeokureliEliteMasterEric
authored andcommitted
Revert "Revert "FlxG: query maxTextureSize when window is created"" (HaxeFlixel#3528)
* Revert "Revert "FlxG: query maxTextureSize when window is created (HaxeFlixel#3522)" (#…" This reverts commit c62c294. * check renderTile rather than window.context.hardware
1 parent d06d0bd commit affab3a

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

flixel/FlxG.hx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -553,6 +553,10 @@ class FlxG
553553
FlxG.height = height;
554554

555555
initRenderMethod();
556+
#if FLX_OPENGL_AVAILABLE
557+
// Query once when window is created and cache for later
558+
bitmap.get_maxTextureSize();
559+
#end
556560

557561
FlxG.initialWidth = width;
558562
FlxG.initialHeight = height;

flixel/system/frontEnds/BitmapFrontEnd.hx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -343,10 +343,12 @@ class BitmapFrontEnd
343343

344344
#if FLX_OPENGL_AVAILABLE
345345
static var _maxTextureSize = -1;
346+
347+
@:allow(flixel.FlxG)
346348
function get_maxTextureSize():Int
347349
{
348-
if (_maxTextureSize < 0 && FlxG.stage.window.context.attributes.hardware)
349-
_maxTextureSize = cast GL.getParameter(GL.MAX_TEXTURE_SIZE);
350+
if (_maxTextureSize < 0)
351+
_maxTextureSize = FlxG.renderTile ? cast GL.getParameter(GL.MAX_TEXTURE_SIZE) : 0;
350352

351353
return _maxTextureSize;
352354
}

0 commit comments

Comments
 (0)