Skip to content

Commit

Permalink
Query max texture size only once.
Browse files Browse the repository at this point in the history
  • Loading branch information
EliteMasterEric committed Feb 18, 2025
1 parent 21caee3 commit fffb1a7
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions flixel/system/frontEnds/BitmapFrontEnd.hx
Original file line number Diff line number Diff line change
Expand Up @@ -342,10 +342,14 @@ class BitmapFrontEnd
}

#if FLX_OPENGL_AVAILABLE
static var _maxTextureSize:Int = -1;
function get_maxTextureSize():Int
{
if (FlxG.stage.window.context.attributes.hardware)
return cast GL.getParameter(GL.MAX_TEXTURE_SIZE);
if (_maxTextureSize > 0) return _maxTextureSize;

if (FlxG.stage.window.context.attributes.hardware) {
return (_maxTextureSize = cast GL.getParameter(GL.MAX_TEXTURE_SIZE));
}

return -1;
}
Expand Down

0 comments on commit fffb1a7

Please sign in to comment.