-
Notifications
You must be signed in to change notification settings - Fork 492
Revert "FlxG: query maxTextureSize when window is created" #3525
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This reverts commit 9f6e768.
|
What error were you getting? |
|
GL is null, here. Could've sworn I tested your branch on html5 but it seems I didn't. Not sure if there's a unit test that can catch this. |
|
I will take a proper look when I'm able to, but is it possible this was running in a browser that doesn't support WebGL? It might also need a check to see if the render context is hardware accelerated |
|
After more sleuthing I just noticed that my html5 builds seem to use renderBlit, I have no idea why, I'm not using |
|
Ah yep checks out. Can I redo the PR including this fix?
I’d also check if your browser has hardware acceleration enabled. WebGL
won’t work without it
…On Mon, 1 Dec 2025 at 18:36, George Kurelic ***@***.***> wrote:
*Geokureli* left a comment (HaxeFlixel/flixel#3525)
<#3525 (comment)>
After more sleuthing I just noticed that my html5 builds seem to use
renderBlit, I have no idea why, I'm not using <window hardware="false"/>,
but the stage's context is "canvas"
—
Reply to this email directly, view it on GitHub
<#3525 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ALGZODPOVA47WC3PL6VB7CD37R4C5AVCNFSM6AAAAACNV7QCPCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTKOJXHEZTIMBYGM>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
|
After reverting I'm still seeing the issue, but this immediately started happening after pulling this change, so I'm not sure whats going on Edit: Tried this on a different project and it works fine, even when I manually enable render blit |
|
Seems like something strange is going on. The if statement I mentioned actually shouldn't be necessary because it's already there, in flixel/flixel/system/frontEnds/BitmapFrontEnd.hx Lines 348 to 349 in 687c1cc
So it seems that EDIT: openfl/lime#2002 should fix the if statement falsely passing. I think we could revert the revert now 😅 |
|
Thanks for that! Is there something we can do in flixel to avoid this crash. Lime releases are pretty infrequent so I'd like to have something working for the upcoming flixel 6.1.2 release |
The if check in |
|
I made this change, locally, it worked. I can use yours, if you think one is better than the other. #if FLX_OPENGL_AVAILABLE
static var _maxTextureSize = -1;
function get_maxTextureSize():Int
{
if (_maxTextureSize < 0)
{
final hardware = FlxG.stage.window.context.attributes.hardware
// Prevents lime error (fixed here: https://github.com/openfl/lime/pull/2002)
&& #if (html5 && lime <= "8.3.0") FlxG.renderTile #else true #end;
if (hardware)
_maxTextureSize = cast GL.getParameter(GL.MAX_TEXTURE_SIZE);
else
_maxTextureSize = 0;
}
return _maxTextureSize;
}
#endSmall note: setting I'll try the lime git, too, though sometimes using git lime on my mac is a hassle |
|
Oh, now that you mention it, I think it could just boil down to |
Meaning this? #if FLX_OPENGL_AVAILABLE
static var _maxTextureSize = -1;
function get_maxTextureSize():Int
{
if (_maxTextureSize < 0 && FlxG.renderTile)
_maxTextureSize = cast GL.getParameter(GL.MAX_TEXTURE_SIZE);
return _maxTextureSize;
}
#endIn the future I plan to make the global sub-object |
Yep, seems good!
Is there an issue for something like this where it could be discussed? Recently I was thinking about how Flixel handles rendering, and imo all the main rendering bits should be moved outside of FlxCamera and into a separate renderer class. |
|
…#3522)" (HaxeFlixel#3525) This reverts commit 9f6e768.
Reverts #3522
I'm getting errors on my html5 tests