glText icon indicating copy to clipboard operation
glText copied to clipboard

Update gltext.h

Open TheArchailect opened this issue 4 years ago • 4 comments

manually unbind the current shader on gltEndDraw, allowing rendering of a non-shader pipeline scene.

TheArchailect avatar Aug 03 '21 14:08 TheArchailect

What's the context? When you say "non-shader pipeline scene" are you implying the fixed-function pipeline? If yes, then I'd really prefer this to be configurable, e.g. with a macro. As glText already assumes OpenGL 3.0 -> 3.3. So I feel like a glUseProgram(0); might in general just be overhead, for all those who aren't using the fixed-function-pipeline, if that was what you were referring too of course.

However, if glUseProgram(0); is enabled through e.g. a macro, then I'm fine with it. What do you think? :)

vallentin avatar Aug 03 '21 14:08 vallentin

yes, indeed I'm referring to the fixed-function pipe line, using a macro is probably a much better idea as like you mentioned we assume the use of a version > 3.0. Is there any reason other then readability that the gltEndDraw function is currently empty? Thanks for the quick response!

TheArchailect avatar Aug 05 '21 01:08 TheArchailect

using a macro is probably a much better idea as like you mentioned we assume the use of a version > 3.0

Feel free to rework the PR and add it, and I'll happily merge the PR :)

Is there any reason other then readability that the gltEndDraw function is currently empty

The other one is called, gltBeginDraw(), so it just makes sense there's a gltEndDraw(). The idea was, that it allows adding stuff easier, without introducing a minor hidden breaking change that requires people update and add a new call later. Having it makes sense in relation to exactly like adding glUseProgram(0); or maybe gltEndDraw() handled drawing if draw calls were batched.

vallentin avatar Aug 05 '21 13:08 vallentin

Do you think a simple #ifdef GLT_LEGACY wrapper will suffice?

TheArchailect avatar Aug 06 '21 05:08 TheArchailect