Fix SlicedTexture drawing logic to resolve GL1280 errors#194
Open
NealDeal34 wants to merge 1 commit intoGTNewHorizons:masterfrom
Open
Fix SlicedTexture drawing logic to resolve GL1280 errors#194NealDeal34 wants to merge 1 commit intoGTNewHorizons:masterfrom
NealDeal34 wants to merge 1 commit intoGTNewHorizons:masterfrom
Conversation
UltraProdigy
requested changes
Apr 15, 2026
Member
UltraProdigy
left a comment
There was a problem hiding this comment.
Looks good, two minor things
| } finally { | ||
| GL11.glPopMatrix(); | ||
| GL11.glPopAttrib(); | ||
| while (GL11.glGetError() != GL11.GL_NO_ERROR); |
Member
There was a problem hiding this comment.
This line should not be included. It's not resolving errors here just erasing the evidence of them
| int dx = x; | ||
| int dy = y; | ||
|
|
||
| GL11.glPushAttrib(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_ENABLE_BIT); |
Member
There was a problem hiding this comment.
I believe this is missing GL_CURRENT_BIT
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes frequent GL1280 OpenGL errors when BetterQuesting's animated quest boxes are rendered with the Angelica mod. The issue occurred because SlicedTexture modified global OpenGL state without restoring it, used a 4-parameter blend function incompatible with some LWJGL 2 environments, and passed invalid color values from dynamic alpha calculations. This state leakage polluted subsequent render calls, triggering Angelica's strict state validation during post-render checks.
The fix replaces the 4-parameter blend function with the universally compatible 2-parameter version and sanitizes color values to prevent illegal parameters.
This fix was developed with AI assistance due to my limited OpenGL expertise, but it seems to work well.
Reference Error Log:
[Client thread/ERROR]: ########## GL ERROR ##########
[Client thread/ERROR]: @ Post render
[Client thread/ERROR]: 1280: Invalid enum
Test Environment:
GPU: NVIDIA GTX 1650 (Driver 595.79)
Java: 25
Angelica: 2.1.14
NotEnoughItems: 2.8.84-GTNH
lwjgl3ify: 3.0.15
Draconic Evolution: 1.5.19-GTNH