Skip to content
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

sprite.shader causes missing SpriteBatch.flush() #64

Open
kamstrup opened this issue Apr 15, 2014 · 1 comment
Open

sprite.shader causes missing SpriteBatch.flush() #64

kamstrup opened this issue Apr 15, 2014 · 1 comment
Labels

Comments

@kamstrup
Copy link

I just added a big water sprite to my game that I draw with a shader that I set on the sprite with the sprite.shader = ... property. But this resulted in the player not being correctly drawn anymore (missing the his body).

After hunting this for a while I realized that when the water.shader property was != NULL the last draw() call just before the water's draw() would be "forgotten", that is, called correctly - but not shown on screen.

After some more digging I added a manual FlxG.batch.flush() in the top of my water.renderShader() override and everything started working.

I guess the batch.flush() call should have been done automatically somewhere..? Can't really tell if it's a libgdx issue or the problem is in flixel-gdx.

@WingEraser
Copy link
Member

batch.flush() will be called when a new shader is loaded (FlxG.batch.setShader(..)). I need to check this issue myself.

@WingEraser WingEraser added the bug label Nov 1, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants