-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
[rlgl] Fix Not default Draw Mode breaking when changing texture #5195
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
[rlgl] Fix Not default Draw Mode breaking when changing texture #5195
Conversation
|
@maiconpintoabreu I can't remember at the moment if This PR changes how it was designed originally... and I'm afraid it was structure that way for some reason... but it was so long ago that I can't remember... |
|
@raysan5, this change does not change any OpenGL call, but I will try to test it on 1.1 and post the results later.
|
Based on OpenGL 1.1 |
|
Hi @raysan5 , is it ok to use |
d95de81 to
6cd3dcd
Compare
|
Changed the PR to draft as I am trying to test all the cases again |
|
Hi @raysan5, Tested and working:
|
|
@maiconpintoabreu I'm afraid proposed solution is not ideal. raylib is intended to work the same way independently of the OpenGL version (despite feature limitations). And requesting different approaches depending on the version will confuse rlgl users. I prefer to keep the library with the current limitation. |
|
"raylib is intended to work the same way independently of the OpenGL version" This seems to be exactly the purpose of this PR. I'm no specialist but if OpenGL 3 behavior is purposefully different from OpenGL 1 (batches vs simple state machine) then rlgl, being a wrapper layer dealing with implementation details, is the perfect place to abstract this away. |
|
@raysan5 @maiconpintoabreu |
|
Hi @casperbear, I am working on another PR to solve this issue without changing the order of settexture and begin. |


This PR is to fix the
rlSetTextureas when you have different textures it will not override the mode that is default to GL_QUAD.The fix is to check if the
drawCounterhas more then 1 and copy the previous mode to the new Draw.If the developer is drawing a mix of Modes The
rlSetTextureneed to be afterrlBegin.Fix for the issue: #5142
RenderDoc tests: